  function r(maxV){day=new Date();sec=day.getSeconds();return(sec%6)+1}

 function RevolvingImages() {
  var URL2="";var S; S=r(60);
  if(S==1){document.write("<img src='./images/categories/sideA.jpg' border=0>");}
  if(S==2){document.write("<img src='./images/categories/sideB.jpg' border=0>");}
  if(S==3){document.write("<img src='./images/categories/sideC.jpg' border=0>");}
  if(S==4){document.write("<img src='./images/categories/sideD.jpg' border=0>");}
  if(S==5){document.write("<img src='./images/categories/sideE.jpg' border=0>");}
  if(S==6){document.write("<img src='./images/categories/sideF.jpg' border=0>");}
  
}

  
  function isNotFloat(str) {
	if (!/^\d+(\.\d+)?$/.test(str)) {		
		return true;
	}
	return false;
  }

  function isEmpty(str) {
    if(str==null || str=="")
      return true;
    return false;  
  }
  
  function isNotPositiveInteger(str) {
    var pattern = "0123456789"
    var i=0;
    do {
      var pos = 0;
      for (var j=0; j<pattern.length; j++)
        if (str.charAt(i)==pattern.charAt(j)) {
	  pos  = 1;
	  break;
	}
	i++;
    } while (pos==1 && i<str.length)
    if (pos == 0)
      return true;
    return false;
  }
    
  function areTheyNotEqual (passnew, passconfirm) {
    if(passnew == passconfirm)
      return false;    
    return true;    
  }  
  
  function isValidEmail(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 validateProduct () {
    if (isEmpty(document.product.partnumber.value)) {
      alert('Please enter the part number.');
      document.product.partnumber.focus();
      return false;
    }  
    if (isEmpty(document.product.productname.value)) {
      alert('Please enter the product name.');
      document.product.productname.focus();
      return false;
    }
    if (isNotFloat(document.product.jobberprice.value)) {
      alert('The jobber price is not correct.');
      document.product.jobberprice.focus();
      return false;
    }
    if (isNotFloat(document.product.listprice.value)) {
      alert('The list price is not correct.');
      document.product.listprice.focus();
      return false;
    }
    if (isNotFloat(document.product.retailprice.value)) {
      alert('The retail price is not correct.');
      document.product.retailprice.focus();
      return false;
    }
        
    return true;    
 }  
