function ChgIns(InsKey)
	{
	if(document.frmInsurance)
		{
		if (document.frmInsurance.InsBuy.checked)document.frmInsurance.action = "AddToBasket.asp?ItemKey=" + InsKey;
		else document.frmInsurance.action = "RemoveFromBasket.asp?ItemKey=" + InsKey;
		document.frmInsurance.submit();			
		}
	}
	
function addIns(InsKey)
  {
  document.frmInsurance.action = "../basket/AddToBasket.asp?ItemKey=" + InsKey;
	//alert("test" + InsKey)
  document.frmInsurance.submit();
}

//-- Opens pop up for insurance policy summary.
function fn_ViewPolicySum(InsKey,HandKey)
{
	var objWin, l, t, h, w;
	h = 400;
	w = 450;
	l = (screen.width) ? (screen.width-w)/2 : 0;
	t = (screen.height) ? (screen.height-h)/2 : 0;
	
	objWin = window.open('/help/help_pas_summary.asp?InsKey=' + InsKey + '&HandKey=' + HandKey,'Pas_Policy_Document','height='+ h +', width='+ w +', top='+ t +', left='+ l +', toolbar=no, status=no, scrollbars=yes','');
	if (window.focus) 
	{
		objWin.focus();
	}
	return true;
}

//-- Add insurance to basket from pop up.
function fn_AddInsToBasket(InsKey)
{
	var objOWin;
	
	//getStyle('ErrorMessage').display = "none";
	
	//if(document.paspolicysummary.confirmbox.checked == true)
	//	{
		objOWin = window.opener;
		if (objOWin.document.frmInsurance)objOWin.document.frmInsurance.submit();
		else objOWin.window.location = '/basket/addtobasket.asp?ItemKey=' + InsKey;
		objOWin.window.focus();
		window.close();
		return true;
	//	}
	/*else
		{
		getStyle('ErrorMessage').display = "inline";
		return false;
		}
	*/	
}

//-- Use in insuance pop to close pop and either open new window or change parent window location.
function fn_goto(URL,t)
{
	var objOWin;
	
	if (t == -1)
	{
		//window.close();
	}
	else
	{
		objOWin = window.opener;
		objOWin.window.location = URL;
		objOWin.window.focus();
		window.close();
	}
	
	return true;
	
}
