//requires mootools

function check_form(theForm){

if (theForm.enquiry_name.value==""){
alert("Please enter your name");
theForm.enquiry_name.focus();
return false;
}

var x = theForm.enquiry_email.value;
var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x) !=true){
alert("Please enter a valid email address");
theForm.enquiry_email.focus();
return false;
}


if (theForm.enquiry_tel.value==""){
alert("Please enter your telephone number");
theForm.enquiry_tel.focus();
return false;
}

if (theForm.enquiry_message.value==""){
alert("Please enter your message");
theForm.enquiry_message.focus();
return false;
}


var message="Website Enquiry\n";
message+="Lead generated: The Serious Business Group (http://seriousgroup.co.uk) \n\n";
message+="Name: "+theForm.enquiry_name.value+"\n";
message+="Email: "+theForm.enquiry_email.value+"\n";
message+="Telephone: "+theForm.enquiry_tel.value+"\n";
message+="Comments: "+theForm.enquiry_message.value+"\n\n\n";




x=document.location.href;

//hardcode if a dowloaded version
if (x.substring(0,8)=="file:///") {
domain= "http://seriousinvestor.com";
}else{


if (x.substring(0,7)=="http://") {
x=x.substring(7,x.length);
}
y=x.split("/");
var domain= "http://"+y[0];
}



//jquery ajax

 $.ajax({
   type: "POST",
   url: domain+"/ishopstudio.com/factory/ajax.php",
   data:  { trigger: "callback_noaccount",propertyref:"Serious Investor", message: message },
   dataType: "script",
   });



theForm.enquiry_name.value="";
theForm.enquiry_email.value="";
theForm.enquiry_tel.value="";
theForm.enquiry_message.value="";

return false;	
}






function check_request_form(theForm){


if (theForm.forename.value == '') {
		alert("Please enter your forename");
		theForm.forename.focus();
		return false;
}

if (theForm.surname.value == '') {
		alert("Please enter your surname");
		theForm.surname.focus();
		return false;
}

if (theForm.telephone.value == '') {
		alert("Please enter your telephone number");
		theForm.telephone.focus();
		return false;
}


if (theForm.email.value == '') {
		alert("Please enter your e-mail address.");
		theForm.email.focus();
		return false;
}
		var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
if (filter.test(theForm.email.value) != true){
		theForm.email.focus();
		alert("Your e-mail address is not valid! Please try again.");
		return false;	
}

var message="Website Enquiry\n";
message+="Lead generated: The Serious Business Group (http://seriousgroup.co.uk) \n\n";
message+="Name: "+theForm.forename.value+" "+theForm.surname.value+"\n";
message+="Email: "+theForm.email.value+"\n";
message+="Telephone: "+theForm.telephone.value+"\n";
message+="Country of residence: "+theForm.country.value+"\n";
message+="Add to mailing list: "+theForm.newsletter.value+"\n";
message+="Comments: "+theForm.comments.value+"\n\n\n";
message+="Further details: \n\n"+theForm.furtherinfo.value+"\n";




x=document.location.href;

//hardcode if a dowloaded version
if (x.substring(0,8)=="file:///") {
domain= "http://seriousinvestor.com";
}else{


if (x.substring(0,7)=="http://") {
x=x.substring(7,x.length);
}
y=x.split("/");
var domain= "http://"+y[0];
}



//jquery ajax

 $.ajax({
   type: "POST",
   url: domain+"/ishopstudio.com/factory/ajax.php",
   data:  { trigger: "callback_noaccount", propertyref: theForm.propertyref.value,message: message },
   dataType: "script",
   });





theForm.forename.value="";
theForm.surname.value="";
theForm.telephone.value="";
theForm.email.value="";
theForm.comments.value="";


parent.$('#fancy_close').trigger('click');

return false;
}





function check_investment_form(theForm){


if (theForm.forename.value == '') {
		alert("Please enter your forename");
		theForm.forename.focus();
		return false;
}

if (theForm.surname.value == '') {
		alert("Please enter your surname");
		theForm.surname.focus();
		return false;
}

if (theForm.telephone.value == '') {
		alert("Please enter your telephone number");
		theForm.telephone.focus();
		return false;
}


if (theForm.email.value == '') {
		alert("Please enter your e-mail address.");
		theForm.email.focus();
		return false;
}
		var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
if (filter.test(theForm.email.value) != true){
		theForm.email.focus();
		alert("Your e-mail address is not valid! Please try again.");
		return false;	
}

var message="Website Enquiry\n";
message+="Lead generated: The Serious Business Group (http://seriousgroup.co.uk) \n\n";
message+="Name: "+theForm.forename.value+" "+theForm.surname.value+"\n";
message+="Email: "+theForm.email.value+"\n";
message+="Telephone: "+theForm.telephone.value+"\n";
message+="Country of residence: "+theForm.country.value+"\n";
message+="Add to mailing list: "+theForm.newsletter.value+"\n";
message+="Comments: "+theForm.comments.value+"\n\n\n";
message+="Further details: \n\n"+theForm.furtherinfo.value+"\n";




x=document.location.href;

//hardcode if a dowloaded version
if (x.substring(0,8)=="file:///") {
domain= "http://seriousinvestor.com";
}else{


if (x.substring(0,7)=="http://") {
x=x.substring(7,x.length);
}
y=x.split("/");
var domain= "http://"+y[0];
}



//jquery ajax

 $.ajax({
   type: "POST",
   url: domain+"/ishopstudio.com/factory/ajax.php",
   data:  { trigger: "callback_noaccount", propertyref: theForm.propertyref.value,message: message },
   dataType: "script",
   });





theForm.forename.value="";
theForm.surname.value="";
theForm.telephone.value="";
theForm.email.value="";
theForm.comments.value="";



return false;
}








function check_registration_form(theForm){


if (theForm.forename.value == '') {
		alert("Please enter your forename");
		theForm.forename.focus();
		return false;
}

if (theForm.surname.value == '') {
		alert("Please enter your surname");
		theForm.surname.focus();
		return false;
}

if (theForm.telephone.value == '') {
		alert("Please enter your telephone number");
		theForm.telephone.focus();
		return false;
}



if (theForm.namenum.value == '') {
		alert("Please enter your building name or number");
		theForm.namenum.focus();
		return false;
}

if (theForm.postcode.value == '') {
		alert("Please enter your postal/zip code");
		theForm.postcode.focus();
		return false;
}

if (theForm.email.value == '') {
		alert("Please enter your e-mail address.");
		theForm.email.focus();
		return false;
}
		var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
if (filter.test(theForm.email.value) != true){
		theForm.email.focus();
		alert("Your e-mail address is not valid! Please try again.");
		return false;	
}


if (theForm.password.value == '') {
		alert("Please choose a password");
		theForm.password.focus();
		return false;
}

if (theForm.password.value.length < 6) {
		alert("Please ensure your password is at least 6 characters");
		theForm.password.focus();
		return false;
}




x=document.location.href;

//hardcode if a dowloaded version
if (x.substring(0,8)=="file:///") {
domain= "http://seriousinvestor.com";
}else{


if (x.substring(0,7)=="http://") {
x=x.substring(7,x.length);
}
y=x.split("/");
var domain= "http://"+y[0];
}



//jquery ajax

 $.ajax({
   type: "POST",
   url: domain+"/ishopstudio.com/factory/ajax.php",
   data:  { 
trigger: "register", 
forename: theForm.forename.value,
surname:theForm.surname.value,
country: theForm.country.value,
telephone: theForm.telephone.value,
namenum: theForm.namenum.value,
postcode: theForm.postcode.value,
email: theForm.email.value,
password:theForm.password.value
},
   dataType: "script",
   });




return false;
}






function dologin(theForm){


if (theForm.email.value == '') {
		alert("Please enter your e-mail address.");
		theForm.email.focus();
		return false;
}
		var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
if (filter.test(theForm.email.value) != true){
		theForm.email.focus();
		alert("Your e-mail address is not valid! Please try again.");
		return false;	
}


if (theForm.password.value == '') {
		alert("Please enter your password");
		theForm.password.focus();
		return false;
}

if (theForm.password.value.length < 6) {
		alert("Please ensure your password is at least 6 characters");
		theForm.password.focus();
		return false;
}



loc=document.location.href;
x=loc;

//hardcode if a dowloaded version
if (x.substring(0,8)=="file:///") {
domain= "http://seriousinvestor.com";
}else{


if (x.substring(0,7)=="http://") {
x=x.substring(7,x.length);
}
y=x.split("/");
var domain= "http://"+y[0];
}




//jquery ajax



 $.ajax({
   type: "POST",
   url: domain+"/ishopstudio.com/factory/ajax.php",
   data:  { 
trigger: "login", 
email: theForm.email.value,
password:theForm.password.value
},
   dataType: "script",
   });





return false;
}

