//新泰人才网js文件
$(function(){
	$("#email").click(function(){
	var clipBoardContent="";
    clipBoardContent+=$(this).attr("title");
    window.clipboardData.setData("Text",clipBoardContent);
    alert("邮箱已复制到剪切板，");		   
		});
	
	//首页TAB切换上
	$(".main_one .sider .sider_top .tab .tab_nav li.tab1").mouseover(function(){
				var index = 0;														   
				$(this).addClass("selected").siblings().removeClass("selected");
				index = $(".main_one .sider .sider_top .tab .tab_nav li").index(this);
				$(".main_one .sider .sider_top .tab .tab_content div").eq(index).show().siblings().hide();
					});
	//首页TAB切换下
	$(".main_one .sider .sider_bottom .tab .tab_nav li.tab3").mouseover(function(){
				var index = 0;														   
				$(this).addClass("selected").siblings().removeClass("selected");
				index = $(".main_one .sider .sider_bottom .tab .tab_nav li").index(this);
				$(".main_one .sider .sider_bottom .tab .tab_content div").eq(index).show().siblings().hide();
					});
	
	//首页环灯片
     var len  = $(".main_one .middle .num > li").length;
	 var index = 0;
	 var adTimer;
	 $(".main_one .middle .num li").mouseover(function(){
		index  =   $(".main_one .middle .num li").index(this);
		showImg(index);
	 }).eq(0).mouseover();	
	 
	 //滑入 停止动画，滑出开始动画.
	 $('.main_one .middle .ad').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    showImg(index)
				index++;
				if(index==len){index=0;}
			  } , 3000);
	 }).trigger("mouseleave");
	 
	 // 表单 文本框鼠标事件				
	var key = $("#header .header_bottom .form_search .qy_search input.key").attr("value")	;
	$("#header .header_bottom input.key").focus(function(){	
				if(this.value=='请输入关键字'){this.value='';}
					}).blur(function(){
						if(this.value==''){this.value='请输入关键字';}
						});
						
	 
	//首页人才推荐图片边框高亮
	$(".main_three .rc_con img").css("border","1px solid #C9E3FE");					
	$(".main_three .rc_con img").hover(function(){
		$(this).css("border","2px solid #57ADFB"); 
			},function(){
				$(this).css("border","1px solid #C9E3FE");
				});	
	//首页登录类型默认选中个人会员		
	//$("#LoginForm input[name='UserType']").val(["Person"]);  
	
	//新手上路弹出层
	$("#xs").boxy(); 
	
	//一句话招聘滚动
	var yjhTime;
	var $this;
	$("#yjh .yjhCon").hover(function(){
		clearInterval(yjhTime);
		},function(){
			yjhTime =setInterval( function(){
				var li_first = $("#yjh .yjhCon ul").find("li:first");
				var liheight = $("#yjh .yjhCon ul").find("li:first").height();
				$("#yjh .yjhCon ul").animate({ "marginTop" : -liheight + "px"},600,function(){
					$(this).css({marginTop:0}).find("li:first").appendTo($(this));
					});
				},3000)
			}).trigger("mouseleave");	
			
	//求职信息 招聘信息 加盟企业 页面 隔行变色
		$("#rc_con ul li:even").addClass("select");	 
		//$("#rc_con ul li:odd").css("background-color","#D8E8F0");	
		$("#rc_con ul li").hover(function(){
			$(this).addClass("selected");
			},function(){
				$(this).removeClass("selected");
				});	
				 	
	//文档下载UL高亮显示
	$("#ziliao div.zl").hover(function(){
		$(this).css({ "border":"1px #3F97FF solid"});
		$(this).children("h3").css({ "backgroundColor":"#CAEDFE"});
		//$(this).children("ul").css({ "backgroundColor":"#F4F4F4"});
		},function(){
			$(this).css({ "border":"1px #FFF solid"});
			$(this).children("h3").css({ "backgroundColor":"#F5F5F5"});
			//$(this).children("ul").css({ "backgroundColor":"#FFF"});
			});	
	//推荐人才 页面 求职信息高亮显示
	$("#rc_tj li").hover(function(){
		$(this).css({ "border":"1px #3F97FF solid"});
		$(this).css({ "backgroundColor":"#CAEDFE"});
		//$(this).children("ul").css({ "backgroundColor":"#F4F4F4"});
		},function(){
			$(this).css({ "border":"1px #FFF solid"}).css({ "borderBottom":"1px #ccc dotted"});
			$(this).css({ "backgroundColor":"#FFF"});
			//$(this).children("ul").css({ "backgroundColor":"#FFF"});
			});	
			
	//一句话高亮显示
	$("#yjh_con ul li").hover(function(){
		$(this).css({ "border":"1px #3F97FF solid"});
		$(this).css({ "backgroundColor":"#CAEDFE"});
		//$(this).children("ul").css({ "backgroundColor":"#F4F4F4"});
		},function(){
			$(this).css({ "border":"1px #FFF solid"}).css({ "borderBottom":"1px #ccc dotted"});
			$(this).css({ "backgroundColor":"#FFF"});
			//$(this).children("ul").css({ "backgroundColor":"#FFF"});
			});	
	
	});


// 控制首页幻灯片的调用函数
function showImg(index){
        var adHeight = $(".main_one .middle .ad").height();
		$(".slider").stop(true,false).animate({top : -adHeight*index},1000);
		$(".num li").removeClass("on")
			.eq(index).addClass("on");
                 }
//PNG背景透明				 
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters))
    {
       for(var j=0; j<document.images.length; j++)
       {
          var img = document.images[j]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
          {
             var imgID = (img.id) ? "id='" + img.id + "' " : ""
             var imgClass = (img.className) ? "class='" + img.className + "' " : ""
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
             var imgStyle = "display:inline-block;" + img.style.cssText
             if (img.align == "left") imgStyle = "float:left;" + imgStyle
             if (img.align == "right") imgStyle = "float:right;" + imgStyle
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
             var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
             img.outerHTML = strNewHTML
             j = j-1
          }
       }
    }   
}
window.attachEvent("onload", correctPNG);
