

sfHover = function() {     
            var sfEls = document.getElementById("nav").getElementsByTagName("LI");    
            for (var i=0; i<sfEls.length; i++) {         
                sfEls[i].onmouseover=function() {             
                     this.className+=" sfhover";         
                }         
               
                sfEls[i].onmouseout=function() {             
                     this.className=this.className.replace(new RegExp(" sfhover\\b"), "");         
                }     
             }
          } 
         
if (window.attachEvent) window.attachEvent("onload", sfHover); 
   



function wopen(url, name, w, h)
{
// Fudge factors for window decoration space.
 // In my tests these work well on all platforms & browsers.
    w += 32;
    h += 96;
 var win = window.open(url,
  name, 
  'width=' + w + ', height=' + h + ', ' +
  'location=no, menubar=no, ' +
  'status=no, toolbar=no, scrollbars=no, resizable=no');
 win.resizeTo(w, h);
 win.focus();
}
        
  

function message(theMessage){ alert(theMessage); }

function detectIE()
  {  
     var  _ie = /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
     var menu = document.getElementById('productsMenu'); 
    
      menu.style.margin=(_ie) ? '0 0 0 -30px' : '0 0 0 13px' ;
  }
  
  
  
   function ValidateFields()
   {
        var firstName   = document.forms[0]['first_name'].value;
        var lastName   = document.forms[0]['last_name'].value;
        var email = document.forms[0]['your_email'].value;
  
        if (firstName.length == 0)
        {
            document.forms[0]['first_name'].style.backgroundColor = "lightyellow";
            document.forms[0]['first_name'].select();
            window.scrollTo(0,450);
            return false;
        }
        else 
            document.forms[0]['first_name'].style.backgroundColor = "white";
        
        if (lastName.length == 0)
        {
            document.forms[0]['last_name'].style.backgroundColor = "lightyellow";
            document.forms[0]['last_name'].select();
            window.scrollTo(0,450);
            return false;
        }
        else
            document.forms[0]['last_name'].style.backgroundColor = "white";
        
        
        if (email.length == 0)
        {
            document.forms[0]['your_email'].style.backgroundColor = "lightyellow";
            document.forms[0]['your_email'].select();
            window.scrollTo(0,450);
            return false;
        }
        else 
            document.forms[0]['your_email'].style.backgroundColor = "white";
            
        //validate the email format is correct
        var regexp =  /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;

            
        if ( regexp.exec(email) == null)
        {
            document.forms[0]['your_email'].style.backgroundColor = "lightyellow";
            document.getElementById('email_asterix').innerHTML = "[Invalid address]";
            document.forms[0]['your_email'].select();
            window.scrollTo(0,450);
            return false;
        }
        else{
            document.forms[0]['your_email'].style.backgroundColor = "white";
            document.getElementById('email_asterix').innerHTML = "*";
        }
        
       
        
     return true;
}