// ------------------------------------------------------------------------------------------------
function openBrWindow(theURL,winName,features) { //v2.0
// ------------------------------------------------------------------------------------------------
  window.open(theURL,winName,features);
}

// ------------------------------------------------------------------------------------------------
function reDirect(s){
// ------------------------------------------------------------------------------------------------
    var destination =   s.options[s.selectedIndex].value
    if (destination !="") {self.location = destination;}
}

// ------------------------------------------------------------------------------------------------
function findObj(theObj, theDoc)
// ------------------------------------------------------------------------------------------------
// Example: obj = findObj("image1");
{
  var p, i, foundObj;

  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++)
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

  return foundObj;
}

// ------------------------------------------------------------------------------------------------
function validateForm() { //viway
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// DO NOT DELETE THIS SECTION OF CODE.  THIS IS NOT THE MM VERSION.  WE'VE MODIFIED IT TO INCLUDE A
// VALID ITEM NAME WHEN A MESSAGE IS ISSUED
// ------------------------------------------------------------------------------------------------

    var i,p,q,nm,test,num,min,max,errors='',args=validateForm.arguments;
    for (i=0; i<(args.length-3); i+=4) { test=args[i+2]; val=findObj(args[i]);
        if (val) { nm=args[i+3];; 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'; }
      }

//  -----Check for required button fields----------------------------------------------------------
// ------------------------------------------------------------------------------------------------

      if (errors) alert('The following error(s) occurred:\n'+errors);
      document_returnValue = (errors == '');
}



//  ===================================================
function confirmation(f) {
//  ===================================================
     if (confirm("Are you sure?")){
        f.submit();
     }
     else{
         return false;
     }
}

function getDirections (form) {
	var data = form.addr.value + "," + form.city.value + "," + form.zip.value;
	form.saddr.value = data;
	form.submit();
}