<!--
function openwindow(URL){
window.open(URL, '', 'menubar,scrollbars,resizable,location,maximize,left=10,top=10,width=700');
}

function openwindowtosize(URL){
window.open(URL, '', 'menubar,scrollbars,resizable,location,left=10,top=10,width=760,height=350');
}

function changeloc(myurl){window.location = myurl;}

function checknum(myfield){
if ((isNaN(myfield.value))||(myfield.value.length<1)){myfield.value=0;}
}

function checktext(mytext){
  var regexp = /'/gi;
  mytext.value = mytext.value.replace(regexp,"`");
}

function checktextempty(mytext,empty){
  if(mytext.value.length=0){alert("You Must Enter Value");document.surfboard.name.focus();}
  
 // var regexp = /'/gi;
 // mytext.value = mytext.value.replace(regexp,"`");
//if(empty==1){
//mytext.focus();
//}
}
function checkdates(dates){
		var dateproblem = false;
		//check length
		if (dates!=""){
		//check for slashes
				if(dates.indexOf("/")==-1){dateproblem=true;}else{
				    var days = dates.substring(0,dates.indexOf("/"));
					if(days.indexOf("0")==0){days = days.substring(1,2)}
					var secondslash = dates.substring((dates.indexOf("/")+1));
					//check for second slash
					if(secondslash.indexOf("/")==-1){dateproblem=true;}else{ 
							  var months = secondslash.substring(0,secondslash.indexOf("/"));
							  if(months.indexOf("0")==0){months = months.substring(1,2)}
							  var years =  secondslash.substring((secondslash.indexOf("/")+1));
							  if (years.length==2){years = "20" + years;}
							  if(isNaN(days)){dateproblem=true;}
							  //check range
							  //days
							  if((months==4)||(months==6)||(months==9)||(months==11)||(months==2)){
							  			if(months==2){if(!inRange(days,1,29)){dateproblem=true;}}
										else{if(!inRange(days,1,30)){dateproblem=true;}}  
							  }else{if(!inRange(days,1,31)){dateproblem=true;}}
							  //months
							  if(isNaN(months)){dateproblem=true;}
							  if(!inRange(months,1,12)){dateproblem=true;}
							  //years							  
							  if(isNaN(years)){dateproblem=true;}
							  if(!inRange(years,2001,2020)){dateproblem=true;}
							 }
				
				   }//end check slashes
				     //send back if problem with date format
				    if(dateproblem == true){return true;}else{return false;}
				  
		}//end of date!="" 
}

function inRange(inputStr,lo,hi){
		 var num = parseInt(inputStr,10)
		 if(num<lo||num>hi){return false;}else{return true;}
}

function checkthisdate(mydate){
		 if(checkdates(mydate.value)){alert(mydate.name + " has a format error \r\n \r\n Correct format e.g.15/12/2001");mydate.focus();}
}
		 
function checkemail(myaddress){
      if(myaddress.value.length>0){
  	  var str=myaddress.value;
	  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	  if (filter.test(str)){testresults=true;}
	  else{alert("Please input a valid email address!");myaddress.focus();
	  }  }
}

function checkbae(){
 if(document.layers||document.getElementById||document.all){return checkemail();}else{return true;}
}
function deleteRecord(boardid){
 if(confirm("Are you sure you want to DELETE this board with boardID: " + boardid + " ?")){
     document.SurfBoard.Action.value="true";document.SurfBoard.submit();
   }
}
function checkpass()
{
 if (document.SurfBoard.Password.value != document.SurfBoard.rePassword.value)
 {
  alert("Passwords do not match. Please type both passwords again !");
  document.SurfBoard.Password.value="";
  document.SurfBoard.rePassword.value="";
 document.SurfBoard.Password.focus();
  }
 }
 function checkempty(objectname)
 {
 if(objectname=="")
 {
  alert("Required Field");
  }
  }
 
//-->
