 ch=0;
	function change()
	{
		data = cha.innerHTML;
		ch=1;
		cha.innerHTML="";
	}

	function change1(){
		if (ch)
		{
			cha.innerHTML=data;
		}
	}
	

function search()
{
document.form_adurl.method="POST"
document.form_adurl.action="/cgi-bin/sitesearch.cgi"
document.form_adurl.submit()
}

function Validate1(x)
 {
 

 var retValue=false;
 var invalidChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%^&*(){}|\':;?/<>,.@-+=[]~`_ ";
 var i;
  
for(i=0;i<invalidChars.length;i++)
 {
  if(x.indexOf(invalidChars.charAt(i))>-1)
  {
     retValue=true;
     break;
   }
 }
 
return retValue;
 }


function Validate2(x)
 {
 

 var retValue=false;
 var invalidChars="0123456789!#$%^&*(){}|\':;?/<>";
 var i;
  
for(i=0;i<invalidChars.length;i++)
 {
  if(x.indexOf(invalidChars.charAt(i))>-1)
  {
     retValue=true;
     break;
   }
 }
 
return retValue;
 }


function Validate3(x)
 {
 

 var retValue=false;
 var invalidChars=".@";
 var i;
  
for(i=0;i<invalidChars.length;i++)
 {
  if(x.indexOf(invalidChars.charAt(i))>-1)
  {
     retValue=true;
     break;
   }
 }
 
return retValue;
}

function validate_addurl()
{


if (document.form_adurl.title.value== "")
{
alert("Please Enter Title ");
document.form_adurl.title.focus();
return;
}


if (document.form_adurl.url.value== "")
{
alert("Please Enter URL");
document.form_adurl.url.focus();
return;
}
/*if (!(document.form_adurl.url.value== ""))
{
if(!(url.indexOf('www')<='1' || url.lastindexOf('.com'))
alert("Please Enter URL");
document.form_adurl.url.focus();
return;
}
*/
if(!(document.form_adurl.url.value ==""))
	{
	 
    var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
  if(!(document.form_adurl.url.value.match(tomatch)))
		{
	 alert("Please Enter a Valid  URL");
	document.form_adurl.url.select();
	return false;
		}
	}
if (document.form_adurl.reciprocal_url.value== "")
{
alert("Please Enter  RESIPROCAL  URL");
document.form_adurl.reciprocal_url.focus();
return;
}
if(!(document.form_adurl.reciprocal_url.value ==""))
	{
	 
    var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
  if(!(document.form_adurl.reciprocal_url.value.match(tomatch)))
		{
	 alert("Please Enter a Valid  RESIPROCAL  URL");
	document.form_adurl.reciprocal_url.select();
	return false;
		}
	}
if (document.form_adurl.description.value== "")
{
alert("Please Enter Description ");
document.form_adurl.description.focus();
return;
}



if (document.form_adurl.name1.value== "")
{
alert("Please Enter Name");
document.form_adurl.name1.focus();
return;
}

if( document.form_adurl.email.value != '')
{
var e_mail=  document.form_adurl.email.value;

if(e_mail.indexOf('.')< 0 || e_mail.indexOf('@') < 0)
  {
	alert("Please Enter Valid Email");
	document.form_adurl.email.value="";
	document.form_adurl.email.focus();
	return;	
  }
 }

else
{
alert("Please Enter Email ");
document.form_adurl.email.focus();
return;

}



document.form_adurl.method="POST";
document.form_adurl.action="http://www.foreclosureend.com/addurl-mail.php?subject=mamortgagedepo AddUrl Form";
document.form_adurl.submit();

}


