function clearinput(t,p)
{
	if (t.value==p)	{ t.value=''; }
}

function populateinput(t,p)
{
	if (t.value=='')	{ t.value=p; }
}

function popradio()
{																																				 window.open('http://cbsplayer.streamtheworld.com/index.php?CALLSIGN=KLSXFM','win','location=no,scrollbars=no,resizable=no,width=600,height=355,top=50,left=50');
	return false;
}

function pop(l,n,o)
{
	window.open(l,n,o);
	return false;
}

function wson()
{
	window.status='Open photo in a new window';
}
function wsoff()
{
	window.status='';
}
								
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("That is not a valid email address.")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("That is not a valid email address.")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("That is not a valid email address.")
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		alert("That is not a valid email address.")
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("That is not a valid email address.")
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		alert("That is not a valid email address.")
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		alert("That is not a valid email address.")
		return false
	 }

	 return true					
}

function validateForm(f)
{
	if (f.nl_name.value.length < 3)
	{
		alert("Your name must be longer than 2 characters, right?");
		f.nl_name.focus();
		return false;
	}
	
	var emailID=f.nl_em;

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please enter your email address.")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}						
	
	return true;
}