
function chkBrowser(){this.ver=navigator.appVersion;this.dom=document.getElementById?1:0;this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;this.ns4=(document.layers && !this.dom)?1:0;this.bVer=(this.ie5 || this.ie4 || this.ns4 || this.ns5);return this;}
bVer=new chkBrowser();ns4 = (document.layers)? true:false;ie4 = (document.all)? true:false;function AttB(f){if(bVer.ie4)f.style.display='block';}function AttN(f){if(bVer.ie4)f.style.display='none';}

function modelesswin(url,mwidth,mheight){ 
if (document.all&&window.print) //if ie5 
eval('window.showModelessDialog(url,"","help:0;resizable:0;status:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")') 
else 
eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=0,scrollbars=0")') 
} 

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function isBetween(inObj, inMin, inMax, inMessage, ID){

var obj = MM_findObj(inObj)
var str = obj.value
var filter = /^\d{1,2}\/\d{1,2}\/\d{2,4}/

if (str >= inMin && str <= inMax)
{
document.getElementById('image' + ID).style.display = 'none';
return true;
}
else
{
obj.focus();
document.getElementById('image' + ID).style.display = 'inline';
modelesswin('inputerror.asp?msg=You must enter<br>' + inMessage + '<br>',250,130);
return false;
}
}

function numOnly(objEvent) 
{
  var myKeyCode;  	
  myKeyCode = objEvent.keyCode;			
  if(myKeyCode>=48 && myKeyCode<=57) return true;
  return false;
}

function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}

function checkEmailObject(objName, ID) {
var obj = MM_findObj(objName);
if (!isEmail(obj.value)) {
obj.focus();
modelesswin('inputerror.asp?msg=You must enter a<br>valid eMail address<br>',250,130);
return false;
}

return true;
}

function checkFormObject(objName, inMessage, ID) {
var obj = document.getElementById(objName);
if (obj.value == "") {
obj.focus();
modelesswin('inputerror.asp?msg=You must enter<br>' + inMessage + '<br>',250,130);
return false;
}

return true;
}