// JavaScript Document
function on_pageload(){
	tMonthlyHandler = createCustomHandler();
	get_topMonthly();
}
function get_topMonthly(){
	if(tMonthlyHandler){
		var r = Math.floor(Math.random()*20000);
		tMonthlyHandler.open("GET","tMonthly.php?id="+loadOn+"&ref="+r);
		tMonthlyHandler.onreadystatechange = tMonthlyChange;
		tMonthlyHandler.send(null);
	}
}

function tMonthlyChange(){
	var tBlock = document.getElementById("tMonthlyBlock");
	if(tMonthlyHandler.readyState == 4 && tMonthlyHandler.status == 200){
		tBlock.innerHTML = tMonthlyHandler.responseText;
	}
}

function on_tPagesCombobox_change(){
	var p = $("#tPagesCombobox").val();
	responseToPage(p);
}
function responseToPage(p){
	document.location.href = 'products.php?page='+p+"&cat="+$("#tCurrentGroup").val()+"&subcat="+$("#tCurrentSubgroup").val()+"&service="+$("#tCurrentService").val();	
}
function on_item_selected(id){
	//document.location.href = 'view.php?id='+id;	
	window.open('../view.php?id='+id);
    //window.open(id+".html");
}
function on_maingrid_loadsubgroup(s){
	document.location.href = "products.php?cat="+$("#tCurrentGroup").val()+"&subcat="+s;
}
function on_maingrid_loadservice(s){
	document.location.href = "products.php?cat="+$("#tCurrentGroup").val()+"&subcat="+$("#tCurrentSubgroup").val()+"&service="+s;
}



