var sampImage;
var fontFamily1="Monotype Corsiva";
var docImage3 = new Array();
var image = new Array();
var docPic3 = new Array();
var obj = new Object();
obj.image = new Array();
obj.id = new Array();

function resizeProject3(){
var windowWidth, windowHeight, allResized;
	
	windowWidth=getWindowWidth();	
	windowHeight=getWindowHeight();

	myBorder=Math.round(bodyDiv.offsetWidth/600) + "px solid #000000";
    myBorderWidth = Math.round(windowWidth/1000);
	myMargin=Math.round(windowWidth/150);
	
	if (!myProjectUndertaken3.appendChild(myProjectUndertakePic)) { return false; }
	if (!scaleToWidth(myProjectUndertakePic, mainDiv.offsetWidth)) { return false; }
	myProjectUndertakePic.style.position="absolute";
	myProjectUndertakePic.style.visibility="hidden";
	
	titleFontSize = Math.round(bodyDiv.offsetWidth/70) + "px";
	if (!myProjectUndertaken3.appendChild(docTitle)) { return false; }
	docTitle.style.top=myMargin*2.7 + "px";
	docTitle.style.left=Math.round(mainDiv.offsetWidth/42) + "px";
	docTitle.style.fontSize=titleFontSize;
	docTitle.style.width=Math.round(mainDiv.offsetWidth*0.5) + "px";
	docTitle.style.position="absolute";
	
	fontSizeTxt=Math.round(bodyDiv.offsetWidth/70) + "px";
	if (!myProjectUndertaken3.appendChild(projectVisualTxt)) { return false; }
	projectVisualTxt.style.top = myMargin*7.8 + "px";
	projectVisualTxt.style.left = myMargin*7 + "px";
	projectVisualTxt.style.fontSize = fontSizeTxt;
	//projectVisualTxt.style.border = "1px solid green";
	projectVisualTxt.style.width = Math.round(mainDiv.offsetWidth*0.7) + "px";
	projectVisualTxt.style.position = "absolute";
	
	if (!myProjectUndertaken3.appendChild(docTxtDiv)) { return false; }
	docTxtDiv.style.width = Math.round(myProjectUndertakePic.offsetWidth) + "px";
	docTxtDiv.style.height = Math.round(myProjectUndertakePic.offsetHeight/2.3) + "px";
	docTxtDiv.style.top = Math.round((myProjectUndertakePic.offsetHeight - docTxtDiv.offsetHeight)/6) + "px";
	docTxtDiv.style.position = "absolute";
	//docTxtDiv.style.visibility = "hidden";

	//for the thumbpics documents
	i=0;
	for (i=0; i<docPic3.length; i++) {
		if (!docTxtDiv.appendChild(docPic3[i])) { return false; }
		if (!scaleToWidth(docPic3[i], bodyDiv.offsetWidth*0.13)) { return false; }
		//if (!scaleToHeight(docPic3[i], bodyDiv.offsetHeight*0.13)) { return false; }
		docPic3[i].style.position = "absolute";
		docPic3[i].style.border = "1px solid orange";
		
		if ( i==0) {
		
			docPic3[i].style.top=Math.round((docTxtDiv.offsetHeight - docPic3[i].offsetHeight)/2) + "px";
			docPic3[i].style.left=Math.round(docTxtDiv.offsetWidth/15) + "px";
			
		}else if (i>0 && i %4== 0) {
		
			docPic3[i].style.top=Math.round(docPic3[i-1].offsetTop + docPic3[i-1].offsetHeight + myMargin*5.7) + "px";
			docPic3[i].style.left=Math.round(docPic3[0].offsetLeft) + "px";
			
		}else if (i>0 && i<4) {
		
			docPic3[i].style.top=Math.round((docTxtDiv.offsetHeight - docPic3[i].offsetHeight)/2) + "px";
			docPic3[i].style.left=Math.round(docPic3[i-1].offsetLeft + docPic3[i-1].offsetWidth + myMargin*5) + "px";
			
		}else if (i>0 && i>4) {
		
			docPic3[i].style.top=Math.round(docPic3[i-1].offsetTop) + "px";
			docPic3[i].style.left=Math.round(docPic3[i-1].offsetLeft + docPic3[i-1].offsetWidth + myMargin*5) + "px";
			
		}
	}
	
	if (!myProjectUndertaken3.appendChild(arrow1)) { return false; }	
	if (!scaleToWidth(arrow1, mainDiv.offsetWidth*0.04)) { return false; }
	arrow1.style.top=Math.round(myProjectUndertakePic.offsetHeight/1.2) + "px";
	arrow1.style.left=Math.round(mainDiv.offsetWidth/2.2) + "px";
	arrow1.style.position="absolute";
	
	myProjectUndertaken3.style.height = Math.round(myProjectUndertakePic.offsetHeight) + "px";
	
	return true;
}

function createproject3Page(){ //alert('3');
	//create company Docs page
	myProjectUndertaken3 = createDiv();
	myProjectUndertaken3.style.position="absolute";
	clearMargins(myProjectUndertaken3);
	
	loading=displayText("Please wait Loading...");
	loading.style.visibility="hidden";
	loading.style.fontFamily="verdana";
	mainDiv.appendChild(loading);
	
	if (browserInfo().browserShortName=="Firefox") {
		
		//alert("Firefox")				
		myProjectUndertakePic = xImage("images/avp_bg3.jpg");
		myProjectUndertakePic.oncontextmenu=protectImage;
		
	} else if (browserInfo().browserShortName=="IE") {
	
		//alert("IE")
		myProjectUndertakePic = xImage("images/avp_bg2.jpg");
		myProjectUndertakePic.oncontextmenu=protectImage;
		myProjectUndertakePic.style.height="620px";	
	}
	else {
		myProjectUndertakePic = xImage("images/avp_bg2.jpg");
		myProjectUndertakePic.oncontextmenu=protectImage;
		myProjectUndertakePic.style.height="620px";	
	}
	
	projectVisualTxt = document.createElement("p");
	projectVisualTxt.innerHTML="AVP Construction has been part of many major construction projects.<br/>Click on the image thumb to view its full-size.";
	projectVisualTxt.style.fontFamily="Trebuchet MS";
	projectVisualTxt.style.width="90%";
	projectVisualTxt.style.fontWeight="bolder";
	projectVisualTxt.style.position = "absolute";
	projectVisualTxt.style.color = "#787274";
	clearMargins(projectVisualTxt);
		
	//image[0] = "images/businessPermit.jpg";
	image[0] = "images/projectU9.jpg";
	image[1] = "images/projectU10.jpg";
	image[2] = "images/projectU11.jpg";
	image[3] = "images/projectU12.jpg";
	image[4] = "images/projectU13.jpg";
	image[5] = "images/projectU14.jpg";
	
	
	for(i = 0; i < image.length; i++) {
		docImage3[i] = xImage(image[i]);
		docImage3[i].oncontextmenu=protectImage;
		docImage3[i].style.position = "absolute";
	}

	//for the title text
	docTitle = document.createElement("p");
	docTitle.innerHTML="Project Undertaken 3-3";
	docTitle.style.fontFamily="Trebuchet MS";
	docTitle.style.fontWeight="bolder";	
	docTitle.style.color = "#8E7070";
	clearMargins(docTitle);
	
	docTxtDiv = createDiv();
	
	docTxtDiv1 = createDiv();
	docTxtDiv1.style.position = "absolute";
	docTxtDiv.appendChild(docTxtDiv1);
	
	obj.image[0] = "images/projectU9_thumb.jpg";
	obj.id[0] = "Project Undertaken Image 9";
	
	obj.image[1] = "images/projectU10_thumb.jpg";
	obj.id[1] = "Project Undertaken Image 10";
	
	obj.image[2] = "images/projectU11_thumb.jpg";
	obj.id[2] = "Project Undertaken Image 11";
	
	obj.image[3] = "images/projectU12_thumb.jpg";
	obj.id[3] = "Project Undertaken Image 12";
	
	obj.image[4] = "images/projectU13_thumb.jpg";
	obj.id[4] = "Project Undertaken Image 13";
	
	obj.image[5] = "images/projectU14_thumb.jpg";
	obj.id[5] = "Project Undertaken Image 14";
	
	for(i = 0; i < 6; i++) {
		docPic3[i] = xImage(obj.image[i]);
		docPic3[i].oncontextmenu=protectImage;
		docPic3[i].id = obj.id[i];
		//Attribute "alt" and "title" added
		docPic3[i].alt = obj.id[i];
		docPic3[i].title = obj.id[i];
		//docPic3[i].style.border = "1px solid #DDC460";
		docPic3[i].onmouseover=docOver3;
		docPic3[i].onmouseout=docOut3;
		docPic3[i].xname=image[i];
		docPic3[i].onclick=eventListener1;
	}
		//docPic3[3].onclick=eventListener;
		//docPic3[4].onclick=eventListener;
	
	arrow1 = xImage("images/arrow4.gif");
	arrow1.oncontextmenu=protectImage;
	arrow1.id="ProjectUndertaken2";
	arrow1.onclick=basicMenuClick;
	arrow1.style.cursor="pointer";
	
	myProjectUndertaken3.resize=resizeProject3;

return myProjectUndertaken3;
}	

function eventListener1(){
var windowWidth, windowHeight;
        windowWidth=getWindowWidth();
        windowHeight=getWindowHeight();
		
        if(typeof(this.xname)!="undefined"){
                height=Math.round(windowHeight*.8);
            	width=Math.round(windowWidth*.4);
                window.status="Width"+width+" Height"+height;
                window.imageName=this.xname
                //createCookie("Popup", this.xname, 0);
                openWindow("pop1.htm", 100, 100, width, height);
        }
        else{
                width=Math.round(windowWidth*.5);
                height=Math.round(windowHeight*.5);
                window.imageName=this.id;
                //createCookie("Popup", this.xname, 0);
                openWindow("pop1.htm", 100, 100, width, height);
        }
}

function eventListener(){
var windowWidth, windowHeight;
        windowWidth=getWindowWidth();
        windowHeight=getWindowHeight();
        if(typeof(this.xname)!="undefined"){
                  height=Math.round(windowHeight*.6);
            width=Math.round(windowWidth*.5);
                window.status="Width"+width+" Height"+height;
                window.imageName=this.xname
                //createCookie("Popup", this.xname, 0);
                openWindow("pop.htm", 100, 100, width, height);
        }
        else {
                width=Math.round(windowWidth*.5);
                height=Math.round(windowHeight*.5);
                window.imageName=this.id;
                //createCookie("Popup", this.xname, 0);
                openWindow("pop.htm", 100, 100, width, height);
        }
}

function docOver3(evt) {
var windowWidth, windowHeight;
var srcElement, evtptr;

	if (typeof(evt)=="object") {		//--- Firefox
		evtptr=evt;
	}
	else {
		evtptr=window.event;			//----Internet Explorer
	}
	if (typeof(evtptr.target)=="object") {		//--- Firefox
		srcElement=evtptr.target;
	}
	else {
		srcElement=evtptr.srcElement;			//--- Internet Explorer
	}

	changeCursor(this);
	a = createP(this.id);
	docTxtDiv1.appendChild(a);
	docTxtDiv1.style.visibility="hidden";
	
	this.style.border = "1px solid yellow";	
	
	docTxtDiv1.style.top=Math.round(docTxtDiv.offsetTop - myMargin*4) + "px";
	docTxtDiv1.style.width=Math.round(mainDiv.offsetWidth*0.3) + "px";
	docTxtDiv1.style.left=Math.round((myProjectUndertaken3.offsetWidth - docTxtDiv1.offsetWidth)/2) + "px";
	
	fontSize=Math.round(bodyDiv.offsetWidth/80) + "px";
	a.style.fontSize=fontSize;
	a.style.margin=myMargin + "px";
}

function docOut3(evt) {
	var srcElement, evtptr;
	
	if (typeof(evt)=="object") {		//--- Firefox
		evtptr=evt;
	}
	else {
		evtptr=window.event;			//----Internet Explorer
	}
	if (typeof(evtptr.target)=="object") {		//--- Firefox
		srcElement=evtptr.target;
	}
	else {
		srcElement=evtptr.srcElement;			//--- Internet Explorer
	}
		docTxtDiv1.style.visibility="hidden";
		if (docTxtDiv1.appendChild(a)) 
		docTxtDiv1.removeChild(a);		
		
	this.style.border = "1px solid orange";
	
}// JavaScript Document
