// 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);
}
/*So sanh height cua 2 the div tgp_body_content & tgp_right*/
function EqualHeight(elements) { 
    //Xác định chiều cao của cột cao nhất 
    tallest = 0; 
    elements.each(function() { 
        elementHeight = jQuery(this).height(); 
        if(elementHeight > tallest) { 
            tallest = elementHeight; 
        } 
    }); 
    //Chỉnh chiều cao cho tất cả các cột 
    //theo chiều cao của cột cao nhất 
    elements.height(tallest); 
} 
//Áp đặt chiều cao cho các cột khi trang 
//đã được load hoàn tất. 
jQuery(window).load(function(){
	/*So sanh height cua 2 the div content_page & content_right*/
	EqualHeight(jQuery(".content_page, .content_right")); 
    jQuery(window).resize(function(){ 
        EqualHeight(jQuery(".content_page, .content_right")); 
    }); 

	$('#myselectbox').selectbox();
	// Kiểm tra IE
	function isIE()
	{
	  return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
	}
	// Kiểm tra IE6
	function isIE6()
	{
		if (typeof document.body.style.maxHeight != "undefined") {
		  // IE 7, mozilla, safari, opera 9
		  return false;
		} else {
		  // IE6, older browsers
		  return true;
		}
	}
	
	// Lava Lamp menu
	$(".lavaLamp").lavaLamp({ fx: "linear", speed: 300 });
	
	// Cufon
	Cufon.replace('.content_page .title', { fontFamily: 'HP-Hai Au', color: '-linear-gradient(#c81f09, #902516)'});
	/*
	if (isIE6())
	{
		$(".tgp_container .tgp_body .content_center ul li").css("margin-left","10px");
	}else
	{
		$(".tgp_container .tgp_body .content_center ul li").css("margin-left","20px");
	}*/
	$('.content_left .slider').nivoSlider();
}); 
