// 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 
$(function(){
Cufon.replace('.title_left_right,.title_center,.dn,.gt_title_left_right,.title_center_1,.title_center_btec,.title_left_right_btec,.title_center_sunderland,.title_left_right_sunderland,.title_center_towson,.title_left_right_towson,.title_center_stirling,.title_left_right_stirling,.title_center_teg,.title_left_right_teg,.title_center_2,.title_tim_hieu,.title_center_ts,.title_center_3', { fontFamily: 'Tahoma', hover: true });
Cufon.replace('', { fontFamily: 'HP-Hai Au'});
});
//đã được load hoàn tất. 
jQuery(window).load(function(){ 
 
    //$('div.menu_body').css({"display":"block"});
	//EqualHeight(jQuery(".tgp_container .tgp_body .tgp_left .tgp_video , .tgp_container .tgp_body .tgp_right .tgp_content")); 
    //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_container .tgp_body .tgp_left .tgp_video , .tgp_container .tgp_body .tgp_right .tgp_content"));
    });
	
	//if (document.getElementById("global_act").value == "home")
//	{
//	$(".tgp_wrapper_bottom").css({'background':'url(/images/wrapper_bottom_2.gif) repeat-x left 490px'});
//	$(".tgp_container .tgp_body .tgp_right .tgp_content").css({'background':'none'});
//	}
});


//
$(document).ready(function()
{		
	//video gioi thieu ve truong
	$('.pane1').jScrollPane();
	
	swfobject.embedSWF("/images/mediaplayer.swf", "video", "460", "300", "9.0.0", "/images/expressInstall.swf", {
		file : '/uploads/image/video_gioi_thieu_truong.flv',
		image : '/images/thumb.jpg',
		width : 460,
		height : 300
	}, {
		wmode : 'opaque',
		allowfullscreen : 'true',
		allowscriptaccess : 'always'
	});
	
	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
	$("#firstpane p.menu_head").click(function()
    {
		$(this).css({backgroundImage:"url(/images/bg_giangvien_click.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
       	$(this).siblings().css({backgroundImage:"url(/images/bg_giangvien.png)"});

	});
	//slides the element with class "menu_body" when mouse is over the paragraph
	$("#secondpane p.menu_head").mouseover(function()
    {
	     $(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
         $(this).siblings().css({backgroundImage:"url(left.png)"});
	});
	//video
	$('ul.sf-menu').superfish(); 
	
		$("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>';
		}
		});
		
		
		$("a[rel=example_group1]").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>';
		}
		});
		
		
		$("a[rel=example_group2]").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>';
		}
		});
		
		$("a[rel=example_group3]").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>';
		}
		});
		$("a[rel=example_group4]").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>';
		}
		});
		$("a[rel=example_group5]").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>';
		}
		});
		$("a[rel=example_group6]").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>';
		}
		});
		$("a[rel=example_group7]").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>';
		}
		});
		$("a[rel=example_group8]").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>';
		}
		});
		$("a[rel=example_group9]").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>';
		}
		});
		$("a[rel=example_group10]").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>';
		}
		});
		

	
});

