function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function openPopWindow(popurl,pname,pwdith,pheight,pscroll) {
var woptions
woptions = 'width=' + pwdith;
woptions += ',height=' + pheight;
woptions += ',scrollbars=' + pscroll;
var popupwindow
popupwindow = window.open(popurl,'pname',woptions);
popupwindow.focus();
}
/* ------------------*/
function replaceChar(srchID){
if( srchID  !=  "" ){
srchID=replaceSubstring(srchID,"*","%");
srchID=replaceSubstring(srchID,"?","_");
document.formHead.srchKey.value=srchID;
}else{document.formHead.srchKey.value = "";}
}
/* ------------------*/
function replaceSubstring(inputString, fromString, toString) {
var temp = inputString;
if (fromString == "") {
return inputString;
}
if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation)
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } else { 
      var midStrings = new Array("~", "`", "_", "^", "#");
      var midStringLen = 1;
      var midString = "";
      while (midString == "") {
         for (var i=0; i < midStrings.length; i++) {
            var tempMidString = "";
            for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
            if (fromString.indexOf(tempMidString) == -1) {
               midString = tempMidString;
               i = midStrings.length + 1;
            }
         }
      } 
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + midString + toTheRight;
      }
      while (temp.indexOf(midString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(midString));
         var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } 
   return temp; 
}
/* ------------------*/
function Popup(pname,purl,w,h,s) {
 LeftPosition = (screen.width) ? (screen.width-w-8)/2 : 0;
 TopPosition = (screen.height) ? (screen.height-h-50)/2 : 0;
 myWinName = window.open(purl,pname,"width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition+",resizable=no,scrollbars="+s);
 if (parseInt(navigator.appVersion) >= 4) {
  myWinName.window.focus();
 }
 return myWinName;
}
/* ------------------*/
function PopColor(fname,flink) {
	Popup(fname,flink,200,200,0);
}
/* ------------------*/
function validEmail(mailObj)
{
	if (mailObj.value.search("^.+@.+\\..+$") != -1)
	{	return true; }
	else {	return false; }
}
/* ------------------*/
function validUrl(url)
{
	if (url.value.search("^http://.+\\..+$") != -1)
	{	return true; }
	else {	return false; }
}
/* ------- */
function validDigit(fld,evt){
 var charCode = (evt.which) ? evt.which : event.keyCode
 if ( (charCode!=8 && charCode!=37 && charCode!=39 && charCode!=46) && (charCode<48 || charCode>57) ){ return false;}
 return true;
}
/* ------- */
function validFloat(fld,evt){
 var charCode = (evt.which) ? evt.which : event.keyCode
 //charCode 8= backspace, 37:back arrow, 39: front arrow, 46: delete, 190: decimal point
 if ( (charCode!=8 && charCode!=37 && charCode!=39 && charCode!=46 && charCode!=190) && (charCode<48 || charCode>57) ){return false;}
 return true;
}
/* ------------------*/
function checkLogin(frm){
	if(frm.email.value == ""){
		alert("Please enter email address.");
		frm.email.focus();
		return false;
	}else if(!validEmail(frm.email)){
		alert("Invalid email address. Please try again.");
		frm.email.focus();
		return false;
	}else if(frm.password.value == ""){
		alert("Please enter password.");
		frm.password.focus();
		return false;
	}else if(frm.password.value.length < 5 || frm.password.value.length > 12){
		alert('Your password must be between 5-12 characters.')
		frm.password.focus();
		frm.password.value="";
		return false;	
	}else{
		return true;
	}
}


