function relatedTarget(a){if(a&&a.relatedTarget)return a.relatedTarget;else if(window.event)return window.event.type=="mouseover"?window.event.fromElement:window.event.type=="mouseout"?window.event.toElement:null}
var slidePic={o:null,getRelDom:function(a,b){var c=slidePic.o=$(a);c.thumb=c.find("[rel=thumb]");c.shadow=c.find("[rel=shadow]");c.des=c.find("[rel=description]");c.title=c.find("[rel=title]");c.ctrl=c.find("[rel=ctrl]");c.num=c.find("[rel=num]");c.n=c.num.find("strong");c.tl=c.find("[rel=tl]");c.tr=c.find("[rel=tr]");c.t=b||6E3},init:function(a,b){slidePic.getRelDom(a,b);slidePic.getData();slidePic.setShadow();slidePic.showDes();slidePic.auto();slidePic.slideLR()},getData:function(){var a=slidePic.o,
b=a.data=[];a.find("[rel=slide-data]").find("li").each(function(c){b[c]=[];$(this).find("p").each(function(){b[c].push($(this).html())})});a.size=slidePic.o.data.length;a.now=0;a.index=slidePic.o.now+1;a.num.find("em").html(a.size);slidePic.updateDomData(a.index,b[a.now][0],b[a.now][1],b[a.now][2],b[a.now][3])},setShadow:function(){var a=slidePic.o,b=a.des.innerHeight(),c=a.des.parent().innerWidth();a.shadow.bottom=-b-10;a.des.bottom=-b;a.shadow.css({display:"block",opacity:0.5,position:"absolute",
bottom:-b-10,height:b+10,width:c,zIndex:20});a.shadow.parent().css({position:"relative",overflow:"hidden"});a.des.css({position:"absolute",bottom:-b,zIndex:30})},updateDomData:function(a,b,c,f,e){var d=slidePic.o;d.n.html(a);d.title.html(b).attr("href",c);d.des.html(f);d.thumb.parent().attr("href",c);e!=undefined&&d.thumb.attr("src",e)},showDes:function(){var a=slidePic.o;a.thumb.parent().parent().hover(function(){a.shadow.animate({bottom:0},"normal");a.des.animate({bottom:0},"normal");a.des.hover(function(){window.clearTimeout(a.timeDes)},
function(b){if(relatedTarget(b)!=a.shadow[0]){a.shadow.animate({bottom:a.shadow.bottom},"normal");a.des.animate({bottom:a.des.bottom},"normal")}})},function(){a.timeDes=window.setTimeout(function(){a.shadow.animate({bottom:a.shadow.bottom},"normal");a.des.animate({bottom:a.des.bottom},"normal")},200)})},auto:function(){var a=slidePic.o,b=a.data;a.timerPic=window.setInterval(function(){a.now+=1;if(a.now==a.size){a.now=0;window.clearInterval(a.timerPic);slidePic.auto()}a.index=a.now+1;slidePic.updateDomData(a.index,
b[a.now][0],b[a.now][1],b[a.now][2],b[a.now][3]);slidePic.slider()},a.t)},slider:function(){var a=slidePic.o;a.thumb.hide();a.thumb.fadeIn("slow")},slideLR:function(){var a=slidePic.o,b=a.data;a.tl.click(function(){window.clearInterval(a.timerPic);a.now-=1;if(a.now==-1)a.now=a.size-1;a.index=a.now+1;slidePic.updateDomData(a.index,b[a.now][0],b[a.now][1],b[a.now][2],b[a.now][3]);slidePic.slider();slidePic.auto()});a.tr.click(function(){window.clearInterval(a.timerPic);a.now+=1;if(a.now==a.size)a.now=
0;a.index=a.now+1;slidePic.updateDomData(a.index,b[a.now][0],b[a.now][1],b[a.now][2],b[a.now][3]);slidePic.slider();slidePic.auto()})}};slidePic.init("#slide-box");
