// 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(){ 

 

    EqualHeight(jQuery(".tgp_body_content, .tgp_right")); 

 

    //Tự động điều chỉnh lại chiều cao sau khi 

    //resize browser. Nếu không quan tâm đến việc 

    //resize browser, bạn có thể gỡ bỏ hàm này 

    jQuery(window).resize(function(){ 

        EqualHeight(jQuery(".tgp_body_content, .tgp_right")); 

    }); 

}); 

//Xu ly tabs menu

$(document).ready(function() {

	$('a.tabs').click(function(){

		$('.active').removeClass('active');

		$(this).addClass('active');

		$('.content_new').slideUp();

		var content_show = $(this).attr('title');

		$('#'+ content_show).slideDown();

		

	});

});

$(document).ready(function() {

	$('a.tab').click(function(){

		$('.active').removeClass('active');

		$(this).addClass('active');

		$('.content_news').slideUp();

		var content_show = $(this).attr('title');

		$('#'+ content_show).slideDown();

		

	});

});



//xu ly left menu

jQuery(function(){

	jQuery('ul#linhkien').superfish();
	jQuery('ul#notebooks').superfish();
	jQuery('ul#thietbi').superfish();

});

$(function(){

Cufon.replace('fehftitle', {color:'-linear-gradient(#000, #717171)'});

});


