var first_photo_id=1;var ready_btns=true;var timer;var photoShow,photoHide;function SwapPhoto(x,y){var margin_top=(340-parseFloat($('slide_photo_'+x).style.height))/2;var margin_left=(340-parseFloat($('slide_photo_'+x).style.width))/2;$('slide_photo_'+x).style.top=margin_top+'px';$('slide_photo_'+x).style.left=margin_left+'px';$('ph_sl_id_'+x).appear({duration:1.5});var margin_top=(340-parseFloat($('slide_photo_'+y).style.height))/2;var margin_left=(340-parseFloat($('slide_photo_'+y).style.width))/2;$('slide_photo_'+y).style.top=margin_top+'px';$('slide_photo_'+y).style.left=margin_left+'px';$('ph_sl_id_'+y).fade({duration:1.5});};function StartSlideShow(value){var margin_top=(340-parseFloat($('slide_photo_'+first_photo_id).style.height))/2;var margin_left=(340-parseFloat($('slide_photo_'+first_photo_id).style.width))/2;$('slide_photo_'+first_photo_id).style.top=margin_top+'px';$('slide_photo_'+first_photo_id).style.left=margin_left+'px';$('ph_sl_id_'+first_photo_id).style.display="block";var helperDelay=18-value;timer=helperDelay;play=setInterval('Play()',value*1000);$('StartMBS_panel').hide();$('StopMBS_panel').appear({duration:0});new Control.Slider('sshow_slider_hand','sshow_slider',{range:$R(3,15),increment:0.5,sliderValue:helperDelay,onChange:function(value){timer=18-Math.round(value*10)/10;RestartSlideShow();}});};function RestartSlideShow(){clearInterval(play);play=setInterval('Play()',timer*1000);};function PlayAgain(){$('StartMBS_panel').hide();$('StopMBS_panel').appear({duration:0});ready_btns=true;play=setInterval('Play()',timer*1000);};function Play(){if(ready_btns!=false){photoShow=first_photo_id+1;photoHide=first_photo_id;if(photoShow>QtyPhotos){SwapPhoto(1,photoHide);first_photo_id=1;}else{SwapPhoto(photoShow,photoHide);first_photo_id++;}}};function Stop(){ready_btns=false;clearInterval(play);$('StartMBS_panel').appear({duration:0});$('StopMBS_panel').hide();};function GoNext(){ready_btns=false;clearInterval(play);$('StartMBS_panel').appear({duration:0});$('StopMBS_panel').hide();photoShow=first_photo_id+1;photoHide=first_photo_id;if(photoShow>QtyPhotos){SwapPhoto(1,photoHide);first_photo_id=1;}else{SwapPhoto(photoShow,photoHide);first_photo_id++;}};function GoPrevious(){ready_btns=false;clearInterval(play);$('StartMBS_panel').appear({duration:0});$('StopMBS_panel').hide();photoShow=first_photo_id-1;photoHide=first_photo_id;if(photoShow==0){SwapPhoto(QtyPhotos,photoHide);first_photo_id=QtyPhotos;}else{SwapPhoto(photoShow,photoHide);first_photo_id--;}}