if(!window.Kidzbop)Kidzbop={};Kidzbop.Video={setFlagVideoClickObserve:function(obj){if(obj){obj.select('li').each(function(li){li.observe('click',Kidzbop.Video.flagVideoReasonClickHandler);});}},flagVideoReasonClickHandler:function(e){if(this.childElements().length==0){if(this.up().id=='main_menu'){$('select_reason').value=this.innerHTML;}else{var select_reason_value=this.up().up().firstChild.nodeValue+' - '+this.innerHTML;$('select_reason').value=select_reason_value.replace(/\s+/g,' ');}
Kidzbop.Video.hideOrShowCustomTextField(this.innerHTML=='Other');$('main_menu').hide();$('select_reason_submit').show();}},hideOrShowCustomTextField:function(visible){var custom_text=$('custom_text');var custom_text_textarea=$('custom_text_textarea');custom_text_textarea.value='';limitchars(140,custom_text_textarea,"custom_text_count");custom_text.style.display=(visible?'block':'none');$('flag_video_popup').style.height=(visible?'350':'270')+'px';$$('#flag_video_popup .popup_right_center')[0].style.height=(visible?'350':'270')+'px';},toggleMenu:function(){$('main_menu').toggle();}};var Stars=Class.create();Stars.prototype={initialize:function(options){this.options={bindField:null,maxRating:5,container:null,imgPath:'/images/',imgRate:'',imgYourRate:'your_rating.gif',imgOn:'star_on.gif',imgOff:'star_off.gif',imgRateOn:'star_on_r.gif',imgRateOff:'star_off_r.gif',actionURL:null,initialRate:0,locked:false,ratingTextId:'rating_text'};Object.extend(this.options,options);this.yourRate=0;this.stars=[];this.locked=this.options.locked;this.infoImg=new Image();this.starSrc={empty:this.options.imgPath+this.options.imgOff,full:this.options.imgPath+this.options.imgOn,rate_empty:this.options.imgPath+this.options.imgRateOff,rate_full:this.options.imgPath+this.options.imgRateOn};this.display();},display:function(){this.getContainer();var p=document.createElement('p');p.className='stars';if(this.locked){p.className+='_r';};if(this.options.imgRate!=''){p.appendChild(this.setInfoImg());}
p.appendChild(this.buildStars());this.container.appendChild(p);this.setInitialState();},setInfoImg:function(){if(this.locked){this.infoImg.src=this.options.imgPath+this.options.imgYourRate;this.infoImg.alt='';}else{this.infoImg.src=this.options.imgPath+this.options.imgRate;this.infoImg.alt='';}
return this.infoImg;},getContainer:function(){if(this.options.container){this.container=$(this.options.container);}else{var containerId='starsContainer.'+Math.random(0,100000);document.write('<p class="rate" id="'+containerId+'"></p>');this.container=$(containerId);}},buildStars:function(){var span=document.createElement('span');for(var i=0;i<this.options.maxRating;i++){var star=new Image();star.src=this.starSrc.empty;if(!this.locked){star.style.cursor='pointer';}
if(!this.locked){Event.observe(star,'mouseover',this.starMouseOver.bind(this));Event.observe(star,'click',this.starMouseClick.bind(this));Event.observe(star,'mouseout',this.starMouseOut.bind(this));}
this.stars.push(star);span.appendChild(star);}
return span;},starMouseOver:function(e){if(this.locked){return;}
if(!e)e=window.event;var star=Event.element(e);var rating_text='';var markFull=true;for(var i=0;i<this.stars.length;i++){this.stars[i].src=markFull?this.starSrc.full:this.starSrc.empty;if(this.stars[i]==star){markFull=false;switch(i+1){case 1:rating_text='Needs Work';break;case 2:rating_text='Okay';break;case 3:rating_text='Really good';break;case 4:rating_text='Totally awesome!';break;case 5:rating_text='Best thing EVER!';break;}
var rating_text_el=$(this.options.ratingTextId);if(rating_text_el){rating_text_el.innerHTML=rating_text;}}}},starMouseClick:function(e){if(this.locked){return;}
if(!e)e=window.event;var star=Event.element(e);for(var i=0;i<this.stars.length;i++){if(this.stars[i]==star){this.yourRate=i+1;this.setState();break;}}},starMouseOut:function(e){if(this.locked){return;}
this.setStarsSrc(this.options.initialRate);var rating_text_el=$(this.options.ratingTextId);if(rating_text_el){rating_text_el.innerHTML=' ';}},setStarsSrc:function(rateValue){var prefix=this.locked?"rate_":"";for(var i=1;i<this.stars.length+1;i++){this.stars[i-1].src=(i<=rateValue+0.5)?eval("this.starSrc."+prefix+"full"):eval("this.starSrc."+prefix+"empty");}},sendAjaxRequest:function(){if(this.options.actionURL){new Ajax.Request(this.options.actionURL+"&rate="+this.yourRate,{method:'get'});}},setInitialState:function(){this.setStarsSrc(this.options.initialRate)
this.setWidgetValue(this.options.initialRate);},setState:function(){var markFull=true;for(var i=0;i<this.stars.length;i++){this.stars[i].src=markFull?this.starSrc.full:this.starSrc.empty;if(i+1==this.yourRate){markFull=false;}}
this.sendAjaxRequest();this.locked=true;this.setInfoImg();this.setStarsSrc(this.yourRate);this.setWidgetValue(this.yourRate);},setWidgetValue:function(rate){if(this.options.bindField){$(this.options.bindField).value=rate;}}};var JWPlayer=Class.create({initialize:function(containerID,options){this.options=options;this.containerID=containerID;this.base=this.options.base||"http://www.kidzbop.com";this.skin=this.options.skin||this.base+"/flash/nacht.zip";this.autostart=this.options.autostart||false;this.playlist=this.options.playlist||[];this.playerId=this.options.playerId||'jw_player';JWPlayer.prototype.image=this.options.image||'';this.dimensions={width:this.options.width||320,height:this.options.height||275};this.createPlaylist();this.createPlayer();}});JWPlayer.fn=JWPlayer.prototype;JWPlayer.fn.playlists={};JWPlayer.fn.video_ad=null;JWPlayer.fn.already_called_tracking_pixels={};JWPlayer.fn.createPlayer=function(){var flashvars={id:this.playerId,autostart:this.autostart,playlist:"none",playlistsize:"0",shuffle:false,repeat:"list",skin:this.skin,stretching:"exactfit",controlbar:"bottom",plugins:"gapro-1","gapro.accountid":"UA-10269482-1"};var params={allowfullscreen:true,allowscriptaccess:"always",wmode:"transparent",base:this.base};var attributes={id:this.playerId,name:this.playerId};swfobject.embedSWF(this.base+"/flash/jw_player.swf",this.containerID,this.dimensions.width,this.dimensions.height,"9.0.115",false,flashvars,params,attributes);};JWPlayer.fn.drawVideoAdvert=function(video_adverts,overall_freq_cap){if(overall_freq_cap==0||this.getOverallFreqCapCookieValue()<=overall_freq_cap){var ads=[];video_adverts.each(function(ad){if(ad['display_limit']==0||this.getAdCookieValue(ad['video_id'])<=ad['display_limit']){ads.push(ad);}}.bind(this));if(ads.length>0){return ads[Math.floor(Math.random()*ads.length)];}}
return null;};JWPlayer.fn.createPlaylist=function(){var list=new Array();this.playlist.each(function(e){list.push(e);}.bind(this));if(this.video_ad){this.updateAdCookieValue(this.video_ad['video_id']);setTimeout(function(){$$('body')[0].insert(this.video_ad['tracking_pixel']);}.bind(this),1000);list.unshift(this.video_ad);}
this.playlists[this.playerId]=list;};JWPlayer.fn.getAdCookieValue=function(video_id){var cookie_name='v_ad_'+video_id;var cookie=parseInt(Cookie.getCookie(cookie_name));return isNaN(cookie)?1:cookie+1;};JWPlayer.fn.getOverallFreqCapCookieValue=function(){var cookie_name='v_ad_overall';var cookie=parseInt(Cookie.getCookie(cookie_name));return isNaN(cookie)?1:cookie+1;};JWPlayer.fn.updateAdCookieValue=function(video_id){var cookie_name='v_ad_'+video_id;var date=new Date();var time_to_midnight=((23-date.getHours())*60+(60-date.getMinutes()))/(24*60);Cookie.setCookie(cookie_name,this.getAdCookieValue(video_id),time_to_midnight,'/');Cookie.setCookie('v_ad_overall',this.getOverallFreqCapCookieValue(),time_to_midnight,'/');};JWPlayer.fn.loadPlaylist=function(object_id){this.player=this.loadPlayerObject(object_id);this.player.sendEvent('LOAD',this.playlists[object_id]);};JWPlayer.fn.loadPlayerObject=function(object_id){return $(object_id);};JWPlayer.fn.addEvents=function(){this.player.addViewListener('PLAY','JWPlayer.fn.adRedirect');this.player.addModelListener('STATE','JWPlayer.fn.adMessage');this.player.addModelListener('TIME','JWPlayer.fn.playbackTracking');};JWPlayer.fn.playbackTracking=function(e){var item=this.getCurrentPlayingItem();if(item['ad']){if(!this.already_called_tracking_pixels[item['video_id']]){this.already_called_tracking_pixels[item['video_id']]={};}
var percent=e['position']/e['duration'];var place=0;[0,25,50,75,100].each(function(step){place=step==100?98:step;if(percent*100>=place&&item['tracking_pixel_'+step]&&!this.already_called_tracking_pixels[item['video_id']][step]){this.already_called_tracking_pixels[item['video_id']][step]=true;$$('body')[0].insert(item['tracking_pixel_'+step]);}}.bind(this));}};JWPlayer.fn.adRedirect=function(e){var item=this.getCurrentPlayingItem();var state=this.player.getConfig().state;if(!!item['ad']&&!!item['link']&&(state!='IDLE')&&(state!='COMPLETED')){window.location=item['link'];}};JWPlayer.fn.getCurrentPlayingItem=function(){return this.player.getPlaylist()[this.player.getConfig().item];};JWPlayer.fn.adMessage=function(e){var item=this.getCurrentPlayingItem();if(e.newstate=='PLAYING'&&item['ad']){this.player.up().insert('<div class="player_ad">Advertisement - Your content will start after this message.</div>');}else{this.player.up().select('.player_ad').each(function(e){e.remove();});}};playerReady=function(e){JWPlayer.fn.loadPlaylist(e['id']);JWPlayer.fn.addEvents(e['id']);};var Carousel=Class.create();Carousel.prototype={carousel_in_progress:false,updating_items:false,nextButton:null,prevButton:null,carouselElement:null,step:null,item_width:null,total_number_of_items:null,loaded_number_of_items:null,current_position:0,fetch_url:null,initialize:function(options){this.nextButton=$(options.next_button_id);this.prevButton=$(options.prev_button_id);this.carouselElement=$(options.carousel_element_id);this.step=options.step;this.item_width=options.item_width;this.total_number_of_items=options.total_number_of_items;this.loaded_number_of_items=options.loaded_number_of_items;this.fetch_url=options.fetch_url;this.initializeButtons();},initializeButtons:function(){this.showOrHideButtons();this.nextButton.onclick=function(){this.moveCarouselNext();return false;}.bind(this);this.prevButton.onclick=function(){this.moveCarouselPrev();return false;}.bind(this);},moveCarouselNext:function(){var step=this.current_position+this.step+this.step>this.loaded_number_of_items?this.loaded_number_of_items-this.current_position-this.step:this.step;this.moveCarousel(step);},moveCarouselPrev:function(){var step=-1*(this.current_position-this.step<0?this.current_position:this.step);this.moveCarousel(step);},moveCarousel:function(step){if(this.carousel_in_progress===false&&step!=0){this.carousel_in_progress=true;this.current_position+=step;this.loadElements();new Effect.Move(this.carouselElement,{x:-1*step*this.item_width,y:0,mode:'relative',duration:0.5,transition:Effect.Transitions.sinoidal,afterFinish:function(){this.showOrHideButtons();this.carousel_in_progress=false;}.bind(this)});}},showOrHideButtons:function(){if(this.current_position>0){this.prevButton.show();}else{this.prevButton.hide();}
if(this.current_position+this.step<this.loaded_number_of_items){this.nextButton.show();}else{this.nextButton.hide();}},canUpdateItems:function(){return this.updating_items===false&&this.fetch_url&&(this.current_position+2*this.step>=this.loaded_number_of_items)&&this.loaded_number_of_items<this.total_number_of_items;},loadElements:function(){if(this.canUpdateItems()){this.updating_items=true;var url=this.fetch_url+'&offset='+this.loaded_number_of_items;new Ajax.Request(url,{method:'get',onSuccess:function(response){this.carouselElement.insert(response.responseText);this.loaded_number_of_items=this.carouselElement.childElements().size();this.carouselElement.style.width=(this.loaded_number_of_items*(this.item_width+2))+'px';this.showOrHideButtons();}.bind(this),onComplete:function(){this.updating_items=false;}.bind(this)});}}}
if(!window.Kidzbop)Kidzbop={};if(!window.Kidzbop.Props)Kidzbop.Props={};Kidzbop.Props.get_checked_boxes=function(){var checked_props=new Array();var props_form=$('props_form');if(props_form){var boxes=props_form.select('input');for(box in boxes){if(boxes[box].checked){checked_props.push(boxes[box]);}}
return checked_props;}};Kidzbop.Props.clear_checked_boxes_after_timeout=function(){var thanks=$('thanks_for_props');if(thanks){thanks.style.display='block';}
setTimeout(Kidzbop.Props.clear_checked_boxes,2000);};Kidzbop.Props.clear_checked_boxes=function(){var thanks=$('thanks_for_props');if(thanks){thanks.style.display='none';}
var checked_props=new Array();var props_form=$('props_form');if(props_form){var boxes=props_form.select('input');for(box in boxes){if(boxes[box].checked){boxes[box].checked=false;boxes[box].next('img').className='pngfix';}}}
var props_counter=$('props_counter');if(props_counter){props_counter.innerHTML=3;}
return true;}
Kidzbop.Props.check_checked_props_form=function(){var checked_props=Kidzbop.Props.get_checked_boxes();var props_form=$('props_form');if(checked_props.length==0){var efect=new Effect.Highlight(props_form);return false;}
else if(checked_props.length<4){return true;}
else{alert("You have selected too many props.");return false;}}
Kidzbop.Props.change_prop_selection=function(selected_check_box,image_check_box){if(selected_check_box.checked==true){selected_check_box.checked=false;image_check_box.className='pngfix';}else{selected_check_box.checked=true;image_check_box.className='pngfix active';}}
Kidzbop.Props.change_selection_of_check_box=function(selected_check_box_id){var selected_check_box=$(selected_check_box_id);var image_check_box=$(selected_check_box_id).next('img');var checked_props=Kidzbop.Props.get_checked_boxes();if(checked_props.length<4){if(checked_props.length==3){if(selected_check_box.checked==true){Kidzbop.Props.change_prop_selection(selected_check_box,image_check_box);}else{checked_props.each(function(box){if(box!=selected_check_box){new Effect.Highlight($(box).up('div'));}});}}else{Kidzbop.Props.change_prop_selection(selected_check_box,image_check_box);}}
else{if(selected_check_box){Kidzbop.Props.change_prop_selection(selected_check_box,image_check_box);}}
$('props_counter').innerHTML=3-Kidzbop.Props.get_checked_boxes().length;}
Event.observe(window,'load',Kidzbop.Props.clear_checked_boxes);function getElementsByTagNames(list,obj){if(!obj)obj=document;var tagNames=list.split(',');var resultArray=new Array();for(var i=0;i<tagNames.length;i++){var tags=obj.getElementsByTagName(tagNames[i]);for(var j=0;j<tags.length;j++){resultArray.push(tags[j]);}}
return resultArray;}
if(!Scrolling)var Scrolling={};Scrolling.createScroll=function(scroller_id,scrollbar_id,width,height){var scroller=new Scrolling.Scroller(document.getElementById(scroller_id),width,height,new Scrolling.ScrollTween());var scrollbar=new Scrolling.Scrollbar(document.getElementById(scrollbar_id),scroller,new Scrolling.ScrollTween());return[scroller,scrollbar];};Scrolling.Scrollbar=function(o,s,t){var self=this;var _components={};var _dimensions={};var _temporary={};var _hasTween=t?true:false;var _timer,_ratio;this.onMouseDown=function(){};this.onMouseUp=function(){};this.onScroll=function(){};this.scrollAmount=5;this.scrollSpeed=30;this.disabled=false;function initialize(){var c=_components;var d=_dimensions;var g=s.getDimensions();s.scrollBar=self;c.up=findComponent("Scrollbar-Up",o);c.down=findComponent("Scrollbar-Down",o);c.track=findComponent("Scrollbar-Track",o);c.handle=findComponent("Scrollbar-Handle",c.track);c.spinner=findComponent("Scrollbar-Preloader",o)||false;d.trackTop=findOffsetTop(c.track);d.trackHeight=c.track.offsetHeight;d.handleHeight=c.handle.offsetHeight;d.x=0;d.y=0;if(_hasTween)t.apply(self);addEvent(s.getContent(),"mousewheel",scrollbarWheel);addEvent(o,"mousedown",scrollbarClickPrimer);self.reset();};function findOffsetTop(o){var t=0;if(o.offsetParent){while(o.offsetParent){t+=o.offsetTop;o=o.offsetParent;}}
return t;};function addEvent(o,t,f){if(o.attachEvent)o.attachEvent('on'+t,f);else o.addEventListener(t,f,false);};function removeEvent(o,t,f){if(o.detachEvent)o.detachEvent('on'+t,f);else o.removeEventListener(t,f,false);};function findComponent(c,o){var kids=o.childNodes;for(var i=0;i<kids.length;i++){if(kids[i].className&&kids[i].className.indexOf(c)>=0){return kids[i];}}};function scroll(y){if(y<0)y=0;if(y>_dimensions.trackHeight-_dimensions.handleHeight)
y=_dimensions.trackHeight-_dimensions.handleHeight;_components.handle.style.top=y+"px";_dimensions.y=y;s.scrollTo(0,Math.round(_dimensions.y*_ratio));self.onScroll();};function scrollbarClickPrimer(e){if(self.disabled)return false;e=e?e:event;if(!e.target)e.target=e.srcElement;scrollbarClick(e.target.className,e);};function scrollbarClick(c,e){var d=_dimensions;var t=_temporary;var cy=e.clientY+document.body.scrollTop;if(c.indexOf("Scrollbar-Up")>=0)
startScroll(-self.scrollAmount);if(c.indexOf("Scrollbar-Down")>=0)
startScroll(self.scrollAmount);if(c.indexOf("Scrollbar-Track")>=0)
if(_hasTween)self.tweenTo((cy-d.trackTop-d.handleHeight/2)*_ratio);else scroll(cy-d.trackTop-d.handleHeight/2);if(c.indexOf("Scrollbar-Handle")>=0){t.grabPoint=cy-findOffsetTop(_components.handle);addEvent(document,"mousemove",scrollbarDrag,false);}
t.target=e.target;t.select=document.onselectstart;document.onselectstart=function(){return false;};self.onMouseDown(e.target,c,e);addEvent(document,"mouseup",stopScroll);};function scrollbarDrag(e){e=e?e:event;var d=_dimensions;var t=parseInt(_components.handle.style.top);var v=e.clientY+document.body.scrollTop-d.trackTop;if(v>=d.trackHeight-d.handleHeight+_temporary.grabPoint)
v=d.trackHeight-d.handleHeight;else if(v<=_temporary.grabPoint)
v=0;else v=v-_temporary.grabPoint;scroll(v);};function scrollbarWheel(e){if(self.disabled)return false;e=e?e:event;var dir=0;if(e.wheelDelta>=120)dir=-1;if(e.wheelDelta<=-120)dir=1;self.scrollBy(dir*20);e.returnValue=false;};function startScroll(y){_temporary.disty=y;_timer=window.setInterval(function(){self.scrollBy(_temporary.disty);},self.scrollSpeed);};function stopScroll(e){e=e?e:event;removeEvent(document,"mousemove",scrollbarDrag);removeEvent(document,"mouseup",stopScroll);document.onselectstart=_temporary.select;if(_timer)window.clearInterval(_timer);self.onMouseUp(_temporary.target,_temporary.target.className,e);};this.reset=function(){var d=_dimensions;var c=_components;var g=s.getDimensions();_ratio=(g.theight-g.vheight)/(d.trackHeight-d.handleHeight);var pos=Math.round(g.y/_ratio);c.handle.style.top=pos+"px";c.handle.ondragstart=function(){return false;};c.handle.onmousedown=function(){return false;};s.reset();if(g.theight<g.vheight){this.disabled=true;o.className+=" Scrollbar-Disabled";}};this.scrollTo=function(y){scroll(y/_ratio);};this.scrollBy=function(y){scroll((s.getDimensions().y+y)/_ratio);};this.scrollToElement=function(element_id){var element=$(element_id);if(element){this.scrollTo(element.positionedOffset()[1]);}};this.swapContent=function(n,w,h){o=n;s.swapContent(o,w,h);initialize();};this.disable=function(){this.disabled=true;o.className+="Scrollbar-Disabled";};this.enable=function(){this.disabled=false;o.className=o.className.replace(/Scrollbar\-Disabled/,"");};this.getContent=function(){return s.getContent();};this.getComponents=function(){return _components;};this.getDimensions=function(){var d=s.getDimensions();d.trackHeight=_dimensions.trackHeight;d.handleHeight=_dimensions.handleHeight;return d;};this.showSpinner=function(flag){if(_components.spinner){if(flag){_components.spinner.style.display='block';}else{_components.spinner.style.display='none';}}};this.resetBar=function(){this.reset();};initialize();};if(!Scrolling)var Scrolling={};Scrolling.Scroller=function(o,w,h,t){var list=getElementsByTagNames("div,ul",o);for(var i=0;i<list.length;i++){if(list[i].className.indexOf("Scroller-Container")>-1){o=list[i];}}
var self=this;var _vwidth=w;var _vheight=h;var _o=o;var _twidth=o.offsetWidth;var _theight=o.offsetHeight;var _hasTween=t?true:false;var _requesting=false;var _timer,_x,_y;this.onScrollStart=function(){};this.onScrollStop=function(){};this.onScroll=function(){};this.scrollBar=false;this.scrollSpeed=30;this.preloadDistance=100;this.fetchUrl=false;this.preloadElements=10;this.totalElements=0;this.actualElements=getNumOfItems();this.resetScrollBar=false;function setPosition(x,y){if(x<_vwidth-_twidth)
x=_vwidth-_twidth;if(x>0)x=0;if(y<_vheight-_theight)
y=_vheight-_theight;if(y>0)y=0;if(!_requesting&&self.fetchUrl&&self.actualElements<self.totalElements&&(_theight-_vheight+y)<self.preloadDistance){_requesting=true;self.scrollBar.showSpinner(true);_fetchItemsRequest();}
_x=x;_y=y;o.style.left=_x+"px";o.style.top=_y+"px";};function _fetchItemsRequest(){new Ajax.Request(self.fetchUrl,{method:'get',parameters:'offset='+self.actualElements,requestHeaders:{Accept:'text/html'},onComplete:function(response){_fetchNewItemsResponse(response);}});}
function _fetchNewItemsResponse(response){o.innerHTML+=response.responseText;self.actualElements=getNumOfItems();_twidth=o.offsetWidth;_theight=o.offsetHeight;self.scrollBar.resetBar();_requesting=false;self.scrollBar.showSpinner(false);}
function getNumOfItems(){var num=0;for(var i=0;i<o.childNodes.length;i++){if(o.childNodes[i].nodeName.search(/.*(div|li).*/i)!=-1)num++;}
return num;}
this.setAjaxPreloader=function(url,preloadNum,totalNum,preloadDistance){this.preloadDistance=preloadDistance;this.fetchUrl=url;this.preloadElements=preloadNum;this.totalElements=totalNum;};this.scrollBy=function(x,y){setPosition(_x-x,_y-y);this.onScroll();};this.scrollTo=function(x,y){setPosition(-x,-y);this.onScroll();};this.startScroll=function(x,y){this.stopScroll();this.onScrollStart();_timer=window.setInterval(function(){self.scrollBy(x,y);},this.scrollSpeed);};this.stopScroll=function(){if(_timer)window.clearInterval(_timer);this.onScrollStop();};this.reset=function(){_twidth=o.offsetWidth;_theight=o.offsetHeight;_x=0;_y=0;if(_hasTween)t.apply(this);};this.swapContent=function(c,w,h){o=c;var list=getElementsByTagNames("div,ul",o);for(var i=0;i<list.length;i++){if(list[i].className.indexOf("Scroller-Container")>-1){o=list[i];}}
if(w)_vwidth=w;if(h)_vheight=h;reset();};this.getDimensions=function(){return{vwidth:_vwidth,vheight:_vheight,twidth:_twidth,theight:_theight,x:-_x,y:-_y};};this.getContent=function(){return o;};this.reset();};if(!Scrolling)var Scrolling={};Scrolling.ScrollTween=function(){var self=this;var _steps=[0,25,50,70,85,95,97,99,100];var _values=[];var _idle=true;var o,_inc,_timer;function tweenTo(y){if(!_idle)return false;var d=o.getDimensions();if(y<0)y=0;if(y>d.theight-d.vheight)
y=d.theight-d.vheight;var dist=y-d.y;_inc=0;_timer=null;_values=[];_idle=false;for(var i=0;i<_steps.length;i++){_values[i]=Math.round(d.y+dist*(_steps[i]/100));}
_timer=window.setInterval(function(){o.scrollTo(_values[_inc]);if(_inc==_steps.length-1){window.clearInterval(_timer);_idle=true;}else _inc++;},o.stepSpeed);};function tweenBy(y){o.tweenTo(o.getDimensions().y+y);};function setSteps(s){_steps=s;};this.apply=function(p){o=p;o.tweenTo=tweenTo;o.tweenBy=tweenBy;o.setSteps=setSteps;o.stepSpeed=30;};};function scrollToSectionHandler(event){var link=Event.findElement(event,'a');var element_id='l-'+link.href.split('#').last();if(scrollbar){scrollbar.scrollToElement(element_id);}
var linkList=Event.findElement(event,'ul');linkList.select('a').each(function(e){e.className='';});link.className='active';Event.stop(event);}
Kidzbop.AudioPlayer=Class.create({initialize:function(){},setPlayer:function(flashPlayer){this.flashPlayer=flashPlayer;},onInit:function(){},onUpdate:function(){if(this.isPlaying=="false"){this.stop();}},play:function(track){this.stop();this.currentTrack=track;this.flashPlayer.SetVariable("method:setUrl",this.currentTrack.url);this.flashPlayer.SetVariable("method:play","");this.flashPlayer.SetVariable("enabled","true");this.currentTrack.play();},stop:function(){if(this.currentTrack!=null){this.currentTrack.stop();}
this.flashPlayer.SetVariable("method:stop","");}});Kidzbop.Track=Class.create({initialize:function(url,albumName,trackName,playButton,stopButton){this.url=url;this.albumName=albumName;this.trackName=trackName;this.playButton=playButton;this.stopButton=stopButton;},play:function(){this.playButton.hide();this.stopButton.show();if(typeof(pageTracker)!='undefined'){pageTracker._trackEvent("Cd Albums",this.albumName,this.trackName+' play event');}
var play_number=this.playButton.up('div.play_number');if(play_number){play_number.addClassName('show_play');}},stop:function(){this.stopButton.hide();this.playButton.show();var play_number=this.playButton.up('div.play_number');if(play_number){play_number.removeClassName('show_play');}}});var audioPlayer=new Kidzbop.AudioPlayer();