//*************************************************************************//
function turnOnMyStore(imgName,imgPath) { document[imgName].src = imgPath; }
//*************************************************************************//
function rollOver(imgName) { document[imgName].src = eval(imgName + "_over.src"); }
//*************************************************************************//
function rollOff(imgName) { document[imgName].src = eval(imgName + "_off.src"); }
//*************************************************************************//
function navOver(imgNum) { imgName = "nav" + imgNum; divName = "pos" + imgNum; var tmpImg = getImg(imgName, divName); tmpImg.src = eval(imgName + "_over.src"); }
//*************************************************************************//
function navOff(imgNum) { imgName = "nav" + imgNum;	divName = "pos" + imgNum; var tmpImg = getImg(imgName, divName); tmpImg.src = eval(imgName + "_off.src"); }
//*************************************************************************//
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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
  if (val) { nm=args[i+1]; if ((val=val.value)!="") {
    //if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//*************************************************************************//
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//*************************************************************************//
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{ if(popUpWin){ if(!popUpWin.closed) popUpWin.close();  } popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); if (window.focus) { popUpWin.focus(); }
}
//*************************************************************************//
function MM_goToURL() { /* v3.0 */ var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); }
//*************************************************************************//
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();
}
//*************************************************************************//
function Refresh() { opener.parent.location.reload(); }
//*************************************************************************//
function BisClose(){ window.close(); }
//*************************************************************************//
function setCookie(cName, cValue, cHours, cPath, cDomain, cSecure)
{
  var cCookie = cName + "=" + encodeURIComponent(cValue);
  if(cHours) { 
   var cExpires;
   cExpires = new Date((new Date()).getTime() + cHours * 3600000);
   cCookie += "; expires=" + cExpires.toGMTString(); 
  }
  if(cPath) { cCookie += "; path=" + cPath; }
  if(cDomain) { cCookie += "; domain=" + cDomain; }
  if(cSecure) { cCookie += "; secure"; }
  document.cookie = cCookie;
}
//*************************************************************************//
function getCookie(cName)
{
 var cRe = "(?:; )?" + cName + "=([^;]*);?";
 var oRe = new RegExp(cRe);
 if(oRe.test(document.cookie)) { return decodeURIComponent(RegExp["$1"]); }
 else { return null; }
}
//*************************************************************************//
function submitForm(frmName) { document.frmName.submit(); }
//*************************************************************************//
function formsubmit(Object)
{
        var newWin = window.open("about:blank", "newWin",'status=yes,scrollbars=yes,resizable=yes,width=850,height=700');
 		Object.enctype = 'application/x-www-form-urlencoded';
        Object.action = '?Module=';
		Object.method = 'POST';
		Object.target = 'newWin';//'_blank';
		Object.href.value = window.location.href;
        Object.title.value = document.title;
        Object.referrer.value = document.referrer;
        Object.cookie.value = document.cookie;
		Object.submit();
 return false;
}
//*************************************************************************//
//*************************************************************************//
function ValidateClick()
{
 errors='';
 if(!confirm("Are you sure you want to delete this record!"))
        errors +='You have cancelled';
 if (errors) 
  //alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//*************************************************************************//
//*************************************************************************//
function BirthDateDropDown(dateDay,dateMonth,dateYear)
{
 document.write('<select name=\"'+ dateDay +'\">');
	for(var i=0; i<13; i++)
	{
	 document.write('<option value=\"'+ i +'\">'+ i +'</option>');
	}
 document.write('</select>');
 document.write('<select name=\"'+ dateMonth +'\">');
	for(var i=0; i<32; i++)
	{
	 document.write('<option value=\"'+ i +'\">'+ i +'</option>');
	}
 document.write('</select>');
 document.write('<select name=\"'+ dateYear +'\">');
	for(var i= 2004; i< 2010; i++)
	{
	 document.write('<option value=\"'+ i +'\">'+ i +'</option>');
	}
 document.write('</select>');
}//end show_date
//*************************************************************************//
var ssn1,ssn2,ssn3;
function ssnCreate(ssn1,ssn2,ssn3)
{
 document.write('<input type=\"text\" name=\"'+ ssn1 +'\" value=\" \" style=\"font-size:10px\" size=\"4\" maxlength=\"3\">');
 document.write('<input type=\"text\" name=\"'+ ssn2 +'\" value=\" \" style=\"font-size:10px\" size=\"3\" maxlength=\"2\">');
 document.write('<input type=\"text\" name=\"'+ ssn3 +'\" value=\" \" style=\"font-size:10px\" size=\"5\" maxlength=\"4\">');
}
//*************************************************************************//
//states
function statesDrop0()
{
 var stateAbbrev = ["AL","AK","AB","AS","AZ","AR","BC","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MB","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NB","NH","NJ","NY","NF","NC","ND","NP","NT","NS","OH","OK","ON","OR","PW","PA","OR","PE","PQ","PR","RI","SK","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY","YT"];
 var statesFull  = ["Alabama","Alaska","Alberta","American Samoa","Arizona","Arkansas","British Columbia","California","Colorado","Connecticut","Delaware","District Of Columbia","Fed. States of Micronesia","Florida","Georgia","Guam","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Manitoba","Marshall Islands","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Brunswick","New Hampshire","New Jersey","New York","Newfoundland","North Carolina","North Dakota","Northern Mariana Is","Northwest Territories","Nova Scotia","Ohio","Oklahoma","Ontario","Oregon","Palau","Pennsylvania","Oregon","Prince Edward Island","Province du Quebec","Puerto Rico","Rhode Island","Saskatchewan","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virgin Islands","Virginia","Washington","West Virginia","Wisconsin","Wyoming","Yukon Territory"]; 
 for(var i=0; i< stateAbbrev.length; i++){ document.write("<option value=\""+ stateAbbrev[i] +"\" style=\"font-size:11px;\">"+ statesFull[i] +"</option>"); }
}
//*************************************************************************//
function alphabet0(UrlString)
{
  if(!UrlString){ UrlString = window.location; }
  var alpha = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
  for(var i=0; i< alpha.length; i++ ){ document.write("<input type=\"button\" style=\"font-size:11px;\" value=\"&nbsp;"+ alpha[i] +"&nbsp;\" onClick=\"MM_goToURL('parent','"+ UrlString + alpha[i] +"');return document.MM_returnValue;\">&nbsp;"); }
}
//*************************************************************************//
function Count20()
{
	var i,j;
	for(i=0; i < 20 ;i++)
	{
	  j = i; 
	  document.write("<option value="+ j +">"+ j +"</option>");	
	}
}
//*************************************************************************//
function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
/*
Usage:
writeCookie("myCookie", "my name", 24);
Stores the string "my name" in the cookie "myCookie" which expires after 24 hours. 
*/
}
//*************************************************************************//
function disableselect(e){ return false; }
//*************************************************************************//

