var search_str =/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;
jQuery(function(){
	
	jQuery("#signbutton").click(function(){
	  if(jQuery("#email").val()==""){
		  alert("Please input your email address.");
		  return false;
	  }
	  if(jQuery("#password").val()==""){
		  alert("Please input your password.");
		  return false;
	  }
	  var data="username="+jQuery("#email").val()+"&password="+jQuery("#password").val();
	  jQuery.ajax({
		  type:"POST",
		  url:"ajax/check_customer_sign",
		  data:data,
		  success:function(info){
		  	if(jQuery.trim(info)=="0"){
		  		alert("The Email address/password is incorrect!");
		  		window.location.href="sign_in";
		  	}
		  	if(jQuery.trim(info)=="1"){
		  		window.location.href=window.location.href;
		  		//window.location.href="index.html";
		  	}
		  	
	  	}
		  
	  });
	  
  });
  
	
 
 /*
  * ²ιΡ―
  */ 
  jQuery("#search").click(function(){
	  var key=jQuery("#key").val();
	  if(key=="Keyword"){
		  jQuery("#key").val("");
		  alert("Please input keyword");
		  return false;
	  }
	  window.location.href="/product_search.html?key="+jQuery("#key").val();
  });

});