

	function displayInfo(info)
{
	if (info == 'weather')
		showDialog('http://www3.tuoitre.com.vn/transweb/rams.htm', 492, 659);
	if (info == 'forex')
		showDialog('http://www3.tuoitre.com.vn/transweb/tygia.htm', 460, 432);
	if (info == 'gold')
		showDialog('http://www3.tuoitre.com.vn/transweb/giavang.htm', 450, 220);
	if (info == 'tvguide')
		showWindow('http://www3.tuoitre.com.vn/transweb/truyenhinh.htm', false, false, true, false, false, false, true, true, 450, 354, 0, 0);
	if (info == 'lottery')
		showWindow('http://www3.tuoitre.com.vn/Transweb/XoSo.html', false, false, true, false, false, false, true, true, 450, 600, 0, 0);
		//showDialog('http://www3.tuoitre.com.vn/transweb/xoso.htm', 600, 346);
		//showDialog('http://www.xsktcantho.com.vn/xsktcantho.asp', 1024, 1350);
	if (info == 'stock')
		showWindow('http://www3.tuoitre.com.vn/transweb/chungkhoan.htm', false, false, true, false, false, false, true, true, 770, 750);
}
function showDialog(url, width, height)
{
	return showWindow(url, false, false, false, false, false, false, true, true, width, height, 0, 0);
}
function showWindow(url, isStatus, isResizeable, isScrollbars, isToolbar, isLocation, isFullscreen, isTitlebar, isCentered, width, height, top, left)
{
	if (isCentered)
	{
		top = (screen.height - height) / 2;
		left = (screen.width - width) / 2;
	}

	open(url, '_blank', 'status=' + (isStatus ? 'yes' : 'no') + ','
	+ 'resizable=' + (isResizeable ? 'yes' : 'no') + ','
	+ 'scrollbars=' + (isScrollbars ? 'yes' : 'no') + ','
	+ 'toolbar=' + (isToolbar ? 'yes' : 'no') + ','
	+ 'location=' + (isLocation ? 'yes' : 'no') + ','
	+ 'fullscreen=' + (isFullscreen ? 'yes' : 'no') + ','
	+ 'titlebar=' + (isTitlebar ? 'yes' : 'no') + ','
	+ 'height=' + height + ',' + 'width=' + width + ','
	+ 'top=' + top + ',' + 'left=' + left);
}

	function send_dathang(id,lang)
	{
		o_name=document.frm_Dathang.contact_name.value;
		o_address=document.frm_Dathang.contact_address.value;
		o_telephone=document.frm_Dathang.contact_telephone.value;
		o_email=document.frm_Dathang.contact_email.value;
		o_content=document.frm_Dathang.contact_content.value;
		xajax_send_order(o_name,o_address,o_telephone,o_email,o_content,id,lang)
			
	}
	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_dathang()
	{
		if(document.frmDathang.txt_fullname.value == "")
		{
			alert('Vui long nhap ho ten vao !');
			document.frmDathang.txt_fullname.focus();
			return false;
		}
		if(document.frmDathang.txt_email.value == "")
		{
			alert('Vui long nhap dia chi email vao !');
			document.frmDathang.txt_email.focus();
			return false;
		}
		if(document.frmDathang.txt_content.value == "")
		{
			alert('Vui long nhap noi dung vao !');
			document.frmDathang.txt_content.focus();
			return false;
		}
		
		return true;
		
	}
	function check_frm_contact()
	{
		if(document.frmContact.contact_name.value=="")
		{
			alert("Vui long dien ho ten vao !");
			document.frmContact.contact_name.focus();
			return false;
		}
	
		if(document.frmContact.contact_email.value=="")
		{
			alert("Vui long dien dia chi email vao !");
			document.frmContact.contact_email.focus();
			return false;
		}
		
		if(document.frmContact.contact_detail.value=="")
		{
			alert("Vui long dien noi dung vao !");
			document.frmContact.contact_detail.focus();
			return false;	
		}
		return true;
	}
	
	
	function check_frm_faq()
	{
		if(document.frmFaq.user_name.value=="")
		{
			alert("Vui long dien ho ten !");
			document.frmFaq.user_name.focus();
			return false;	
		}
		if(document.frmFaq.user_email.value=="")
		{
			alert("Vui long dien email vao !");
			document.frmFaq.user_email.focus();
			return false;
		}
		else
		{
			if(!checkemail(document.frmFaq.user_email.value))
			{
				alert("Vui long nhap dia chi email dung vao !");
				document.frmFaq.user_email.focus();
				return false;	
			}
		}
		if(document.frmFaq.user_content.value=="")
		{
			alert("Vui long nhap noi dung cau hoi !");
			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);	
		
	}