function openit(url,type){
	if (type=='1'){
		opt='scrollbars=yes,width=337,height=450,top=0,left=0'
	}
	else
	{
		opt="height=200,width=420,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes"
	}
window.open(url,null,opt);
}


function luhn(cn){
	sum=0;num_digit = cn.length;oddoreven = num_digit & 1; 
	for (count = 0; count < num_digit; count++) {
		digit = parseInt(cn.charAt(count));
		digit=((count & 1) ^ oddoreven)?digit:digit*2;
		digit=(digit>9)?digit-9:digit;
		sum += digit;
	}
	return ((sum % 10 == 0) && (sum>0));
}

function checkit(){
msg=(document.getElementById("agree").checked==true)?"":"You must agree to the terms and conditions\n\n";
msg+=(luhn(document.getElementById("cardnumber").value))?"":"The card number is not valid\n";
if (msg!=""){alert(msg);return false;}else{return true; }
}

function filtcar(sid){
	if(document.getElementById("vtype")){
		vt=document.getElementById("vtype").value;
		tm=document.getElementById("transmission").value;	
		window.location.href="?sid=" + sid + "&vtype=" + vt + "&transmission=" + tm;
	}	
}