  function fGoLink(zURL) {
    document.location.href=zURL;
  }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


var prevId
function displayIntro(divIdArg)
{
//alert(divIdArg != prevId);
if ((prevId != divIdArg)&& (prevId != null))
{
eval(prevId+".style.display = 'none'");
prevId = divIdArg;
}
eval(divIdArg+".style.display = 'block'");
prevId = divIdArg;

}

function hideIntro(divIdArg)
{
//alert(divIdArg != prevId);
if ((prevId != divIdArg)&& (prevId != null))
{
eval(prevId+".style.display = 'none'");
prevId = divIdArg;
}
eval(divIdArg+".style.display = 'none'");
prevId = divIdArg;

}



// ADDED EXATR JS FUNCTIONS FOR FORM VALIDATION

  function maxLength(field,maxChars)
 {
       if(field.value.length > maxChars) {
//          event.returnValue=false;
          field.value=field.value.substr(0,maxChars); 
          alert("You have entered more than the allocated" +maxChars + " characters.");
          return false;
       }

 }  

 function maxLengthPaste(field,maxChars)
 {
//       event.returnValue=false;
       if((field.value.length +  window.clipboardData.getData("Text").length) > maxChars) {
          field.value=field.value.substr(0,maxChars); 
          alert("You have entered more than the allocated" +maxChars + " characters.");
         return false;
       }
//       event.returnValue=true;
 }


  function fCheckRequired(aFormObject,aValueString) {
    var zmyArr = new Array();
    
    zmyArr = aValueString.split("|"); 
    
    for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
    {
        if (eval('aFormObject.'+zmyArr[zvaluecount]+'.value')=='') {
          zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;
          zErrorMessage='\n - '+zMessageLabel+' cannot be blank.';
          zError+=zErrorMessage;
        }
    } 

  }

  function fCheckAlphaNumeric(aFormObject,aValueString)
  {
    var zmyArr = new Array();    
    zmyArr = aValueString.split("|"); 
    
    for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
    {
        zAlphaErrorMessage='';
      	znumaric = eval('aFormObject.'+zmyArr[zvaluecount]+'.value');
      	for(var j=0; j<znumaric.length; j++)
      	{
            zAlphaErrorMessage='';
      		  var alphaa = znumaric.charAt(j);
      		  var hh = alphaa.charCodeAt(0);
      		  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
      		  {
      		  }
      		  else	{
              zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;
              zAlphaErrorMessage='\n - '+zMessageLabel+' MUST be letters and numbers only.';
      		  }
        }
        if (zAlphaErrorMessage!='') {
          zError+=zAlphaErrorMessage; 
        }
     }
  }

  function fCheckNumeric(aFormObject,aValueString) {
//  check for valid numeric strings
      var strValidChars = "0123456789.-";       
      var zmyArr = new Array();    
      zmyArr = aValueString.split("|"); 
      
      for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
      {
          zNumericErrorMessage='';
          strChar='';
          blnResult = true;

          strString= eval('aFormObject.'+zmyArr[zvaluecount]+'.value');
//  test strString consists of valid characters listed above
           for (i = 0; i < strString.length && blnResult == true; i++)  {
              strChar = strString.charAt(i);
                if (strValidChars.indexOf(strChar) == -1) {
                  blnResult = false;
                  zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;
                  zNumericErrorMessage='\n - '+zMessageLabel+' MUST be numbers only, no commas or spaces.';
                }
           }
        if (zNumericErrorMessage!='') {
          zError+=zNumericErrorMessage; 
        }
      }
  }


  function xreplace(checkMe,toberep,repwith){
    var temp = checkMe;
    var i = temp.indexOf(toberep);
    while(i > -1) {

      temp = temp.replace(toberep, repwith);
        i = temp.indexOf(toberep, i + repwith.length + 1);
    }
    return temp;
  }


  function fReplaceFormCharacters(aFormObject,aValueString) {
    var zmyFormArr = new Array();
    
    zmyFormArr = aValueString.split("|"); 
    
    for(var zformvaluecount=0;zformvaluecount<zmyFormArr.length;zformvaluecount++)
    {
        zFormInput=eval('aFormObject.'+zmyFormArr[zformvaluecount]); 
        zStringToReplace = zFormInput.value;

        zString_new = xreplace(zStringToReplace,"'","&#39;");
        zString_new = xreplace(zString_new,'"','&#39;&#39;');
        zFormInput.value = zString_new;  
    }
  }
  function fReplaceFormSingleQuotes(aFormObject,aValueString) {
    var zmyFormArr = new Array();
    
    zmyFormArr = aValueString.split("|"); 
    
    for(var zformvaluecount=0;zformvaluecount<zmyFormArr.length;zformvaluecount++)
    {
        zFormInput=eval('aFormObject.'+zmyFormArr[zformvaluecount]); 
        zStringToReplace = zFormInput.value;

        zString_new = xreplace(zStringToReplace,"'","&#39;");
        zFormInput.value = zString_new;  
    }
  }


  function fRemove(zID) {
    zName=document.getElementById('Name_'+zID).innerHTML;
    var zquest = 'Are you sure you would like to DISABLE/REMOVE "'+zName+'"?';
    if (confirm(zquest)) {
      document.getElementById('FrmRemove').inpRemoveId.value = zID;
      document.getElementById('FrmRemove').submit();
    }
  }

  function fPublish(zID) {
    zName=document.getElementById('Name_'+zID).innerHTML;
    var zquest = 'Are you sure you would like to PUBLISH "'+zName+'"?';
    if (confirm(zquest)) {
      document.getElementById('FrmPublish').inpPublishID.value = zID;
      document.getElementById('FrmPublish').submit();
    }
  }

  function fCancel(zID) {
    zName=document.getElementById('Name_'+zID).innerHTML;
    var zquest = 'Are you sure you would like to cancel "'+zName+'"?';
    if (confirm(zquest)) {
      document.getElementById('FrmRemove').inpRemoveId.value = zID;
      document.getElementById('FrmRemove').submit();
    }
  }






