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

$("a[rel=example_group]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">Hình ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
		}
		});
		
	$(function(){
	   Cufon.replace('h1.title', {fontFamily:'Tahoma',color: '-linear-gradient(#000000, #000000)'});  
	   Cufon.replace('.tgp_navigation ul li a', {fontFamily:'Tahoma',color: '-linear-gradient(#FFFFFF, #FFFFFF)'});  
	   Cufon.replace('h1.link', {fontFamily:'Tahoma',color: '-linear-gradient(#000000, #000000)'});  
	});
	//EqualHeight(jQuery(".tgp_left, .tgp_body_right_content")); 
	//if ($(".tgp_left .content").val().length < 30)
//	{
//		$(".tgp_left").height($(".tgp_body_right_content").height() - 104);
//	}
});

$(function(){
	/*PhongTX - Xu ly logo - tooltip*/

	$('.tooltip').tooltip();

});

function EqualHeight(elements) { 
    tallest = 0; 
    elements.each(function() { 
        elementHeight = jQuery(this).height(); 
        if(elementHeight > tallest) { 
            tallest = elementHeight; 
        } 
    }); 
    elements.height(tallest); 
} 
