// AJAX INIT
function $$$(id) {
	return document.getElementById(id);
}
function khoitao_ajax()
{
	var x;
	try 
	{
		x	=	new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
    	try 
		{
			x	=	new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(f) { x	=	null; }
  	}
	if	((!x)&&(typeof XMLHttpRequest!="undefined"))
	{
		x=new XMLHttpRequest();
  	}
	return  x;
}
function	Forward(url)
{
	window.location.href = url;
}
function	_postback()
{
	return void(1);
}
$(document).ready(function()
{
$(function(){
Cufon.replace('.tgp_container .tgp_body .tgp_right .sologan span ', {fontFamily:'HP-Hai Au',color: '-linear-gradient(#FFFFFF, #FFFFFF)',textShadow: '0px 0px 1px #FFF'});  
Cufon.replace('.tgp_container .tgp_body .tgp_left h1.title,.tgp_container .tgp_body .tgp_right .hot_news .box_content .title,.tgp_container .tgp_body .tgp_right .tgp_bottom .title,.tgp_container .tgp_body .tgp_right .content_right .title_news ', {fontFamily:'HP-Hai Au',color: '-linear-gradient(#006600, #006600)',textShadow: '0px 0px 1px #FFF'}); 
Cufon.replace('.menu ul#topnav li a.nav_text.active,.tgp_container .tgp_body .tgp_right .right_title', {fontFamily:'HP-Hai Au',color: '-linear-gradient(#006600, #006600)',textShadow: '0px 0px 1px #FFF'}); 
});
/*So sanh height cua 2 the div tgp_body_content & tgp_right*/
function EqualHeight(elements) { 
    tallest = 0; 
    elements.each(function() { 
        elementHeight = jQuery(this).height(); 
        if(elementHeight > tallest) { 
            tallest = elementHeight; 
        } 
    }); 
    elements.height(tallest); 
} 
jQuery(window).load(function(){ 
							 
    //EqualHeight(jQuery(".tgp_body_content, .tgp_right")); 
    jQuery(window).resize(function(){ 
       // EqualHeight(jQuery(".tgp_body_content, .tgp_right")); 
    }); 
	

});
});
//cuongnt
$(document).ready(function() {
    $("ul#topnav li").hover(function() { //sự kiện khi đưa chuột vào menu
        //$(this).css({ 'background' : '#FFFFFF'}); //Add background color and image on hovered list item
        $(this).find("span").show(); //hiễn thị menu cấp 2
		$(this).addClass('cuong');
    } , function() { //on hover out...
        //$(this).css({ 'background' : 'none'}); 
        $(this).find("span").hide(); //ẩn menu cấp 2
		$(this).removeClass('cuong');
    });
	//xu ly active
	var curr_act = $("#get_act").val();
	if(curr_act == "home")
	{
		$('ul#topnav li.active a').addClass('active');
	}
	if(curr_act == "gioi_thieu")
	{
		$('ul#topnav li.active a').addClass('active');
	}
	if(curr_act == "san_pham")
	{
		$('ul#topnav li.active a').addClass('active');
	}
	if(curr_act == "tu_van")
	{
		$('ul#topnav li.active a').addClass('active');
	}
	if(curr_act == "tin_tuc")
	{
		$('ul#topnav li.active a').addClass('active');
	}
	if(curr_act == "tuyen_dung")
	{
		$('ul#topnav li.active a').addClass('active');
	}
	if(curr_act == "hinh_anh")
	{
		$('ul#topnav li.active a').addClass('active');
	}
	if(curr_act == "lien_he")
	{
		$('ul#topnav li.active a').addClass('active');
	}
});


