var photo_scrollSpeed,link_scrollSpeed,text_scrollSpeed;var scroll_timeout=null;var photo_ads_num=0,photo_scroll_timer;function scrollPhotoAds(pos){try{$('photo_ads_div').scrollLeft=$('photo_ads_div').scrollLeft+((pos-$('photo_ads_div').scrollLeft>1)?2:1);if(pos>$('photo_ads_div').scrollLeft)photo_scroll_timer=setTimeout('scrollPhotoAds('+pos+');',photo_scrollSpeed);else nextLinkAds();}catch(e){}}
function nextPhotoAds(){try{photo_ads_num++;if(photo_ads_num==$('photo_ads_table').rows[0].cells.length-3){photo_ads_num=1;$('photo_ads_div').scrollLeft=0;}
scrollPhotoAds($('photo_ads_table').rows[0].cells[photo_ads_num].offsetLeft-3);}catch(e){}}
var link_ads_num=0,link_scroll_timer
function scrollLinkAds(pos){try{$('link_ads_div').scrollLeft=$('link_ads_div').scrollLeft+((pos-$('link_ads_div').scrollLeft>1)?2:1);if(pos>$('link_ads_div').scrollLeft)link_scroll_timer=setTimeout('scrollLinkAds('+pos+');',link_scrollSpeed);else nextTextAds();}catch(e){}}
function nextLinkAds(){try{link_ads_num++;if(link_ads_num==$('link_ads_table').rows[0].cells.length-3){link_ads_num=1;$('link_ads_div').scrollLeft=0;}
scrollLinkAds($('link_ads_table').rows[0].cells[link_ads_num].offsetLeft-3);}catch(e){}}
var text_ads_num=0,text_scroll_timer
function scrollTextAds(pos){try{$('text_ads_div').scrollLeft=$('text_ads_div').scrollLeft+((pos-$('text_ads_div').scrollLeft>1)?2:1);if(pos>$('text_ads_div').scrollLeft)text_scroll_timer=setTimeout('scrollTextAds('+pos+');',text_scrollSpeed);else nextPhotoAds();}catch(e){}}
function nextTextAds(){try{text_ads_num++;if(text_ads_num==$('text_ads_table').rows[0].cells.length-3){text_ads_num=1;$('text_ads_div').scrollLeft=0;}
scrollTextAds($('text_ads_table').rows[0].cells[text_ads_num].offsetLeft-3);}catch(e){}}
function initSpeed(){var _speed=10;if(browser.msie){_speed=2;}
photo_scrollSpeed=_speed;link_scrollSpeed=_speed;text_scrollSpeed=_speed;}
initSpeed();function overStop(type){outRun();switch(type){case'photo':photo_scrollSpeed=40;break;case'link':link_scrollSpeed=40;break;case'text':text_scrollSpeed=40;break;}}
function outRun(){initSpeed();}
function stopScroll(){var clear=function(timer){var timer=eval(timer);clearTimeout(timer);clearInterval(timer);}
$A(['scroll_timeout','photo_scroll_timer','link_scroll_timer','text_scroll_timer'])
.each(function(t){clear(t);eval(t+'= null;');});photo_ads_num=0;link_ads_num=0;text_ads_num=0;}
var can_scroll=false;Event.onReady(function(){try{if($('photo_ads_table')){if($('photo_ads_table').rows.length>1){while($('photo_ads_table').rows[0].cells.length<8){$('photo_ads_table').rows[0].insertCell($('photo_ads_table').rows[0].cells.length);}
while($('photo_ads_table').rows[1].cells.length<8){$('photo_ads_table').rows[1].insertCell($('photo_ads_table').rows[1].cells.length);}
for(var i=0;i<4;i++){$('photo_ads_table').rows[0].insertCell($('photo_ads_table').rows[0].cells.length).innerHTML=$('photo_ads_table').rows[0].cells[i].innerHTML;$('photo_ads_table').rows[1].insertCell($('photo_ads_table').rows[1].cells.length).innerHTML=$('photo_ads_table').rows[1].cells[i].innerHTML;}}
if($('link_ads_table').rows.length>1){while($('link_ads_table').rows[0].cells.length<8){$('link_ads_table').rows[0].insertCell($('link_ads_table').rows[0].cells.length);}
while($('link_ads_table').rows[1].cells.length<8){$('link_ads_table').rows[1].insertCell($('link_ads_table').rows[1].cells.length);}
for(var i=0;i<4;i++){$('link_ads_table').rows[0].insertCell($('link_ads_table').rows[0].cells.length).innerHTML=$('link_ads_table').rows[0].cells[i].innerHTML;$('link_ads_table').rows[1].insertCell($('link_ads_table').rows[1].cells.length).innerHTML=$('link_ads_table').rows[1].cells[i].innerHTML;}}
if($('text_ads_table').rows.length>1){while($('text_ads_table').rows[0].cells.length<8){$('text_ads_table').rows[0].insertCell($('text_ads_table').rows[0].cells.length);}
while($('text_ads_table').rows[1].cells.length<8){$('text_ads_table').rows[1].insertCell($('text_ads_table').rows[1].cells.length);}
for(var i=0;i<4;i++){$('text_ads_table').rows[0].insertCell($('text_ads_table').rows[0].cells.length).innerHTML=$('text_ads_table').rows[0].cells[i].innerHTML;$('text_ads_table').rows[1].insertCell($('text_ads_table').rows[1].cells.length).innerHTML=$('text_ads_table').rows[1].cells[i].innerHTML;}}
can_scroll=true;}}catch(e){}
if(can_scroll)scroll_timeout=setTimeout(nextPhotoAds,2000);});