function bus()

{
document.Search.Products.value='Products or Business';
}

function prodwr()
{
if(document.Search.Products.value=="Products or Business"){document.Search.Products.value="";}
}

function show()
{
var cit=document.getElementById('citigroup');
if(cit.style.display=="none"){cit.style.display="block"}
SetTimeout("show()",200)
}


function kill()
{
var cit=document.getElementById('citigroup');
cit.style.display="none";
}


function sitevalid()
{
var wb=document.store.website.value;

var regexp = /^http:\/\/[a-z0-9\.-]{3,}\.[a-z]{3}$/;

  
if (!wb.match(regexp))
{
alert("website URl is incorrect! Please make sure the prefix http:// precedes the url");
document.getElementById('webs').style.borderColor="red";
return false;
}
else
{
document.getElementById('webs').style.borderColor="#999999";
}
}


function blink()
{
var a=document.getElementById('client');
if(a.style.color=="#0000ff")
{a.style.color="#0088ff"}
else
{
a.style.color="#0000ff";
}

setTimeout("blink()",1000)
}



function bizdisplay()
{
var a=document.getElementById('fea-pro');
var b=document.getElementById('rec-rev');
var c=document.getElementById('new-biz');


if(a.style.display=="none")  {a.style.display="none"} else{a.style.display="none"}
if(b.style.display=="none")  {b.style.display="none"} else{b.style.display="none"}
if(c.style.display=="none")  {c.style.display="block"} else{c.style.display="block"}
}

function revdisplay()
{
var a=document.getElementById('fea-pro');
var b=document.getElementById('new-biz');
var c=document.getElementById('rec-rev');


if(a.style.display=="none")  {a.style.display="none"} else{a.style.display="none"}
if(b.style.display=="none")  {b.style.display="none"} else{b.style.display="none"}
if(c.style.display=="none")  {c.style.display="block"} else{c.style.display="block"}

}


function prodisplay()
{
var a=document.getElementById('rec-rev');
var b=document.getElementById('new-biz');
var c=document.getElementById('fea-pro');


if(a.style.display=="none")  {a.style.display="none"} else{a.style.display="none"}
if(b.style.display=="none")  {b.style.display="none"} else{b.style.display="none"}
if(c.style.display=="none")  {c.style.display="block"} else{c.style.display="block"}

}


function subscribevalid()
{
var b=document.ad.email.value;
var ok="mortgage_subscribe.php";


if(b.indexOf("@")<0 || b.indexOf(".")<0 ||b.indexOf(" ")>0)
{ 
alert("Please enter a valid email!");
document.getElementById('emai').style.borderColor="red";
return false;
}
else{document.getElementById('emai').style.borderColor="#999999";}

document.ad.action=ok;
}


function chng()
{
var a=document.getElementById("col");
if(a.style.backgroundColor=="#88bb00"){a.style.backgroundColor="#d4ff60"} 
else{a.style.backgroundColor="#88bb00"}
}


function ratevalid()
{
var a=document.ad.review.value;
var b=document.ad.fullN.value;

var badChars="~@#$%^&*()_+}{?`-=]/[\|";
var i=0;

if(a.length<150)
{alert("Review field must be at least 150 characters!");
document.getElementById('rev').style.borderColor="red";
return false;
}
else{document.getElementById('rev').style.borderColor="#999999";}

for (i=0;i<a.length;i++)
{ 
if (badChars.indexOf(a.charAt(i)) >=0 )
{
alert("Review Field contains special characters! Please remove those characters.");
document.getElementById('rev').style.borderColor="red";
return false;
}
else
{
document.getElementById('rev').style.borderColor="#999999";
}
}

if(b.length==0)
{alert("Full name field is empty! Please enter Your Full Name!");
document.getElementById('full').style.borderColor="red";
return false;
}
else{document.getElementById('full').style.borderColor="#999999";}

for (i=0;i<b.length;i++)
{ 
if (badChars.indexOf(b.charAt(i)) >=0 )
{
alert("Name Field contains special characters! Please remove those characters.");
document.getElementById('full').style.borderColor="red";
return false;
}
else
{
document.getElementById('full').style.borderColor="#999999";
}
}
var sen="/thxvot.php";
document.ad.action=sen;
}

function linebreak()
{
alert("Insert <br><br> where you want a blank line")
}

function searchvalid()
{
var po=document.Search.Products.value;
var ci=document.Search.City.value;
var zi=document.Search.ZIP.value;

if(po.length==0)
{
alert("Products field is empty!");
document.getElementById('prodx').style.borderColor="red";
document.getElementById('prodx').style.borderWidth="1px";
return false;
}
else{document.getElementById('prodx').style.borderColor="#FFFFFF";
document.getElementById('prodx').style.borderWidth="0px";}

if(ci.length==0)
{
alert("Please enter City!");
document.getElementById('citi').style.borderColor="red";
document.getElementById('citi').style.borderWidth="1px";
return false;
}
else{document.getElementById('citi').style.borderColor="#FFFFFF";
document.getElementById('citi').style.borderWidth="0px";}

if(zi.length==0)
{
alert("Please enter ZIP Code!");
document.getElementById('zipp').style.borderColor="red";
document.getElementById('zipp').style.borderWidth="1px";
return false;
}
else{document.getElementById('zipp').style.borderColor="#FFFFFF";
document.getElementById('zipp').style.borderWidth="0px";}

if(zi.length<5)
{
alert("ZIP code must be 5 digits");
document.getElementById('zipp').style.borderColor="red";
document.getElementById('zipp').style.borderWidth="1px";
return false;
}
else{document.getElementById('zipp').style.borderColor="#FFFFFF";
document.getElementById('zipp').style.borderWidth="0px";
}
}


function shprvalid()
{
var fi=document.store.first.value;
var la=document.store.last.value;
var b=document.store.email.value;
var q=document.store.password.value;
var pro=document.store.products.value;
var ad=document.store.address.value;
var ci=document.store.city.value;
var z=document.store.zip.value; 
var p=document.store.phone.value;
var m=document.store.mobile.value;


var badChars="~!@#$%^&*()_+}{:?><`-=][';/.,|";
var allowedChars="1234567890";
var phoneChars=" 1234567890";
var faxChars=" 1234567890";
var mobChars=" 1234567890";
var i=0;


if(fi.length==0)
{
alert("First name field is empty! Please enter Your First Name!");
document.getElementById('fina').style.borderColor="red";
return false;
}
else{document.getElementById('fina').style.borderColor="#999999";}

if(la.length==0)
{
alert("Last name field is empty! Please enter Your Last Name!");
document.getElementById('lana').style.borderColor="red";
return false;
}
else{document.getElementById('lana').style.borderColor="#999999";}


if(b.indexOf("@")<0 || b.indexOf(".")<0 ||b.indexOf(" ")>0)
{ 
alert("Please enter a valid email!");
document.getElementById('emai').style.borderColor="red";
return false;
}
else{document.getElementById('emai').style.borderColor="#999999";}

if(q.length<10 || q.indexOf(" ")>0)
{ 
alert("Password must be at least 10 characters and no spaces allowed!");
document.getElementById('pass').style.borderColor="red";
return false;
}
else{document.getElementById('pass').style.borderColor="#999999";}

if(pro.length==0)
{
alert("Products field is empty! Please enter products you are interested in!");
document.getElementById('prod').style.borderColor="red";
return false;
}
else{document.getElementById('prod').style.borderColor="#999999";}

if(pro.length==0)
{
alert("Please enter at least 10 characters in the product field!");
document.getElementById('prod').style.borderColor="red";
return false;
}
else{document.getElementById('prod').style.borderColor="#999999";}

for (i=0;i<pro.length;i++)
{ 
if (badChars.indexOf(pro.charAt(i)) >=0 )
{
alert("Products Field contains commas, semi-colons or special characters! Please replace those characters by spaces.");
document.getElementById('prod').style.borderColor="red";
return false;
}
else
{
document.getElementById('prod').style.borderColor="#999999";
}
}


if(ad.length==0)
{
alert("Please enter your address");
document.getElementById('addr').style.borderColor="red";
return false;
}
else{document.getElementById('addr').style.borderColor="#999999";}

for (i=0;i<ad.length;i++)
{ 
if (badChars.indexOf(ad.charAt(i)) >=0 )
{
alert("Address Field contains commas, semi-colons or special characters! Please replace those characters by spaces.");
document.getElementById('addr').style.borderColor="red";
return false;
}
else
{
document.getElementById('addr').style.borderColor="#999999";
}
}

if(ci.length==0)
{
alert("City field is empty! Please enter Your City");
document.getElementById('cits').style.borderColor="red";
return false;
}
else{document.getElementById('cits').style.borderColor="#999999";}

if(z.length<5 || z.length==0 || z.substring(z.length-1,z.length)==" ")
{
alert("Please enter a valid ZIP Code");
document.getElementById('zips').style.borderColor="red";
return false;
}
else{document.getElementById('zips').style.borderColor="#999999";}

for (i=0;i<z.length;i++)
{ 
if (allowedChars.indexOf(z.charAt(i)) == -1 )
{
alert("Please enter only numeric characters in the ZIP Code Field!");
document.getElementById('zips').style.borderColor="red";
return false;
}
else{document.getElementById('zips').style.borderColor="#999999";}
}

if(p.length<12 || p.length==0 || p.substring(p.length-1,p.length)==" ")
{
alert("Please enter a valid Phone Number!Phone number should be in the format NNN NNN NNNN");
document.getElementById('phon').style.borderColor="red";
return false;
}
else{document.getElementById('phon').style.borderColor="#999999";}

for (i=0;i<p.length;i++)
{ 
if (phoneChars.indexOf(p.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Phone Field!");
document.getElementById('phon').style.borderColor="red";
return false;
}
else{document.getElementById('phon').style.borderColor="#999999";}
}

if(m.length>0 && m.length<12 || m.substring(m.length-1,m.length)==" ")
{
alert("Please enter a valid Mobile Phone Number!");
document.getElementById('mobi').style.borderColor="red";
return false;
}
else{document.getElementById('mobi').style.borderColor="#999999";}

for (i=0;i<m.length;i++)
{ 
if (mobChars.indexOf(m.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Mobile Phone Field!");
document.getElementById('mobi').style.borderColor="red";
return false;
}
else{document.getElementById('mobi').style.borderColor="#999999";}
}
}


function accessvalid()
{
var b=document.store.email.value;
var q=document.store.password.value;

if(b.indexOf("@")<0 || b.indexOf(".")<0 ||b.indexOf(" ")>0)
{ 
alert("Please enter a valid email!");
document.getElementById('emai').style.borderColor="red";
return false;
}
else{document.getElementById('emai').style.borderColor="#999999";}

if(q.length<10 || q.indexOf(" ")>0)
{ 
alert("Password must be at least 10 characters and no spaces allowed!");
document.getElementById('pass').style.borderColor="red";
return false;
}
else{document.getElementById('pass').style.borderColor="#999999";}

}

function updatevalid()
{
var fi=document.store.first.value;
var la=document.store.last.value;
var c=document.store.company.value;
var b=document.store.email.value;
var wb=document.store.website.value;
var q=document.store.password.value;
var des=document.store.description.value;
var pro=document.store.products.value;
var ad=document.store.address.value;
var ci=document.store.city.value;
var z=document.store.zip.value; 
var p=document.store.phone.value;
var f=document.store.fax.value;
var m=document.store.mobile.value;
var a=document.store.picture.value;

var badChars="~!@#$%^&*()_+}{:?><`-=][';/.,|";
var allowedChars="1234567890";
var phoneChars=" 1234567890";
var faxChars=" 1234567890";
var mobChars=" 1234567890";
var i=0;


if(fi.length==0)
{
alert("First name field is empty! Please enter Your First Name!");
document.getElementById('fina').style.borderColor="red";
return false;
}
else{document.getElementById('fina').style.borderColor="#999999";}

if(la.length==0)
{
alert("Last name field is empty! Please enter Your Last Name!");
document.getElementById('lana').style.borderColor="red";
return false;
}
else{document.getElementById('lana').style.borderColor="#999999";}

if(c.length==0)
{
alert("Company name field is empty! Please enter Your Company's Name!");
document.getElementById('comp').style.borderColor="red";
return false;
}
else{document.getElementById('comp').style.borderColor="#999999";}

if(b.indexOf("@")<0 || b.indexOf(".")<0 ||b.indexOf(" ")>0)
{ 
alert("Please enter a valid email!");
document.getElementById('emai').style.borderColor="red";
return false;
}
else{document.getElementById('emai').style.borderColor="#999999";}

//
var regexp = /^http:\/\/[a-z0-9\.-]{3,}\.[a-z]{3}$/;

  
if (!wb.match(regexp))
{
alert("website URl is incorrect! Please make sure the prefix http:// precedes the url");
document.getElementById('webs').style.borderColor="red";
return false;
}
else
{
document.getElementById('webs').style.borderColor="#999999";
}
//


if(q.length<10 || q.indexOf(" ")>0)
{ 
alert("Password must be at least 10 characters and no spaces allowed!");
document.getElementById('pass').style.borderColor="red";
return false;
}
else{document.getElementById('pass').style.borderColor="#999999";}

if(des.length==0)
{
alert("Description field is empty! Please enter at least 150 characters in the description field!");
document.getElementById('descr').style.borderColor="red";
return false;
}
else{document.getElementById('descr').style.borderColor="#999999";}


for (i=0;i<pro.length;i++)
{ 
if (badChars.indexOf(pro.charAt(i)) >=0 )
{
alert("Products Field contains commas, semi-colons or special characters! Please replace those characters by spaces.");
document.getElementById('prod').style.borderColor="red";
return false;
}
else
{
document.getElementById('prod').style.borderColor="#999999";
}
}

var adult=new Array("hardcore","sex movie","sex movies","sex film","sex films","sex tape","sex tapes","cock","cocks","pussy","pussies","porn","porno","pornography","pornographic","fuck","fucked","fucker","fucking","ass-fucked","whore","whores");

for(var i=0;i<=adult.length-1;i++)
{
if(pro.indexOf(adult[i])>=0)
{
alert("There are forbidden words in the Products Field! This is a violation of the Terms of Use! Your IP has been identified!");
document.getElementById('prod').style.borderColor="red";
return false;
}
else
{
document.getElementById('prod').style.borderColor="#999999";
}
}



if(ad.length==0)
{
alert("Please enter Your Business Address");
document.getElementById('addr').style.borderColor="red";
return false;
}
else{document.getElementById('addr').style.borderColor="#999999";}

for (i=0;i<ad.length;i++)
{ 
if (badChars.indexOf(ad.charAt(i)) >=0 )
{
alert("Address Field contains commas, semi-colons or special characters! Please replace those characters by spaces.");
document.getElementById('addr').style.borderColor="red";
return false;
}
else
{
document.getElementById('addr').style.borderColor="#999999";
}
}



if(ci.length==0)
{
alert("City field is empty! Please enter Your City");
document.getElementById('cits').style.borderColor="red";
return false;
}
else{document.getElementById('cits').style.borderColor="#999999";}

if(z.length<5 || z.length==0 || z.substring(z.length-1,z.length)==" ")
{
alert("Please enter a valid ZIP Code");
document.getElementById('zips').style.borderColor="red";
return false;
}
else{document.getElementById('zips').style.borderColor="#999999";}

for (i=0;i<z.length;i++)
{ 
if (allowedChars.indexOf(z.charAt(i)) == -1 )
{
alert("Please enter only numeric characters in the ZIP Code Field!");
document.getElementById('zips').style.borderColor="red";
return false;
}
else{document.getElementById('zips').style.borderColor="#999999";}
}

if(p.length<12 || p.length==0 || p.substring(p.length-1,p.length)==" ")
{
alert("Please enter a valid Company's Phone Number!Phone number should be in the format NNN NNN NNNN");
document.getElementById('phon').style.borderColor="red";
return false;
}
else{document.getElementById('phon').style.borderColor="#999999";}

for (i=0;i<p.length;i++)
{ 
if (phoneChars.indexOf(p.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Phone Field!");
document.getElementById('phon').style.borderColor="red";
return false;
}
else{document.getElementById('phon').style.borderColor="#999999";}
}


if(f.length>0 && f.length<12 || f.substring(f.length-1,f.length)==" ")
{
alert("Please enter a valid Company's Fax Number!");
document.getElementById('faxs').style.borderColor="red";
return false;
}
else{document.getElementById('faxs').style.borderColor="#999999";}


for (i=0;i<f.length;i++)
{ 
if (faxChars.indexOf(f.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Fax Field!");
document.getElementById('faxs').style.borderColor="red";
return false;
}
else{document.getElementById('faxs').style.borderColor="#999999";}
}

if(m.length>0 && m.length<12 || m.substring(m.length-1,m.length)==" ")
{
alert("Please enter a valid Mobile Phone Number!");
document.getElementById('mobi').style.borderColor="red";
return false;
}
else{document.getElementById('mobi').style.borderColor="#999999";}

for (i=0;i<m.length;i++)
{ 
if (mobChars.indexOf(m.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Mobile Phone Field!");
document.getElementById('mobi').style.borderColor="red";
return false;
}
else{document.getElementById('mobi').style.borderColor="#999999";}
}

if(a.length>0)
{
if(a.substring(a.length-4,a.length)!=".jpg" && a.substring(a.length-4,a.length)!=".gif"&& a.substring(a.length-5,a.length)!=".jpeg" && a.substring(a.length-4,a.length)!=".JPG" && a.substring(a.length-4,a.length)!=".GIF" && a.substring(a.length-5,a.length)!=".JPEG" && a.substring(a.length-4,a.length)!=".PNG" && a.substring(a.length-4,a.length)!=".png" || a.substring(a.length-4,a.length)==".exe")
{
alert("Image format not supported! Please upload only JPG, PNG or GIF images");
document.getElementById('pict').style.borderColor="red";
return false;
}
else{document.getElementById('pict').style.borderColor="#999999";}
}
}

function logout()
{
window.location.replace('logout.php')
}

function msgvalid()
{
var b=document.shopper.email.value;
var fi=document.shopper.first.value;
var la=document.shopper.last.value;
var p=document.shopper.phone.value;
var s=document.shopper.subject.value;
var m=document.shopper.msg.value;
var phoneChars=" 1234567890";

var i=0;

if(b.indexOf("@")<0 || b.indexOf(".")<0 ||b.indexOf(" ")>0)
{ 
alert("Please enter a valid email!");
document.getElementById('eml').style.borderColor="red";
return false;
}
else{document.getElementById('eml').style.borderColor="#999999";}

if(fi.length==0)
{
alert("First name field is empty! Please enter Your First Name!");
document.getElementById('frst').style.borderColor="red";
return false;
}
else{document.getElementById('frst').style.borderColor="#999999";}


if(la.length==0)
{
alert("Last name field is empty! Please enter Your Last Name!");
document.getElementById('lstn').style.borderColor="red";
return false;
}
else{document.getElementById('lstn').style.borderColor="#999999";}

if(p.length<12 || p.length==0|| p.substring(p.length-1,p.length)==" ")
{
alert("Please enter a valid Phone Number!Phone number should be in the format NNN NNN NNNN");
document.getElementById('tel').style.borderColor="red";
return false;
}
else{document.getElementById('tel').style.borderColor="#999999";}

for (i=0;i<p.length;i++)
{ 
if (phoneChars.indexOf(p.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Phone Field!");
document.getElementById('tel').style.borderColor="red";
return false;
}
else{document.getElementById('tel').style.borderColor="#999999";}
}

if(s.length==0)
{
alert("Subject field is empty! Please enter the subject of your message!");
document.getElementById('subj').style.borderColor="red";
return false;
}
else{document.getElementById('subj').style.borderColor="#999999";}

if(m.length<40)
{
alert("Please enter at least 40 characters in the message field!");
document.getElementById('ms').style.borderColor="red";
return false;
}
else{document.getElementById('ms').style.borderColor="#999999";}

var ok="/contact_us.php";
document.shopper.action=ok;

}


function strvalid()
{
var b=document.shopper.sender.value;
var fi=document.shopper.sndrfrst.value;
var la=document.shopper.sndrlst.value;
var p=document.shopper.sndrnmbr.value;
var phoneChars=" 1234567890";

var i=0;

if(b.indexOf("@")<0 || b.indexOf(".")<0 ||b.indexOf(" ")>0)
{ 
alert("Please enter a valid email!");
document.getElementById('ml').style.borderColor="red";
return false;
}
else{document.getElementById('ml').style.borderColor="#999999";}

if(fi.length==0)
{
alert("First name field is empty! Please enter Your First Name!");
document.getElementById('frst').style.borderColor="red";
return false;
}
else{document.getElementById('frst').style.borderColor="#999999";}

if(la.length==0)
{
alert("Last name field is empty! Please enter Your Last Name!");
document.getElementById('lstn').style.borderColor="red";
return false;
}
else{document.getElementById('lstn').style.borderColor="#999999";}



if(p.length<12 || p.length==0|| p.substring(p.length-1,p.length)==" ")
{
alert("Please enter a valid Phone Number!Phone number should be in the format NNN NNN NNNN");
document.getElementById('tel').style.borderColor="red";
return false;
}
else{document.getElementById('tel').style.borderColor="#999999";}

for (i=0;i<p.length;i++)
{ 
if (phoneChars.indexOf(p.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Phone Field!");
document.getElementById('tel').style.borderColor="red";
return false;
}
else
{
document.getElementById('tel').style.borderColor="#999999";
}
}
}

function showmsg()
{
var a=document.shopper.sender.value;
var b=document.shopper.sndrfrst.value;
var c=document.shopper.sndrlst.value;
var d=document.shopper.sndrnmbr.value;

if(a.length==0 || b.length==0 || c.length==0 || d.length==0)
{
alert("Please fill the form first in order to preview the message");
return;
}
else
{
document.getElementById('msg').style.display="block";
document.getElementById('nome').innerHTML=b+" "+c
}
}

function shopvalid()
{
var fi=document.shopper.first.value;
var la=document.shopper.last.value;
var pro=document.shopper.products.value;
var b=document.shopper.email.value;
var ad=document.shopper.address.value;
var ci=document.shopper.city.value;
var z=document.shopper.zip.value; 
var p=document.shopper.phone.value;
var m=document.shopper.mobile.value;

var badChars="~!@#$%^&*()_+}{:?><`-=][';/.,|";
var allowedChars="1234567890";
var phoneChars=" 1234567890";
var faxChars=" 1234567890";
var mobChars=" 1234567890";
var i=0;


if(fi.length==0)
{
alert("First name field is empty! Please enter Your First Name!");
document.getElementById('frst').style.borderColor="red";
return false;
}
else{document.getElementById('frst').style.borderColor="#999999";}

if(la.length==0)
{
alert("Last name field is empty! Please enter Your Last Name!");
document.getElementById('lstn').style.borderColor="red";
return false;
}
else{document.getElementById('lstn').style.borderColor="#999999";}

if(pro.length==0)
{
alert("Products field is empty! Please enter the products you are looking for");
document.getElementById('pros').style.borderColor="red";
return false;
}
else{document.getElementById('pros').style.borderColor="#999999";}

for (i=0;i<pro.length;i++)
{ 
if (badChars.indexOf(pro.charAt(i)) >=0 )
{
alert("Products Field contains commas, semi-colons or special characters! Please replace those characters by spaces.");
document.getElementById('pros').style.borderColor="red";
return false;
}
else
{
document.getElementById('pros').style.borderColor="#999999";
}
}

if(b.indexOf("@")<0 || b.indexOf(".")<0 ||b.indexOf(" ")>0)
{ 
alert("Please enter a valid email!");
document.getElementById('eml').style.borderColor="red";
return false;
}
else{document.getElementById('eml').style.borderColor="#999999";}

if(ad.length==0)
{
alert("Please enter Your Address");
document.getElementById('addy').style.borderColor="red";
return false;
}
else{document.getElementById('addy').style.borderColor="#999999";}

for (i=0;i<ad.length;i++)
{ 
if (badChars.indexOf(ad.charAt(i)) >=0 )
{
alert("Address Field contains commas, semi-colons or special characters! Please replace those characters by spaces.");
document.getElementById('addy').style.borderColor="red";
return false;
}
else
{
document.getElementById('addy').style.borderColor="#999999";
}
}

if(ci.length==0)
{
alert("City field is empty! Please enter Your City");
document.getElementById('town').style.borderColor="red";
return false;
}
else{document.getElementById('town').style.borderColor="#999999";}

if(z.length<5 || z.length==0 || z.substring(z.length-1,z.length)==" ")
{
alert("Please enter a valid ZIP Code");
document.getElementById('zico').style.borderColor="red";
return false;
}
else{document.getElementById('zico').style.borderColor="#999999";}

for (i=0;i<z.length;i++)
{ 
if (allowedChars.indexOf(z.charAt(i)) == -1 )
{
alert("Please enter only numeric characters in the ZIP Code Field!");
document.getElementById('zico').style.borderColor="red";
return false;
}
else{document.getElementById('zico').style.borderColor="#999999";}
}

if(p.length<12 || p.length==0|| p.substring(p.length-1,p.length)==" ")
{
alert("Please enter a valid Phone Number!Phone number should be in the format NNN NNN NNNN");
document.getElementById('tel').style.borderColor="red";
return false;
}
else{document.getElementById('tel').style.borderColor="#999999";}

for (i=0;i<p.length;i++)
{ 
if (phoneChars.indexOf(p.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Phone Field!");
document.getElementById('tel').style.borderColor="red";
return false;
}
else{document.getElementById('tel').style.borderColor="#999999";}
}

if(m.length>0 && m.length<12 || m.substring(m.length-1,m.length)==" ")
{
alert("Please enter a valid Mobile Phone Number!");
document.getElementById('mobl').style.borderColor="red";
return false;
}
else{document.getElementById('mobl').style.borderColor="#999999";}

for (i=0;i<m.length;i++)
{ 
if (mobChars.indexOf(m.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Mobile Phone Field!");
document.getElementById('mobl').style.borderColor="red";
return false;
}
else{document.getElementById('mobl').style.borderColor="#999999";}
}
var mlsen="/shopper_regis.php";
document.shopper.action=mlsen;
}

function checkBad()

{
var pro=document.store.products.value;
var badChars="~!@#$%^&*()_+}{:?><`-=][';/.,|";
for (i=0;i<pro.length;i++)
{
if(badChars.indexOf(pro.charAt(i))>=0)
{
alert("Please Remove the Last Character. It's not Allowed!");
}
}
}

function CountLeft() 
{
var pro=document.store.products.value;
var max=150; 
var curr=pro.length;
var rem=max-curr;
var enc=" left";

document.getElementById('sh').innerHTML=rem+enc;
}


function storevalid()
{
var fi=document.store.first.value;
var la=document.store.last.value;
var c=document.store.company.value;
var b=document.store.email.value;
var wb=document.store.website.value;
var pro=document.store.products.value;
var ad=document.store.address.value;
var ci=document.store.city.value;
var z=document.store.zip.value; 
var p=document.store.phone.value;
var f=document.store.fax.value;
var m=document.store.mobile.value;
var a=document.store.picture.value;


var badChars="~!@#$%^&*()_+}{:?><`-=][';/.,|";
var badEm="~!#$%^&*()+}{:?><`-=][';/,|";
var allowedChars="1234567890";
var phoneChars=" 1234567890";
var faxChars=" 1234567890";
var mobChars=" 1234567890";
var i=0;


if(fi.length==0)
{
alert("First name field is empty! Please enter Your First Name!");
document.getElementById('fina').style.borderColor="red";
return false;
}
else{document.getElementById('fina').style.borderColor="#999999";}

//

for (i=0;i<fi.length;i++)
{ 
if (badChars.indexOf(fi.charAt(i)) >=0 )
{
alert("First Name Field contains commas, semi-colons or special characters! Please remove those characters.");
document.getElementById('fina').style.borderColor="red";
return false;
}
else
{
document.getElementById('fina').style.borderColor="#999999";
}
}

//
if(la.length==0)
{
alert("Last name field is empty! Please enter Your Last Name!");
document.getElementById('lana').style.borderColor="red";
return false;
}
else{document.getElementById('lana').style.borderColor="#999999";}

//

for (i=0;i<la.length;i++)
{ 
if (badChars.indexOf(la.charAt(i)) >=0 )
{
alert("Last name Field contains commas, semi-colons or special characters! Please remove those characters.");
document.getElementById('lana').style.borderColor="red";
return false;
}
else
{
document.getElementById('lana').style.borderColor="#999999";
}
}
//

if(c.length==0)
{
alert("Company name field is empty! Please enter Your Company's Name!");
document.getElementById('comp').style.borderColor="red";
return false;
}
else{document.getElementById('comp').style.borderColor="#999999";}

//

for (i=0;i<c.length;i++)
{ 
if (badChars.indexOf(c.charAt(i)) >=0 )
{
alert("Company Name Field contains commas, semi-colons or special characters! Please rremove those characters.");
document.getElementById('comp').style.borderColor="red";
return false;
}
else
{
document.getElementById('comp').style.borderColor="#999999";
}
}
//


if(b.indexOf("@")<0 || b.indexOf(".")<0 ||b.indexOf(" ")>0)
{ 
alert("Please enter a valid email!");
document.getElementById('emai').style.borderColor="red";
return false;
}
else{document.getElementById('emai').style.borderColor="#999999";}

//

for (i=0;i<b.length;i++)
{ 
if (badEm.indexOf(b.charAt(i)) >=0 )
{
alert("Email Field contains commas, semi-colons or special characters! Please remove those characters.");
document.getElementById('emai').style.borderColor="red";
return false;
}
else
{
document.getElementById('emai').style.borderColor="#999999";
}
}
//
var regexp = /^http:\/\/[w]{3}\.[a-z0-9\.-]{3,}\.[a-z]{3}$/;

  
if (!wb.match(regexp))
{
alert("website URl is incorrect! Please make sure the prefix 'http://www' precedes the url or there is no '/' at the end");
document.getElementById('webs').style.borderColor="red";
return false;
}
else
{
document.getElementById('webs').style.borderColor="#999999";
}
//

if(pro.length==0)
{
alert("Products field is empty! Please enter a list of the products your company sells!");
document.getElementById('prod').style.borderColor="red";
return false;
}
else{document.getElementById('prod').style.borderColor="#999999";}

if(pro.length<100)
{
alert("Please enter at leat 100 characters in the product field!");
document.getElementById('prod').style.borderColor="red";
return false;
}
else{document.getElementById('prod').style.borderColor="#999999";}

for (i=0;i<pro.length;i++)
{ 
if (badChars.indexOf(pro.charAt(i)) >=0 )
{
alert("Products Field contains commas, semi-colons or special characters! Please replace those characters by spaces.");
document.getElementById('prod').style.borderColor="red";
return false;
}
else
{
document.getElementById('prod').style.borderColor="#999999";
}
}


var adult=new Array("hardcore","sex movie","sex movies","sex film","sex films","sex tape","sex tapes","cock","cocks","pussy","pussies","porn","porno","pornography","pornographic","fuck","fucked","fucker","fucking","ass-fucked","whore","whores");

for(var i=0;i<=adult.length-1;i++)
{
if(pro.indexOf(adult[i])>=0)
{
alert("There are forbidden words in the Products Field! This is a violation of the Terms of Use! Your IP has been identified!");
document.getElementById('prod').style.borderColor="red";
return false;
}
else
{
document.getElementById('prod').style.borderColor="#999999";
}
}

//
var prospace=pro.substring(1,pro.length-1);
if (prospace.indexOf(" ")==-1 || (prospace.split(" ").length - 1)<=5)
{
alert("There must be at least 5 spaces in the Products Field");
document.getElementById('prod').style.borderColor="red";
return false;
}
else
{
document.getElementById('prod').style.borderColor="#999999";
}


if (pro.length>150)
{
alert("There must be less than 150 characters in the Products Field");
document.getElementById('prod').style.borderColor="red";
return false;
}
else
{
document.getElementById('prod').style.borderColor="#999999";
}

if(ad.length==0)
{
alert("Please enter Your Business Address");
document.getElementById('addr').style.borderColor="red";
return false;
}
else{document.getElementById('addr').style.borderColor="#999999";}

for (i=0;i<ad.length;i++)
{ 
if (badChars.indexOf(ad.charAt(i)) >=0 )
{
alert("Address Field contains commas, semi-colons or special characters! Please replace those characters by spaces.");
document.getElementById('addr').style.borderColor="red";
return false;
}
else
{
document.getElementById('addr').style.borderColor="#999999";
}
}

//
if (!ad.match(/^\d/) || !ad.match(/[a-zA-Z]/))
{
alert("Address must contain numbers and letters!");
document.getElementById('addr').style.borderColor="red";
return false;
}
else
{
document.getElementById('addr').style.borderColor="#999999";

}

//

if(ci.length==0)
{
alert("City field is empty! Please enter Your City");
document.getElementById('cits').style.borderColor="red";
return false;
}
else{document.getElementById('cits').style.borderColor="#999999";}

//
for (i=0;i<ci.length;i++)
{ 
if (badChars.indexOf(ci.charAt(i)) >=0 )
{
alert("City Field contains commas, semi-colons or special characters! Please remove those characters.");
document.getElementById('cits').style.borderColor="red";
return false;
}
else
{
document.getElementById('cits').style.borderColor="#999999";
}
}
//

if(z.length<5 || z.length==0 || z.substring(z.length-1,z.length)==" ")
{
alert("Please enter a valid ZIP Code");
document.getElementById('zips').style.borderColor="red";
return false;
}
else{document.getElementById('zips').style.borderColor="#999999";}

for (i=0;i<z.length;i++)
{ 
if (allowedChars.indexOf(z.charAt(i)) == -1 )
{
alert("Please enter only numeric characters in the ZIP Code Field!");
document.getElementById('zips').style.borderColor="red";
return false;
}
else{document.getElementById('zips').style.borderColor="#999999";}
}

if(p.length<12 || p.length==0 || p.substring(p.length-1,p.length)==" ")
{
alert("Please enter a valid Company's Phone Number!Phone number should be in the format NNN NNN NNNN");
document.getElementById('phon').style.borderColor="red";
return false;
}
else{document.getElementById('phon').style.borderColor="#999999";}

for (i=0;i<p.length;i++)
{ 
if (phoneChars.indexOf(p.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Phone Field!");
document.getElementById('phon').style.borderColor="red";
return false;
}
else{document.getElementById('phon').style.borderColor="#999999";}
}

if(f.length>0 && f.length<12 || f.substring(f.length-1,f.length)==" ")
{
alert("Please enter a valid Company's Fax Number!");
document.getElementById('faxs').style.borderColor="red";
return false;
}
else{document.getElementById('faxs').style.borderColor="#999999";}

for (i=0;i<f.length;i++)
{ 
if (faxChars.indexOf(f.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Fax Field!");
document.getElementById('faxs').style.borderColor="red";
return false;
}
else{document.getElementById('faxs').style.borderColor="#999999";}
}

if(m.length>0 && m.length<12 || m.substring(m.length-1,m.length)==" ")
{
alert("Please enter a valid Mobile Phone Number!");
document.getElementById('mobi').style.borderColor="red";
return false;
}
else{document.getElementById('mobi').style.borderColor="#999999";}

for (i=0;i<m.length;i++)
{ 
if (mobChars.indexOf(m.charAt(i)) == -1 )
{
alert("Please enter only numeric characters and spaces in the Mobile Phone Field!");
document.getElementById('mobi').style.borderColor="red";
return false;
}
else{document.getElementById('mobi').style.borderColor="#999999";}
}

if(a.length==0)
{
alert("Picture field in empty! Please upload Your Picture or Logo!");
document.getElementById('pict').style.borderColor="red";
return false;
}
else{document.getElementById('pict').style.borderColor="#999999";}

if(a.substring(a.length-4,a.length)!=".jpg" && a.substring(a.length-4,a.length)!=".gif"&& a.substring(a.length-5,a.length)!=".jpeg" && a.substring(a.length-4,a.length)!=".JPG" && a.substring(a.length-4,a.length)!=".GIF" && a.substring(a.length-5,a.length)!=".JPEG" && a.substring(a.length-4,a.length)!=".PNG" && a.substring(a.length-4,a.length)!=".png" || a.substring(a.length-4,a.length)==".exe")
{
alert("Image format not supported! Please upload only JPG, PNG or GIF images");
document.getElementById('pict').style.borderColor="red";
return false;
}
else{document.getElementById('pict').style.borderColor="#999999";}

var go="/store_regis.php";
document.store.action=go;
}


function recommendvalid()
{
var b=document.shopper.sendee.value;
var fi=document.shopper.sendeenm.value;
var la=document.shopper.sender.value;
var p=document.shopper.sendernm.value;


if(b.indexOf("@")<0 || b.indexOf(".")<0 ||b.indexOf(" ")>0)
{ 
alert("Please enter a valid friend's email");
document.getElementById('ml').style.borderColor="red";
return false;
}
else{document.getElementById('ml').style.borderColor="#999999";}

if(fi.length==0)
{
alert("Please enter your friend's first name");
document.getElementById('frst').style.borderColor="red";
return false;
}
else{document.getElementById('frst').style.borderColor="#999999";}


if(la.indexOf("@")<0 || la.indexOf(".")<0 || la.indexOf(" ")>0)
{ 
alert("Please enter a valid email");
document.getElementById('sml').style.borderColor="red";
return false;
}
else{document.getElementById('sml').style.borderColor="#999999";}


if(p.length==0)
{
alert("Please enter your first name");
document.getElementById('sfrst').style.borderColor="red";
return false;
}
else{document.getElementById('sfrst').style.borderColor="#999999";}


var url="recommend.php";
document.shopper.action=url;
}


function googclose()
{
document.getElementById('googmap').style.display="none";
}

function googfind()
{
var x=document.getElementById('googmap');
if(x.style.display=="none"){x.style.display="block";}
}

var i=0;

function tagname(i)
{
var x=document.getElementsByTagName("a");
ya=x[i].innerHTML;
var url="site_search.php?Products="+ya+"&City="+"&ZIP="+"00000";

i++;

location.href=url;
}

function renew()
{
document.Search.Products.value="";
}

function temps()
{
var t=new Date()
var h=t.getHours()

if (h>12&&h<=24)
{
h=h-12
}

var m=t.getMinutes()
if(m<10){m="0"+m}

var s=t.getSeconds()
if(s<10){s="0"+s+" "}
if(s>=10){s=s+" "}

document.getElementById('realtime').innerHTML=h+":"+m+":"+s+" "

setTimeout("temps()",1000)
}

function am()
{
var t=new Date()
var h=t.getHours()
if(h>=12)
{
document.getElementById('real').innerHTML="PM"+" "
}
else
{
document.getElementById('real').innerHTML="AM"+" "
}
setTimeout("am()",1000)
}

function jour()
{
var t=new Date()
var x=new Array("Sun", "Mon",
   "Tue", "Wed", "Thu",
   "Fri", "Sat")

 var y=new Array("Jan", "Feb",
   "Mar", "Apr", "May",
   "Jun", "Jul" , "Aug", "Sep", "Oct",
   "Nov", "Dec")      

 var z=t.getYear();

var n=z.toString()
var  browser=navigator.appName
if(browser=="Netscape"||browser=="Firefox"||browser=="Safari"||browser=="Chrome")

{
z="20"+n.substring(1,n.length)
}

 var u=t.getDate();

document.getElementById('realdate').innerHTML="on"+" "+x[t.getDay()]+","+" "+y[t.getMonth()]+" "+u+" "+" "+z

setTimeout("jour()",1000)
}

function year()
{
var t=new Date()

var z=t.getYear();

var n=z.toString()
var  browser=navigator.appName
if(browser=="Netscape"||browser=="Firefox"||browser=="Safari"||browser=="Chrome")

{
z="20"+n.substring(1,n.length)
}

document.getElementById('realyear').innerHTML=z

}


function locity()
{
		if(google.loader.ClientLocation)
		{
			var cit= google.loader.ClientLocation.address.city;


                if(document.Search.City.value=="")
                        {			
			document.Search.City.value=cit;
                        }
                document.shopper.city.value=cit;
                document.store.city.value=cit;

		}
}		



