<!-- 

// myPopup function by Chris Creevy
// Centers windows within the parent window and will check if the window exists or not

//Global Popup window object
var myDetailsWin;
var pageFormPost;
howDeep = screen.availHeight
howWide = screen.availWidth

function updateProviderWindow()
{
	// Write out form data and set a javascript auto post of form
	//alert(pageFormPost);
	myDetailsWin.document.open("text/html","replace");
	myDetailsWin.document.write("<html><body onLoad='document.forms[0].submit()'>"); 
	myDetailsWin.document.write(pageFormPost);
	myDetailsWin.document.write("</body></html>");
	myDetailsWin.document.close();
}


function myPopup(page,strWinName,width,height,scroll,statusbar)
{
	widthOffset = (width / 1.75)
	heightOffset = (height / 2)
	
	var Xwindow = (howWide / 2) - widthOffset;
	var Ywindow = (howDeep / 2) - heightOffset;

	if (strWinName == "detailsApplyWindow")	{
		Xwindow+=30
		Ywindow-=30
		
		
		// Check if deepLinkForm
		// This is specific to carhire for deep link form posting
		if( parseInt(page.indexOf("</form>")) > 0 )
		{
		
			pageFormPost = page;
			
			if (myDetailsWin==null)
			{
				//myDetailsWin = window.open("",strWinName,'width=' + width + ',height=' + height + ',resizable=yes,statusbar=' + statusbar + ',status=' + statusbar + ',toolbar=no,personalbar=no,directories=no,locationbar=no,scrollbars=' + scroll + ',left='+Xwindow+',top='+Ywindow + ',screenX='+Xwindow+',screenY='+Ywindow);
				myDetailsWin = window.open("","",'width=' + width + ',height=' + height + ',resizable=yes,statusbar=' + statusbar + ',status=' + statusbar + ',toolbar=no,personalbar=no,directories=no,locationbar=no,scrollbars=' + scroll + ',left='+Xwindow+',top='+Ywindow + ',screenX='+Xwindow+',screenY='+Ywindow);
			}
			
			if (myDetailsWin.closed)
			{
				myDetailsWin = window.open("","",'width=' + width + ',height=' + height + ',resizable=yes,statusbar=' + statusbar + ',status=' + statusbar + ',toolbar=no,personalbar=no,directories=no,locationbar=no,scrollbars=' + scroll + ',left='+Xwindow+',top='+Ywindow + ',screenX='+Xwindow+',screenY='+Ywindow);
			}
			
			updateProviderWindow();

		}
		else
		{
			myDetailsWin = window.open(page,strWinName,'width=' + width + ',height=' + height + ',resizable=yes,statusbar=' + statusbar + ',status=' + statusbar + ',toolbar=no,personalbar=no,directories=no,locationbar=no,scrollbars=' + scroll + ',left='+Xwindow+',top='+Ywindow + ',screenX='+Xwindow+',screenY='+Ywindow)
		}
		
		myDetailsWin.focus();
	}
	else
	{
		window.open(page,strWinName,'width=' + width + ',height=' + height + ',resizable=yes,statusbar=' + statusbar + ',status=' + statusbar + ',toolbar=no,personalbar=no,directories=no,locationbar=no,scrollbars=' + scroll + ',left='+Xwindow+',top='+Ywindow + ',screenX='+Xwindow+',screenY='+Ywindow)
	}
	
}

function applyProcess(strPage)	{
	
	// Make channel page global
	strChannelPage = strPage;

	if (!window.myDetailsWin)
	{
		myPopup(strTempURL, 'detailsApplyWindow', 810, 600, 'yes', 'yes');
	}
	else
	{
		if (myDetailsWin.closed)
		{
			myPopup(strTempURL, 'detailsApplyWindow', 810, 600, 'yes', 'yes');
		}
		else
		{
			myDetailsWin.focus()
		}
	}
	
	if (strPage == "carhire")
	{
		document.CarHireApply.submit()
	}
	else
	{
		document.FlightFinderApply.submit()
	}
}

// WRID 6118 duplicate clicks - close then reopen provider window on clicking continue...
function applyProcessDupeClick(strPage)	
{
	// Make channel page global
	strChannelPage = strPage;

	if (!window.myDetailsWin)
	{
		myPopup(strTempURL, 'detailsApplyWindow', 810, 600, 'yes', 'yes');
	}
	else
	{
		if (myDetailsWin.closed)
		{
			myPopup(strTempURL, 'detailsApplyWindow', 810, 600, 'yes', 'yes');
		}
		else
		{
			myDetailsWin.close()
			myPopup(strTempURL, 'detailsApplyWindow', 810, 600, 'yes', 'yes');
			myDetailsWin.focus()
		}
	}
	if (strPage == "carhire")
	{
		document.CarHireApply.submit()
	}
	else
	{
		document.FlightFinderApply.submit()
	}
	
}

//end hiding here-->
