// JavaScript Document
var sampImage;
var fontFamily1="Trebuchet MS";
var projectTxtOwner = new Array();
var projectTxt = new Array();
var pageText = new Array();
var parTxt = new Array();
var OwnerTxt = new Array();

function resizeProject(){
var windowWidth, windowHeight, allResized;
	
	windowWidth=getWindowWidth();	
	windowHeight=getWindowHeight();
	
	myBorder=Math.round(windowWidth/1000)+"px solid #BF617E";
    myBorderWidth = Math.round(windowWidth/1000);
	myMargin=Math.round(windowWidth/150);
	
	if (!myProject.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 (!myProject.appendChild(projectTitle)) { return false; }
	projectTitle.style.top=myMargin*2.7 + "px";
	projectTitle.style.left=Math.round(mainDiv.offsetWidth/42) + "px";
	projectTitle.style.fontSize=titleFontSize;
	projectTitle.style.width=Math.round(mainDiv.offsetWidth*0.5) + "px";
	projectTitle.style.position="absolute";
	
	fontSize=Math.round(bodyDiv.offsetWidth/70) + "px";
	for(i=0;i<projectTxt.length;i++) {
		if (!myProject.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";
		//OwnerTxt[i].style.visibility = "hidden";
		if (!myProject.appendChild(OwnerTxt[i])) { return false; }
		if(i==0) {
			OwnerTxt[i].style.top = Math.round(homePic3.offsetHeight/6) + "px"; //myMargin*7 + "px";
		}
		else {
			OwnerTxt[i].style.top = Math.round(parTxt[i-1].offsetTop + parTxt[i-1].offsetHeight + parTxt[i-1].offsetHeight*0.2) + "px";
		}
		OwnerTxt[i].style.left=Math.round(mainDiv.offsetWidth/11) + "px";
		OwnerTxt[i].style.fontSize=fontSize;
		
		if (!myProject.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) + "px";
		arrow.style.position="absolute";
	}
	
	//for the text 
	fontSize=Math.round(bodyDiv.offsetWidth/70) + "px";
	if (!myProject.appendChild(projectTxt0)) { return false; }
	projectTxt0.style.top=Math.round(homePic3.offsetHeight/11.5) + "px";
	projectTxt0.style.left=Math.round(mainDiv.offsetWidth/11) + "px";
	projectTxt0.style.fontSize=fontSize;
	projectTxt0.style.position="absolute";
	
	if (!myProject.appendChild(projectTxt1)) { return false; }
	projectTxt1.style.top=Math.round(homePic3.offsetHeight/11.5) + "px";
	projectTxt1.style.left=Math.round(mainDiv.offsetWidth/2) + "px";
	projectTxt1.style.fontSize=fontSize;
	projectTxt1.style.position="absolute";
	
	myProject.style.height = Math.round(homePic3.offsetHeight) + "px";
	
	myProject.style.visibility="hidden";
	return true;
}

function createprojectPage(pageNum){ 
	//create home page
	myProject = createDiv();
	myProject.style.position="absolute";
	clearMargins(myProject);
	
	loading=displayText("Please wait loading...");
	loading.style.visibility="hidden";
	loading.style.fontFamily="verdana";
	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;
		homePic3.style.visibility="hidden";
	} else { if (browserInfo().browserShortName=="IE") {
	
		//alert("IE")
		homePic3 = xImage("images/avp_bg2.jpg");
		homePic3.oncontextmenu=protectImage;
		homePic3.style.height="620px";
		homePic3.style.visibility="hidden";
		}
		homePic3 = xImage("images/avp_bg2.jpg");
		homePic3.oncontextmenu=protectImage;
		homePic3.style.height="620px";
		homePic3.style.visibility="hidden";
	}
	//end of our browser detection
	
	//for the title text
	projectTitle = document.createElement("p");
	projectTitle.innerHTML="Projects Undertaken 1-3";
	projectTitle.style.fontFamily="Trebuchet MS";
	projectTitle.style.fontWeight="bold";	
	projectTitle.style.color = "#8E7070";
	clearMargins(projectTitle);
	
	//for the text 
	projectTxt0 = document.createElement("p");
	projectTxt0.innerHTML="COMPANY OWNER";
	projectTxt0.style.fontWeight="bold";
	projectTxt0.style.color = "#0A352C";
	projectTxt0.style.fontFamily="Trebuchet MS";
	
	projectTxt1 = document.createElement("p");
	projectTxt1.innerHTML="PROJECT DESCRIPTION / LOCATION";
	projectTxt1.style.fontWeight="bold";
	projectTxt1.style.color = "#0A352C";
	projectTxt1.style.fontFamily="Trebuchet MS";
	
	//Project Owner
	projectTxtOwner[0] = "AVP Trading & Const. and<br/>Pueblo de Oro Dev't Corp.<br/>(joint venture)";
	projectTxtOwner[1] = "Robinsons Homes, Inc.";
	projectTxtOwner[2] = "BOHECO";
	projectTxtOwner[3] = "KORESCO";
	projectTxtOwner[4] = "LGU-Libona Bukidnon";
	projectTxtOwner[5] = "Private Enterprise Corp.";
	
	for(i=0; i<projectTxtOwner.length; i++) {
		pageText =createP(projectTxtOwner[i]);	
		pageText.style.fontFamily="Trebuchet MS";
		pageText.style.width="60%";
		pageText.style.fontWeight="bolder";
		pageText.style.position = "absolute";
		pageText.style.color = "#787274";
		clearMargins(pageText);
		OwnerTxt[i]=pageText;
	}
	
	//Project Description
	projectTxt[0] = "Land Development of Vista Verde Village<br/>Phase 1 to 4 @ Pueblo de Oro Township<br/>Date started: March 2005<br/>Orig. Completion April 2007<br/>Project Cost: P75,000,000.00";
	projectTxt[1] = "Land Development of Bloomfields Lanang<br/> Phase 1 and 2, Lanang, Davao City<br/>Date Started: July 10, 2006<br/>Orig. Completion: May 30, 2008<br/>Project Cost: P89,000,000.00";
	projectTxt[2] = "Completion of 2.5MW Sevilla Mini-Hydro<br/>Electric Project @ Brgy. Ewon, Sevilla, Bohol<br/>Date Started: June 9, 2006<br/>Date of Completion: October 30, 2007<br/>Project Cost: P 93,819,400.00";
	projectTxt[3] = "Const. of Condominium Building 7 Storey<br/>Date Started: December 2006<br/>Date of Completion: June 2007<br/>Project Cost: P21,000,000.00";
	projectTxt[4] = "Rehab. of 3 Segments Farm to Market Road<br/>Date Started: August 5, 2006<br/>Date of Completion: January 18, 2007<br/>Project Cost: P4,454,334.70";
	projectTxt[5] = "Construction of Philtown Hotel<br/>Date Started: August 15, 1993<br/>Date of Completion: December 10, 1994<br/>Project Cost: P120 Million";
	
	for(i=0; i<projectTxt.length; i++) {
		pageText =createP(projectTxt[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="ProjectUndertaken2";
	arrow.onclick=basicMenuClick;
	arrow.onmouseover=onMouseOver;
		
	myProject.resize=resizeProject;
	
return myProject;
}
