﻿// JavaScript Document
function cate_over(theTD){	
	theTD.style.backgroundColor = '#fff0e1';
}
function cate_out(theTD){	
	theTD.style.backgroundColor = '#336699';
}
function publish_over(theTD){	
	theTD.style.backgroundColor = '#fff0e1';
}
function publish_out(theTD){	
	theTD.style.backgroundColor = '#8095B3';
}
function onlyNumber(){
	if((event.keyCode<48)||(event.keyCode>57))
	event.returnValue=false;
}
function cart_update(action){
		var frm = document.frmShoppingCart;						
		frm.act.value = action;
		frm.submit();
}

function cart_add(frm_name){
		var frm = eval('document.'+frm_name);		
		frm.submit();
}
function tS(){
	x=new Date(); 
	x.setTime(x.getTime()); 
	return x; 
} 
function lZ(x){ return (x>9)?x:'0'+x; }
function tH(x){ ap=(x>11)?' PM':' AM'; if(x==0){ x=12; } return (x>12)?x-=12:x; } 
function fY(x){ return (x<500)?x+1900:x; } 
function dT(){ if(fr==0){ fr=1; document.write('<style="font-size: 8pt; font-family: Tahoma"><span id="tP">'+eval(oT)+'</span></font>'); } tP.innerText=eval(oT); setTimeout('dT()',1000); } 
var dN=new Array('Chủ nhật','Thứ hai','Thứ ba','Thứ tư','Thứ năm','Thứ sáu','Thứ bẩy'),mN=new Array('1','2','3','4','5','6','7','8','9','10','11','12'),ap,fr=0,oT="dN[tS().getDay()]+' - '+tS().getDate()+'/'+mN[tS().getMonth()]+'/'+fY(tS().getYear())+' '+'-'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+ap";

function doFormIndex(){	
	//var whereId = document.frmIndex.where_id.options[document.frm_main.where_id.selectedIndex].value;
	//var catId = document.frmIndex.cat_id.value;
	//var sel = document.frmIndex.sel.value;	
	//var title = document.frmIndex.hidden_onchange.value;
	document.frmIndex.submit();
}
function Search_Help() {
	message = '--------------------   HƯỚNG DẪN TÌM KIẾM   --------------------\n\n- Ví dụ: Tìm từ Nokia 8800\n- Bạn gõ từ Nokia 8800\n- Tất cả các bản tin có từ Nokia 8800 sẽ xuất hiện\n- Để xem chi tiết về tìm kiếm xin vui lòng nhấp vào "Hỏi đáp" từ menu chính';
	alert(message);
}
function checkKey(str) {
	var textVal = str.value;	
	if (textVal == '') {
		alert("Vui lòng nhập vào nội dung tìm kiếm");
		str.focus();
		return false;
	}
	return true;
}
function popup(p,w,h){
	var left = (screen.availWidth/2) - (w/2);
	var top = (screen.availHeight/2) - (h/2);
	var win = window.open(p,'Open','width='+w+',height='+h+',scrollbars=no,status=0, left='+left+', top='+top);
	win.focus();
}

function run_film(wURL,wTitle,wFeature){
	mywin=window.open(wURL,wTitle,wFeature);
}

function ghilai(){
	document.execCommand("SaveAs");					
}
function lang() {
	alert("Comming soon !");	
	return;
}
