function date(){
	var currentTime = new Date()
	var year = currentTime.getFullYear()
	document.write(year)
}

function openDir( form ) { 
	var newIndex = form.dropdown.selectedIndex; 
	if ( newIndex == 0 ) { 
		alert( "Please select a manufacturer!" ); 
	} else { 
		cururl = form.dropdown.options[ newIndex ].value; 
		window.location.assign( cururl ); 
	} 
} 


function validateForm(txtName,txtCompany,txtEmail,txtPhone) {
	
	var error=true;
	var errorMsg="";
        
    //validate txtName	  
	var trimmed = txtName.value.replace(/^\s+|\s+$/g, '') ;
    if (trimmed == "") {
        txtName.focus();
        errorMsg="Name field is empty.\n";
        error=false;
    }
    
    //validate txtCompany
	var trimmed = txtCompany.value.replace(/^\s+|\s+$/g, '') ;
    if (trimmed == "") {
        if(error==true){
           txtPhone.focus();
        }
        errorMsg=errorMsg+"Company field is empty.\n";
        error=false;
    }
    
	//validate email
	var str = txtEmail.value; // email string
    
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
	if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid
		
	}
	else{
        if(error==true){
           txtEmail.focus();
        }
	errorMsg=errorMsg+"Incorrect email.\n";
	error= false;
	}
    
    //validate txtPhone
	var trimmed = txtPhone.value.replace(/^\s+|\s+$/g, '') ;
    if (trimmed == "") {
        if(error==true){
           txtPhone.focus();
        }
        errorMsg=errorMsg+"Phone field is empty.\n";
        error=false;
    }
  
	if(error==false)
	{
	   alert(errorMsg);
	   return error;
	}
	else
	{
	  return error;
	}
}

$(document).ready(function(){
	$('li.headlink').hover(
		function() { $('ul', this).css('display', 'block'); },
		function() { $('ul', this).css('display', 'none'); });
});
