<!--

function listenWin(chan) {

	var url = "http://www.georgefm.co.nz/listen.html";
	if (chan) {
		url = url + "?sel=" + chan;
	}
	newpop = window.open (url,"listen","location=0,status=0,scrollbars=1,width=720,height=500,resizable=yes");
	newpop.moveTo(50,50);
}


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("Entered email address is invalid. Please try again.\n\nIf you're having trouble please send an email directly to george@georgefm.co.nz asking to receive the George Newsie.")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Entered email address is invalid. Please try again.\n\nIf you're having trouble please send an email directly to george@georgefm.co.nz asking to receive the George Newsie.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Entered email address is invalid. Please try again.\n\nIf you're having trouble please send an email directly to george@georgefm.co.nz asking to receive the George Newsie.")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Entered email address is invalid. Please try again.\n\nIf you're having trouble please send an email directly to george@georgefm.co.nz asking to receive the George Newsie.")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Entered email address is invalid. Please try again.\n\nIf you're having trouble please send an email directly to george@georgefm.co.nz asking to receive the George Newsie.")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Entered email address is invalid. Please try again.\n\nIf you're having trouble please send an email directly to george@georgefm.co.nz asking to receive the George Newsie.")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Entered email address is invalid. Please try again.\n\nIf you're having trouble please send an email directly to george@georgefm.co.nz asking to receive the George Newsie.")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.frmSample.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("No email address entered.")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

function DoorlistValidateForm(){
	var nameID=document.doorlistForm.fullname;
	var contactID=document.doorlistForm.contact;
	
	if ((nameID.value==null)||(nameID.value=="")){
		alert("Full name is required.")
		nameID.focus()
		return false
	}
	if ((contactID.value==null)||(contactID.value=="")){
		alert("Contact # is required.")
		contactID.focus()
		return false
	}
	return true
 }
// -->
