//Leaving Corporate Popup

function openNewWindow( URL, windowName, windowFeatures ) {
	newWindow = window.open( URL, windowName, windowFeatures ); 
}

function Popup(url) {
        agent = navigator.userAgent;
        windowName = "moduleWin";
        params  = "";
        params += "toolbar=0,";
        params += "location=0,";
        params += "directories=0,";
        params += "status=0,";
        params += "menubar=0,";
        params += "scrollbars=0,";
        params += "resizable=0,";
        params += "width=385,";
        params += "height=317";   
        win = window.open(url, windowName, params);
        if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
                win = window.open(url, windowName , params);
        }
        if (!win.opener) {
                win.opener = window;
        } 
} 
function doPreload()
{
	
   var the_images = new Array('/FourSeasons/Corporate/images/2px_Blueline.gif','/FourSeasons/Corporate/images/2px_line.gif','/FourSeasons/Corporate/images/2px_BluelineLev2.gif','/FourSeasons/Corporate/images/2px_lineLev2.gif','/FourSeasons/Corporate/images/2px_YellowlineLev3.gif','/FourSeasons/Corporate/images/2px_lineLev3.gif');
   preloadImages(the_images);
 }

function preloadImages(the_images) {

   for(var loop = 0; loop < the_images.length; loop++)
	
   {
 	var an_image = new Image();
	an_image.src = the_images[loop];
   }
}

function lineOn(image1,image2) 
{ 
	if (document[image1]) {document[image1].src ='/images/2px_Blueline.gif';}
	if (document[image2]) {if (image2 != ''){document[image2].src ='/images/2px_Blueline.gif';}}
} 

function lineOff(image1,image2) 
{ 
	if (document[image1]) {document[image1].src ='/images/2px_line.gif';}
	if (document[image2]) {if (image2 != ''){document[image2].src ='/images/2px_line.gif';}}
} 

function lineOnLev2(image1,image2) 
{ 
	if (document[image1]) {document[image1].src ='/images/2px_BluelineLev2.gif';}
	if (document[image2]) {if (image2 != ''){document[image2].src ='/images/2px_BluelineLev2.gif';}}
} 

function lineOffLev2(image1,image2) 
{ 
	if (document[image1]) {document[image1].src ='/images/2px_lineLev2.gif';}
	if (document[image2]) {if (image2 != ''){document[image2].src ='/images/2px_lineLev2.gif';}}
}

function lineOnLev3(image1,image2) 
{ 
	if (document[image1]) {document[image1].src ='/images/2px_YellowlineLev3.gif';}
	if (document[image2]) {if (image2 != ''){document[image2].src ='/images/2px_YellowlineLev3.gif';}}
} 

function lineOffLev3(image1,image2) 
{ 
	if (document[image1]) {document[image1].src ='/images/2px_lineLev3.gif';}
	if (document[image2]) {if (image2 != ''){document[image2].src ='/images/2px_lineLev3.gif';}}
}

function getObj(elementID){
	return document.getElementById(elementID);
}

function changePhoto(imageNo)
{
	
	//hide the arrow
	arrowObj=document.getElementsByTagName('img')
	for (i=0;i<document.getElementsByTagName('img').length;i++)
		{
			strImgsrc = arrowObj[i].src
			if (strImgsrc.indexOf("arrow.gif") != -1)
				{
					arrowObj[i].style.visibility = "hidden"
				}
		}
	
	divcategoryLinksObj=document.getElementsByTagName('div')

	//hide category links
	for (i=0;i<document.getElementsByTagName('div').length;i++)
		{
			strGetDivID = divcategoryLinksObj[i].id
			if (strGetDivID.indexOf("categoryLinks_Div") != -1 || strGetDivID.indexOf("categorySubLinks_Div") != -1)
				{
					divcategoryLinksObj[i].style.display = "none"
				}
		}
	strLeftImgPath = document.getElementById('imgThumb' + imageNo).src;
	re = /InsideThumbnail/g;
	
	strLeftImgPathFinal = strLeftImgPath.replace(re,"Inside");
	
	
	document.getElementById('imgTopLeft').innerHTML = '<IMG  src="'+strLeftImgPathFinal + '" border=0>';
		
	document.getElementById('categoryLinks_DefaultText').style.display="none";
	document.getElementById('categoryLinks_Div' + imageNo).style.display="";
	document.getElementById('categorySubLinks_Div' + imageNo).style.display="";
	document.getElementById('arrow' + imageNo).style.visibility	=	"visible";
	document.getElementById('inputImageNoHidden').value = imageNo
	document.getElementById('inputImageNameHidden').value = strLeftImgPathFinal
}

function changeProductPhoto(imageNo,obj,path,imgFileName,imgOutSidePath)
{

	strIMGOuterHTML = '<a href=""><img id="imgThumb'+document.getElementById("hidImageNo").value+ '" src="'+path+document.getElementById("hidImageFile").value + '" alt="" width="60" height="59" hspace="0" vspace="4" border="0" align="left" onclick=changeProductPhoto("'+document.getElementById("hidImageNo").value+'","this","'+path+'","'+document.getElementById("hidImageFile").value+'","'+imgOutSidePath+ '") style="cursor:pointer"></a>'

	strCon = "divimgThumb"+imageNo
	
	
		
	document.getElementById(strCon).innerHTML = strIMGOuterHTML

	document.getElementById('hidImageThumbNo').value   = document.getElementById('hidImageNo').value; 
	document.getElementById('hidImageThumbFile').value  = document.getElementById('hidImageFile').value;
	
	obj.src = path+document.getElementById('hidImageFile').value
	obj.id = "imgThumb"+document.getElementById('hidImageNo').value
	
	document.getElementById(strCon).src = path+document.getElementById('hidImageFile').value
	document.getElementById(strCon).id = "divimgThumb"+document.getElementById('hidImageNo').value
	
	document.getElementById('hidImageNo').value = imageNo
	document.getElementById('hidImageFile').value = imgFileName
	
	strLeftImgPath = path;
	re = /InsideThumbnail/g;
	strLeftImgPathFinal = strLeftImgPath.replace(re,"Inside")+imgFileName;
	document.getElementById('imgTopLeft').innerHTML = '<IMG style="height=330px,width=410px"  src="'+strLeftImgPathFinal + '" border=0>';
	
	strancViewLarge = "<a style='text-decoration:none;cursor:pointer' id='ancViewLarge' class='productViewLargeImage' onclick='shwInLargeWindow("
	strancViewLarge = strancViewLarge + '"'+ document.getElementById("hidImageFile").value + '","' + imgOutSidePath + '")'
	strancViewLarge = strancViewLarge + "'><span style='font-size:12px;font-weight:bold;margin:0px 0 0px 0;'>EXTERIOR VIEW<br /></span><span style='line-height:15px;background-color:#FF9900;font-size:12px;font-weight:bold;'>Click To Enlarge</span></a>";
	
	document.getElementById('divAncViewLarge').innerHTML = strancViewLarge
	
	strOutSideImgPath = imgOutSidePath;
	re = /Outside/g;
	strOutSideImgPath_Final = strOutSideImgPath.replace(re,"OutsideThumbnail");
	strOutsideImgPathFinal = strOutSideImgPath_Final+document.getElementById("hidImageFile").value 

	document.getElementById('divOutsideShot').innerHTML = '<IMG  src="'+strOutsideImgPathFinal + '" border=0 style="WIDTH: 98px; HEIGHT: 93px">';
}

function shwInLargeWindow(imgFileName,path)
{
	strURL = "../shwLargeImage.aspx?imageFileName="+imgFileName+"&width=415&height=360&path="+path
	window.open(strURL,null, 'height=330,width=410,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no')
}