
$(document).ready(function(){
	//ie6/iphone/ipad fix
	if($("html").hasClass("ie6") || $("html").hasClass("iphone") | $("html").hasClass("webkit")){
		$("#footer .sites").bind("mouseover",function(){
			$(".drop",$(this)).show();
		}).bind("mouseleave",function(){
			$(".drop",$(this)).hide();
		});
	}
	if($("html").hasClass("ie7")){
		var zIndexNumber = 1000;
		$('div').each(function() {
			var elm = $(this);
			if(!elm.parents('#mainbanner').length){
				elm.css('zIndex', zIndexNumber);
				zIndexNumber -= 10;
			}
		});
		
		$("#footer .sites").bind("mouseover",function(){
			var elm = $(this);
			$(".drop",elm).show();
			$("span",elm).css("zIndex","9990");
			$("#footer").css("zIndex","9000");
		}).bind("mouseleave",function(){
			var elm = $(this);
			$(".drop",elm).hide();
			$("span",elm).css("zIndex","100");
			$("#footer").css("zIndex","10");
		});
		
		$(".btleft").css("zIndex",6000);
		$(".btright").css("zIndex",6000);		
	}
	
	//select box init
	$(".selectdd").msDropDown({mainCSS:'dd2'});
	$(".ddChild").each(function(){
		var elm = $(this);
		//remove title option
		$("a:first",elm).hide();
		var h = elm.height();
		elm.prepend("<div class='top'><\/div><div class='middle'><\/div>");
		$(".middle",elm).css("height",h);
		h = h + 23;h = h+"px";
		elm.css("height",h);
		elm.append("<div class='bottom'><\/div>");
		$(".ddTitle").css("z-index",1010);
	});
	
	$("#header .menu ul li").bind("mouseover",function(){
		var elm = $(this);
		elm.addClass("active");
		$(".bigsubmenu",elm).slideDown();
	}).bind("mouseleave",function(){
		var elm = $(this);
		elm.removeClass("active");
		$(".bigsubmenu",elm).stop(true,true).hide();
	});	
	
	//input search animation
	$(".search input.text")
	.bind("focus",function(){
		$(this).css("color","#fff").css("font-style","normal"); //.css("font-family","Arial")
	}).bind("blur",function(){
		$(this).css("color","#d7d7d7").css("font-style","italic");//.css("font-family","Georgia")
	});
});
