// 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);
}
jQuery(window).load(function(){

// Kiểm tra IE
function isIE()
{
return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}

// Đặt tọa độ cho biểu tượng loading
$(".loading").fadeIn();
$(".loading_status").css("top","50%");
$(".loading_status").css("left","45%");
$(document).ready(function(){					   
	$(function(){
		$("#select-wrapper").jqTransform();
		});
		function formatText(index, panel) {
		return index + "";
	}
	$(function() { $(".san_pham_xem .menu").lavaLamp({ fx: "backout", speed: 700 })});					   
	$(".tgp_menu .menu .main_li .company_overview").hover(function(){
		$(".sub_news").hide();
		$(this).siblings(".sub_news").fadeOut();
		$(this).siblings(".sub").fadeOut();	
		$(".sub_product").hide();
		$(this).siblings(".sub_product").fadeOut();	
		$(".sub_ho_tro").hide();
		$(this).siblings(".sub_ho_tro").fadeOut();
		$(".sub_services").hide();
		$(this).siblings(".sub_services").fadeOut();
		$(".sub").hide();																   
		$(this).siblings(".sub").fadeIn();																   													   
	});
	$(".tgp_menu .menu .main_li .news").hover(function(){	
		$(".sub").hide();
		$(this).siblings(".sub").fadeOut();	
		$(".sub_product").hide();
		$(this).siblings(".sub_product").fadeOut();	
		$(".sub_ho_tro").hide();
		$(this).siblings(".sub_ho_tro").fadeOut();
		$(".sub_services").hide();
		$(this).siblings(".sub_services").fadeOut();
		$(".sub_news").hide();
		$(this).siblings(".sub_news").fadeIn();
	});
	$(".tgp_menu .menu .main_li .services").hover(function(){	
		$(".sub").hide();
		$(this).siblings(".sub").fadeOut();	
		$(".sub_product").hide();
		$(this).siblings(".sub_product").fadeOut();	
		$(".sub_ho_tro").hide();
		$(this).siblings(".sub_ho_tro").fadeOut();
		$(".sub_news").hide();
		$(this).siblings(".sub_news").fadeOut();
		$(".sub_services").hide();
		$(this).siblings(".sub_services").fadeIn();
	});
	$(".tgp_menu .menu .main_li .product").hover(function(){	
		$(".sub").hide();
		$(this).siblings(".sub").fadeOut();	
		$(".sub_news").hide();
		$(this).siblings(".sub_news").fadeOut();
		$(".sub_services").hide();
		$(this).siblings(".sub_services").fadeOut();
		$(".sub_ho_tro").hide();
		$(this).siblings(".sub_ho_tro").fadeOut();
		$(".sub_product").hide();
		$(this).siblings(".sub_product").fadeIn();
	});
	$("#1").hover(function(){	
		$(".sub").hide();
		$(this).siblings(".sub").fadeOut();	
		$(".sub_news").hide();
		$(this).siblings(".sub_news").fadeOut();
		$(".sub_services").hide();
		$(this).siblings(".sub_services").fadeOut();
		$(".sub_ho_tro").hide();
		$(this).siblings(".sub_ho_tro").fadeOut();
		$(".sub_product").css({
				background:'url(/images/bg_menu_hover_xe_du_lich.png) no-repeat'
		});
	});
	$("#2").hover(function(){	
		$(".sub").hide();
		$(this).siblings(".sub").fadeOut();	
		$(".sub_news").hide();
		$(this).siblings(".sub_news").fadeOut();
		$(".sub_services").hide();
		$(this).siblings(".sub_services").fadeOut();
		$(".sub_ho_tro").hide();
		$(this).siblings(".sub_ho_tro").fadeOut();
		$(".sub_product").css({
				background:'url(/images/bg_menu_hover_xe_chuyen_dung.png) no-repeat '
		});
	});
	$(".tgp_menu .menu .main_li .ho_tro").hover(function(){	
		$(".sub").hide();
		$(this).siblings(".sub").fadeOut();	
		$(".sub_news").hide();
		$(this).siblings(".sub_news").fadeOut();
		$(".sub_services").hide();
		$(this).siblings(".sub_services").fadeOut();
		$(".sub_product").hide();
		$(this).siblings(".sub_product").fadeOut();		
		$(".sub_ho_tro").hide();
		$(this).siblings(".sub_ho_tro").fadeIn();
	});
	$(".tgp_slider,.tgp_body,.tgp_menu .menu .main_li .main, .menu_contacts, .logo").hover(function(){
	
		$(".sub").hide();
		$(this).siblings(".sub").fadeOut();
		$(".sub_news").hide();
		$(this).siblings(".sub_news").fadeOut();
		$(".sub_services").hide();
		$(this).siblings(".sub_services").fadeOut();
		$(".sub_product").hide();
		$(this).siblings(".sub_product").fadeOut();
		$(".sub_ho_tro").hide();
		$(this).siblings(".sub_ho_tro").fadeOut();
	});
	$("a.menu_xe,a.menu_xe_2").hover(function(){													   
		$(this).find("h1.ten_xe").css({display:'block'});																   													   
	},
	function (){
		$(this).find("h1.ten_xe").stop().css({display:'none'});
	});
	$('#photos').galleryView({
			panel_width: 960,
			panel_height: 370,
			transition_speed: 1500,
			transition_interval: 5000,
			nav_theme: 'dark',
			border: 'none',
			pause_on_hover: true
		});
	 Cufon.replace('h1.title', {color: '-linear-gradient(#7c8187,#40464b)'});
	 Cufon.replace('h1.ten_xe', {color: '-linear-gradient(#ccc,#fff)'});
	 Cufon.replace('h1.title_loai_xe', {color: '-linear-gradient(#ccc,#fff)'});	 
	 Cufon.replace('h2.title', {color: '-linear-gradient(#282d32,#282d32)'});
	 Cufon.replace('.san_pham_xem .thong_so h2.title,.san_pham_xem .gallery h2.title', {color: '-linear-gradient(#465271,#465271)'});
	 $(".loading").fadeOut();
		if (isIE())
		{
		$("html").css("overflow","auto");
		$("html body").css("overflow","hidden");
		}
});
});
