// 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.
$(document).ready(function()
 {
    
 $(function(){ 
 		Cufon.replace('.tgp_container .intro .nav li a,.tgp_container .tgp_banner .language li a', {fontFamily:'HP-Aptima', hover: {color: '-linear-gradient(#ffffff, #ffffff)'},outline :'none',border:'none'});
        Cufon.replace('.tgp_container .tgp_left .tgp_slide a.skip, .tgp_booking .tgp_left .left_bottom .map span', {fontFamily:'HP-Aptima', hover: {color: '-linear-gradient(#ff6600, #ff6600)'},outline :'none',border:'none'});
        Cufon.replace('.tgp_container .tgp_left .tgp_slide .infor .content,.tgp_rooms .r_bottom .r_left .menu h1.title,.tgp_restaurant .r_bottom .r_left .menu h1.title,.tgp_booking .tgp_left .left_top h1.title,.tgp_rooms .r_bottom .r_right .content_right .hinhanh .bottom .price,.tgp_restaurant .r_bottom .r_right .content_right .restaurant .res h1.name_res,.tgp_container .tgp_body .tgp_slide_res .nav_res .nav h1.res,.tgp_spa .r_bottom .r_left .menu h1.title,.tgp_container .tgp_body .tgp_spa_menu .spa_1 .spa_title  h1.spa ', {fontFamily:'HP-Aptima',color: '-linear-gradient(#ffffff, #ffffff)'});
        Cufon.replace('.tgp_booking .tgp_right .tgp_inforRoom .title h1.title,.tgp_restaurant .r_bottom .r_right .content_right .restaurant .res h1.name_res span', {fontFamily:'HP-Aptima',color: '-linear-gradient(#ff995a, #ff995a)'});
        Cufon.replace('.tgp_spa .r_bottom .r_right .content_right .spa_menu .spa h1.name_spa a', {fontFamily:'HP-Aptima', hover: {color: '-linear-gradient(#ff995a, #ff995a)'},outline :'none',border:'none'});
 	});

     $("#menu li.book ").hover(function(){
			$(this).css({background: "url(/images/book_hover.png) no-repeat"});
	},function(){
			$(this).css({background: "url(/images/nav_booking.png) no-repeat"});
	});
     $("#menu li.room ").hover(function(){
			$(this).css({background: "url(/images/room_hover.png) no-repeat"});
	},function(){
			$(this).css({background: "url(/images/nav_rooms.png) no-repeat"});
	});
    $("#menu li.res ").hover(function(){
			$(this).css({background: "url(/images/res_hover.png) no-repeat"});
	},function(){
			$(this).css({background: "url(/images/nav_res.png) no-repeat"});
	});
    $("#menu li.spa ").hover(function(){
			$(this).css({background: "url(/images/spa_hover.png) no-repeat"});
	},function(){
			$(this).css({background: "url(/images/nav_spa.png) no-repeat"});
	});
     $("#menu li.exc ").hover(function(){
			$(this).css({background: "url(/images/exc_hover.png) no-repeat"});
	},function(){
			$(this).css({background: "url(/images/nav_exc.png) no-repeat"});
	});
    $("#menu li.rec ").hover(function(){
			$(this).css({background: "url(/images/rec_hover.png) no-repeat"});
	},function(){
			$(this).css({background: "url(/images/nav_rec.png) no-repeat"});
	});
     $("#menu li.mic ").hover(function(){
			$(this).css({background: "url(/images/mic_hover.png) no-repeat"});
	},function(){
			$(this).css({background: "url(/images/nav_mic.png) no-repeat"});
	});
     $("#menu li.vilas ").hover(function(){
			$(this).css({background: "url(/images/vilas_hover.png) no-repeat"});
	},function(){
			$(this).css({background: "url(/images/nav_vilas.png) no-repeat"});
	});
     //restaurant 
/*     jQuery(".list_res li.champa a").click(
        function () {
            $(this).addClass("active");
             $(jQuery(".list_res li.namdinh a")).removeClass("active");
            $(jQuery(".list_res li.wave a")).removeClass("active");
            jQuery(".move_div_champa").animate({
                  opacity:"show"
              },2000);
              jQuery(".move_div_champa2").animate({
                  opacity:"show"
              },2000);
              jQuery(".move_div_namdinh").animate({
                  opacity:"hide"
              },2000);
              jQuery(".move_div_namdinh2").animate({
                  opacity:"hide"
              },2000);
               jQuery(".move_div_wave").animate({
                  opacity:"hide"
              },2000);
              jQuery(".move_div_wave2").animate({
                  opacity:"hide"
              },2000);
          }
	);
       jQuery(".list_res li.namdinh a").click(
       function () {
            $(this).addClass("active");
            $(jQuery(".list_res li.champa a")).removeClass("active");
            $(jQuery(".list_res li.wave a")).removeClass("active");
           jQuery(".move_div_namdinh").animate({
                 opacity:"show"
             },2000);
             jQuery(".move_div_namdinh2").animate({
                 opacity:"show"
             },2000);
             jQuery(".move_div_wave").animate({
                 opacity:"hide"
             },2000);
             jQuery(".move_div_wave2").animate({
                 opacity:"hide"
             },2000);
             jQuery(".move_div_champa").animate({
                 opacity:"hide"
             },2000);
             jQuery(".move_div_champa2").animate({
                 opacity:"hide"
             },2000);
          }
       );
       jQuery(".list_res li.wave a").click(
       function () {
            $(this).addClass("active");
            $(jQuery(".list_res li.champa a")).removeClass("active");
            $(jQuery(".list_res li.namdinh a")).removeClass("active");
           jQuery(".move_div_wave").animate({
                 opacity:"show"
             },2000);
             jQuery(".move_div_wave2").animate({
                 opacity:"show"
             },2000);
             jQuery(".move_div_champa").animate({
                 opacity:"hide"
             },2000);
             jQuery(".move_div_champa2").animate({
                 opacity:"hide"
             },2000);
             jQuery(".move_div_namdinh").animate({
                 opacity:"hide"
             },2000);
             jQuery(".move_div_namdinh2").animate({
                 opacity:"hide"
             },2000);
          }
       ); */
		$('#txtAr_date').datepicker({
			changeMonth:true,
			changeYear:true,
			dateFormat:'dd.mm.yy'							
		});
		$('#to_calendar').click(function(){		
			$('#txtAr_date').focus();
		});	
		
		$('#txtLe_date').datepicker({
			changeMonth:true,
			changeYear:true,
			dateFormat:'dd.mm.yy'							
		});
		$('#from_calendar').click(function(){		
			$('#txtLe_date').focus();
		});	
		
		$("#booking").jqTransform();

		
		

 });
