
	function go_to_page(link)
 	{
 		window.location.href=link;	
 	}

	function show_frm_confirm(id)
	{
		document.getElementById('sanpham_content').style.display='none';	
		document.getElementById('frmDownload').style.display='inline';
		
	}
	
	function check_search()
	{
		if(document.frmSearch.txtSearch.value == "")
		{
			alert('Vui long nhap noi dung can tim vao ! ');
			return false;	
		}
		return true;
	}
	function check_frm_contact()
	{
		if(document.frmContact.contact_name.value=="")
		{
			alert("Please enter your name !");
			document.frmContact.contact_name.focus();
			return false;
		}
	
		if(document.frmContact.contact_email.value=="")
		{
			alert("Please enter your email !");
			document.frmContact.contact_email.focus();
			return false;
		}
		else
		{
			if(!checkemail(document.frmContact.contact_email.value))
			{
				alert("Please enter your mail that is correct ,ex: abc@domain.com !");
				document.frmContact.contact_email.focus();
				return false;
			}
		}
		
		if(document.frmContact.contact_detail.value=="")
		{
			alert("Please enter your detail !");
			document.frmContact.contact_detail.focus();
			return false;	
		}
		return true;
	}
	
	
	function check_frm_faq()
	{
		if(document.frmFaq.user_name.value=="")
		{
			alert("Please enter your name !");
			document.frmFaq.user_name.focus();
			return false;	
		}
		if(document.frmFaq.user_email.value=="")
		{
			alert("Please enter your email !");
			document.frmFaq.user_email.focus();
			return false;
		}
		else
		{
			if(!checkemail(document.frmFaq.user_email.value))
			{
				alert("Please enter your mail that is correct ,ex: abc@domain.com !");
				document.frmFaq.user_email.focus();
				return false;	
			}
		}
		if(document.frmFaq.user_content.value=="")
		{
			alert("Please enter your question !");
			document.frmFaq.user_content.focus();
			return false;	
		}
		return true;
	}
	
	function CheckNumber(str)
	{
		for(var i = 0; i < str.length; i++)
		{	
			var temp = str.substring(i, i + 1);		
			if(!(temp == "," || (temp >= 0 && temp <=9)))
			{
					return false;
			}
		}
		return true;
	}
	function checkemail(theemail)
	{
		if (theemail=="") {return false;}
		if (theemail.indexOf(" ")>0) {return false;}
		if (theemail.indexOf("@")==-1) {return false;}
		if (theemail.indexOf(".")==-1) {return false;}
		if (theemail.indexOf("..")!==-1) {return false;}
		if (theemail.indexOf("@")!=theemail.lastIndexOf("@")) {return false;}
		var str="abcdefghijklmnopqrstuvwxyz-_@.0123456789";
		for (var j=1;j < theemail.length;j++){
		if (str.indexOf(theemail.charAt(j))==-1) {alert('Your Email invalid! Please enter email again!');document.frmContact.lienhe_email.focus();return false;}}
		return true;
	}
	
	function exp_res_img(div_id,img_name)
	{
		if(div_id.style.display == "inline")
		{ 	
			div_id.style.display = "none"; 
			if(img_name.src == btn_min.src) img_name.src = btn_max.src;
			else img_name.src = btn_min.src;
		}
		else
		{ 
			div_id.style.display = "inline";
			if(img_name.src== btn_min.src) img_name.src = btn_max.src;
			else img_name.src = btn_min.src;
		};
	}
	
	function exp_res(div_id)
	{
		if(div_id.style.display == "inline")
		{ 	
			div_id.style.display = "none"; 
		}
		else
		{ 
			div_id.style.display = "inline";
		}
}
	function GotoPage(iPage)
	{
	    document.frmPaging.curPg.value=iPage;
	    document.frmPaging.submit();
	}
	function weblink(value)
	{
		if(value != "")
			window.open(value);	
		
	}
