function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.id; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}




function MM_validateForm2() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm2.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.id; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } 
  
    if (form2.Password.value != form2.Confirm_Password.value) 
  {
	  errors += '- Password mismatches.\n';
  }

 
  if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue2 = (errors == '');
}





function MM_validateForm3() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm3.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.id; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } 
  
    if (form1.Password.value != form1.Confirm_Password.value) 
  {
	  errors += '- Password mismatches.\n';
  }

  if (form1.terms.checked == false) 
  {
	  errors += '- Please read Terms & Conditions.\n';
  }
  
  if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue3 = (errors == '');
}







function checkIt(string)
{
	place = navigator.appVersion.indexOf(string) + 1;
	return place;
}
if (checkIt('6') || checkIt('5.5'))
{
indexcss = "index1024.css";
productscss = "products1024.css";
}
else
{
indexcss = "index800.css";
productscss = "products800.css";
}
indexcss = '<link href="'+indexcss+'" rel="stylesheet" type="text/css">';
productscss = '<link href="'+productscss+'" rel="stylesheet" type="text/css">';


function setText() { 
	if (new_member.checkbox.checked==true){
	new_member.rname.value = new_member.fname.value + " " + new_member.lname.value; 
	new_member.deliv_address1.value = new_member.bill_address1.value; 
	new_member.deliv_address2.value = new_member.bill_address2.value; 
	new_member.deliv_city.value = new_member.bill_city.value; 
	new_member.deliv_postcode.value = new_member.bill_postcode.value; 
	}
	else{
	new_member.rname.value = "";
	new_member.deliv_address1.value = "";
	new_member.deliv_address2.value = "";
	new_member.deliv_city.value = "";
	new_member.deliv_postcode.value = "";
	}
} 


// START - function to hide start date line in case of SWITCH card on offline card payment

function startd_block()
	{
	
	//alert (document.form2.cardtype.value);
		if(document.form2.cardtype.value=='Switch')
			{
			document.getElementById('rowShadow').style.display='none';
			}
		else
			{
			document.getElementById('rowShadow').style.display='block';
			}
	return false;
	}

// END - function to hide start date line in case of SWITCH card on offline card payment
function show(){
alert("hello");
}