
// ***************************************************************
// *** Rugby.com.au Javascript 
// *** Lateral Systems http://www.lateralsystems.com.au
// *** Created by Todd Baker 5/5/2003
// ***************************************************************

// Browser Check
function Is (){
    var agt=navigator.userAgent.toLowerCase();
    this.major		= parseInt(navigator.appVersion);
    this.minor		= parseFloat(navigator.appVersion);
    this.nav		= ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    this.nav4		= (this.nav && (this.major == 4));
    this.nav6up		= (this.nav && (this.major >= 5));
    this.ie			= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie4		= (this.ie && (this.major == 4) && (agt.indexOf("msie 5")==-1) );
    this.ie4up		= (this.ie && (this.major >= 4));
    this.mac		= (agt.indexOf("mac")!=-1);
}
var is = new Is();




/* ##################################################
	menu Code Using Divs, Similar to 
	the Old Rugby.com.au Method
################################################## */

var folder=""
var folderOld=""
var objPrevObj=""
var parentPrevObj=""
var ishover = ""

// Main left hand nav function
function expandit(curobj,parentObj){
	if (getObj('hover')){
		ishover = "true"
	}
	if(!is.nav4){
		//alert(curobj + '  '  + parentObj);
		folder = getObj(curobj).style
		if (folder.display=="none"){
			if(objPrevObj!=""){
				folderOld = getObj(objPrevObj).style
				folderOld.display="none"
				if(parentPrevObj!=''){
					getObj(parentPrevObj).className=""
				}
			} 
			folder.display="";
			objPrevObj = curobj
			if(parentObj!=''){
				if (ishover=="true"){
					getObj('hover').className="navOn"
				}
				parentPrevObj = parentObj
			}	
			
		}else{
			folder.display="none"
			if (ishover=="true"){
					getObj('hover').className="navOn"
				}
			objPrevObj = ""
			if(parentPrevObj!=''){
				if (ishover=="true"){
					getObj('hover').className=""
				}
				parentPrevObj=""
			}	
		}
	}
}
function getObj(id){
	if(document.getElementById){
		return document.getElementById(id);
	}else{
		return document.all[id];
	} 
}



function PhotoPop(id){
	if(id!=""){
		var strURL = "/photo.rugby/photo/" + id
		var objPhotoWindow = window.open(strURL,'photo','height=500,width=550,left=10,top=10,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,resizable=0,status=0,toolbar=0');
	}

}


var myimages = new Array();
function preload(){
	for (x=0; x>preload.arguments.length; x++){
	myimages[x] = new Image();
	myimages[x].src = preload.arguments[x];
	}
}
	
/// Form validation functions
function strTrim(strText) {
		for (i=0; i<strText.length; ++i) {
			if (strText.charAt(i) != ' ') break;
		}
		if (i >= strText.length) return ('');
		if (i > 0) strText = strText.substring(i, strText.length);
		for (j=strText.length-1; j > i; --j) {
			if (strText.charAt(j) != ' ') break;
		}
		if (j < strText.length -1)
			strText = strText.substring(0, j+1);
		return strText;

}

/*
function ValidEmail(strEmail)
{
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	
	if (filter.test(strEmail))
		return true
	else
		return false
}
*/
function ValidEmail(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  if (theStr.indexOf(" ") > 0 )  return false;  
  if (theStr.indexOf("@", index + 1) > 0 ) return false;
  return result;
}

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function ValidPhone(strPhone, minDigitsInIPhoneNumber)
{
	var phoneNumberDelimiters = "()- ";
	var validWorldPhoneChars = phoneNumberDelimiters + "+";

	s=stripCharsInBag(strPhone, validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function ValidPhoneStripped(strPhone, minDigitsInIPhoneNumber)
{
	var phoneNumberDelimiters = "()- ";
	var validWorldPhoneChars = phoneNumberDelimiters + "+";

	s=stripCharsInBag(strPhone, validWorldPhoneChars);
	if ((isInteger(s) && s.length >= minDigitsInIPhoneNumber))
		return stripCharsInBag(strPhone, phoneNumberDelimiters);
	else
		return false;
}

function ValidText(strText, intMin)
{
	if (strText == "" || strText.length < intMin)
		return false;
	else
		return true;
}

function TextStartNumber(strText)
{   
	// Check if first character is a number
	if ((strText.charAt(0) < "0") || (strText.charAt(0) > "9"))
	{	
		return false;
	}
	else
	{
		return true;
	}
}	

function ValidChecked(objField) {
// This can be used for both checkboxes and radio buttons
	if(objField.length) {
		for (var i=0 ; i<objField.length ; i++) {
			if (objField[i].checked)
				return true;
		}
	} else {
		//only one item
		if(objField.checked)
			return true;
	}
}

function IsValidDate(intDay, strMonth, intYear) {
	var blnLeapYear = false;
	var blnRet = false;

	if ((intDay>0) && (intDay<32) && (intYear>1900)) {
		switch (strMonth.toLowerCase()) {
		case "4":
		case "6":
		case "9":
		case "11":
		case "apr":
		case "jun":
		case "sep":
		case "nov":
			if (intDay < 31) blnRet = true;
			break;
		case "2":
		case "feb":
			if (intYear % 100 == 0) {
				if (intYear % 400 == 0)
					blnLeapYear = true;
			}
			else {
				if (intYear % 4 == 0)
					blnLeapYear = true;
			}

			if (blnLeapYear) {
				if (intDay < 30)
					blnRet = true;
			}
			else {
				if (intDay < 29)
					blnRet = true;
			}
			break;
		default:
			blnRet = true;
		}
	}
	return blnRet
}

	function ValidateForm(obj){
		var strAlert = "";
		strAlert = "______________________________________\n\nPlease\n\n";
		var isAlert = false;
	
		// trim the values of white space
		var strFirstName = strTrim(obj.firstName.value);
		var strLastName = strTrim(obj.lastName.value);
		var strMethod = obj.contactMethod.options[obj.contactMethod.selectedIndex].value
		var strEmail = strTrim(obj.email.value);
		var strPhone = strTrim(obj.homePhone.value);
		var strMobilePhone = strTrim(obj.mobilePhone.value);
		var strFeedback = strTrim(obj.feedback.value);
		
		
		if (!ValidText(strFirstName,1)){
			strAlert += "- Enter your first name\n";
			isAlert = true;
		}
		else if (isInteger(strFirstName))
		{
			strAlert += "- Your first name must contain alphabetic characters.\n";
			isAlert = true;
		}	
		if (!ValidText(strLastName,1)){
			strAlert += "- Enter your last name\n";
			isAlert = true;
		}
		else if (isInteger(strLastName))
		{
			strAlert += "- Your last name must contain alphabetic characters.\n";
			isAlert = true;
		}			
	
		if (!ValidText(strMethod,1)){
			strAlert += "- Select your preferred method of contact\n";
			isAlert = true;
		}		
			
			
			
			
	
	 	switch (strMethod) {
		case "phone": 
			if ( (strPhone == "") && (strMobilePhone == "") ){
				strAlert += "- Enter a phone number or mobile number\n";
				isAlert = true;
			}
			break;
		case "email":
			if(strEmail == "") {
				strAlert += "- Enter an email address\n";
				isAlert = true;
			}
		}
		
		
		
		if (strEmail != ""){
			if (!ValidEmail(strEmail)){
				strAlert += "- Enter a valid email address\n";
				isAlert = true;
			}
		}
		if (strPhone != ""){
			var strStrippedPhone = ValidPhoneStripped(strPhone, 10);
			if (!strStrippedPhone){
				strAlert += "- Enter a 10 digit phone number (including area code)\n";
				isAlert = true;
			} else obj.homePhone.value = strStrippedPhone;
		}
		if (strMobilePhone != ""){
			var strStrippedPhone = ValidPhoneStripped(strMobilePhone, 10);
			if (!strStrippedPhone){
				strAlert += "- Enter a 10 digit mobile phone number\n";
				isAlert = true;
			} else obj.mobilePhone.value = strStrippedPhone;
		}
	
		if (strFeedback == ""){
			strAlert +="- Enter your feedback\n";
			isAlert = true;		

		}else{
			var s = strFeedback;
			s = s.toString();    // Ensure that we are processing a string .
			var i = 0;
			var sLength = s.length;
			if ((sLength > "5000")) {
				toolong = ((sLength - "5000" ));
				strAlert +="- This form only accepts feedback up to a length of 5000 characters.\nYour feedback is currently " + sLength + " characters long.\nPlease remove " + toolong + " characters and try again.";
				isAlert = true;
			}
		}	
		if (isAlert == true){
			strAlert += "\n\n______________________________________";
			alert (strAlert);
			return false;
		}else{
			return true;
		}
	}
	
	
function ValidateRegisterForm(obj){
		var strAlert = "";
		strAlert = "______________________________________\n\nPlease\n\n";
		var isAlert = false;
	
		// trim the values of white space
		var strFirstName = strTrim(obj.firstName.value);
		var strLastName = strTrim(obj.lastName.value);
		//var strMethod = obj.contactMethod.options[obj.contactMethod.selectedIndex].value
		var strEmail = strTrim(obj.email.value);
		//var strPhone = strTrim(obj.homePhone.value);
		//var strMobilePhone = strTrim(obj.mobilePhone.value);
		var strPassword = strTrim(obj.password.value);
		var strConfirmPassword = strTrim(obj.confirmPassword.value);
		
		
		if (!ValidText(strFirstName,1)){
			strAlert += "- Enter your first name\n";
			isAlert = true;
		}
		else if (isInteger(strFirstName))
		{
			strAlert += "- Your first name must contain alphabetic characters.\n";
			isAlert = true;
		}	
		if (!ValidText(strLastName,1)){
			strAlert += "- Enter your last name\n";
			isAlert = true;
		}
		else if (isInteger(strLastName))
		{
			strAlert += "- Your last name must contain alphabetic characters.\n";
			isAlert = true;
		}			
		
		if (!ValidText(strEmail,1)){
			strAlert += "- Enter your email address\n";
			isAlert = true;
		}else if (strEmail != ""){
			if (!ValidEmail(strEmail)){
				strAlert += "- Enter a valid email address\n";
				isAlert = true;
			}
		}
		
		if (!ValidText(strPassword,1)){
			strAlert += "- Enter a password\n";
			isAlert = true;
		}
		
		if (!ValidText(strConfirmPassword,1)){
			strAlert += "- Confirm your password\n";
			isAlert = true;
		}
		
		if (strPassword != "" && strConfirmPassword != ""){
			if (strPassword != strConfirmPassword){
				strAlert += "- Your passwords do not match\n";
				isAlert = true;
				}			
			}
			
		if (isAlert == true){
			strAlert += "\n\n______________________________________";
			alert (strAlert);
			return false;
		}else{
			return true;
		}
	}
	
function ValidateUpdateForm(obj){
		var strAlert = "";
		strAlert = "______________________________________\n\nPlease\n\n";
		var isAlert = false;
	
		// trim the values of white space
		var strFirstName = strTrim(obj.firstName.value);
		var strLastName = strTrim(obj.lastName.value);
		//var strMethod = obj.contactMethod.options[obj.contactMethod.selectedIndex].value
		var strEmail = strTrim(obj.email.value);
		//var strPhone = strTrim(obj.homePhone.value);
		//var strMobilePhone = strTrim(obj.mobilePhone.value);
		var strPassword = strTrim(obj.password.value);
		var strConfirmPassword = strTrim(obj.confirmPassword.value);
		
		
		if (!ValidText(strFirstName,1)){
			strAlert += "- Enter your first name\n";
			isAlert = true;
		}
		else if (isInteger(strFirstName))
		{
			strAlert += "- Your first name must contain alphabetic characters.\n";
			isAlert = true;
		}	
		if (!ValidText(strLastName,1)){
			strAlert += "- Enter your last name\n";
			isAlert = true;
		}
		else if (isInteger(strLastName))
		{
			strAlert += "- Your last name must contain alphabetic characters.\n";
			isAlert = true;
		}			
		
		if (!ValidText(strEmail,1)){
			strAlert += "- Enter your email address\n";
			isAlert = true;
		}else if (strEmail != ""){
			if (!ValidEmail(strEmail)){
				strAlert += "- Enter a valid email address\n";
				isAlert = true;
			}
		}
		
		if (strPassword != "" | strConfirmPassword != ""){
			if (strPassword != strConfirmPassword){
				strAlert += "- Your passwords do not match\n";
				isAlert = true;
				}			
			}
			
		if (isAlert == true){
			strAlert += "\n\n______________________________________";
			alert (strAlert);
			return false;
		}else{
			return true;
		}
	}	
	
function ValidateRegisterPuff(obj){
		var strAlert = "";
		strAlert = "______________________________________\n\nPlease\n\n";
		var isAlert = false;
	
		// trim the values of white space
		var strFirstName = strTrim(obj.firstName.value);
		var strLastName = strTrim(obj.lastName.value);
		var strEmail = strTrim(obj.email.value);
				
		if (!ValidText(strFirstName,1)){
			strAlert += "- Enter your first name\n";
			isAlert = true;
		}
		else if (isInteger(strFirstName))
		{
			strAlert += "- Your first name must contain alphabetic characters.\n";
			isAlert = true;
		}	
		if (!ValidText(strLastName,1)){
			strAlert += "- Enter your last name\n";
			isAlert = true;
		}
		else if (isInteger(strLastName))
		{
			strAlert += "- Your last name must contain alphabetic characters.\n";
			isAlert = true;
		}			
		
		if (!ValidText(strEmail,1)){
			strAlert += "- Enter your email address\n";
			isAlert = true;
		}else if (strEmail != ""){
			if (!ValidEmail(strEmail)){
				strAlert += "- Enter a valid email address\n";
				isAlert = true;
			}
		}
		
		if (isAlert == true){
			strAlert += "\n\n______________________________________";
			alert (strAlert);
			return false;
		}else{
			return true;
		}
	}
	
function ValidateLoginForm(obj){
		var strAlert = "";
		strAlert = "______________________________________\n\nPlease\n\n";
		var isAlert = false;
	
		// trim the values of white space
		var strEmail = strTrim(obj.email.value);
		var strPassword = strTrim(obj.password.value);
				
		if (!ValidText(strPassword,1)){
			strAlert += "- Enter your password\n";
			isAlert = true;
		}
		
		if (!ValidText(strEmail,1)){
			strAlert += "- Enter your email address\n";
			isAlert = true;
		}else if (strEmail != ""){
			if (!ValidEmail(strEmail)){
				strAlert += "- Enter a valid email address\n";
				isAlert = true;
			}
		}
		
		if (isAlert == true){
			strAlert += "\n\n______________________________________";
			alert (strAlert);
			return false;
		}else{
			return true;
		}
	}	

	function ValidateEmailForm(obj){
			var strAlert = "";
			strAlert = "______________________________________\n\nPlease\n\n";
			var isAlert = false;
	
			// trim the values of white space
			var strToEmail = strTrim(obj.emailTo.value);
			var strToName = strTrim(obj.nameTo.value);
			var strFromEmail = strTrim(obj.emailFrom.value);
			var strFromName = strTrim(obj.nameFrom.value);
			
	
			if (!ValidText(strToName,1)){
				strAlert += "- Enter name of recipient\n";
				isAlert = true;
			}
			
			if (!ValidText(strFromName,1)){
				strAlert += "- Enter your name\n";
				isAlert = true;
			}
	
			if (!ValidText(strToEmail,1)){
				strAlert += "- Enter an email address for recipient\n";
				isAlert = true;
			}else if (strToEmail != ""){
				if (!ValidEmail(strToEmail)){
					strAlert += "- Enter a valid email address for recipient\n";
					isAlert = true;
				}
			}
			
			if (!ValidText(strFromEmail,1)){
				strAlert += "- Enter your email address\n";
				isAlert = true;
			}else if (strFromEmail != ""){
				if (!ValidEmail(strFromEmail)){
					strAlert += "- Enter your valid email address\n";
					isAlert = true;
				}
			}
	
			if (isAlert == true){
				strAlert += "\n\n______________________________________";
				alert (strAlert);
				return false;
			}else{
				return true;
			}
		}
		
function ValidateKinghillForm(obj){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;

	// trim the values of white space
	var strName = strTrim(obj.Name.value);
	var strMobilePhone = strTrim(obj.mobilePhone.value);
	var strEmail = strTrim(obj.email.value);
	var strFeedback = strTrim(obj.feedback.value);
	var strCAPTCHA = strTrim(obj.strCAPTCHA.value);
	
	if (!ValidText(strName,1)){
		strAlert += "- Enter your name\n\n";
		isAlert = true;
	}
	else if (isInteger(strName)) {
		strAlert += "- Your name must contain alphabetic characters.\n\n";
		isAlert = true;
	}
	
	if(strEmail == "") {
		strAlert += "- Enter an email address\n\n";
		isAlert = true;
	}
	if (strEmail != ""){
		if (!ValidEmail(strEmail)){
			strAlert += "- Enter a valid email address\n\n";
			isAlert = true;
		}
	}
	
	if (strMobilePhone == "") {
		strAlert += "- Enter a mobile phone number\n\n";
		isAlert = true;
	}
	if (strMobilePhone != ""){
		var strStrippedPhone = ValidPhoneStripped(strMobilePhone, 10);
		if (!strStrippedPhone){
			strAlert += "- Enter a 10 digit mobile phone number\n\n";
			isAlert = true;
		} else obj.mobilePhone.value = strStrippedPhone;
	}		
	
	if (strFeedback == ""){
		strAlert +="- Enter text for your entry\n\n";
		isAlert = true;		

	}else{
		var s = strFeedback;
		s = s.toString();    // Ensure that we are processing a string .
		var i = 0;
		var sLength = s.length;
		if ((sLength > "300")) {
			toolong = ((sLength - "300" ));
			strAlert +="- This form only accepts entries up to a length of 300 characters.\nYour entry is currently " + sLength + " characters long.\nPlease remove " + toolong + " characters and try again.\n\n";
			isAlert = true;
		}
	}
	
	if(obj.readTC.checked == false) {
	    strAlert +="- You must read and accept the Terms & Conditions to submit your entry.\n\n";
		isAlert = true;
	}
	
	if (strCAPTCHA == ""){
		strAlert +="- Enter the verification code\n";
		isAlert = true;		
	}
	
		
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}
}
	
function ValidateUpgradeYourMatesForm(obj){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;

	// trim the values of white space
	var strName = strTrim(obj.Name.value);
	var strDob = strTrim(obj.dob.value);
	var strDayPhone = strTrim(obj.dayPhone.value);
	var strMobilePhone = strTrim(obj.mobilePhone.value);
	var strEmail = strTrim(obj.email.value);
	var strCAPTCHA = strTrim(obj.strCAPTCHA.value);
	
	if (!ValidText(strName,1)){
		strAlert += "- Enter your name\n\n";
		isAlert = true;
	}
	else if (isInteger(strName)) {
		strAlert += "- Your name must contain alphabetic characters.\n\n";
		isAlert = true;
	}
	if(strDob == "") {
		strAlert += "- Enter a date of birth\n\n";
		isAlert = true;
	}
	
	if(strEmail == "") {
		strAlert += "- Enter an email address\n\n";
		isAlert = true;
	}
	if (strEmail != ""){
		if (!ValidEmail(strEmail)){
			strAlert += "- Enter a valid email address\n\n";
			isAlert = true;
		}
	}
	
	if (strMobilePhone == "" && strDayPhone == "") {
		strAlert += "- Enter at least one contact number\n\n";
		isAlert = true;
	}else{
		if (strDayPhone != ""){
			var strStrippedPhone = ValidPhoneStripped(strDayPhone, 10);
			if (!strStrippedPhone){
				strAlert += "- Enter a 10 digit day phone number\n\n";
				isAlert = true;
			} else obj.dayPhone.value = strStrippedPhone;
		}
		if (strMobilePhone != ""){
			var strStrippedPhone = ValidPhoneStripped(strMobilePhone, 10);
			if (!strStrippedPhone){
				strAlert += "- Enter a 10 digit mobile phone number\n\n";
				isAlert = true;
			} else obj.mobilePhone.value = strStrippedPhone;
		}		
	}
	
	if(obj.purchased.checked == false) {
	    strAlert +="- You must have purchased Adelaide Sevens Ticket\n\n";
		isAlert = true;
	}
	if(obj.readTC.checked == false) {
	    strAlert +="- You must read and accept the Terms & Conditions to submit your entry\n\n";
		isAlert = true;
	}
	
	if (strCAPTCHA == ""){
		strAlert +="- Enter the verification code\n";
		isAlert = true;		
	}
	
		
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}
}
	
function setRowColor(id, strColour){
	// -- get element (the table), TBODY tag, children of (TR tags)
	var r=document.getElementById(id).getElementsByTagName('tr');
	 // - total number of TR tags
	var l=r.length
	for (i=0;i<l;i++){
		if (i%2 == 0){r[i].style.backgroundColor=strColour;}
		else {}
	}
}

function DisplayPassword(){
	var obj = xDOM("forgotPassword",0);
	if(obj.style.height == "0px"){
		obj.style.height = "120px";
		setTimeout("setPassFocus()",10);
	}else{
		obj.style.height = "0px";
	}	
}

function setPassFocus(){
	var objInput = xDOM("forgotForm",0);
	objInput.email.focus();	
}

// Cross Browser DOM Functions used to create objects and get top / left coords
// copyright Stephen Chapman, 4th Jan 2005
// you may copy this code but please keep the copyright notice as well
var aDOM = 0, ieDOM = 0, nsDOM = 0
var stdDOM = document.getElementById;
if (stdDOM) aDOM = 1; else {
  ieDOM = document.all;
  if (ieDOM) aDOM = 1; else {
    var nsDOM = (
      (navigator.appName.indexOf('Netscape') != -1)
      && (parseInt(navigator.appVersion) ==4));
    if (nsDOM) aDOM = 1;
  }
}
function xDOM(objectId, withStyle) {
var st = ''; if (withStyle) st = '.style';
if (stdDOM) return (eval('document.getElementById(objectId)'+st));
if (ieDOM) return (eval('document.all[objectId]'+st));
if (nsDOM) return (document.layers[objectId]);
}

function emailPage(id){
	if(id!=""){
		var strURL = "/sendpage.asp?id=" + id
		var objPhotoWindow = window.open(strURL,'photo','height=410,width=550,left=10,top=10,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,resizable=0,status=0,toolbar=0');
	}

}

// Clear a form so that default initial values are erased
function clearForm(form) {
   var element;
   for (var i = 0; i < form.elements.length; i++) {
      element = form.elements[i];
      if (element.type == "text" || element.type == "password" || element.type == "textarea") element.value = '';
      else if (element.type.indexOf("select") != -1) element.selectedIndex = -1;
      else if (element.type == "checkbox" && element.checked) element.checked = false;
      else if (element.type == "radio" && element.checked == true) element.checked = false;
   }
}

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
