// JavaScript Document
var sampImage;
var fontFamily1="Monotype Corsiva";
function resizeCommunity(){
var windowWidth, windowHeight, allResized;
	
	windowWidth=getWindowWidth();	
	windowHeight=getWindowHeight();
	
	if (!myCommunity.appendChild(homePic5)) { return false; }
	if (!scaleToWidth(homePic5, mainDiv.offsetWidth)) { return false; }
	homePic5.style.position="absolute";
	homePic5.style.visibility="hidden";
//	greenPic.style.height=Math.round(homePic5.offsetHeight) + "px";
		
	//for the title text
	fontSize=Math.round(bodyDiv.offsetWidth/30) + "px";
	if (!myCommunity.appendChild(communityTitle)) { return false; }
	communityTitle.style.top=myMargin*3 + "px";
	communityTitle.style.left=myMargin*1.5 + "px";
	communityTitle.style.margin=myMargin + "px";
	communityTitle.style.fontSize=fontSize;
	communityTitle.style.width=Math.round(mainDiv.offsetWidth*0.5) + "px";
	communityTitle.style.position="absolute";
	
	//for the sub title
	fontSize=Math.round(bodyDiv.offsetWidth/70) + "px";
	if (!myCommunity.appendChild(communitysubTitle)) { return false; }
	communitysubTitle.style.top=myMargin*8 + "px";
	communitysubTitle.style.left=Math.round(mainDiv.offsetWidth/8) + "px";
	communitysubTitle.style.margin=myMargin + "px";
	communitysubTitle.style.fontSize=fontSize;
	communitysubTitle.style.width=Math.round(mainDiv.offsetWidth*0.5) + "px";
	communitysubTitle.style.position="absolute";
	
	//for the text
	fontSize=Math.round(bodyDiv.offsetWidth/40) + "px";
	if (!myCommunity.appendChild(communityTxt)) { return false; }
	communityTxt.style.top=Math.round(homePic5.offsetHeight/5) + "px";
	communityTxt.style.left=Math.round(mainDiv.offsetWidth/11) + "px";
	communityTxt.style.fontSize=fontSize;
	communityTxt.style.position="absolute";
	
	fontSize=Math.round(bodyDiv.offsetWidth/70) + "px";
	communityTxt1.style.top=Math.round(homePic5.offsetHeight/3.5) + "px";
	communityTxt1.style.left=Math.round(mainDiv.offsetWidth/6.5) + "px";
	communityTxt1.style.fontSize=fontSize;
	communityTxt1.style.width=Math.round(mainDiv.offsetWidth*0.55) + "px";
	communityTxt1.style.position="absolute";
	if (!myCommunity.appendChild(communityTxt1)) { return false; }
	
	myBorder=Math.round(windowWidth/1000)+"px solid #BF617E";
    myBorderWidth = Math.round(windowWidth/1000);

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

function createcommunityPage(){
	//create home page
	myCommunity = createDiv();
	myCommunity.style.position="absolute";
	clearMargins(myCommunity);
	
	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")				
		homePic5 = xImage("images/vista_bg2.jpg");
		homePic5.oncontextmenu=protectImage;
		
	} else { 
		if (browserInfo().browserShortName=="IE") {
		//alert("IE")
			homePic5 = xImage("images/vista_bg1.jpg");
			homePic5.oncontextmenu=protectImage;
			homePic5.style.height="620px";		
		}
		else {
			homePic5 = xImage("images/vista_bg1.jpg");
			homePic5.oncontextmenu=protectImage;
			homePic5.style.height="620px";	
		}
	}
	//end of our browser detection
	
	//for the title of the page
	communityTitle= document.createElement("p");
	communityTitle.innerHTML="Vista Verde Village";
	communityTitle.style.fontFamily="monotype corsiva";
	communityTitle.style.textDecoration="underline";
	communityTitle.style.fontWeight="bold";
	
	communitysubTitle= document.createElement("p");
	communitysubTitle.innerHTML="Pueblo de Oro Township, Cagayan de Oro City";
	communitysubTitle.style.fontFamily="verdana";
	communitysubTitle.style.fontWeight="bold";
	
	communityTxt= document.createElement("p");
	communityTxt.innerHTML="Amenities";
	communityTxt.style.fontFamily="verdana";
	
	communityTxt1= document.createElement("p");
	communityTxt1.innerHTML="-	A minute away from schools, church and Koresco Hotel<br>-	1 kilometer away from SM<br>-	Just beside Pueblo Golf  Course and Corpus Christi School<br>-	Club House<br>-	Swimming Pool<br>-	Parks and Playground<br>-	24 hrs. Security<br>-	Concrete perimeter fence<br>-	Interconnected light and water system<br>-	Underground drainage<br>-	Landscape open space<br>-	Concrete roads with curves and gutter<br>-	Low monthly Amortization";
	communityTxt1.style.fontFamily="verdana";
				
	myCommunity.resize=resizeCommunity;
	
return myCommunity;
}	
