indexslides.parameterupdate=function(){ var winw=$(window).width(); if(winw<1000) winw=1000; $('#slide-index').width(winw); $('#slide-index .slides').width(winw*(indexslides.style.length+1)); indexslides.obj.width(winw); var offset=(winw-1000)/2; for(var i=0; i=indexslides.style.length) j=0; indexslides.clearstage(i); indexslides.current=j; $('#slide-index .control a').removeclass('active').eq(j).addclass('active'); $obj=$('#slide-index .slide').eq(i); if(indexslides.css[j].direction=='tb'){ var initialtextcss={ 'left':indexslides.css[j].text.left, 'top':-$obj.find('.text').height() }; var initialbuttoncss={ 'left':indexslides.css[j].button.left, 'top':$obj.height()+$obj.find('.button').height() }; }else if(indexslides.css[j].direction=='lr'){ var initialtextcss={ 'left':-parseint($obj.find('.text').width())+'px', 'top':indexslides.css[j].text.top }; var initialbuttoncss={ 'left':500, 'top':indexslides.css[j].button.top, 'width':$obj.find('.button').width() }; } $obj.find('.text').css(initialtextcss); $obj.find('.button').css(initialbuttoncss) var left=-i*indexslides.obj.width(); $('#slide-index .slides').animate({'margin-left':left},500,function(){ $obj.find('.text').animate(indexslides.css[j].text,300,function(){ $obj.find('.button').show().animate(indexslides.css[j].button,300, "swing",function(){ if(i>=indexslides.css.length){ $obj=$('#slide-index .slide').eq(0); $obj.find('.text').css(indexslides.css[j].text); $obj.find('.button').css(indexslides.css[j].button); $('#slide-index .slides').css('margin-left','0px'); } indexslides.animating=false; indexslides.reformat(); }); }); }); } indexslides.start=function(){ indexslides.timer=setinterval(indexslides.next,6000); } indexslides.pause=function(){ if(indexslides.timer) clearinterval(indexslides.timer); } indexslides.next=function(){ var next=indexslides.current+1; //if(next>=indexslides.total) //next=0; indexslides.goto(next); } indexslides.clearstage=function(i){ if(indexslides.current>-1){ indexslides.animating=true; var left=3000; if(i7){ var $title=$('#latest-news-index .latest-news .title'); var bgsrc=$title.find('img').attr('src'); $title.find('img').remove(); $title.parent().css({ 'background-image':'url('+bgsrc+')', 'background-repeat':'no-repeat', 'background-position':'0 50%' }); } } latestnews.next=function(){ var lineheight=parseint(latestnews.news.css('height')); latestnews.current++; if(latestnews.current>latestnews.total){ latestnews.obj.css({'margin-top':0}); latestnews.current=1; } var margin=-latestnews.current*lineheight; latestnews.obj.animate({'margin-top':margin}); } latestnews.start=function(){ latestnews.timer=setinterval(latestnews.next,4000); } latestnews.pause=function(){ if(latestnews.timer) clearinterval(latestnews.timer); } var featurepopup={} featurepopup.timer=false; featurepopup.popup=$('#feature-popup'); featurepopup.ini=function(){ $('#feature-popup .close').click(function(e){ e.preventdefault; featurepopup.hide(); }); //---------------------------- //add by bob 2011-04-07 (start) //var timeout1; //$('#feature-trigger').mouseout(function(){ //cleartimeout(timeout1); //}); //(end) //---------------------------- $('#feature-trigger').hover(function(){ if(!featurepopup.disappearing) if(featurepopup.timer) cleartimeout(featurepopup.timer); var target='case'; var $target=$('#feature-popup .'+target); var position=$(this).offset(); position.left = position.left -0.5; if(ipx()){ position.top = 423; }else{ position.top = 423; //position.top = position.top-$target.height()+$(this).height()+8; } //---------------------------- //add by bob 2011-04-07 //featurepopup.popup.css(position).show(); //var f = function(){}; //timeout1 = settimeout(f,500); //---------------------------- var f = function(){ featurepopup.popup.css(position).show(); var maskcssbefore={ 'top':$target.height(), 'left':-$target.width() }; var casecssbefore={ 'top':-$target.height(), 'left':$target.width() }; /* var maskcssafter={ 'top':'0px', 'left':'0px' }; var casecssafter={ 'top':'0px', 'left':'0px' }; */ var animationinterval=15; var animationstep=-1; var maskstep={ 'top':-$target.height()/animationinterval, 'left':$target.width()/animationinterval }; var casestep={ 'top':$target.height()/animationinterval, 'left':-$target.width()/animationinterval }; function featureanimate(){ animationstep++; $('#feature-popup .mask').css({ 'top':parseint(maskcssbefore.top)+animationstep*maskstep.top, 'left':parseint(maskcssbefore.left)+animationstep*maskstep.left },1); $target.css({ 'top':parseint(casecssbefore.top)+animationstep*casestep.top, 'left':parseint(casecssbefore.left)+animationstep*casestep.left },1); if(animationstep>=animationinterval) clearinterval(animationtimer); } $('#feature-popup .mask').css(maskcssbefore); $target.css(casecssbefore); var animationtimer=setinterval(featureanimate,1); } timeout1 = settimeout(f,500); /* $('#feature-popup .mask').css(maskcssbefore).animate(maskcssafter); $target.css(casecssbefore).animate(casecssafter); */ },featurepopup.hide); featurepopup.popup.hover(function(){ if(!featurepopup.disappearing){ if(featurepopup.timer) cleartimeout(featurepopup.timer); } },featurepopup.hide); $('#feature-popup .detail').click(function(){ window.location=$('a',this).attr('href'); }); }; featurepopup.hide=function(){ featurepopup.timer=settimeout(function(){ featurepopup.disappearing=true; if($.browser.msie){ featurepopup.disappearing=false; var hide2 = function(){featurepopup.popup.hide();} timeout2 = settimeout(hide2,500); }else{ featurepopup.popup.stop().fadeout(200,function(){ featurepopup.disappearing=false; featurepopup.popup.hide(); }); } },20); }