// JavaScript Document
var j = jQuery.noConflict();     

jQuery.fn.floatdiv=function(location){
   //判断浏览器版本
var isIE6=false;
var Sys = {};
    var ua = navigator.userAgent.toLowerCase();
    var s;
    (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] : 0;
if(Sys.ie && Sys.ie=="6.0"){
   isIE6=true;
}
var windowWidth,windowHeight;//窗口的高和宽
//取得窗口的高和宽
if (self.innerHeight) {
   windowWidth=self.innerWidth;
   windowHeight=self.innerHeight;
}else if (document.documentElement&&document.documentElement.clientHeight) {
   windowWidth=document.documentElement.clientWidth;
   windowHeight=document.documentElement.clientHeight;
} else if (document.body) {
   windowWidth=document.body.clientWidth;
   windowHeight=document.body.clientHeight;
}
return this.each(function(){
   var loc;//层的绝对定位位置
   var wrap=j("<div></div>");
   var top=-1;
   if(location==undefined || location.constructor == String){
    switch(location){
     case("rightbottom")://右下角
      loc={right:"0px",bottom:"0px"};
      break;
     case("leftbottom")://左下角
      loc={left:"0px",bottom:"0px"};
      break; 
     case("lefttop")://左上角
      loc={left:"0px",top:"0px"};
      top=0;
      break;
     case("righttop")://右上角
      loc={right:"0px",top:"0px"};
      top=0;
      break;
     case("middletop")://居中置顶
      loc={left:windowWidth/2-j(this).width()/2+"px",top:"0px",width:"100%"};
      top=0;
      break;
     case("middlebottom")://居中置低
      loc={left:windowWidth/2-j(this).width()/2+"px",bottom:"0px"};
      break;
     case("leftmiddle")://左边居中
      loc={left:"0px",top:windowHeight/2-j(this).height()/2+"px"};
      top=windowHeight/2-j(this).height()/2;
      break;
     case("rightmiddle")://右边居中
      loc={right:"20px",top:windowHeight/2-j(this).height()/2+"px"};
      top=(windowHeight/2-j(this).height()/2)+200;
      break;
     case("middle")://居中
      var l=0;//居左
      var t=0;//居上
      l=windowWidth/2-j(this).width()/2;
      t=windowHeight/2-j(this).height()/2;
      top=t;
      loc={left:l+"px",top:t+"px"};
      break;
     default://默认为右下角
      location="rightbottom";
      loc={right:"0px",bottom:"0px"};
      break;
    }
   }else{
    loc=location;
    var str=loc.top;
    if (typeof(str)!= 'undefined'){
     str=str.replace("px","");
     top=str;
    }
   }
   /*fied ie6 css hack*/
   if(isIE6){
    if (top>=0)
    {
     wrap=j("<div style=\"top:expression(documentElement.scrollTop+"+top+");\"></div>");
    }else{
     wrap=j("<div style=\"top:expression(documentElement.scrollTop+documentElement.clientHeight-this.offsetHeight);\"></div>");
    }
   }
   j("body").append(wrap);
  
   wrap.css(loc).css({position:"fixed",
    z_index:"999"});
   if (isIE6)
   {
   
    wrap.css("position","absolute");
    j("body").css("background-attachment","fixed").css("background-image","url(n1othing.txt)");
   }
   j(this).appendTo(wrap);
});
};

 
j(document).ready(function() {
j("#dh1").hover(function(){j("#dh1 a img").attr('src','images/dh1.jpg');j("#dh1 ul").show();},
				function(){j("#dh1 a img").attr('src','images/d1.jpg');j("#dh1 ul").hide();});
				
j("#dh2").hover(function(){j("#dh2 a img").attr('src','images/dh2.jpg');j("#dh2 ul").show();},
				function(){j("#dh2 a img").attr('src','images/d2.jpg');j("#dh2 ul").hide();});
				
j("#dh3").hover(function(){j("#dh3 a img").attr('src','images/dh3.jpg');j("#dh3 ul").show();},
				function(){j("#dh3 a img").attr('src','images/d3.jpg');j("#dh3 ul").hide();});

j("#dh4").hover(function(){j("#dh4 a img").attr('src','images/dh4.jpg');j("#dh4 ul").show();},
				function(){j("#dh4 a img").attr('src','images/d4.jpg');j("#dh4 ul").hide();});

j("#dh5").hover(function(){j("#dh5 a img").attr('src','images/dh5.jpg');j("#dh5 ul").show();},
				function(){j("#dh5 a img").attr('src','images/d5.jpg');j("#dh5 ul").hide();});
j("#kf").floatdiv("rightmiddle");

});

function job(id,title){
	
	j("#bg").show();
	j("#bg").css({width:""+j(window).width()+"",height:""+j(document).height()+""});
	j("#bg").animate({opacity:"0.5"},200);
	j("#job").show();
	j("#job").css({left:""+j(window).width()/2-772/2+""});
	j("#work").html(""+title+"");
	j("#wid").attr("value",id);

	}
function closejob(){
		j("#bg").animate({opacity:"0"},200);
		j("#bg").css({display:"none"});
		j("#job").css({display:"none"});
		("#work").html("");
		j("#wid").attr("value","")
		
	}


function left(i){
	j("#meun").css({backgroundPosition:"0px "+i+"px"});
	}
function out(i){
	j("#meun").css({backgroundPosition:"0px "+i+"px"});
	}
	
function ResumeError() { 
return true;
} 
window.onerror = ResumeError; 
