function antispam(x,y) {
	ext='org';
	name1='kham';
	name2='sa';
	link1='mai';
	link2='lto:';
	nfs='@';
	document.write('<a href="#" onMouseOver="this.href='+"'"+link1+link2+x+y+nfs+name1+name2+'.'+ext+"'"+';">'+x+y+nfs+name1+name2+'.'+ext+'</a>');
}

function tellafriend(page) {
var w = (screen.width/2 - 235);
var h = (screen.height/2 - 200);
var atts = '" height=250,width=440,status=no,toolbar=no,menubar=no,scrollbars=no,top='+h+',left='+w+'"'
illya = window.open(page,"r", atts);
illya.focus();
}

function subscribe(formObj) {
	//~ var w="w4-A_@fg45.frt";
    //~ if (w.match(/^[A-Za-z0-9-_\.]+?@([A-Za-z0-9-_]+?)(\.[A-Za-z_]+)*(\.[A-Za-z_]{2,})+$/i)) 
        //~ x=1;
    //~ else
        //~ x=2;
	//~ if (x==2) return true;

    //~ if (isMailOk(formObj.r_info[email])) {
		//~ alert("Please enter correct email address"); 
	//~ } 
	/*
	else if (!isMailOk(formObj.email)) {
		 var url = 'subscribe.php?email='+formObj.email.value+'&name='+formObj.name.value+'&home='+formObj.home.value;
		 var w = (screen.width/2 - 185);
         var h = (screen.height/2 - 100);
         var atts = '" height=50,width=350,status=no,toolbar=no,menubar=no,scrollbars=no,top='+h+',left='+w+'"'
        // illya = window.open(url,"r", atts);
      
        var _surname = formObj.name.value;
        var _email = formObj.email.value;
        var _location = formObj.home.value;
        document.location="registration.php?surname="+_surname+"&email="+_email+"&location="+_location;
         //alert()   
         illya.focus(); 
		 }
		*/
		formObj.submit();
}

function isMailOk(textObj){
var mail=textObj.value;
    if (mail.match(/^[A-Za-z0-9-_\.]+?@([A-Za-z0-9-_]+?)(\.[A-Za-z_]+)*(\.[A-Za-z_]{2,})+$/i)) 
        return false;
    else
        return true;

}


function openpopup(url){
	var w = (screen.width/2 - 670);
	var h = (screen.height/2 - 540);

	win = window.open(url, null, "width=670,height=540,location=no,resizable=no,directories=no,menubar=no, scrollbars=yes, status=yes,titlebar=no,toolbar=no,top="+h+",left="+w);
	return false;
}



function validateComplete(formObj) {
/*
	var w="w4-A_@fg45.frt";
    if (w.match(/^[A-Za-z0-9-_\.]+?@([A-Za-z0-9-_]+?)(\.[A-Za-z_]+)*(\.[A-Za-z_]{2,})+$/i)) 
        x=1;
    else
        x=2;
*/
	//alert(w);


//~ if (x==2) return true;
     //~ else 
	 //~ alert(formObj["r_info[name]"]);
	 //~ return false;
	 if (emptyField(formObj["r_info[name]"]))

          alert("Please enter your First Name.");

     else if (emptyField(formObj["r_info[surname]"]))

          alert("Please enter your Surname.");

     else if (isMailOk(formObj["r_info[email]"]))

          alert("Please enter correct email address \nOtherwise we will not be able to contact you.");

/*      else if (emptyField(formObj["r_info[job_title]"]))

          alert("Please enter description of your business.");    
 */
 
     else return true;

     return false;

}

function emptyField(textObj){

     if (textObj.value.length == 0) return true;

     for (var i=0; i<textObj.value.length; ++i) {

          var ch = textObj.value.charAt(i);

          if (ch != ' ' && ch != '\t') return false;

     }

     return true;

}


function contactForm() {
   if(document.let.name.value=='') {
	  alert('Please enter your name');
	  document.let.name.focus();
	  return false;
	  }
	    if(document.let.surname.value=='') {
	  alert('Please enter your surname');
	  document.let.surname.focus();
	  return false;
	  }
	    if(document.let.email.value=='') {
	  alert('Please enter your email eddress');
	  document.let.email.focus();
	  return false;
	  }
	     if(document.let.user_message.value=='') {
	  alert('Please enter your message');
	  document.let.user_message.focus();
	  return false;
	  }
	
  
return true;
}



