function PopupUrl(title, url, width, height) {
		
	var winLeft = (screen.width - width) / 2;
	var winTop = (screen.height - height) / 2 - 20;

	day = new Date();
	id = day.getTime();
	
	eval("MyWin = window.open('" + url + "', '" + title + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0, width=" + width + ", height=" + height + ", left=" + winLeft + ", top=" + winTop + "');");

}

function PopupUrl2(title, url, width, height) {
		
	var winLeft = (screen.width - width) / 2;
	var winTop = (screen.height - height) / 2 - 20;

	day = new Date();
	id = day.getTime();
	
	eval("SProWin = window.open('" + url + "', '" + title + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0, width=" + width + ", height=" + height + ", left=" + winLeft + ", top=" + winTop + "');");

    return false;
}

function OpenImageWindow(title, filepath, width, height) {

	var winLeft = (screen.width - width) / 2;
	var winTop = (screen.height - height) / 2 - 20;

	day = new Date();
	id = day.getTime();
	features = "'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0, width=" + width + ", height=" + height + ", left=" + winLeft + ", top=" + winTop + "'";
	
	HTMLstring='<HTML>\n';
	HTMLstring+='<HEAD>\n';
	HTMLstring+='<TITLE>' + title + '</TITLE>\n';
	HTMLstring+='</HEAD>\n';
	HTMLstring+='<BODY topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">\n';
	HTMLstring+='<P><img src="' + filepath + '"></P>\n';
	HTMLstring+='</BODY>\n';
	HTMLstring+='</HTML>';

	newWin = window.open("", "ImageWindow", features);
	newWin.document.write(HTMLstring);
	newWin.document.close();
	newWin.focus();
}

function OpenImageWindow1(title, filepath, width, height) {
		
	var winLeft = (screen.width - width) / 2;
	var winTop = (screen.height - height) / 2 - 20;

	day = new Date();
	id = day.getTime();
	features = "'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0, width=" + width + ", height=" + height + ", left=" + winLeft + ", top=" + winTop + "'";
	
	HTMLstring='<HTML>\n';
	HTMLstring+='<HEAD>\n';
	HTMLstring+='<TITLE>' + title + '</TITLE>\n';
	HTMLstring+='</HEAD>\n';
	HTMLstring+='<BODY topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">\n';
	HTMLstring+='<P><img src="' + filepath + '"></P>\n';
	HTMLstring+='</BODY>\n';
	HTMLstring+='</HTML>';

	newWin = window.open("", "ImageWindow", features);
	newWin.document.write(HTMLstring);
	newWin.document.close();
	newWin.focus();
}

function OpenImageScrollWindow(title, filepath, width, height) {
		
	var img = new Image();
	img.src = filepath;
	
	var winLeft = (screen.width - width) / 2;
	var winTop = (screen.height - height/2) / 2 - 20;	

	day = new Date();
	id = day.getTime();
	features = "'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0, width=" + (width+20) + ", height=" + height/2 + ", left=" + winLeft + ", top=" + winTop + "'";
	
	HTMLstring='<HTML>\n';
	HTMLstring+='<HEAD>\n';
	HTMLstring+='<TITLE>' + title + '</TITLE>\n';
	HTMLstring+='</HEAD>\n';
	HTMLstring+='<BODY topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">\n';
	HTMLstring+='<P><img src="' + filepath + '"></P>\n';
	HTMLstring+='</BODY>\n';
	HTMLstring+='</HTML>';

	newWin = window.open("", "ImageWindow", features);
	newWin.document.write(HTMLstring);
	newWin.document.close();
	newWin.focus();
}

function ChangeMenuView(menuid)
{		
	//var menu = document.getElementById(menuid);
	
	document.getElementById("nav2About").style.display = "none";
	document.getElementById("nav2News").style.display = "none";

	if(menuid != null)
	{
		document.getElementById(menuid).style.display = "block";
	}	
}

function ShowSubMenu (divId)
{
    for(ctr = 0; ctr <= 4; ctr++)
    {
        if("mainMenu"+ctr != divId)
            document.getElementById("mainMenu" + ctr).style.display = "none";
        else
            document.getElementById("mainMenu" + ctr).style.display = "block";
    }
}

function ChangeView(section)
{
    document.getElementById("section0").style.display = "none";
    document.getElementById("section1").style.display = "none";
    document.getElementById("section2").style.display = "none";
    document.getElementById("section3").style.display = "none";
    document.getElementById("section4").style.display = "none";
    document.getElementById(section).style.display = "block";
    
    pageImage = document.getElementById("DisplayImage");
    switch(section)
    {
        case "section0":
            pageImage.src = "/FEOCorp.Display/Images/Water_Place_Aerial_Pool_night.jpg";
            break;
        case "section1":
            pageImage.src = "/FEOCorp.Display/Images/overview_farEast.jpg";
            break;
        case "section2":
            pageImage.src = "/FEOCorp.Display/Images/overview_sino.jpg";
            break;
        case "section3":
            pageImage.src = "/FEOCorp.Display/Images/overview_Central_Square.jpg";
            break;
        case "section4":
            pageImage.src = "/FEOCorp.Display/Images/overview_gardenVista.jpg";
            break;	
    }
}

function ChangeImage(imgSrc,imgWidth,imgHeight)
{			
	var tempWidith = imgWidth;
	var tempHeight = imgHeight;
	document.getElementById("DisplayImage").style.display = "none";
	document.getElementById("DisplayImage").width = tempWidith;
	document.getElementById("DisplayImage").height = tempHeight;
    	document.getElementById("DisplayImage").src = imgSrc;
	document.getElementById("DisplayImage").style.display = "block";
}


function ChangeImage(imgSrc,imgWidth,imgHeight,imgCaption)
{			
	var tempWidith = imgWidth;
	var tempHeight = imgHeight;
	
	document.getElementById("DisplayImage").style.display = "none"
	document.getElementById("DisplayImage").width = tempWidith;
	document.getElementById("DisplayImage").height = tempHeight;
    document.getElementById("DisplayImage").src = imgSrc;
	document.getElementById("DisplayImage").style.display = "block"
	
	document.getElementById("Caption").innerHTML = imgCaption;
}

function fixIE()
{
    if (document.getElementById("flashObject"))
    {
        object = document.getElementById("flashObject"); 			
        object.outerHTML = object.outerHTML;				
    }
}
        
function changeVideo(videoName, videoSize)
{
    var videoElement;			
            
    if (document.getElementById('objectFlashVideo'))
    {
        videoElement = document.getElementById('objectFlashVideo');
                        
        if (videoSize == 'LOW')
            videoElement.innerHTML = '<object id="flashObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="720" height="400" VIEWASTEXT>' + '<param name="movie" value="' + videoName + '" />' + '<param name="quality" value="high" /><embed src="' + videoName +  '" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="720" height="400"></embed></object>';
        else if (videoSize == 'MID')
            videoElement.innerHTML = '<object id="flashObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="720" height="400" VIEWASTEXT>' + '<param name="movie" value="' + videoName + '" />' + '<param name="quality" value="high" /><embed src="' + videoName +  '" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="720" height="400"></embed></object>';
        else if (videoSize == 'HIGH')
            videoElement.innerHTML = '<object id="flashObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="720" height="400" VIEWASTEXT>' + '<param name="movie" value="' + videoName + '" />' + '<param name="quality" value="high" /><embed src="' + videoName +  '" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="720" height="400"></embed></object>';			   				   	
    }		
}

function newWindow(varURL,varWidth,varHeight)
{
	varTop = (screen.height - varHeight)/2
	varLeft = (screen.width - varWidth)/2
	window.open(varURL, "myWindow","scrollbars=1,resizable=0,location=0,status=0,toolbar=0,top=" + varTop + ",left=" + varLeft +  ",width="+ varWidth + ",height=" + varHeight); 
}