﻿$(function(){
//导航下拉
if($.browser.msie&&$.browser.version==6){
$('#hd-nav>li>a').hover(function(){$(this).next('div').show().append('<iframe id="selectMask" style="width:100%;position:absolute;top:5px;left:0;z-index:-1;" frameborder="0"></iframe>');$('#selectMask').height($(this).next('div').height()-5);},function(){$(this).next('div').hide().find('iframe').remove();});
$('#hd-nav>li>a').next('div').hover(function(){$(this).show().append('<iframe id="selectMask" style="width:100%;position:absolute;top:5px;left:0;z-index:-1;" frameborder="0"></iframe>');$('#selectMask').height($(this).height()-5);$(this).prev('a').addClass('cur');},function(){$(this).hide().find('iframe').remove();$(this).prev('a').removeClass('cur');}); 
}
$('#hd-nav>li>a').hover(function(){$(this).next('div').show();},function(){$(this).next('div').hide();});
$('#hd-nav>li>a').next('div').hover(function(){$(this).show();$(this).prev('a').addClass('cur');},function(){$(this).hide();$(this).prev('a').removeClass('cur');}); 
// 
$("#hd li.my-page").hover(function(){
	$(this).children("ul").show();
	$(this).addClass("hover bg-none");
	$(this).next().addClass("bg-none");
	$(this).css({paddingLeft:"10px",paddingRight:"10px",marginTop:"-1px"});
	}, function(){
	$(this).children("ul").hide();	
	$(this).removeClass("hover bg-none");
	$(this).next().removeClass("bg-none");
	$(this).css({paddingLeft:"11px",paddingRight:"11px",marginTop:"0px"});
	});
//搜索框
var $hdText=$('#hd-sr .hd-text,#hd2-sr .hd-text');
$hdText.val('2012年 会计 职称');
$hdText.focus(function(){
	$(this).select();
	$(this).removeClass('lower');
	if($(this).val()==this.defaultValue){
		$(this).val('');
		}
	}).blur(function(){
		if($(this).val()==''){
			$(this).addClass('lower').val(this.defaultValue);
			}
		});
$('#hd-sr form:first').submit(function(){
	if($hdText.val()==$hdText[0].defaultValue||$hdText.val()==''){
		return false;
		}
	});
//新COMM
if($.browser.msie&&$.browser.version==6){
$('#hd2_nav > li').hover(function(){
	var $slideDiv=$(this).find('div.navp');
	if ($slideDiv.length === 0) {
		return;
	}
	$(this).children("a").addClass("hover");
	$slideDiv.show();
	$(this).append('<iframe id="selectMask" style="position:absolute;left:0;z-index:-1;" frameborder="0" src="http://www.kaoshi.sh.cn"></iframe>');
	$('#selectMask').height($slideDiv.height()+3).width($slideDiv.width()+6);},
	function(){
		var $that=$(this);
		var $slideDiv=$(this).find('div.navp');
		if ($slideDiv.length === 0) {
			return;
		}
		$slideDiv.hide(0);
		$(this).find('iframe').remove().children("a").removeClass('hover');
		});
	//修复IE6不缓存背景图
	try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
}
//下拉导航
$("#hd2_nav > li").hover(function(){
	var $slideDiv=$(this).find('div.navp');
	if ($slideDiv.length === 0) {
		return;
	}
	$(this).children("a").addClass("hover");
	$slideDiv.show();
}, function(){
	var $that=$(this);
	var $slideDiv=$(this).find('div.navp');
	if ($slideDiv.length === 0) {
		return;
	}
	$slideDiv.hide();
	$(this).children("a").removeClass('hover');
});
//书下拉
$("#hd2 li.myPage").hover(function(){
	$(this).children("ul").show();
	$(this).addClass("hover");
	$(this).css({paddingLeft: "10px",paddingRight: "11px",marginTop: "-1px"});
}, function(){
	$(this).children("ul").hide();
	$(this).removeClass("hover");
	$(this).css({paddingLeft: "11px",paddingRight: "11px",marginTop: "0px"});
});
//购物车效果
$("#hd2-cart").hover(function(){
	$(this).addClass("hover");
}, function(){
	$(this).removeClass("hover")
});
//新导航结束


//页脚hover效果
$("#help2").find("dl").hover(function(){
		$(this).addClass("cur");					   
	},
	function(){
		$(this).removeClass("cur");
	});
//DOMreader结束
});
