var waitwin = null;

// Create popup wait window
function pop(params) {}

// Remove previous popup window when entering page
function unpop() {}

// Used for Verisign
function chkVerisign(url) {
	sealWin=window.open(url,'win','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
	self.name = 'mainWin';
}

// Popup terms window - copy Wait window code for unpop() reuse
function terms(params) {
	var w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
	var popW = 600, popH = 550;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
    var url = params;
    
	waitwin = window.open(url, '_wait', 'toolbar=no,location=no,menubar=no,status=no,scrollbars=1,'+'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}

// Method to show ViewCharges page for the Edit Website.../
function showCharges() {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 650;
		var popH = 500;
		var popH;
		var leftPos = (w-popW)/2, topPos = h/5;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;				
								
		chargeWindow = window.open('ViewCharges.aspx', 'chargeWindow', 'location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,'+ dimensions);
		chargeWindow.focus()
		}

// Method to show Window to select number of paxs for the Edit Website.../
function selectPaxNumber() {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 580; 
		var popH = 200;
		var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;	
				 			
								
		addPaxNumWindow = window.open('AddPaxPrompt.aspx', 'addPaxNumWindow', 'toolbar=no,status=no,scrollbars=no,resizable=no,'+ dimensions);
		//addPaxNumWindow = window.open('AddPaxPrompt.html', 'addPaxNumWindow', 'toolbar=no,status=no,scrollbars=no,resizable=yes','width=200,height=200,screenX=400,screenY=400,top=400,left=400');
		addPaxNumWindow.focus()
		}
		
function unloadPaxNumber() {
	// Find existing window
	addPaxNumWindow = window.open('AddPaxPrompt.aspx', 'addPaxNumWindow');

	if (addPaxNumWindow != null && addPaxNumWindow.open) 	addPaxNumWindow.close();
}

// create popup window to search for pax
function paxsearch(url, pax) {
	var searchwin
	var w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
	var popW = 850, popH = 400;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
        
	searchwin = window.open(url + '&pax=' + pax + '&paxid=' + document.forms[0].elements['hidPax' + pax + '_Search'].value + '&fname=' + document.forms[0].elements['txtPax' + pax + '_FName'].value + '&lname=' + document.forms[0].elements['txtPax' + pax + '_LName'].value + '&phone1=' + document.forms[0].elements['txtPax' + pax + '_Phone1'].value + '&phone2=' + document.forms[0].elements['txtPax' + pax + '_Phone2'].value, '_paxsearch', 'location=no,toolbar=no,status=yes,scrollbars=yes,resizable=no,'+'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}

// Method to open the email page for the Edit Website, this also sends the email.../
function openEmailPage(url) {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 520;
		var popH = 300;
		var popH;
		var leftPos = (w-popW)/2, topPos = h/5;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;				
								
		emailWindow = window.open(url, 'emailWindow', 'location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,'+ dimensions);
		emailWindow.focus()
	}
	
// Method to open the email confirmation window for the Edit Website.../
function openEmailConfirmPage(url) {
	var  w, h;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	} else {
		w = screen.width;
		h = screen.height;
	}	

	// Center window
		var popW = 750;
		var popH = 300;
		var popH;
		var leftPos = (w-popW)/2, topPos = h/5;
	
		var dimensions = "width=" + popW +
						 ", height=" + popH +
						 ",top=" + topPos +
						 ",left=" + leftPos;				
								
		emailWindow = window.open(url, 'emailConfirmWindow', 'location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,'+ dimensions);
		emailWindow.focus()
	}
	
function unloadConfirmWindow() {
// Find existing window
	emailConfirmWindow = window.open('EWConfimEditItin.aspx', 'emailConfirmWindow');

	if (emailConfirmWindow != null && emailConfirmWindow.open) 	emailConfirmWindow.close();
}

