//-------------------------------------------------------------------
// $Header: /WebSites/bahamas/JavaScript/JSPopup.js 8     4/16/09 11:41a Sampsonm $
// Performs javascript popup functions
//-------------------------------------------------------------------

function JSPopup(htm) {
	DemoWin = window.open(htm,"ICT","resizable=yes,scrollbars=yes,toolbar=no,directories=no,menubar=no,status=no,width=500,height=450");
}

function expJSPopup(htm) {
	DemoWin = window.open(htm,"ICT","resizable=no,scrollbars=no,toolbar=no,directories=no,menubar=no,status=no,width=500,height=500");
}

function openwin(win,w,h)
{
	var winDesc = 'resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,width=' + w + ',height=' + h;
	HelpWin = window.open(win,"ICT",winDesc);
	HelpWin.focus();
}

function OpenGenericWindow(as_url) {
	var winDesc = '';//'resizable=yes,scrollbars=yes,toolbar=yes,location=no,directories=no,status=no,menubar=no,width=' + w + ',height=' + h;
	var WinHndl = window.open(as_url,"ICT",winDesc);
	WinHndl.focus();
}

function openwinName(win,name,w,h)
{
	var winDesc = 'resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,width=' + w + ',height=' + h;
	HelpWin = window.open(win,name,winDesc);
	HelpWin.focus();
}

function openwinScroll(win,w,h,scroll)
{
	var winDesc = 'resizable=yes,scrollbars=' + scroll + ',toolbar=no,location=no,directories=no,status=no,menubar=no,width=' + w + ',height=' + h;
	HelpWin = window.open(win,"ICT",winDesc);
}
function JSPopupSM(htm) {
	DemoWin = window.open(htm,"ICT","resizable=yes,scrollbars=yes,toolbar=no,directories=no,menubar=no,status=no,width=300,height=150");
}

function JSPopupSweepStakes(htm) {
	DemoWin = window.open(htm,"ICT","left=50,top=50,resizable=yes,scrollbars=yes,toolbar=no,directories=no,menubar=no,status=no,width=580,height=450");
}	

function Open_TaxDisclaimer(){
        popup = window.open("/getaway/tax_disclaimer.asp","Window2","width=475,height=570,left=50,top=20,toolbar=auto,location=no, directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes")
        popup.focus();   
}

// Will handle window popups for survey popup requests 
function triggerSurvey() {
	URL = '/includes/survey_win_mon.asp'
	var pagepop
	if(pagepop == undefined){
		if (navigator.appVersion.match("MSIE") == "MSIE"){
			pagepop = window.open(URL, "winEscapeCatcher", "toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=100,height=100");
			pagepop.moveTo(-1000,10000);
		}else if ((navigator.appName.match("Netscape") == "Netscape") && (navigator.appVersion.match("5.") == "5.")){
			pagepop = window.open(URL, "winEscapeCatcher", "titlebar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,screenX=0,screenY=0,top=0,left=0,width=100,height=100");
			//pagepop.moveTo(-1000,10000);					
		}else{
			//DO NOTHING!
			//NO POPUP FOR THIS FELLA!
		}
	}
}

//handles display of more airlines on bp_air.asp (if there are more than 6)
function DisplayMore() {
	
	var right = document.getElementById("rightMore");
	var left = document.getElementById("leftMore");
	var air1 = document.getElementById("airlines1");
	var air2 = document.getElementById("airlines2");
	
	//If the link on the right is visible then hide it (ditto for the other one)
	if (right.style.display == 'block')
	{
		right.style.display = "none";
		left.style.display = "block";
		
		air1.style.display = "none";
		air2.style.display = "block";
	}
	else
	{
		right.style.display = "block";
		left.style.display = "none";	
		
		air1.style.display = "block";
		air2.style.display = "none";
	}
}	

 function showWin(as_dateFieldType, as_dateForMonth, as_formname)
    {
		// used to display the search widget calendar
		window.open('/includes/calendar/calendar.asp?form=' + as_dateFieldType + '&date=' + as_dateForMonth + '&formname=' + as_formname,'popup','width=200,height=330,resizable=yes,menubar=no,status=no,scrollbars=no,toolbar=no,directories=no,location=no,top=100,left=100');
	}