<!--
function validRequired(formField,fieldLabel) {
	var result = true;
	if(formField.value == "") {
		alert('Please enter a value for the "' + fieldLabel + '" field.');
		formField.focus();
		result = false;
	}
	return result;
}

function allDigits(str) {
	return inValidCharSet(str,"0123456789");
}

function inValidCharSet(str,charset) {
	var result = true;
	//Note : does'nt use regular expressions to avoid early mac browswer bugs
	for (var i=0;i<str.length;i++)
		if(charset.indexOf(str.substr(i,1))<0) {
			result = false;
			break;
		}
	return result;
}

function validNum(formField,fieldLabel,required) {
	var result = true;
	if(required && !validRequired(formField,fieldLabel))
		result = false;
			
	if(result) {
		if(!allDigits(formField.value)) {
			alert('Please enter a number for the "' + fieldLabel + '" field.');
			formField.focus();
			result = false;
		}
	}
	return result;
}

function validEmail(formField) {
	var result = true;
	var string1=formField.value;
	if(formField.value == "") {
		alert('Please enter a value for the Email field.');
		formField.focus();
		result = false;
	} else if(string1.indexOf("@")==-1 || string1.indexOf(".")==-1) {
		alert('That is not a correct email address');
		formField.focus();
		result = false;
	}

	return result;
}
function checkTheSame (formField1,formField2) {
	var result = false;
	var var1 = formField1.value;
	var var2 = formField2.value;
	if (var1 == var2) {
		result = true;
	} else {
		alert('The password fields are not the same');
		formField1.focus();
	}
	return result;
}
function checkMinMax(theForm,minVname,maxVname) {
	//Check min and max values
	var minValue = Number(minVname.value);
	var maxValue = Number(maxVname.value);

	if (maxValue<=0) {
		maxValue = 10000000;
	}
	if (minValue>maxValue) {
		alert("The minimum value is MORE than the maximum value");
		return false;
	} else {
		return true;
	}
}
//confirm the delete of info
function deleteInfo(url)	{
	if (confirm("Are you sure YES/NO ?") == true) {
		location.replace(url);
		//window.navigate(url);
	}
}
//The function for a jump menu
function jumpMenu(targ,selObj,restore){
	
	gowhere = selObj.options[selObj.selectedIndex].value;
	
	if (gowhere.indexOf("mailto") == 0) {
		
		window.location=gowhere;
		
	} else if (gowhere.indexOf("javascript") == 0) {
		
		eval(gowhere);
		
	} else {
		
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		
	}
	if (restore) selObj.selectedIndex=0;
	
}
//resize a window complex
function resizeWinComplex(theURL,winName,Bwidth,Bheight,scrollBar) {
  var sbar=scrollBar;
  var w=Bwidth;
  var h=Bheight;
  var left = (screen.width/2) - w/2;
  var top = (screen.height/2) - h/2;
  var styleStr =  'scrollbars='+sbar+',width='+w+',height='+h+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  window.open(theURL,winName,styleStr);
  window.resizeTo(w,h);
  window.moveTo(left,top);
}
//build a window complex
function openWinComplex(theURL,winName,Bwidth,Bheight,scrollBar) {
  var sbar=scrollBar;
  var w=Bwidth;
  var h=Bheight;
  var left = (screen.width/2) - w/2;
  var top = (screen.height/2) - h/2;
  var styleStr =  'scrollbars='+sbar+',width='+w+',height='+h+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  window.open(theURL,winName,styleStr);
}
//build a window basic
function openWinBasic(theURL,winName) { 
  window.open(theURL,winName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
//resize window
var i=0;
function resize() {
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
  self.focus();
}
//toggle function for reveal
function toggleBox(szDivID) {
  if (document.layers) { // NN4+
    if (document.layers[szDivID].visibility == 'visible') {
      document.layers[szDivID].visibility = "hide";
      document.layers[szDivID].display = "none";
      document.layers[szDivID+"SD"].fontWeight = "normal";
    } else {
      document.layers[szDivID].visibility = "show";
      document.layers[szDivID].display = "inline";
      document.layers[szDivID+"SD"].fontWeight = "bold";
    }
  } else if (document.getElementById) { // gecko(NN6) + IE 5+
    var obj = document.getElementById(szDivID);
    var objSD = document.getElementById(szDivID+"SD");

    if (obj.style.visibility == 'visible') {
      obj.style.visibility = "hidden";
      obj.style.display = "none";
      objSD.style.fontWeight = "normal";
    } else {
      obj.style.visibility = "visible";
      obj.style.display = "inline";
      objSD.style.fontWeight = "bold";
    }
  } else if (document.all) { // IE 4
    if (document.all[szDivID].style.visibility == 'visible') {
      document.all[szDivID].style.visibility = "hidden";
      document.all[szDivID].style.display = "none";
      document.all[szDivID+"SD"].style.fontWeight = "normal";
    } else {
      document.all[szDivID].style.visibility = "visible";
      document.all[szDivID].style.display = "inline";
      document.all[szDivID+"SD"].style.fontWeight = "bold";
    }
  }
}
//check all checkboxes
function checkAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = true ;
}
//uncheck all checkboxes
function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = false ;
}
//-->