function validate()
{
	var wtitle=document.addsite.wtitle;
	if (wtitle.value.length==0)
	{
		alert('Website title must not be empty');
		wtitle.focus();
		return false;
	}
	var wurl=document.addsite.wurl;
	if ((wurl.value.length==0)||(wurl.value=="http://"))
	{
		alert('Website URL must not be empty');
		wurl.focus();
		return false;
	}else{
		Url2=wurl.value
		p=Url2.substring(0,7)
		u=Url2.substring(4,2)
		if(p!="http://")
		{
			alert("URL should start with http://")
			wurl.focus();
			return false;
		}
		
	}

	var descr=document.addsite.desc;
	if (descr.value.length==0)
	{
		alert('Website Description must not be empty');
		descr.focus();
		return false;
	}
	var category=document.addsite.category;
	if((category.value=='choose') && (document.addsite.addcategory.value==0))
	{
		alert('Choose a Sport or Enter New Sport');
		document.addsite.addcategory.focus();
		return false;
	}
	var subcategory=document.addsite.subcategory;
	if((subcategory.value=='choose') && (document.addsite.addsubcategory.value==0))
	{
		alert('Choose a Product or Enter New Product');
		document.addsite.addsubcategory.focus();
		return false;
	}

	var formField = document.addsite.country;
	if(formField.options[formField.selectedIndex].value=="choose")
	{
		alert('Choose Country');
		formField.focus();
		return false;
	}
	var pro = document.addsite.state;
	if(formField.options[formField.selectedIndex].value==184)
	{
		document.addsite.otherUS.disabled=true;
		if(pro.options[pro.selectedIndex].value>51 && pro.options[pro.selectedIndex].value != 0)
		{
			alert('Please choose a US state');			
			pro.focus();
			return false;
		}
	}

	if(formField.options[formField.selectedIndex].value==31)
	{
		document.addsite.otherUS.disabled=true;
		if(((pro.options[pro.selectedIndex].value<53) || (pro.options[pro.selectedIndex].value>64)) && pro.options[pro.selectedIndex].value != 0)
		{
			alert('Please choose a Canadian state');
			pro.focus();
			return false;
		}
	}

	if((formField.options[formField.selectedIndex].value!=184) && (formField.options[formField.selectedIndex].value!=31))
	{
		document.addsite.otherUS.disabled=false;
	
		if(pro.options[pro.selectedIndex].value!=66)
		{
			document.addsite.state.value=66;
			if((document.addsite.otherUS.value==0))
			{
				//alert('Please Enter your State 1');
				//document.addsite.otherUS.value="Not Specified";
				//return false;
			}
			
		}
		
	}

	if(pro.options[pro.selectedIndex].value==66)
	{
			if((document.addsite.otherUS.value==0))
			{
				//alert('Please Enter your State 2');
				//document.addsite.state.focus();
				document.addsite.state.value=66;
				//document.addsite.otherUS.focus();
				//return false;
			}

	}
	if((document.addsite.city.value==0))
	{
		//alert('Please Enter your City');
		//document.addsite.city.focus();
		//document.addsite.city.value = "Not Specified"
		//return false;
	}

	var rlink=document.addsite.rlink;
	if (rlink.value.length==0)
	{
		alert('Please enter the Reciprocal Link');
		rlink.focus();
		return false;
	}
/*
	var title8=document.addsite.contact;
	if (title8.value.length==0)
	{
		alert('Please enter Contact Name');
		title8.focus();
		return false;
	}
	var email=document.addsite.cemail;
	if (email.value.length==0)
	{
		alert ("Please enter Contact Email");
		email.focus();
		return false;
	}else 
	 if (!(email.value.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/)))	
	{   
		alert ("Invalid email");
		email.focus();
		email.select();
		return false;
	}
*/
}

function country_onchange(obj)
{
	var formField = document.addsite.country;
	document.addsite.state.value="0";
	document.addsite.otherUS.value="";	
	document.addsite.otherUS.disabled=false;
	if(formField.options[formField.selectedIndex].value==184 || formField.options[formField.selectedIndex].value==31)
	{
	document.addsite.otherUS.disabled=true;
	}
}
