
function priceimageswap(area) {
// swaps numbers with a graphic for the homepage price
var numb0="<img src='/images/pound.png'>";
var numb1="<img src='/images/"+document.getElementById(area).innerHTML.charAt(0)+".png'>";
var numb2="<img src='/images/"+document.getElementById(area).innerHTML.charAt(1)+".png'>";
var numb3="<img src='/images/"+document.getElementById(area).innerHTML.charAt(2)+".png'>";
document.getElementById(area).innerHTML=numb0+numb1+numb2+numb3;
}

function setupform() {

// setting up the checkout page layers 
	
//document.getElementById('address-popup').style.display="none";
//document.getElementById('address-popup2').style.display="none";
//document.getElementById('checkout-col2a').style.display="none";
//document.getElementById('checkout-col2b').style.display="none";
//document.getElementById('checkout-col3').style.display="none";
document.getElementById('loadingscreen').style.display="none";
document.getElementById('bodyarea').style.display="block";
//document.getElementById('checkout-payment').style.backgroundImage="url(/images/payment2.gif)";
//document.getElementById('checkout-installationdetails').style.backgroundImage="url(/images/installationdetails2.gif)";
//document.getElementById('ctl00_ContentPlaceHolder1_imgbtnnext1').style.cursor="pointer";
//document.getElementById('nextbut2').style.cursor="pointer";
//document.getElementById('nextbut3').style.cursor="pointer";
//document.getElementById('makepayment').style.cursor="pointer";
checkstep=1;
}

function checkout1() {

// show the second column on the checkout page
	
	if(checkstep==1){
//document.getElementById('nextbut1').style.cursor="arrow";
//document.getElementById('nextbut1').src="images/nextbuttonoff.gif";
//document.getElementById('checkout-col2b').style.display="block";
//document.getElementById('checkout-installationdetails').style.backgroundImage="url(/images/installationdetails.gif)";
//checkstep=2;
	}
}

function checkout2(bit1) {
	
// show the address pop up on the checkout page
document.getElementById(bit1).style.display="block";
}

function checkout3(bit1) {
// hide the address pop up on the checkout page
document.getElementById(bit1).style.display="none";
}

function checkout4() {
	
// show the third column on the checkout page
document.getElementById('checkout-col2b').style.display="none";
document.getElementById('checkout-col2a').style.display="block";
document.getElementById('checkout-col3').style.display="block";
document.getElementById('checkout-payment').style.backgroundImage="url(/images/payment.gif)";
}


function checkout5() {
	
// show the 4th column on the checkout page
	
	document.getElementById('checkout-payment').style.backgroundImage="url(/images/payment2.gif)";
	document.getElementById('checkout-col3').style.display="none";
	document.getElementById('checkout-col2b').style.display="block";
document.getElementById('checkout-col2a').style.display="none";
}

function checkout6() {

// show the loading layer
	
document.getElementById('loadingscreen').style.display="block";	
document.getElementById('bodyarea').style.display="none";

}


function checkprice() {
	
	//totals up the price on home security plus options page.
	
var price=0;
if(document.getElementById("check1").checked==true) {
price=price+99;
}
if(document.getElementById("check2").checked==true) {
price=price+199;
}
if(document.getElementById("check3").checked==true) {
price=price+49;
}
if(document.getElementById("check4").checked==true) {
price=price+99;
}
price=price+49+399;
document.getElementById("totalprice").innerHTML="&pound;"+price;
}



function checkprice2() {
	
	//totals up the price on home security options page.
	
var price=0;
if(document.getElementById("check1").checked==true) {
price=price+99;
}

if(document.getElementById("check2").checked==true) {
price=price+49;
}

price=price+49+299;
document.getElementById("totalprice").innerHTML="&pound;"+price;
}



function hideprod(varbit,varbit2) {
checkvar="ctl00_ContentPlaceHolder1_chkOption"+varbit;
checkvar2="ctl00_ContentPlaceHolder1_prod"+varbit+"base";
checkvar3="summarybox"+varbit;
document.getElementById(checkvar3).style.display="none";
//document.getElementById(checkvar).checked=false;
//document.getElementById(checkvar2).style.backgroundImage="url(/images/bluebase.gif)";		
}

function showprod(varbit,varbit2) {
checkvar="ctl00_ContentPlaceHolder1_chkOption"+varbit;
checkvar2="ctl00_ContentPlaceHolder1_prod"+varbit+"base";
checkvar3="summarybox"+varbit;
document.getElementById(checkvar3).style.display="block";
//document.getElementById(checkvar).checked=true;
//document.getElementById(checkvar2).style.backgroundImage="url(/images/yellowbase.gif)";		
}


function product1on(varbit,bit3) {
	
// toggles home security plus options when you click on them
//hideprod(bit2,bit2);
	 checkvar2="divprod"+varbit+"base";
	if (bit3=='images/check1.gif')
        document.getElementById(checkvar2).style.backgroundImage="url(/images/bluebase.gif)";
     else
     document.getElementById(checkvar2).style.backgroundImage="url(/images/yellowbase.gif)";
    
}



function product1bon(bit1,bit2,bit3) {
	
// highlights areas on home security page
	
	if (document.getElementById(bit3).checked==false) {
showprod(bit1,bit1);
	} 
	else {
hideprod(bit1,bit1);
	}
	
checkprice2();
	
	
}








function setupproducts() {
// which options are selected when you enter the security plus product page	
hideprod('1','1');
hideprod('2','2');
hideprod('3','3');
hideprod('4','4');
checkprice();
}

function setupproducts2() {
// which options are selected when you enter the security product page	
hideprod('1','1');
hideprod('2','2');
checkprice2();
}

function homepopup(bit) {
	// gives the warning on the homepage when you want to go to the next page
	document.getElementById('overlay').style.display="block";
	var heightbit=document.getElementById('container').offsetHeight;
	
	
	if (self.innerHeight) // all except Explorer
{
	heightbit2 = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
{
	heightbit2 = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
	heightbit2 = document.body.clientHeight;
}

if (heightbit2>heightbit) {
heightbit=heightbit2;	
}
	
	document.getElementById(bit).style.display="none";
	document.getElementById('overlay').style.height=heightbit+"px";





}


function myPopup2(url,numb) {
window.open( url, "myWindow"+numb, 
"status = 0, height = 600, width = 700, resizable = 1,scrollbars=yes" )
}

function myPopup3(url,numb) {
window.open( url, "myWindow"+numb, 
"status = 0, height=300, width =650,resizable = 1,scrollbars=yes,top=300,left=300" )
}

function cardoption() {

if (document.getElementById('ctl00_ContentPlaceHolder1_ddlCardtype').selectedIndex==4) {
document.getElementById('issuemandatory').style.color="#005ca9";
}
else {
document.getElementById('issuemandatory').style.color="#fff";
}

}