<!--
// *************************************************************************************
//
//										Popup_Pic
//
// *************************************************************************************
//
// This script is not made to be available for public use.
// Use of this code will cause you to be in violation of United States and International copyright laws.
// Any scripting code proceeding this notice is copyright © 2006 http://www.findlocalhotels.com
//
// *************************************************************************************
var IE=document.all; //Only IE has document.all thus it will be false for anything else.
var maxWaitTime = 5; //secondspageUrl
var timeWaited = 0;
var checkInterval = .50;//seconds
var winHandle = 0;
var	pic = new Image();
var	pageUrl = "";
var	title = "";
var	target = "";
var	onBlurAction = 0;
var	picWidth = 0;
var	picHeight = 0;
var	altTag = "";
var	titleTag = "";
var	anchorTag = "";
var	anchorTarget = "";

function PopupPic(pageUrl,picUrl,target,onBlurAction,title,picWidth,picHeight,altTag,titleTag,anchorTag,anchorTarget) {
//Preload the image
//Properties native to the object that are cross-browser compatible are:
//align,alt,border,height,hspace,isMap,longDesc,lowsrc,name,src,useMap,vspace,width
	if (!pageUrl || ! picUrl){alert("You must specify at least the first two parameters, the page url and the image url");return}
	window.pic.src = picUrl;
	window.pageUrl = pageUrl;
	window.title = title;
	window.target = target;
	window.onBlurAction = onBlurAction;
	window.picWidth = picWidth;
	window.picHeight = picHeight;
	window.altTag = altTag //Add properties to the object
	window.titleTag = titleTag;
	window.anchorTag = anchorTag;
	window.anchorTarget = anchorTarget;
    //checkComplete();
	setTimeout("checkComplete();",.5*1000);	
}

function checkComplete(){
	if(pic.complete){
	  showPic();
    } else {
      // Try again in .5 seconds - give the broswer some time.
	   if (timeWaited < maxWaitTime){  
	     timeWaited = timeWaited + checkInterval;
         setTimeout("checkComplete();", checkInterval*1000);
	   } else {
	   	 alert("Image failed to load.");timeWaited = 0;
	   }//if (timeWaited < maxWaitTime)
    } //if(pic.complete)
} //checkComplete()

function showPic(){
//if size is not specified in the call, set it to the native image size
	if (!picWidth && !picHeight){
	  picWidth = pic.width;
	  picHeight = pic.height;
	}

//Find the position of the current window
	if(!IE){var windowX = window.screenX; var windowY=window.screenY;}
	else {var windowX = window.screenLeft-4; var windowY=window.screenTop-120;} //Rouch calc since IE distance to client area

//Find the size of the browser to determine picture position.
    if(!IE){var windowW=self.outerWidth; var windowH=self.outerHeight;} 
    else{var windowW=document.body.clientWidth+8; var windowH=document.body.clientHeight+150;} //IE only gives client area size
	
//Calc position of new window
	var popupX = windowX + ((windowW - picWidth)/2);
	var popupY = windowY + ((windowH - picHeight)/2);
	
//Rough calc initial windows size
	var winW = picWidth + 8;
	var winH = picHeight + 150;

//Open Window
    var winprops = 'width=' + picWidth + ',height=' + picHeight + ',left=' + popupX + ',top=' + popupY + ',resizable=1,status=0,toolbar=0,menubar=0';
	//junk=pageUrl+"?"+pic.src+"&"+title+"&"+picWidth+"&"+picHeight+"&"+onBlurAction+"&"+altTag+"&"+titleTag+"&"+anchorTag+"&"+anchorTarget
	//alert(junk);
	//junk=junk+","+anchorTarget+","+winprops;
	//alert(junk);
	var winHandle=window.open(pageUrl+"?"+pic.src+"&"+title+"&"+picWidth+"&"+picHeight+"&"+onBlurAction+"&"+altTag+"&"+titleTag+"&"+anchorTag+"&"+anchorTarget,target,winprops); //url,target,properties
}//PopupPic

//} -->