// JavaScript Document
var sampImage;
var fontFamily1="trebuchet ms";
var references = new Array();
var referenceTxt = new Array();
var pageText = new Array();
var parTxt = new Array();
var refTxt = new Array();

function resizeCredit4(){ 
var windowWidth, windowHeight, allResized;
	
	windowWidth=getWindowWidth();	
	windowHeight=getWindowHeight();
	
	myBorder=Math.round(windowWidth/1000)+"px solid #BF617E";
    myBorderWidth = Math.round(windowWidth/1000);
	
	if (!myCredit2.appendChild(homePic3)) { return false; }
	if (!scaleToWidth(homePic3, mainDiv.offsetWidth)) { return false; }
	homePic3.style.position="absolute";
	homePic3.style.visibility="hidden";
//	greenPic.style.height=Math.round(homePic3.offsetHeight) + "px";
	
	//for the title text
	titleFontSize = Math.round(bodyDiv.offsetWidth/70) + "px";
	if (!myCredit2.appendChild(creditTitle2)) { return false; }
	creditTitle2.style.top=myMargin*2.7 + "px";
	creditTitle2.style.left=Math.round(mainDiv.offsetWidth/42) + "px";
	creditTitle2.style.width=Math.round(mainDiv.offsetWidth*0.5) + "px";
	creditTitle2.style.fontSize=titleFontSize;
	creditTitle2.style.position="absolute";
	
	//for the text 
	fontSize=Math.round(bodyDiv.offsetWidth/70) + "px";
	if (!myCredit2.appendChild(creditTxt)) { return false; }
	creditTxt.style.top=Math.round(homePic3.offsetHeight/11.5) + "px";
	creditTxt.style.left=Math.round(mainDiv.offsetWidth/11) + "px";
	creditTxt.style.fontSize=fontSize;
	creditTxt.style.position="absolute";
	
	if (!myCredit2.appendChild(creditTxt1)) { return false; }
	creditTxt1.style.top=Math.round(homePic3.offsetHeight/11.5) + "px";
	creditTxt1.style.left=Math.round(mainDiv.offsetWidth/2) + "px";
	creditTxt1.style.fontSize=fontSize;
	creditTxt1.style.position="absolute";
	
	fontSize=Math.round(bodyDiv.offsetWidth/70) + "px";
	for(i=0;i<6;i++) {
		if (!myCredit2.appendChild(parTxt[i])) { return false; }
		if(i==0) {
			parTxt[i].style.top = Math.round(homePic3.offsetHeight/6) + "px"; //myMargin*7 + "px";
		}
		else {
			parTxt[i].style.top = Math.round(parTxt[i-1].offsetTop + parTxt[i-1].offsetHeight + parTxt[i-1].offsetHeight*0.2) + "px";
		}
		parTxt[i].style.left=Math.round(mainDiv.offsetWidth/2) + "px";
		parTxt[i].style.fontSize=fontSize;
		//parTxt[i].style.visibility = "hidden";
		//refTxt[i].style.visibility = "hidden";
		if (!myCredit2.appendChild(refTxt[i])) { return false; }
		if(i==0) {
			refTxt[i].style.top = Math.round(homePic3.offsetHeight/6) + "px"; //myMargin*7 + "px";
		}
		else {
			refTxt[i].style.top = Math.round(parTxt[i-1].offsetTop + parTxt[i-1].offsetHeight + parTxt[i-1].offsetHeight*0.2) + "px";
		}
		refTxt[i].style.left=Math.round(mainDiv.offsetWidth/11) + "px";
		refTxt[i].style.fontSize=fontSize;
		
		if (!myCredit2.appendChild(arrow1)) { return false; }
		if (!scaleToWidth(arrow1, mainDiv.offsetWidth*0.04)) { return false; }
		arrow1.style.top=parTxt[i].offsetHeight + parTxt[i].offsetTop*1.035 + "px"; //myMargin*88 + "px"; //Math.round(homePic3.offsetHeight/1) + "px";
		arrow1.style.left=Math.round(mainDiv.offsetWidth/2.2) + "px";
		arrow1.style.position="absolute";
		
		/* if (!myCredit2.appendChild(arrow2)) { return false; }
		if (!scaleToWidth(arrow2, mainDiv.offsetWidth*0.04)) { return false; }
		arrow2.style.top=parTxt[i].offsetHeight + parTxt[i].offsetTop*1.035 + "px"; //myMargin*88 + "px"; //Math.round(homePic3.offsetHeight/1) + "px";
		arrow2.style.left=Math.round(mainDiv.offsetWidth/2.35) + "px";
		arrow2.style.position="absolute"; */
	}

	myCredit2.style.height = Math.round(homePic3.offsetHeight) + "px";
	
	myCredit2.style.visibility="hidden";
	return true;
}

function createcreditref4Page(){
	//create home page
	myCredit2 = createDiv();
	myCredit2.style.position="absolute";
	clearMargins(myCredit2);
	
	loading=displayText("Please wait loading...");
	loading.style.visibility="hidden";
	loading.style.fontFamily="Trebuchet MS";
	mainDiv.appendChild(loading);

	//for the detection of the browser in our main picture
	if (browserInfo().browserShortName=="Firefox") {
		
		//alert("Firefox")				
		homePic3 = xImage("images/avp_bg3.jpg");
		homePic3.oncontextmenu=protectImage;
		
	} else { if (browserInfo().browserShortName=="IE") {
	
		//alert("IE")
		homePic3 = xImage("images/avp_bg2.jpg");
		homePic3.oncontextmenu=protectImage;
		homePic3.style.height="620px";
		
		}
		
		homePic3 = xImage("images/avp_bg2.jpg");
		homePic3.oncontextmenu=protectImage;
		homePic3.style.height="620px";
	}
	//end of our browser detection
	
	//for the title text
	creditTitle2 = document.createElement("p");
	creditTitle2.innerHTML="Credit References 4-4";
	creditTitle2.style.fontFamily="Trebuchet MS";
	creditTitle2.style.position = "absolute";
	creditTitle2.style.color = "#8E7070";
	creditTitle2.style.fontWeight="bold";
	clearMargins(creditTitle2);
	
	//for the text 
	creditTxt = document.createElement("p");
	creditTxt.innerHTML="BANKS";
	creditTxt.style.fontWeight="bold";
	creditTxt.style.color = "#0A352C";
	creditTxt.style.fontFamily="Trebuchet MS";
	
	creditTxt1 = document.createElement("p");
	creditTxt1.innerHTML="LOCATION";
	creditTxt1.style.fontWeight="bold";
	creditTxt1.style.color = "#0A352C";
	creditTxt1.style.fontFamily="Trebuchet MS";
	
	//Project Owner
	references[0] = "DN Steel Roofing";
	references[1] = "LCG Marketing";
	references[2] = "IC Marketing";
	references[3] = "BS Electrical";
	references[4] = "Global Chips Incorporated";
	references[5] = "Stronghold Insurance";

	for(i=0; i<references.length; i++) {
		pageText =createP(references[i]);	
		pageText.style.fontFamily="Trebuchet MS";
		pageText.style.width="60%";
		pageText.style.fontWeight="bolder";
		pageText.style.position = "absolute";
		pageText.style.color = "#787274";
		clearMargins(pageText);
		refTxt[i]=pageText;
	}
	
	//Project Description
	referenceTxt[0] = "Licoan Street,<br/>Cagayan de Oro City,<br/>Philippines";
	referenceTxt[1] = "Osme&ntilde;a Street,<br/>Cagayan de Oro City,<br/>Philippines";
	referenceTxt[2] = "Velez Street,<br/>Cagayan de Oro City,<br/>Philippines";
	referenceTxt[3] = "Tiano-Cruz Taal Street,<br/>Cagayan de Oro City,<br/>Philippines";
	referenceTxt[4] = "Divisoria,<br/>Cagayan de Oro City,<br/>Philippines";
	referenceTxt[5] = "A. Luna Street,<br/>Cagayan de Oro City,<br/>Philippines";
	
	for(i=0; i<referenceTxt.length; i++) {
		pageText =createP(referenceTxt[i]);	
		pageText.style.fontFamily="Trebuchet MS";
		pageText.style.width="60%";
		pageText.style.fontWeight="bolder";
		pageText.style.position = "absolute";
		pageText.style.color = "#787274";
		clearMargins(pageText);
		parTxt[i]=pageText;
	}

	arrow1 = xImage("images/arrow4.gif");
	arrow1.oncontextmenu=protectImage;
	arrow1.id="CreditReferences3";
	arrow1.onclick=basicMenuClick;
	arrow1.style.cursor="pointer";
	
	/* arrow2 = xImage("images/arrow3.gif");
	arrow2.oncontextmenu=protectImage;
	arrow2.id="CreditReferences4";
	arrow2.onclick=basicMenuClick;
	arrow2.style.cursor="pointer"; */	
		
	myCredit2.resize=resizeCredit4;
	
return myCredit2;
}
