
function redirect36(selectthing)
{
	var url = selectthing[selectthing.selectedIndex].value;
	if(url != 'undefined' && url != '--')
	{
		location.href = url;
	}
}

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 Email Address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email Address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid Email Address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email Address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email Address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email Address")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.mainform.EmailAddress

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter an Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		//emailID.value=""
		emailID.focus()
		return false
	}

	return true
 }

function ValidateMob(){

	var emailID=document.Mobile.mobilenumber;
	var lentest=document.Mobile.mobilenumber.value;

	var lstr=lentest.length;

	
	if (isNaN(emailID.value)==true){
		//emailID.value=""
		alert("Please enter a valid number")
		emailID.focus()
		return false
	}
	if (lstr!=10){
		//emailID.value=""
		alert("Please enter a valid number lenght")
		emailID.focus()
		return false
	}

	return true
 }



function Vote()
{

Url = 'http://www.stbrigidsgaa.com/php/poll.php?voteid=17&voteselected=';

for (var i=0; i < vote.actuallycoaching.length; i++)
   {
   if (vote.actuallycoaching[i].checked)
      {
      var rad_val = vote.actuallycoaching[i].value;
      }
   }

Url = Url +  rad_val + '&Can the Dubs retain Leinster next Year?';
reWin=window.open(Url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=230,top=300,height=350,left=300,right=300')
}

function ViewPoll()
{

Url = 'http://www.stbrigidsgaa.com/php/viewpast.php?pollid=17';
reWin=window.open(Url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=230,top=300,height=350,left=300,right=300')
}


function viewFixtures()
{


Url = 'http://www.stbrigidsgaa.com/php/fixt/view.php?type=all';
reWin=window.open(Url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=580,top=300,height=450,left=300,right=300');

}
