	$(document).ready(function()
	{
		// Function for Shopcart
		$("#updatecart").click(function(event){
     	//	alert("Thanks for visiting!");
   		});
		// End Function Shopcart
		
		//slides the element with class "menu_body" when mouse is over the paragraph
		$(".thongbao").click(function(event){
			window.location='help.asp?sid=11';
		});
		
		$("div.menu_title").click(function()
		{
			if ($(this).next("div.menu_body").css("display")=="none"){
				$(this).next("div.menu_body").slideDown(300).siblings("div.menu_body").slideUp("slow");
			}
			else
			{
				$("div.menu_body").slideUp("slow");
			}
		});	
		
		$("#messagebg").click(function()
		{
			$("#messagebg").hide();
			$('#messagebox').hide();
		});	

		$("#btmsg").click(function()
		{
			$("#messagebg").hide();
			$('#messagebox').hide();
		});	
	});

	function share_zingme(){
		u=location.href;
		t=document.title;
		window.open("http://link.apps.zing.vn/share?url="+encodeURIComponent(u)+"&title="+encodeURIComponent(t))
	}
	function share_facebook(){
		u=location.href;
		t=document.title;
		window.open("http://www.facebook.com/share.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t))
	}
	function share_twitter(){
		u=location.href;
		t=document.title;
		window.open("http://twitter.com/home?status="+encodeURIComponent(u))
	}
	function share_google(){
		u=location.href;
		t=document.title;
		window.open("http://www.google.com/bookmarks/mark?op=edit&bkmk="+encodeURIComponent(u)+"&title="+t+"&annotation="+t		
)
	}
	
	function openlogin(){
		$('#loginbox').slideDown(300);
	}
	
	function closelogin(){
		$('#loginbox').slideUp(300);
	}

	function openuserpanel(){
		$('#userpanel').slideDown(300);
	}

	function closeuserpanel(){
		$('#userpanel').slideUp(300);
	}
	
	function dosubmit(searchtext){
		window.location="search.asp?keyword="+searchtext;
	}
	
	function showmsg(txt,bw,bh){
		$('#messagebg').show();
		//$("#messagebox").addClass("info");
		$('#messagebox').css("left",(document.documentElement.clientWidth-bw)/2);
		$('#messagebox').css("top",(document.documentElement.clientHeight-bh)/2);
		if (bh>0){$('#messagebox').css("height",bh);}
		if (bw>0){$('#messagebox').css("width",bw);}
		$('#messagebox').show();
		$('#msgtext').text(txt);
	}
	
	function shownotice(txtmsg){
		jQuery.noticeAdd({
		text: txtmsg,
		stay: false
		});
	}
	
	function paycheck(){
			if (document.getElementById("shopcarttotalitem").innerHTML>0)
			{
				window.location='/shopcart.asp?show=paycheck';
			}
			else
			{
				showmsg('Giỏ hàng chưa có sản phẩm nào.',400,0);
			}
	}
	
	function additemtocart(sid){
		document.getElementById("actionside").src="/shopcart.asp?act=additemtocart&id="+sid;
	}
