if ($('#sliderboxleft').length==0 && $('#sliderboxright').length==0) { $('head').append(""); lasttimeoutleft=0; lasttimeoutright=0; posleft=0; posright=0; $(document).ready(function(){ $('a.sliderLinkRight').each(function(){if ($('#sliderboxright').width()<$(this).width()) $('#sliderboxright').width($(this).width());}); $('#sliderboxleft a').hover(function(){$(this).css('left','0px');},function(){$(this).css('left','-10px');}); $('#sliderboxright a').hover(function(){$(this).css('right','0px');},function(){$(this).css('right','-10px');}); }); function calcTopSlider(id) { pos=(id=='#sliderboxleft')? posleft :posright; if (pos=='middle') return ($(window).height()-$(id).height())/2 + $(window).scrollTop(); else { if (isNaN(parseInt(pos))) return $(window).scrollTop(); else return parseInt(pos)+$(window).scrollTop(); } } function moveWithTimeout() { if(lasttimeoutright) window.clearTimeout(lasttimeoutright); $('#sliderboxright').css({left: calcLeftSliderRight()+'px'}); lasttimeoutright=window.setTimeout("$('#sliderboxright').animate({top: calcTopSlider('#sliderboxright')+'px'},1000,'swing')",500); } function calcLeftSliderRight() { return $(window).width()-$('#sliderboxright').width()+$(window).scrollLeft(); } function createSliderDiv(lor,pos,px) { if (lor=="left") { if ($('#sliderboxleft').length==0) { posleft=px; $('body').prepend("
"); if (pos=='fixed') $(document).ready (function(){$('#sliderboxleft').css("top",calcTopSlider('#sliderboxleft')+"px");$(window).resize(function(){$('#sliderboxleft').css({top: calcTopSlider('#sliderboxleft')-$(window).scrollTop()+'px'});});}); else $(document).ready (function(){$('#sliderboxleft').animate({top: calcTopSlider('#sliderboxleft')+'px'},1000,'swing');$(window).bind('scroll resize',function(){if(lasttimeoutleft) window.clearTimeout(lasttimeoutleft);lasttimeoutleft=window.setTimeout("$('#sliderboxleft').animate({top: calcTopSlider('#sliderboxleft')+'px'},1000,'swing')",500);});}); } } else { if ($('#sliderboxright').length==0) { posright=px; $('body').prepend("
"); if (pos=='fixed') $(document).ready (function(){$('#sliderboxright').css({top : calcTopSlider('#sliderboxright')+'px', left: calcLeftSliderRight()+'px'});$(window).resize(function(){$('#sliderboxright').css({top: calcTopSlider('#sliderboxright')-$(window).scrollTop()+'px', left: calcLeftSliderRight()+'px'});});}); else $(document).ready (function(){$('#sliderboxright').css('left',calcLeftSliderRight()+'px').animate({top: calcTopSlider('#sliderboxright')+'px'},1000,'swing');$(window).bind('scroll resize',function(){moveWithTimeout();});}); } } } }