// JavaScript Document
var ROOT_PATH = 'http://localhost:88/';

function bookmarksite(title, url)
{
    if (document.all)
        window.external.AddFavorite(url, title);
    else if (window.sidebar)
        window.sidebar.addPanel(title, url, "")
}

function dateVN(){
	<!--
	// current date - from http://rainbow.arch.scriptmania.com/scripts
	// Array of day names
	var dayNames = new Array("Chủ nhật","Thứ 2","Thứ 3","Thứ 4","Thứ 5","Thứ 6","Thứ 7");
	
	var monthNames = new Array("tháng 1","tháng 2","tháng 3","tháng 4","tháng 5","tháng 6","tháng 7",
							   "tháng 8","tháng 9","tháng 10","tháng 11","tháng 12");
	
	var dt = new Date();
	var y  = dt.getYear();
	
	// Y2K compliant
	if (y < 1000) y +=1900;
	
	document.write("Hôm nay: " + dayNames[dt.getDay()] + " - Ngày " + dt.getDate() + " " + monthNames[dt.getMonth()] + " - " + y);
	// -->
	}
	
	
	function chuyentrang(lstpage){
		str="/admin/projects.html?page=" + lstpage.value;
		window.location.href=str;
	}
	
	function view_items_by_cate(obj,lstpage){
		str="/admin/"+obj+"/" + lstpage.value;
		window.location.href=str;
	}
	
	function openupimg_win(url){
		window.open(url,'upimg','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=120')
	}
		
	function submit_selc_search(id,title){
		//alert(ROOT_PATH + 'products/' + id);
		document.getElementById('root_6').innerHTML = title;
		document.getElementById('hidden_field').value = id;
		$("#root_6").addClass("nav text");
		$("#sub_6").hide();
		$("#root_6").load('products/' + id, function() {
	   	Cufon.replace('.text'		,{fontFamily: 'Aliat' });
		});
	}

	function verify_logout()
	{
		var ok = confirm("Are you sure to log out ?");
		if (ok == true)
			return true;
		else
			return false;
	}
	
	
	function confirm_delete()
	{
		var ok = confirm("Are you sure to delete this item ?");
		if (ok == true)
			return true;
		else
			return false;
	}
	
	function validate_user(f){
		if (f.txt_cfrnewpass.value  != f.txt_newpass.value){
			alert ( "Password not match !" );
			f.txt_newpass.value = "";
			f.txt_cfrnewpass.value = "";
			return false;
		}
		if ( f.slc_category.selectedIndex == 0 )
		{
			alert ( "You must select a group !" );
			return false;
		}
	}
	
	function underconstruct() {
	  alert('This function is under construction !');
	}
	
	function showDropDownCate(){	
		$("#sub_6").toggle();
	}
	
	function getSubcategories(){
		var idcategory = document.getElementById("c").value;
		//alert(idcategory);
		$.get('http://aliat.vn/admin/getsubcategories/' + idcategory,	function(result){callbackSubcategories(result);});
	}
	
	function callbackSubcategories(result){
		//alert('xxx');
		$("#sc").html(result);
	}
