function isText(strString) {	if (strString.length <1) {		return false;	} else {		return true;	}}function isNumeric(strString) {   var strValidChars = " 0123456789.-";   var strChar;   var blnResult = true;   if (strString.length == 0) return false;   for (i = 0; i < strString.length && blnResult == true; i++) {	  strChar = strString.charAt(i);	  if (strValidChars.indexOf(strChar) == -1) {		 blnResult = false;	  }   }   return blnResult;}function isEmail(strString) {	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strString)){		return true;	}	return false;}function isDate(strString) {	if (/^([0-3][0-9])\/([0-1][0-9])\/([0-9]{2,4})$/.test(strString)){		return true;	}	return false;}function isDateTime(strString) {	if (/^([0-3][0-9])\/([0-1][0-9])\/([0-9]{2,4}) ([0-2][0-9]):([0-5][0-9])$/.test(strString)){		return true;	}	return false;}function chkForm(form) {	
	// alert("checking");	var errMessage = "";		// check any required fields	var fieldList = $(form.name).getElementsByClassName('req');	for (var i = 0, j = fieldList.length; i < j; i++) {		fieldList[i].removeClassName('checkFld');		if(thisField = fieldList[i].hasClassName('text')) {			if(!isText(fieldList[i].value)) {				errMessage += fieldList[i].title + "\n";				fieldList[i].addClassName('checkFld');			}					}		if(thisField = fieldList[i].hasClassName('numeric')) {			if(!isNumeric(fieldList[i].value)) {				errMessage += fieldList[i].title + "\n";				fieldList[i].addClassName('checkFld');			}		}		if(thisField = fieldList[i].hasClassName('email')) {			if(!isEmail(fieldList[i].value)) {				errMessage += fieldList[i].title + "\n";				fieldList[i].addClassName('checkFld');			}		}		if(thisField = fieldList[i].hasClassName('datetime')) {			if(!isDateTime(fieldList[i].value)) {				errMessage += fieldList[i].title + "\n";				fieldList[i].addClassName('checkFld');			}		}		if(thisField = fieldList[i].hasClassName('date')) {			if(!isDate(fieldList[i].value)) {				errMessage += fieldList[i].title + "\n";				fieldList[i].addClassName('checkFld');			}		}	}		// now check any collection of fields where of which one must be completed	var fieldList = $(form.name).getElementsByClassName('req_opt');		var array = new Array();		// loop all fields adding to array 	for (var i = 0, j = fieldList.length; i < j; i++) {		fieldList[i].removeClassName('checkFld');		if(thisField = fieldList[i].hasClassName('text')) {			if(!isText(fieldList[i].value)) {				array.push(fieldList[i].title);			}					}		if(thisField = fieldList[i].hasClassName('numeric')) {			if(!isNumeric(fieldList[i].value)) {				array.push(fieldList[i].title);			}		}		if(thisField = fieldList[i].hasClassName('email')) {			if(!isEmail(fieldList[i].value)) {				array.push(fieldList[i].title);			}		}		if(thisField = fieldList[i].hasClassName('datetime')) {			if(!isDateTime(fieldList[i].value)) {				array.push(fieldList[i].title);			}		}		if(thisField = fieldList[i].hasClassName('date')) {			if(!isDate(fieldList[i].value)) {				array.push(fieldList[i].title);			}		}	}		// if array is set to same length as optional required fields	if ((fieldList.length != 0) && (array.length == fieldList.length)) {				// loop all fields adding new class attribute		for (var i = 0, j = fieldList.length; i < j; i++) {			fieldList[i].removeClassName('checkFld');			if(thisField = fieldList[i].hasClassName('text')) {				if(!isText(fieldList[i].value)) {					fieldList[i].addClassName('checkFld');				}						}			if(thisField = fieldList[i].hasClassName('numeric')) {				if(!isNumeric(fieldList[i].value)) {					fieldList[i].addClassName('checkFld');				}			}			if(thisField = fieldList[i].hasClassName('email')) {				if(!isEmail(fieldList[i].value)) {					fieldList[i].addClassName('checkFld');				}			}			if(thisField = fieldList[i].hasClassName('datetime')) {				if(!isDateTime(fieldList[i].value)) {					fieldList[i].addClassName('checkFld');				}			}			if(thisField = fieldList[i].hasClassName('date')) {				if(!isDate(fieldList[i].value)) {					fieldList[i].addClassName('checkFld');				}			}		}				errMessage +=  "Please select " + array.join(" or ");	}	if (errMessage != "") {		alert(errMessage);		return false;	}		else {		return true;		//return document.forms['badgaform'].submit();	}}function chkVenueListCheckBoxes(chkBox) {		var chkbox_values_array=(chkBox.value).split("_");		var errMessage = "";	// check any required fields	if (errMessage != "") {		alert(errMessage);		return;	}			//document.forms['badga_venue_list_form'].submit();}function chkPostcode(postcode) {		test = postcode.value; 	size = test.length;		if (size == 0) {		return true;	}		test = test.toUpperCase(); //Change to uppercase		while (test.slice(0,1) == " ") //Strip leading spaces	{		test = test.substr(1,size-1);		size = test.length;	}		while(test.slice(size-1,size)== " ") //Strip trailing spaces	{		test = test.substr(0,size-1);		size = test.length;	}		//document.find_venue_form.search_postcode.value = test; //write back to form field	if ((size < 6 || size > 8)	|| (!(isNaN(test.charAt(0))))	|| (isNaN(test.charAt(size-3)))	|| (!(isNaN(test.charAt(size-2))))	|| (!(isNaN(test.charAt(size-1))))	|| (!(test.charAt(size-4) == " ")))	{ //Code length rule		alert(test + " is not a valid postcode");		//postcode.addClassName('checkFld');		postcode.focus();		return false;	}	 	count1 = test.indexOf(" ");	count2 = test.lastIndexOf(" ");	if (count1 != count2){//only one space rule		alert(test + " is not a valid postcode");		//postcode.addClassName('checkFld');		postcode.focus();		return false;	}		return true;}function revealDescriptionBox(form){	document.getElementById('updated_Description_formID').value = form.name;    window.onscroll = function () { 		document.getElementById('modalPage').style.top = document.body.scrollTop; 	};	document.getElementById('updated_Description').value = document.forms[form.name].Description.value;    document.getElementById('modalPage').style.display = "block";	document.getElementById('updated_Description').focus();    document.getElementById('modalPage').style.top = document.body.scrollTop;}function hideDescriptionBox(update){	var formName = document.getElementById('updated_Description_formID').value;	if (update == 'true') {		document.forms[formName].Description.value = document.getElementById('updated_Description').value;	}    document.getElementById('modalPage').style.display = "none";	document.forms[formName].Description.focus();}function revealViewDescriptionBox(form){    window.onscroll = function () { 		document.getElementById('modalPageView').style.top = document.body.scrollTop; 	};	document.getElementById('view_Description').value = document.forms[form.name].Description.value;    document.getElementById('modalPageView').style.display = "block";	document.getElementById('view_Description').focus();    document.getElementById('modalPageView').style.top = document.body.scrollTop;}function hideViewDescriptionBox(){    document.getElementById('modalPageView').style.display = "none";}function showHideTaxIcon(form) {	var tax_icon = "tax_icon_" + form.name + "";	if (document.forms[form.name].TaxType.value == "N/A") {		document.getElementById(tax_icon).style.display = "none";	} else {		document.getElementById(tax_icon).style.display = "inline";	}}function windopen(id,source) {	window.open("/includes/global_confirm_delete.php?id="+id+"&source="+source);}