function blank()
{
	var emailID=document.forminfo.email
	var listCheck = document.forminfo.category.selectedIndex;
	var urlregex = new RegExp("^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+))*$");
	var str = document.forminfo.t1.value;
	var str1 = document.forminfo.t3.value;
	var attach = new String("www.")
	if(str1.substring(0,4)!="www.")
		{
			attach = attach.concat(str1);
			str1=attach;
		}
	else
		{str1=str1;}

if (document.forminfo.t1.value == "")
{
	alert("This entry must be completed before you can submit this form for processing.");
	document.forminfo.t1.focus();
	return false;}
else if (URLcheck(str)==false)
{
		document.forminfo.t1.focus();
		return false;
}
else if (document.forminfo.t2.value == "")
{
	alert("This entry must be completed before you can submit this form for processing.");
	document.forminfo.t2.focus();
	return false;}
else if (document.forminfo.textarea.value == "")
{
	alert("This entry must be completed before you can submit this form for processing.");
	document.forminfo.textarea.focus();
	return false;}
else if (document.forminfo.t3.value == "")
{
	alert("This entry must be completed before you can submit this form for processing.");
	document.forminfo.t3.focus();
	return false;}

else if (str.substring(0,8) !=  str1.substring(0,8))
{
	alert("Domain Of Both URL's Should be Same");
	document.forminfo.t3.focus();
	return(false);
}
else if (document.forminfo.category.options[listCheck].value=="none")
{
alert("select a category");
document.forminfo.category.focus();
return false;
}
else if (document.forminfo.name.value == "")
{
	alert("This entry must be completed before you can submit this form for processing.");
	document.forminfo.name.focus();
	return false;}
else if ((emailID.value==null)||(emailID.value==""))
{
		alert("Please Enter your Email ID")
		emailID.focus();
		return false;
}
else if (echeck(emailID.value)==false)
{
		emailID.focus();
		return false;
}

else if((document.forminfo.radiobutton[0].checked==false) && (document.forminfo.radiobutton[1].checked==false) && (document.forminfo.radiobutton[2].checked==false))
{
		alert("Please select a Other Info");
		return false;
}

else if(document.getElementById("radiobutton").checked==true)
{

		var listCheck1 = document.forminfo.select.selectedIndex;
		if (document.forminfo.select.options[listCheck1].value=="none")
		{
		alert("select a search engine");
		document.forminfo.select.focus();
		return false;
		}


}
else if(document.getElementById("radiobutton1").checked==true)
{
		var info=document.forminfo.special.value;

		if (document.forminfo.special.value == "" || URLcheck(info)==false)
		{
		alert("Invalid Site Name");
		document.forminfo.special.focus();
		return false;
		}

}

else
	{return true;}


}


function RemoveText()
		{
				if(document.forminfo.special.value=="Site Name")
				{
				document.forminfo.special.value="";
				document.forminfo.special.focus();
				}
				else
				{
				document.forminfo.special.focus();
				}


		}


function show()
{
	spanStyle=document.getElementById("1").style
	spanStyleCombo=document.getElementById("2").style

if(document.getElementById("radiobutton1").checked==true)
{
	if(spanStyle.display=="none")
	{
		spanStyle.display=""
		spanStyleCombo.display="none"
	}
	else
	{
		spanStyle.display="none"
	}
}

if(document.getElementById("radiobutton").checked==true)
{
	if(spanStyleCombo.display=="none")
	{
		spanStyleCombo.display=""
		spanStyle.display="none"

	}
	else
	{
		spanStyleCombo.display="none"
	}
}

if(document.getElementById("radiobutton2").checked==true)
{

		spanStyleCombo.display="none"
		spanStyle.display="none"
}
}


function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(" ")!=-1 || str.indexOf("!")!=-1 || str.indexOf("?")!=-1 || str.indexOf("$")!=-1 || str.indexOf("^")!=-1 || str.indexOf("*")!=-1 || str.indexOf("{")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true
	}

function URLcheck(str) {


		var dot="."
		var lstr=str.length
		var ldot=str.indexOf(dot)
		StopPos= str.lastIndexOf(".")
		sublen=str.substring(StopPos+1,lstr)
		domlen=str.substring(ldot+1,StopPos)
		//document.write(domlen);


       if(str.substring(0,4)!="www.")
			{
				alert("www. is must");
				return false

			}
		else if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid URL")
		    return false
		}

		else if (sublen.length>4 || domlen.length<3){
				    alert("Invalid URL")
				    return false
		 }
		else if (str.indexOf("/")!=-1){
					alert("Invalid URL: '/' is not allowed in the Domain Name")
					return false
		 }

	 	else  if (str.indexOf(" ")!=-1 || str.indexOf("!")!=-1 || str.indexOf("@")!=-1 || str.indexOf("$")!=-1 || str.indexOf("^")!=-1 || str.indexOf("*")!=-1 || str.indexOf("{")!=-1){
		    alert("Invalid URL: Special Character are not allowed")
		    return false
		 }

 		 return true
	}
