// JavaScript Document
<!--
var arrayID		= Array("li_tab_","a_tab_","span_tab_");
var arrayClass	= Array("bg_tab_select","left_tab_select","right_tab_select");
function change_tab(id_tab, num_data, arrId, arrClass, id_show, id_data){
	for(i=0; i<num_data; i++){
		for(j=0; j<arrId.length; j++){
			document.getElementById(arrId[j] + i).className = "";
		}
	}
	for(i=0; i<arrId.length; i++){
		document.getElementById(arrId[i] + id_tab).className = arrClass[i];
	}
	if(id_show != "" && id_data != ""){
		document.getElementById(id_show).innerHTML = document.getElementById(id_data).innerHTML;
	}
}

<!-- Function save cookie -->
function save_cookie(cookie_name, cookie_value){
	document.cookie = cookie_name + "=" + cookie_value;
}

function change_picture(id, src){
	ob		= document.getElementById(id);
	ob.src= src;
}
function change_picture_link(id, arrLink){
	ob			= document.getElementById(id);
	ob.title	= arrLink[0];
	ob.href	= arrLink[1];
}

function get_checkbox(name){
	frm	= frmSearch;
	url	= "";
	list_id	= "";
	for(i=0; i<50; i++){
		eval("ob	= frm." + name + "_" + i + ";");
		if(!ob) break;
		if(ob.checked == true) list_id = list_id + ob.value + ",";
	}
	if(list_id != ""){
		list_id	= list_id.substr(0, (list_id.length - 1));
		url = "&" + name + "=" + list_id;
	}
	return url;
}

function generate_star(star, id){
	max_star		= 5;
	strReturn	= "";
	star			= star/2;
	star			= parseFloat(star);
	intStar		= parseInt(star);
	//Kiểm tra sai số
	if (intStar < 0) { intStar = 0; star = 0; }
	if (intStar > max_star) { intStar = max_star; star = max_star; }
	//Ghi star xịn ra
	for (i=1;i<=intStar;i++) strReturn = strReturn + '<img align="absmiddle" border="0" src="' + con_root_path + 'images/star_1.gif" />';
	//Neu intStar!=star thi them 0,5 vao va cong intStar them 1
	if (intStar!=star){ strReturn = strReturn + '<img align="absmiddle" border="0" src="' + con_root_path + 'images/star_2.gif" />'; intStar++;}
	//ghi ra so sao = 0 con lai 
	for (i=intStar+1;i<=max_star;i++) strReturn = strReturn + '<img align="absmiddle" border="0" src="' + con_root_path + 'images/star_0.gif" />';
	if(id != "") document.getElementById(id).innerHTML	= strReturn + ' <span class="star">(' + star*2 + ')</span>';
	else document.write(strReturn + ' <span class="star">(' + star*2 + ')</span>');
}

function remove_loading(id){
	ob	= document.getElementById(id);
	ob.style.display	= "none";
}

function countDown(object, url){
	var count = parseInt(document.getElementById(object).innerHTML);
	if(count > 0){
		document.getElementById(object).innerHTML = count - 1; 
		window.setTimeout("countDown('" + object + "', '" + url + "')", 1000);
	}
	else{
		window.location.href = url;
	}
}

function print_page(module, id){
	url = con_root_path + "home/print.html;module=" + module + "&iData=" + id;
	window.open(url, "", "height=630,width=656,menubar=0,resizable=1,scrollbars=1,statusbar=0,titlebar=0,toolbar=0");
}

function sendmail(url){
	window.open(con_root_path + "home/sendmail.html;url=" + encodeURI(url), "","width=468,height=450,menubar=0,resizable=1,scrollbars=0,statusbar=0,titlebar=0,toolbar=0");
}

function more_picture(module, type, temp){
	url = (type == "add") ? "more_picture.html;module=" + module + "&type=add&temp=" + temp : "more_picture.html;module=" + module + "&type=edit&temp_id=" + temp;
	url = con_root_path + "home/" + url;
	window.open(url, "", "width=700,height=600,menubar=0,resizable=1,scrollbars=1,statusbar=0,titlebar=0,toolbar=0");
}

function save_cookie(cookie_name, cookie_value){
	document.cookie = cookie_name + "=" + cookie_value;
}

function isemail(email) {
	var re = /^(\w|[^_]\.[^_]|[\-])+(([^_])(\@){1}([^_]))(([a-z]|[\d]|[_]|[\-])+|([^_]\.[^_]) *)+\.[a-z]{2,3}$/i;
	return re.test(email);
}

function news_source(id){
	var source = null;
	switch(id){
		case 1: source = "24h.com.vn"; break;
		case 2: source = "BongDa.com.vn"; break;
		case 3: source = "BongDaSo.com"; break;
		case 4: source = "CAND.com.vn"; break;
		case 5: source = "TheThao.DanTri.com.vn"; break;
		case 6: source = "DanTri.com.vn"; break;
		case 7: source = "DoThi.net"; break;
		case 8: source = "GiaDinh.net.vn"; break;
		case 9: source = "NgoiSao.net"; break;
		case 10:source = "TheThao.VietNamNet.vn"; break;
		case 11:source = "NLD.com.vn"; break;
		case 12:source = "SoHoa.net"; break;
		case 13:source = "ThanhNien.com.vn"; break;
		case 14:source = "TienPhong.vn"; break;
		case 15:source = "TimNhanh.com"; break;
		case 16:source = "TinTucOnline.com"; break;
		case 17:source = "TuoiTre.com.vn"; break;
		case 18:source = "TheThao.VietNamNet.vn"; break;
		case 19:source = "VietNamNet.vn"; break;
		case 20:source = "vnExpress.net"; break;
		case 21:source = "vnMedia.vn"; break;
		case 22:source = "VTC.vn"; break;
		case 23:source = "Kenh14.vn"; break;
		case 24:source = "MucTim.com.vn"; break;
		case 25:source = "AutoNet.com.vn"; break;
		case 26:source = "AutoPro.ChannelVN.net"; break;
		case 27:source = "TheGioiOto.com.vn"; break;
		default:source = "";	break;
	}
	document.write("Nguồn: " + source);
}
-->