$(document).ready(function(){
		$(".catalogHome,.whatisnew,.feature,.loginHome,.whereHome,.icoCatelog").pngFix( );
		$("div[src*=png]").pngFix2();
		$(".listCatalog ul li").hover(function(){
			$(this).addClass("liHover");
		},function(){
			$(this).removeClass("liHover");	
		})
		
		$("#email").focus(function(){
			if($(this).val()=="Your email.."){
				$(this).attr("value","");
			}
		})
		$("#email").blur(function(){
			if($(this).val()==""){
				$(this).attr("value","Your email..");
				
			}
		})


	})
	
	function changeTab(id){
		if(id ==1){
			document.getElementById("tab1").className="active";
			document.getElementById("tab2").className="";
			document.getElementById("collector").style.display="none";
			document.getElementById("dealer").style.display="";
		}
		if(id==2){			
			document.getElementById("tab1").className="";
			document.getElementById("tab2").className="active";
			document.getElementById("collector").style.display="";
			document.getElementById("dealer").style.display="none";
		}
		
		
	}
	
	function check()
{
        if(login.username.value =="") 
	{    
		alert("please input username!");    
		login.username.focus();    
		return(false);    
	}
        if(login.password.value =="") 
	{    
		alert("please input password!");    
		login.password.focus();    
		return(false);    
	}
}


function subscribe()
{

	
	var email = document.getElementById("subscribeemail").value;
	if( email =='' || !checkemail(email)){
		alert("invalid email !");
		return false;
	}
	
	document.getElementById("id_subscribeemail").innerHTML = "Processing...";
	var now_lp=(new Date()).getTime();
	window["ajax_"+now_lp] = new XMLHttpClient("ajax_"+now_lp);
	window["ajax_"+now_lp].open('get',"/function/enewsletter.cfm?email="+email+"&t="+now_lp,true);
	window["ajax_"+now_lp].attachOnStatus(200,subscribe_back);
	window["ajax_"+now_lp].send();	
}

function subscribe_back(xmlhttp)
{

	var result = xmlhttp.responseText;	
	document.getElementById("id_formEnews").innerHTML = "<font color=red>Subscribe successfully!</font>";
	
}

function checkemail(Email)
{
	var EmailLength;
	EmailLength=Email.length;
	if (( EmailLength <= 5 ) || (Email.indexOf('@',0) == -1) || (Email.indexOf('.',0) == -1)) 
		  return (false);
	else
	return (true);
}
