function Winopr() { //v2.0
  window.open('/friendform/','Offer','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=617');
}

function Hilite(name,over){
if(window.document.images) {
	if (over)
		window.document.images[name].src = "/images/map/" + name + "_ov.gif";
	else
		window.document.images[name].src =  "/images/map/" + name + ".gif";}	
	}

function lilPopup(url,scroll) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
  } else if( document.documentElement &&
	  ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {				
	myWidth = document.body.clientWidth;
	myHeight = document.body.clientHeight;
  }
window.open(url,"myWindow","status=0,scrollbars="+scroll+",height="+myHeight+",width="+myWidth+",resizable=1") 
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var nameID=document.form1.name
	var address1ID=document.form1.address
	var postcodeID=document.form1.postcode
	var emailID=document.form1.email
	var email2ID=document.form1.email2
	
	if ((nameID.value==null)||(nameID.value=="")){
		alert("Please Enter your Name")
		nameID.focus()
		return false
	}
	   if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
    
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
		
		}
		
	if (emailID.value!=email2ID.value){
		alert("Your Email's do not match!")
		email2ID.focus()
		return false
		
	}
    if ((address1ID.value==null)||(address1ID.value=="")){
		alert("Please Enter the first line of your Address")
		address1ID.focus()
		return false
	}
	
 
	
	if ((postcodeID.value==null)||(postcodeID.value=="")){
		alert("Please Enter your Postcode")
		postcodeID.focus()
		return false
	}
	
      if (document.form1.Market.checked == false) {
        var yesno = confirm('Would you like to scribe to be involved with promotions from the Money Shop? if yes Click Cancel and tick the box. Otherwise click OK')
		return yesno
    }
	return true
 }


function ValidateForm2(){
	var nameID=document.form1.name
	var address1ID=document.form1.address
	var postcodeID=document.form1.postcode
	var emailID=document.form1.email
	var email2ID=document.form1.email2
	
	if ((nameID.value==null)||(nameID.value=="")){
		alert("Please Enter your Name")
		nameID.focus()
		return false
	}
	   if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
    
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
		
		}
		
	if (emailID.value!=email2ID.value){
		alert("Your Email's do not match!")
		email2ID.focus()
		return false
		
	}
    if ((address1ID.value==null)||(address1ID.value=="")){
		alert("Please Enter the first line of your Address")
		address1ID.focus()
		return false
	}
	
 
	
	if ((postcodeID.value==null)||(postcodeID.value=="")){
		alert("Please Enter your Postcode")
		postcodeID.focus()
		return false
	}
	
      if (document.form1.Market.checked == false) {
        var yesno = confirm('Would you like to scribe to be involved with promotions from the Money Shop? if yes Click Cancel and tick the box. Otherwise click OK')
		return yesno
    }
	return true
 }

var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=550,width=550,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
