var hr = escape(window.location.href);
var popups = new Array();

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
	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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//////////////////////////////EMAIL VALIDATION//////////////////////////////////////////////////////////
function the_mail(control_value)
{
		var emailStr = control_value;
		var emailPat=/^(.+)@(.+)$/
		var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
		var validChars="\[^\\s" + specialChars + "\]"
		var quotedUser="(\"[^\"]*\")"
		var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
		var atom=validChars + '+'
		var word="(" + atom + "|" + quotedUser + ")"
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
		var matchArray=emailStr.match(emailPat)
		if (matchArray==null) 
		{
			alert("Email address seems incorrect ");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		var user=matchArray[1]
		var domain=matchArray[2]
		if (user.match(userPat)==null)
		{
			alert("The Email address doesn't seem to be valid.");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) 
		{
			for (var i=1;i<=4;i++) 
			{
				if (IPArray[i]>255) 
				{
					alert("Destination IP address is invalid!");
					//eval("document."+form_name+"."+control_name).focus();
					return true;
				}
			}
				 
		}
		var domainArray=domain.match(domainPat)
		if (domainArray==null) 
		{
			alert("The domain name doesn't seem to be valid.");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		var atomPat=new RegExp(atom,"g")
		var domArr=domain.match(atomPat)
		var len=domArr.length
		if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
		{
			alert("The address must end in a three-letter domain, or two letter country.");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		if (len<2) 
		{
			alert("This address is missing a hostname!");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		return false;
	
}
///////////////////////////////////////////////////////////////////////////////////////////


function popupwin(url,width,height,target,status){
	if(!target) target = '_blank';
	if(!width)  width  = '430';
	if(!height) height = '250';
	if(!status) status = 'no';

	window.open(
		url,
		target,
		"width="+width+", height="+height+", scrollbars=yes, status="+status+", resizable=yes"
		);
	
}
function submit_form_121(z,d){
	
popupwin('cart.php?act=add2cart&pid='+d+'&pqty='+z,'1024','800')
}


function Replay(id,url){
document.getElementById(id).src=url;
}


function submit_tell_friend(form, type, templ){
	real_action = '/tell_friend.php'
	target="_tell_friend"
	if (type != 3){
		email = form.friendsemail.value
		arr = email.match("^[0-9a-zA-Z]([0-9a-zA-Z\._\-]*)@(([0-9a-zA-Z\-]+\.)+)([0-9a-zA-Z\-]+)$")
		if (!arr){
			alert("Please enter valid email")
			return
		}
	}
	
	if (type == 2){
		window.open(real_action + "?type=2&friend_email=" + escape(email), target, "width=580, height=400, location=0, menubar=0, status=0, resizable=1");
	}else if (type == 3){
		window.open(real_action + "?type=3&templ=" + escape(templ), target, "width=580, height=400, location=0, menubar=0, status=0, resizable=1");
	}else{
		window.open(real_action + "?friend_email=" + escape(email), target, "width=580, height=400, location=0, menubar=0, status=0, resizable=1");
	}
	
}

function wopen2(url){
	window.open(url, 'ww', 'width=600, height=450, location=no,resizable=yes,scrollbars=yes');
}

function wopen(url){
	window.open(url, 'ww', 'width=550, height=450, location=no,resizable=yes,scrollbars=yes');
}
function wopen3(url) {
    window.open(url, 'ww', 'width=575, height=385, location=no,resizable=yes,scrollbars=no');
}

function username_check()
{
	
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;

if(!regBlank.test(document.frm.userName.value)){
alert("Please insert user name");
document.frm.userName.focus();
return false;
}
if(!regBlank1.test(document.frm.userPassword.value)){
alert("Please insert user password");
document.frm.userPassword.focus();
return false;
}
}

function pageheading()
{
	
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;

if(!regBlank.test(document.frm.pageheading.value)){
alert("Please insert Page Heading");
document.frm.pageheading.focus();
return false;
}
}

function feedbackform()
{
	
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;

	if(!regBlank.test(document.frm.VisitorName.value)){
		alert("Please insert  Name");
		document.frm.VisitorName.focus();
		return false;
	}
		if(!regBlank.test(document.frm.VisitorEmail.value)){
		alert("Please insert  Email");
		document.frm.VisitorEmail.focus();
		return false;
	}
	if(the_mail(document.frm.VisitorEmail.value))
	{
	document.frm.VisitorEmail.focus();
	return false;
	}
		if(!regBlank.test(document.frm.VisitorComment.value)){
		alert("Please insert Comment");
		document.frm.VisitorComment.focus();
		return false;
	}
}
/*---------------------16-10-07----------------------------------------*/
function checklog()
{
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;
if(!regBlank.test(document.frm1.userName.value)){
alert("Please insert User Name");
document.frm1.userName.focus();
return false;
}
if(!regBlank.test(document.frm1.userPassword.value)){
alert("Please insert Your Password");
document.frm1.userPassword.focus();
return false;
}
}





function changepassword_new()
{
var regBlank = /[^\s]/;
	if(!regBlank.test(document.frm_pass.pass1.value)){
		alert("Please insert Old Password");
		document.frm_pass.pass1.focus();
		return false;
		
	}
	if(!regBlank.test(document.frm_pass.pass2.value)){
		alert("Please insert New Password");
		document.frm_pass.pass2.focus();
		return false;
	}
	if(!regBlank.test(document.frm_pass.pass3.value)){
		alert("Please Confirm New Password");
		document.frm_pass.pass3.focus();
		return false;
	}
	if(document.frm_pass.pass2.value!=document.frm_pass.pass3.value){
		alert("Confirm Password Mismatch");
		document.frm_pass.pass3.focus();
		return false;
	}
}

function edit_profile()
{
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;
if(!regBlank.test(document.frm_profile.billingFirstName.value)){
alert("Please insert First Name");
document.frm_profile.billingFirstName.focus();
return false;
}

if(!regBlank.test(document.frm_profile.billingLastName.value)){
alert("Please insert Last Name");
document.frm_profile.billingLastName.focus();
return false;
}
if(!regBlank.test(document.frm_profile.billingAddress.value)){
alert("Please insert Address");
document.frm_profile.billingAddress.focus();
return false;
}
if(!regBlank.test(document.frm_profile.billingCity.value)){
alert("Please insert City Name");
document.frm_profile.billingCity.focus();
return false;
}
if(!regBlank.test(document.frm_profile.billingState.value)){
alert("Please insert State Name");
document.frm_profile.billingState.focus();
return false;
}
if(document.frm_profile.billingCountry.value==0){
alert("Please Select Country");
document.frm_profile.billingCountry.focus();
return false;
}
if(!regBlank.test(document.frm_profile.billingPin.value)){
alert("Please insert Pin");
document.frm_profile.billingPin.focus();
return false;
}
if(!regBlank.test(document.frm_profile.billingPhone.value)){
alert("Please insert Phone No");
document.frm_profile.billingPhone.focus();
return false;
}if(!regBlank.test(document.frm_profile.billingMobile.value)){
alert("Please insert Mobile No");
document.frm_profile.billingMobile.focus();
return false;
}

if(!regBlank.test(document.frm_profile.shippingFirstName.value)){
alert("Please insert First Name");
document.frm_profile.shippingFirstName.focus();
return false;
}

if(!regBlank.test(document.frm_profile.shippingLastName.value)){
alert("Please insert Last Name");
document.frm_profile.shippingLastName.focus();
return false;
}
if(!regBlank.test(document.frm_profile.shippingAddress.value)){
alert("Please insert Address");
document.frm_profile.shippingAddress.focus();
return false;
}
if(!regBlank.test(document.frm_profile.shippingCity.value)){
alert("Please insert City Name");
document.frm_profile.shippingCity.focus();
return false;
}
if(!regBlank.test(document.frm_profile.shippingState.value)){
alert("Please insert State Name");
document.frm_profile.shippingState.focus();
return false;
}
if(document.frm_profile.shippingCountry.value==0){
alert("Please Select Country");
document.frm_profile.shippingCountry.focus();
return false;
}
if(!regBlank.test(document.frm_profile.shippingPin.value)){
alert("Please insert Pin");
document.frm_profile.shippingPin.focus();
return false;
}
if(!regBlank.test(document.frm_profile.shippingPhone.value)){
alert("Please insert Phone No");
document.frm_profile.shippingPhone.focus();
return false;
}if(!regBlank.test(document.frm_profile.shippingMobile.value)){
alert("Please insert Mobile No");
document.frm_profile.shippingMobile.focus();
return false;
}
}

function feddback()
{

var regBlank =/[^\s]/;
var regBlank1=/[^\s]/;

	
	if(document.frmfeed.query.value==''){
	alert("Please enter your query");
	document.frmfeed.query.focus();
	return false;
	}
	
	
	
}


function tell()
{

var regBlank =/[^\s]/;
var regBlank1=/[^\s]/;

	
	if(document.frmtel.name.value==''){
	alert("Please enter name");
	document.frmtel.name.focus();
	return false;
	}
	
	if(!regBlank.test(document.frmtel.email.value)){
		alert("Please enter email");
		document.frmtel.email.focus();
		return false;
	}
	if(!regBlank.test(document.frmtel.coments.value)){
		alert("Please enter first name");
		document.frmtel.coments.focus();
		return false;
	}
	
}


function edit_shipping()
{

var regBlank =/[^\s]/;
var regBlank1=/[^\s]/;

	
	if(!regBlank.test(document.frm_shipping.billingFirstName.value)){
		alert("Please insert billingFirstName");
		document.frm_shipping.billingFirstName.focus();
		return false;
	}
	
	
	if(!regBlank.test(document.frm_shipping.billingLastName.value)){
		alert("Please insert billingLastName");
		document.frm_shipping.billingLastName.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.billingAddress.value)){
		alert("Please insert billingAddress name");
		document.frm_shipping.billingAddress.focus();
		return false;
	}
	
	if(!regBlank.test(document.frm_shipping.billingCity.value)){
		alert("Please insert billingCity name");
		document.frm_shipping.billingCity.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.billingState.value)){
		alert("Please insert billingState name");
		document.frm_shipping.billingState.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.billingCountry.value)){
		alert("Please insert  country name");
		document.frm_shipping.billingCountry.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.billingPin.value)){
		alert("Please insert  billingPin code");
		document.frm_shipping.billingPin.focus();
		return false;
	}
	
	if(document.frm_shipping.billingPhone.value==''){
	alert("Please insert billingPhone Address");
	document.frm_shipping.billingPhone.focus();
	return false;
	}
	
	if(!regBlank.test(document.frm_shipping.billingMobile.value)){
		alert("Please insert billingMobile");
		document.frm_shipping.billingMobile.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingFirstName.value)){
		alert("Please insert shippingFirstName name");
		document.frm_shipping.shippingFirstName.focus();
		return false;
	}
	
	if(!regBlank.test(document.frm_shipping.shippingLastName.value)){
		alert("Please insert shippingLastName");
		document.frm_shipping.shippingLastName.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingAddress.value)){
		alert("Please insert shippingAddress");
		document.frm_shipping.shippingAddress.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingCity.value)){
		alert("Please insert  shippingCity");
		document.frm_shipping.shippingCity.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingState.value)){
		alert("Please insert  shippingState");
		document.frm_shipping.shippingState.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingCountry.value)){
		alert("Please insert shippingCountry");
		document.frm_shipping.shippingCountry.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingPin.value)){
		alert("Please insert shippingPin");
		document.frm_shipping.shippingPin.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingPhone.value)){
		alert("Please insert  shippingPhone");
		document.frm_shipping.shippingPhone.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingMobile.value)){
		alert("Please insert  shipping Mobile No");
		document.frm_shipping.shippingMobile.focus();
		return false;
	}
	}
	



function shipping()
{

var regBlank =/[^\s]/;
var regBlank1=/[^\s]/;

	
	if(!regBlank.test(document.frm_shipping.billingFirstName.value)){
		alert("Please insert billingFirstName");
		document.frm_shipping.billingFirstName.focus();
		return false;
	}
	
	
	if(!regBlank.test(document.frm_shipping.billingLastName.value)){
		alert("Please insert billingLastName");
		document.frm_shipping.billingLastName.focus();
		return false;
	}
	

	if(!regBlank.test(document.frm_shipping.billingMobile.value)){
	alert("Please insert email address");
	document.frm_shipping.billingMobile.focus();
	return false;
	}
	if(the_mail(document.frm_shipping.billingMobile.value))
	{
	document.frm_shipping.billingMobile.focus();
	return false;
	}
	
	
	
	
	if(!regBlank.test(document.frm_shipping.billingAddress.value)){
		alert("Please insert billingAddress name");
		document.frm_shipping.billingAddress.focus();
		return false;
	}
	
	if(!regBlank.test(document.frm_shipping.billingCity.value)){
		alert("Please insert billingCity name");
		document.frm_shipping.billingCity.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.billingState.value)){
		alert("Please insert billingState name");
		document.frm_shipping.billingState.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.billingCountry.value)){
		alert("Please insert  country name");
		document.frm_shipping.billingCountry.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.billingPin.value)){
		alert("Please insert  billingPin code");
		document.frm_shipping.billingPin.focus();
		return false;
	}

	if(!regBlank.test(document.frm_shipping.billingPhone.value)){
		alert("Please insert  billing Phone");
		document.frm_shipping.billingPhone.focus();
		return false;
	}
	
	
	
	if(!regBlank.test(document.frm_shipping.shippingFirstName.value)){
		alert("Please insert shippingFirstName name");
		document.frm_shipping.shippingFirstName.focus();
		return false;
	}
	
	if(!regBlank.test(document.frm_shipping.shippingLastName.value)){
		alert("Please insert shippingLastName");
		document.frm_shipping.shippingLastName.focus();
		return false;
	}
	

	
	
	if(!regBlank.test(document.frm_shipping.shippingAddress.value)){
		alert("Please insert shippingAddress");
		document.frm_shipping.shippingAddress.focus();
		return false;
	}
	
	
	if(!regBlank.test(document.frm_shipping.shippingCity.value)){
		alert("Please insert  shippingCity");
		document.frm_shipping.shippingCity.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingState.value)){
		alert("Please insert  shippingState");
		document.frm_shipping.shippingState.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingCountry.value)){
		alert("Please insert shippingCountry");
		document.frm_shipping.shippingCountry.focus();
		return false;
	}
	if(!regBlank.test(document.frm_shipping.shippingPin.value)){
		alert("Please insert shippingPin");
		document.frm_shipping.shippingPin.focus();
		return false;
	}
	
	if(!regBlank.test(document.frm_shipping.shippingPhone.value)){
		alert("Please insert  shipping Phone ");
		document.frm_shipping.shippingPhone.focus();
		return false;
	}
	}
	



function checkreg()
{

var regBlank =/[^\s]/;
var regBlank1=/[^\s]/;



if(!regBlank.test(document.frm_reg.username.value)){
		alert("Please insert user name");
		document.frm_reg.username.focus();
		return false;
	}
	if(!regBlank.test(document.frm_reg.userPassword.value)){
		alert("Please insert Password");
		document.frm_reg.userPassword.focus();
		return false;
	}
	if(!regBlank.test(document.frm_reg.useremail.value)){
		alert("Please insert  email");
		document.frm_reg.useremail.focus();
		return false;
	}
	if(the_mail(document.frm_reg.useremail.value))
	{
	document.frm_reg.useremail.focus();
	return false;
	}
	
	if(!regBlank.test(document.frm_reg.firstName.value)){
		alert("Please insert first name");
		document.frm_reg.firstName.focus();
		return false;
	}
	
	if(!regBlank.test(document.frm_reg.lastName.value)){
		alert("Please insert last name");
		document.frm_reg.lastName.focus();
		return false;
	}
		
	if(document.frm_reg.sex.value==2){
	alert("Please Select Gender");
	document.frm_reg.sex.focus();
	return false;
	}
	if(document.frm_reg.country_name.value==0){
	alert("Please Select Country");
	document.frm_reg.country_name.focus();
	return false;
	}
	if(!regBlank.test(document.frm_reg.stateName.value)){
		alert("Please insert state name");
		document.frm_reg.stateName.focus();
		return false;
	}
		if(!regBlank.test(document.frm_reg.zip.value)){
		alert("Please insert zipcode");
		document.frm_reg.zip.focus();
		return false;
	}
	
	
	
	
}


function checkregedit()
{

var regBlank =/[^\s]/;
var regBlank1=/[^\s]/;



if(!regBlank.test(document.frm_reg.username.value)){
		alert("Please insert user name");
		document.frm_reg.username.focus();
		return false;
	}

	if(!regBlank.test(document.frm_reg.useremail.value)){
		alert("Please insert  email");
		document.frm_reg.useremail.focus();
		return false;
	}
	if(the_mail(document.frm_reg.useremail.value))
	{
	document.frm_reg.useremail.focus();
	return false;
	}
	
	if(!regBlank.test(document.frm_reg.firstName.value)){
		alert("Please insert first name");
		document.frm_reg.firstName.focus();
		return false;
	}
	
	if(!regBlank.test(document.frm_reg.lastName.value)){
		alert("Please insert last name");
		document.frm_reg.lastName.focus();
		return false;
	}
		


	if(!regBlank.test(document.frm_reg.stateName.value)){
		alert("Please insert state name");
		document.frm_reg.stateName.focus();
		return false;
	}
		if(!regBlank.test(document.frm_reg.zip.value)){
		alert("Please insert zipcode");
		document.frm_reg.zip.focus();
		return false;
	}
	
	
	
	
}




function changepassword1()
{
	
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;

	

	if(!regBlank.test(document.frm1.pass1.value)){
		alert("Please insert Old Password");
		document.frm1.pass1.focus();
		return false;
	}
	if(!regBlank.test(document.frm1.pass2.value)){
		alert("Please insert New Password");
		document.frm1.pass2.focus();
		return false;
	}
	if(!regBlank.test(document.frm1.pass3.value)){
		alert("Please Confirm New Password");
		document.frm1.pass3.focus();
		return false;
	}
	if(document.frm1.pass2.value!=document.frm1.pass3.value){
		alert("Confirm Password Mismatch");
		document.frm1.pass3.focus();
		return false;
	}
}






function changeforgot()
{
	
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;
	if(!regBlank.test(document.forgot.email.value)){
		alert("Please insert  email");
		document.forgot.email.focus();
		return false;
	}
	if(the_mail(document.forgot.email.value))
	{
	document.forgot.email.focus();
	return false;
	}
	
}

function login()
{

var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;
	
	if(!regBlank.test(document.loginfrm12.uname.value)){
		alert("Please insert username");
		document.loginfrm12.uname.focus();
		return false;
	}
	if(!regBlank.test(document.loginfrm12.pass.value)){
		alert("Please insert password");
		document.loginfrm12.pass.focus();
		return false;
	}
}
















function check_contact()
{
	
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;
	
	
if(!regBlank.test(document.contatcus.name.value)){
		alert("Please insert  your name ");
		document.contatcus.name.focus();
		return false;
	}
if(!regBlank.test(document.contatcus.email.value)){
		alert("Please insert  your email");
		document.contatcus.email.focus();
		return false;
	}
	if(the_mail(document.contatcus.email.value))
	{
	document.contatcus.email.focus();
	return false;
	}
if(!regBlank.test(document.contatcus.areacode.value)){
		alert("Please insert yourareacode :");
		document.contatcus.areacode.focus();
		return false;
	}
	if(!regBlank.test(document.contatcus.telno.value)){
		alert("Please insert your telno");
		document.contatcus.telno.focus();
		return false;
	}
	if(!regBlank.test(document.contatcus.comment.value)){
		alert("Please insert your comment");
		document.contatcus.comment.focus();
		return false;
	}
	
}

/* ajax cat */
function createRequestObject() {
   var req;
   if(window.XMLHttpRequest){
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      req = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      alert('Problem creating the XMLHttpRequest object');
   }
   return req;
}
var http = createRequestObject();

function cat(act) {
//alert(act);
// var key=document.stylesearch.style.value;
 document.getElementById("postadd").innerHTML = "";
 http.open('get','http://www.freeallinone.com/postadd.php?act='+act);
 http.onreadystatechange = handleResponsede;
 http.send(null);
}
function handleResponsede() {
   if(http.readyState == 4 && http.status == 200){
      var response = http.responseText;
      if(response!="")
	  {
	 	  document.getElementById("postadd").innerHTML = '';
         document.getElementById("postadd").innerHTML = response;
			 
      }
   }
}

function postadd(){
	

	
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;
	
	
	if((document.postaddver.city_name.value==0)&&(!regBlank.test(document.postaddver.locationf.value))){
		alert("Please select city or you can type your location");
		document.postaddver.locationf.focus();
		return false;
	}
	if(document.postaddver.category.value==0){
alert("Please Select category");
document.postaddver.category.focus();
return false;
}

	
	
if(!regBlank.test(document.postaddver.titlef.value)){
		alert("Please insert  your title");
		document.postaddver.titlef.focus();
		return false;
	}
	
	if(!regBlank.test(document.postaddver.emailf.value)){
		alert("Please insert  your email");
		document.postaddver.emailf.focus();
		return false;
	}
	if(the_mail(document.postaddver.emailf.value))
	{
	document.postaddver.emailf.focus();
	return false;
	}	
	
		if(!regBlank.test(document.postaddver.desf.value)){
		alert("Please insert  your description");
		document.postaddver.desf.focus();
		return false;
	}



}

function requestmovie(){
	
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;
	
//alert('ss');
	
if(!regBlank.test(document.sfs.moviename.value)){
		alert("Please insert  your moviename");
		document.sfs.moviename.focus();
		return false;
	}
	if(!regBlank.test(document.sfs.email.value)){
		alert("Please insert  your email");
		document.sfs.email.focus();
		return false;
	}
	if(the_mail(document.sfs.email.value))
	{
	document.sfs.email.focus();
	return false;
	}	
		var iChars = "!@#$%^&*()+=-[]\\\';/{}|\":<>?";
for (var i = 0; i < document.sfs.moviename.value.length; i++) {
if (iChars.indexOf(document.sfs.moviename.value.charAt(i)) != -1) {
alert ("The box description has special characters. \nThese are not allowed.\n ");
return false;
}
}

}


/* new */
function resource11(){
	var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;
		
if(!regBlank.test(document.resource1.titlef.value)){
		alert("Please insert  your title");
		document.resource1.titlef.focus();
		return false;
	}
	
	var iChars = "!@#$%^&*()+=-[]\\\';/{}|\":<>?";
for (var i = 0; i < document.resource1.titlef.value.length; i++) {
if (iChars.indexOf(document.resource1.titlef.value.charAt(i)) != -1) {
alert ("The box title has special characters. \nThese are not allowed.\n ");
return false;
}
	
}	
	
	var theurl=document.resource1.urlf.value;
	var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
	if (tomatch.test(theurl))
	{
	}
	else
	{
	 window.alert("URL invalid. Try again.");
	 document.resource1.urlf.focus();
	 return false; 
	}
	if(!regBlank.test(document.resource1.desf.value)){
		alert("Please insert  your site description");
		document.resource1.desf.focus();
		return false;
	} 
var iChars = "!@#$%^&*()+=-[]\\\';/{}|\":<>?";
for (var i = 0; i < document.resource1.desf.value.length; i++) {
if (iChars.indexOf(document.resource1.desf.value.charAt(i)) != -1) {
alert ("The box description has special characters. \nThese are not allowed.\n ");
return false;
}
}
if(document.resource1.category.value==0){
alert("Please Select category");
document.resource1.category.focus();
return false;
}

	if(!regBlank.test(document.resource1.namef.value)){
		alert("Please insert  your name");
		document.resource1.namef.focus();
		return false;
	}
	var iChars = "!@#$%^&*()+=-[]\\\';/{}|\":<>?";
for (var i = 0; i < document.resource1.namef.value.length; i++) {
if (iChars.indexOf(document.resource1.namef.value.charAt(i)) != -1) {
alert ("The box name has special characters. \nThese are not allowed.\n ");
return false;
}
}
	if(!regBlank.test(document.resource1.emailf.value)){
		alert("Please insert  your email");
		document.resource1.emailf.focus();
		return false;
	}
	if(the_mail(document.resource1.emailf.value))
	{
	document.resource1.emailf.focus();
	return false;
	}
	
	var theurl=document.resource1.recurl.value;
	var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
	if (tomatch.test(theurl))
	{
	}
	else
	{
	 window.alert("URL invalid. Try again.");
	 document.resource1.recurl.focus();
	 return false; 
	}
}


/* ajax directory */
/*function createRequestObject() {
   var req;
   if(window.XMLHttpRequest){
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      req = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      alert('Problem creating the XMLHttpRequest object');
   }
   return req;
}
var http = createRequestObject();

function catresource(act) {
alert(act);
 var key=document.stylesearch.style.value;
 document.getElementById("postaddresource").innerHTML = "";
 http.open('get','http://www.freeallinone.com/postaddresource.php?act='+act);
 http.onreadystatechange = handleResponsede;
 http.send(null);
}
function handleResponsede() {
   if(http.readyState == 4 && http.status == 200){
      var response = http.responseText;
      if(response!="")
	  {
	 	  document.getElementById("postaddresource").innerHTML = '';
         document.getElementById("postaddresource").innerHTML = response;
			 
      }
   }
}

*/	
function commandreg(){
	
var regBlank = /[^\s]/;
var regBlank1=/[^\s]/;
	
//alert('ss');
	var iChars = "!@#$%^&*()+=-[]\\\';/{}|\":<>?";

if(!regBlank.test(document.command.commname.value)){
		alert("Please insert  your Name");
		document.command.commname.focus();
		return false;
	}
if(!regBlank.test(document.command.textcommand.value)){
		alert("Please insert  your Command");
		document.command.textcommand.focus();
		return false;
	}	
for (var i = 0; i < document.command.commname.value.length; i++) {
if (iChars.indexOf(document.command.commname.value.charAt(i)) != -1) {
alert ("The box name has special characters. \nThese are not allowed.\n ");
return false;
}
}
for (var i = 0; i < document.command.textcommand.value.length; i++) {
if (iChars.indexOf(document.command.textcommand.value.charAt(i)) != -1) {
alert ("The box Command has special characters. \nThese are not allowed.\n ");
return false;
}
}
}