// 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 resizeCredit(){ 
var windowWidth, windowHeight, allResized;
	
	windowWidth=getWindowWidth();	
	windowHeight=getWindowHeight();
	
	myBorder=Math.round(windowWidth/1000)+"px solid #BF617E";
    myBorderWidth = Math.round(windowWidth/1000);
	
	if (!myCredit.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 (!myCredit.appendChild(creditTitle)) { return false; }
	creditTitle.style.top=myMargin*2.7 + "px";
	creditTitle.style.left=Math.round(mainDiv.offsetWidth/42) + "px";
	creditTitle.style.width=Math.round(mainDiv.offsetWidth*0.5) + "px";
	creditTitle.style.fontSize=titleFontSize;
	creditTitle.style.position="absolute";
	
	//for the text 
	fontSize=Math.round(bodyDiv.offsetWidth/70) + "px";
	if (!myCredit.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 (!myCredit.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<referenceTxt.length;i++) {
		if (!myCredit.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.4) + "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 (!myCredit.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.4) + "px";
		}
		refTxt[i].style.left=Math.round(mainDiv.offsetWidth/11) + "px";
		refTxt[i].style.fontSize=fontSize;
		
		if (!myCredit.appendChild(arrow)) { return false; }
		if (!scaleToWidth(arrow, mainDiv.offsetWidth*0.04)) { return false; }
		arrow.style.top=parTxt[i].offsetHeight + parTxt[i].offsetTop*1.035 + "px"; //myMargin*88 + "px"; //Math.round(homePic3.offsetHeight/1) + "px";
		arrow.style.left=Math.round(mainDiv.offsetWidth/2.2) + "px";
		arrow.style.position="absolute";
	}

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

function createcreditrefPage(){
	//create home page
	myCredit = createDiv();
	myCredit.style.position="absolute";
	clearMargins(myCredit);
	
	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
	creditTitle = document.createElement("p");
	creditTitle.innerHTML="Credit References 1-4";
	creditTitle.style.fontFamily="Trebuchet MS";
	creditTitle.style.position = "absolute";
	creditTitle.style.color = "#8E7070";
	creditTitle.style.fontWeight="bold";
	clearMargins(creditTitle);
	
	//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] = "RCBC Savings Bank";
	references[1] = "Land Bank of the Philippines";
	references[2] = "Penbank";
	references[3] = "Bank of Commerce";
	references[4] = "Banco de Oro";
	references[5] = "Equicom Savings Bank";
	references[6] = "United Asian Bank";
	
	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] = "Velez Branch<br/>Don a. Velez Street,<br/>Cagayan de Oro City";
	referenceTxt[1] = "Velez Branch<br/>Don a. Velez- a. Luna Street,<br/>Cagayan de Oro City";
	referenceTxt[2] = "National Highway Puerto,<br/>Cagayan de Oro City";
	referenceTxt[3] = "Velez Branch<br/>Don a. Velez Street,<br/>Cagayan de Oro City";
	referenceTxt[4] = "Velez Branch<br/>Don a. Velez Street,<br/>Cagayan de Oro City";
	referenceTxt[5] = "Cruz Taal-Tiano Street,<br/>Cagayan de Oro City";
	referenceTxt[6] = "Lapasan Highway,<br/>Cagayan de Oro City";
	
	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;
	}

	arrow = xImage("images/arrow3.gif");
	arrow.oncontextmenu=protectImage;
	arrow.id="CreditReferences2";
	arrow.onclick=basicMenuClick;
	arrow.onmouseover=onMouseOver;
		
	myCredit.resize=resizeCredit;
	
return myCredit;
}
