var isDebug=false;if((location.href).indexOf("debug=true")!=-1){if(window.console&&window.console.log){isDebug=true;}}Array.prototype.append=function(item){this[this.length]=item;};Array.prototype.clear=function(){this.length=0;};if(!Array.prototype.contains){Array.prototype.contains=function(obj,fromIndex){if(fromIndex==null){fromIndex=0;}else{if(fromIndex<0){fromIndex=Math.max(0,this.length+fromIndex);}}for(var i=fromIndex,j=this.length;i<j;i++){if(obj.indexOf(this[i])!=-1){return true;}}return false;};}function StringBuffer(){this.buffer=[];}StringBuffer.prototype.append=function append(string){this.buffer.push(string);return this;};StringBuffer.prototype.toString=function toString(){return this.buffer.join("");};trim=function(value){value=value.replace(/^\s+/,"");value=value.replace(/\s+$/,"");return value;};openMediaPlayer=function(href,title,options){var mediatheekWindow;pauseActiveFlash();title="VideoZone";options="fullscreen=yes;width=800;height=600";mediatheekWindow=window.open(href,title);if(window.focus){mediatheekWindow.focus();}return false;};var activeFlashId=null;var oldMediaContent="";var oldMediaContentId=null;var oldMediaView;function unloadVideo(){if(oldMediaContentId!=null){pauseActiveFlash();resizeFlashBlock(oldMediaContentId,oldMediaView,"false");$("#"+oldMediaContentId).html(oldMediaContent);oldMediaContentId=null;oldMediaContent="";oldMediaView="";$(".embedExpand").removeClass("embedExpand");}}var globalVars;function loadVideo(vars,fallback){clearTimeout(statusTimer);if(fallback=="undefined"){fallback=false;}if(vars["divId"]!="div_liveStream"){globalVars=vars;}var agent=navigator.userAgent.toLowerCase();if(agent.indexOf("iphone")!=-1||agent.indexOf("ipad")!=-1){if(vars["type"]=="YouTubeVideo"&&vars["src"]!=undefined){window.location=vars["src"];}else{if(vars["iphoneServer"]!=undefined&&vars["iphonePath"]!=undefined){window.location=vars["iphoneServer"]+"/"+vars["iphonePath"]+"/playlist.m3u8";}}}else{unloadVideo();if($("#"+vars["divId"]+" embed, #"+vars["divId"]+" object").size()==0){try{if(vars["statSite"].indexOf("deredactie")!=-1&&vars["view"]=="eyecatcherL"){vars["w"]=$("#"+vars["divId"]).width();vars["h"]=$("#"+vars["divId"]).height();}}catch(e){}var parent=$(this);oldMediaContentId=vars["divId"];oldMediaContent=$("#"+vars["divId"]).html();oldMediaView=vars["view"];$("#"+vars["divId"]).html("");var flashVars=new StringBuffer();if(vars["type"]=="YouTubeVideo"){flashVars.append('{"mediaId":"');flashVars.append(vars["flashId"]);flashVars.append('","image":"');flashVars.append(vars["thumb"]);if(vars["autoStart"]=="false"){flashVars.append('","autostart":"false"');}else{flashVars.append('","autostart":"true"');}flashVars.append(',"provider":"youtube"');if(vars["relatedXML"]!=null&&vars["relatedXML"].length>0){flashVars.append(',"plugins":"drelated-1,/html/flash/common/streamsense_jwp-v1.swf"');flashVars.append(',"drelated.dxmlpath":"');flashVars.append(vars["relatedXML"]);flashVars.append('","drelated.dposition":"center"');flashVars.append(',"drelated.dskin":"/html/flash/common/grayskin.swf"');flashVars.append(',"drelated.dtarget":"_self"');}flashVars.append(',"file":"');flashVars.append(vars["src"]);flashVars.append('","skin":"/html/flash/common/glow/glow.xml"}');}else{flashVars.append('{"mediaId":"');flashVars.append(vars["flashId"]);flashVars.append('","image":"');flashVars.append(vars["thumb"]);if(vars["autoStart"]=="false"){flashVars.append('","autostart":"false"');}else{flashVars.append('","autostart":"true"');}if(vars["audioUrl"]!=undefined){flashVars.append(',"provider":"sound"');flashVars.append(',"file":"'+vars["audioUrl"]+'"');}else{flashVars.append(',"provider":"rtmp"');flashVars.append(',"streamer":"');flashVars.append((!fallback)?vars["rtmpServer"]:vars["rtmptServer"]);flashVars.append('","file":"');flashVars.append((!fallback)?vars["rtmpPath"]:vars["rtmptPath"]);flashVars.append('","streamsense_jwp.typestream":"');flashVars.append(vars["statType"]);flashVars.append('","streamsense_jwp.playlisttitle":"');flashVars.append(vars["statPlaylist"]);flashVars.append('","streamsense_jwp.programtitle":"');flashVars.append(vars["statProgram"]);flashVars.append('","streamsense_jwp.episodetitle":"');flashVars.append(JSON.quote(vars["title"],""));flashVars.append('","streamsense_jwp.debug":"on"');flashVars.append(',"bufferlength":"5"');if(vars["relatedXML"]!=null&&vars["relatedXML"].length>0){flashVars.append(',"plugins":"drelated-1,/html/flash/common/streamsense_jwp-v1.swf"');flashVars.append(',"drelated.dxmlpath":"');flashVars.append(vars["relatedXML"]);flashVars.append('","drelated.dposition":"center"');flashVars.append(',"drelated.dskin":"/html/flash/common/grayskin.swf"');flashVars.append(',"drelated.dtarget":"_self"');}else{flashVars.append(',"plugins":"/html/flash/common/streamsense_jwp-v1.swf"');}}flashVars.append(',"controlbar":"over"');flashVars.append(',"skin":"/html/flash/common/glow/glow.xml"');flashVars.append("}");}flashvars=JSON.parse(flashVars.toString());if(vars["view"]=="paragraphResource"||vars["view"]=="eyecatcherEmbeddedL"||vars["view"]=="eyecatcherL"||vars["view"]=="default12"){resizeFlashBlock(vars["divId"],"paragraphResource","true");}if(vars["view"]=="paragraphResource"){vars["w"]=468;vars["h"]=264;}var params={"allowfullscreen":"true","allowscriptaccess":"always","bgcolor":"#000000","wmode":"transparent"};var attributes={"id":vars["flashId"],"name":vars["flashId"]};$("#"+vars["divId"]).html('<div id="videodummy"></div>');swfobject.embedSWF("/html/flash/common/player.swf","videodummy",vars["w"],vars["h"],"9.0.115","/html/flash/expressinstall.swf",flashvars,params,attributes);}var divParts=vars["divId"].split("div_");$("#flashPlayerBlock_"+divParts[1]).addClass("embedExpand");}}var player;var statusTimer;function playerReady(object){player=document.getElementById(object.id);statusTimer=setTimeout("checkStatus()",5000);}var retry=1;function checkStatus(){clearTimeout(statusTimer);var playerState="UNKNOWN";try{playerState=player.getConfig().state;}catch(e){if(isDebug){console.error("checkStatus: %s",e.message);}}if(playerState=="BUFFERING"){if(retry<3){retry++;statusTimer=setTimeout("checkStatus()",5000);}else{var temp="#"+oldMediaContentId;unloadVideo();$(temp).prepend('<span class="message">Deze video kan niet afgespeeld worden in jouw regio.</span>');}}else{if(playerState!="PLAYING"&&playerState!="PAUSED"&&playerState!="IDLE"){loadVideo(globalVars,true);}}}setActiveFlashId=function(id){if(activeFlashId!=null&&activeFlashId!=id){pauseActiveFlash();}activeFlashId=id;};pauseActiveFlash=function(){if(oldMediaContentId!=null){try{var id=oldMediaContentId.substr("div_".length,oldMediaContentId.length);if(id!=""){var flashId="flash_"+id;var activeFlashPlayer=document.getElementById(flashId);if(activeFlashPlayer!=null){try{activeFlashPlayer.sendEvent("play",false);}catch(e){if(isDebug){console.error("activeFlashPlayer.sendEvent('play') -> %s",e.message);}}}}}catch(e){}}};function startFullScreen(){var activeFlashPlayer=document.getElementById(activeFlashId);try{activeFlashPlayer.pauseResume();activeFlashPlayer=null;}catch(e){if(isDebug){console.error("startFullscreen -> %s",e.message);}}}function exitFullscreen(){}resizeFlashBlock=function(divId,view,enlarge){if(view=="paragraphResource"){var containerDiv=$("#"+divId);var divParts=divId.split("div_");var flashId="flash_"+divParts[1];var flashDiv=$("#"+flashId);var flashPlayerBlockId="flashPlayerBlock_"+divParts[1];switch(view,enlarge){case"paragraphResource","true":width=468;height=264;$(flashDiv).css("margin-left","0px");$("#"+flashPlayerBlockId).parent(".paragraph-resource").addClass("expanded");$("#"+flashPlayerBlockId).parent(".paragraph-resource").removeClass("collapsed");break;case"paragraphResource","false":width="100%";height="100%";$(flashDiv).css("margin-left","15px");$("#"+flashPlayerBlockId).parent(".paragraph-resource").removeClass("expanded");$("#"+flashPlayerBlockId).parent(".paragraph-resource").addClass("collapsed");break;}$("#"+flashPlayerBlockId).width(width);$("#"+flashPlayerBlockId).height(height);$(flashDiv).width(width);$(flashDiv).height(height);try{var flashObject=containerDiv.find("embed");flashObject.width(width);flashObject.height(height);if(flashObject.length=0){flashDiv.focus();}}catch(e){if(isDebug){console.error("resizeFlashBlock -> %s",e.message);}}}};Array.prototype.appendIfNotInArray=function(value){if(!this.isInArray(value)){this[this.length]=value;}};Array.prototype.removeFromArray=function(value){for(var i=0;i<this.length;i++){if(this[i]==value){this.splice(i,1);}}};Array.prototype.isInArray=function(value){for(var i=0;i<this.length;i++){if(this[i]==value){return true;}}return false;};var arrayDelimiter=",";Array.prototype.toString=function(){return this.join(arrayDelimiter);};String.prototype.toArray=function(){return this.split(arrayDelimiter);};appendToCookie=function(cookieName,value){var cookieValue=$.cookie(cookieName);var cookieValueArray=(cookieValue==null||cookieValue=="")?new Array():cookieValue.toArray();cookieValueArray.appendIfNotInArray(value);var newCookieValue=cookieValueArray.toString();$.cookie(cookieName,newCookieValue,{expires:365});};removeFromCookie=function(cookieName,value){var cookieValue=$.cookie(cookieName);if(cookieValue!=null&&cookieValue!=""){var cookieValueArray=cookieValue.toArray();cookieValueArray.removeFromArray(value);$.cookie(cookieName,cookieValueArray,{expires:365});}};numberOfItemsInCookie=function(cookieName){var cookieValue=$.cookie(cookieName);if(cookieValue!=null&&cookieValue!=""){var cookieValueArray=cookieValue.toArray();return cookieValueArray.length;}return 0;};$.fn.getClassLike=function(classPart){var classes=$(this).attr("class");var className="";if(classes!=undefined&&classes.length>0){var classArr=classes.split(" ");for(i=0;i<classArr.length;i++){if(classArr[i].indexOf(classPart)!=-1){className=classArr[i];break;}}}return className;};function setTextSize(fontSize){var pct;switch(fontSize){case"a":pct="85";break;case"aa":pct="100";break;case"aaa":pct="120";break;}document.getElementById("aside").style.fontSize=pct+"%";document.getElementById("main").style.fontSize=pct+"%";document.getElementById("bottom").style.fontSize=pct+"%";setCookie("nbfsize",fontSize);}function setAsHome(myLink){try{myLink.style.behavior="url(#default#homepage)";myLink.setHomePage(location.href);}catch(e){var msg="";var browserNaam=navigator.appName;if(browserNaam=="Netscape"){msg="Sleep deze link naar het homepage ";msg+="icoontje (het huisje) om deze pagina in te stellen als ";msg+="startpagina!";}else{if(browserNaam=="Opera"){msg="Ga naar Extra of Tools (bij de Engelstalige versie)";msg+="Kies Voorkeuren of Preferences";msg+="Bij Startpagina of Home Page geef je het adres van deze website";msg+="Klik op OK";}else{if(browserNaam=="Microsoft Internet Explorer"){msg="Ga naar Extra of Tools (bij de Engelstalige versie)";msg+="Kies Internet-opties/Internet-options.";msg+="Bij Startpagina of Home Page geef je het adres van deze website";}else{msg="ik weet niet welke browser dit is...";}}}alert(msg);}}function openPopup(url,title,x,y,width,height,resizable,menubar,scrollbars){window.open(url,title,"menubar="+menubar+",resizable="+resizable+",width="+width+",height="+height+",left="+x+",top="+y+",scrollbars="+scrollbars);}function vrtbalk_gotoURL(siteURL,siteName,openNewWindow){var destinationURL=null;var nedstatURL_to_site=null;if(vrtbalk_isNedstatEnabled()){switch(siteName){case"Nieuws":nedstatURL_to_site="www-deredactie-be.index";break;case"Sport":nedstatURL_to_site="www-sporza-be";break;case"Cultuur":nedstatURL_to_site="www-klara-be";break;case"Weer":nedstatURL_to_site="www-deredactie-be.weer";break;case"Verkeer":nedstatURL_to_site="www-deredactie-be.verkeer";break;case"Webshop":nedstatURL_to_site="www-cosmox-be.vrtshop";break;default:return true;break;}destinationURL=vrtbalk_getNedstatPrefixURL()+nedstatURL_to_site+vrtbalk_getNedstatSuffixURL()+siteURL;}else{destinationURL=siteURL;}if(openNewWindow==false){document.location.href=destinationURL;}else{var u=new Date();window.open(destinationURL,"vrtbalkWindow"+u.getTime());}return false;}function vrtbalk_openRadiospeler(){try{var siteURL="http://internetradio.vrt.be/player_detection.html?qsbrand=";var radiospelerId=null;var regioName=null;var destinationURL=null;if(vrtbalk_vars.radiospelerId!=null||vrtbalk_vars.radiospelerId!=undefined||vrtbalk_vars.radiospelerId!=""){radiospelerId=vrtbalk_vars.radiospelerId;}else{radiospelerId=11;}siteURL+=radiospelerId;if(vrtbalk_isNedstatEnabled()){if(radiospelerId>=20&&radiospelerId<30){switch(vrtbalk_vars.radiospelerId){case 21:regioName="antwerpen";break;case 22:regioName="vlaamsbrabant";break;case 23:regioName="limburg";break;case 24:regioName="oostvlaanderen";break;case 25:regioName="westvlaanderen";break;default:regioName="nationaal";break;}}destinationURL=vrtbalk_getNedstatPrefixURL()+"internetradiospeler-be";if(regioName!=null){destinationURL+=".regio."+regioName;}destinationURL+=vrtbalk_getNedstatSuffixURL()+siteURL;}else{destinationURL=siteURL;}var u=new Date();window.open(destinationURL,"vrtwindow"+u.getTime(),"resizable=0,toolbar=0,scrollbars=0,location=0,status=0,menubar=0,width=787,height=433,left=301,top=232");return false;}catch(e){return true;}}function vrtbalk_getNedstatSiteName(){if(vrtbalk_vars.nedstatSiteName==null||vrtbalk_vars.nedstatSiteName==undefined||vrtbalk_vars.nedstatSiteName==""){return"vrt-be";}else{return nedstatSiteName=vrtbalk_vars.nedstatSiteName;}}function vrtbalk_getNedstatPrefixURL(){return"http://be.sitestat.com/vrt/"+vrtbalk_getNedstatSiteName()+"/s?clickout.VAN.navigatiebalk.NAAR.";}function vrtbalk_getNedstatSuffixURL(){return"&ns_type=clickout&ns_url=";}function vrtbalk_isNedstatEnabled(){if(vrtbalk_vars.enableNedstat!=null&&vrtbalk_vars.enableNedstat!=undefined&&vrtbalk_vars.enableNedstat!=""){return true;}else{return false;}}$(document).ready(function(){$("#vrthead").children(".hnav").children("li").children("a").click(function(e){var sn=$(this).children("span").html();var shref=$(this).attr("href");if(sn=="Radiospeler"){vrtbalk_openRadiospeler(shref);}else{if(sn=="Webshop"){vrtbalk_gotoURL(shref,sn,true);}else{vrtbalk_gotoURL(shref,sn,false);}}e.stopPropagation();e.preventDefault();});});$("#bottomnav li a").click(function(){$(this).parent().siblings(".current").removeClass("current");$(this).parent().addClass("current");});TabSlider=function(canvasId,sliderId,elementClass,slideTime){this.canvasId=canvasId;this.sliderId=sliderId;this.elementClass=elementClass;this.slideTime=slideTime;this.jqPrevId="";this.$prevBtn=null;this.jqNextId="";this.$nextBtn=null;this.startTab=0;this.tabsWidth=0;this.nrOfTabs=0;this.nrOfTabsCalculated=false;this.tabPositions=new Array();};TabSlider.prototype.getCanvasId=function(){return this.canvasId;};TabSlider.prototype.getCanvasObj=function(){return $("#"+this.canvasId);};TabSlider.prototype.getSliderId=function(){return this.sliderId;};TabSlider.prototype.getElementClass=function(){return this.elementClass;};TabSlider.prototype.getSlideTime=function(){return this.slideTime;};TabSlider.prototype.getJqPrevId=function(){return this.jqPrevId;};TabSlider.prototype.setJqPrevId=function(jqPrevId){this.jqPrevId=jqPrevId;};TabSlider.prototype.getPrevBtn=function(){if(this.$prevBtn==null){this.$prevBtn=$(this.getJqPrevId());}return this.$prevBtn;};TabSlider.prototype.removePrevBtn=function(){if(this.getPrevBtn()!=null){this.getPrevBtn().remove();}};TabSlider.prototype.getJqNextId=function(){return this.jqNextId;};TabSlider.prototype.setJqNextId=function(jqNextId){this.jqNextId=jqNextId;};TabSlider.prototype.getNextBtn=function(){if(this.$nextBtn==null){this.$nextBtn=$(this.getJqNextId());}return this.$nextBtn;};TabSlider.prototype.removeNextBtn=function(){if(this.getNextBtn()!=null){this.getNextBtn().remove();}};TabSlider.prototype.getStartTab=function(){return this.startTab;};TabSlider.prototype.setStartTab=function(startTab){this.startTab=startTab;};TabSlider.prototype.getTabPostions=function(){return this.tabPositions;};TabSlider.prototype.setTabPositions=function(tabPositions){this.tabPositions=tabPositions;};TabSlider.prototype.getTabsWidth=function(){return this.tabsWidth;};TabSlider.prototype.setTabsWidth=function(tabsWidth){this.tabsWidth=tabsWidth;};TabSlider.prototype.getTabs=function(){return $($("#"+this.getSliderId()+" ."+this.getElementClass()));};TabSlider.prototype.getNrOfTabs=function(tabsWidth){if(!this.nrOfTabsCalculated){this.nrOfTabs=this.getTabs().length;this.nrOfTabsCalculated=true;}return this.nrOfTabs;};TabSlider.prototype.resetCanvas=function(){$("#"+this.getCanvasId()).scrollLeft(0);$(this.setStartTab(0));};TabSlider.prototype.deActivate=function(){this.removePrevBtn();this.removeNextBtn();this.resetCanvas();};TabSlider.prototype.activate=function(){var tabSlider=this;var tabsWidth=0;var tabSpacerWidth=0;var canvasId=this.getCanvasId();var $canvas=this.getCanvasObj();var sliderId=this.getSliderId();var elementClass=this.getElementClass();var slideTime=this.getSlideTime();var jqPrevId="";var jqNextId="";var tabPositions;if(isDebug){console.group("TabSlider");}tabPositions=this.storeTabPositions();var $lastTab=this.getTab(this.getNrOfTabs()-1);tabsWidth=$lastTab.position().left+$lastTab.outerWidth(true);this.setTabsWidth(tabsWidth);var prevId=canvasId+"_prev";var nextId=canvasId+"_next";jqPrevId="#"+prevId;jqNextId="#"+nextId;this.setJqPrevId(jqPrevId);this.setJqNextId(jqNextId);var prevNext='<div id="'+prevId+'" class="'+canvasId+'_slidePrev"></div><div id="'+nextId+'" class="'+canvasId+'_slideNext"></div>';$("#"+canvasId+" .prevNext").append(prevNext);if($canvas.width()<tabsWidth){$(jqNextId).show();$(jqNextId).click(function(event){event.preventDefault();tabSlider.showNextTab();});}if(isDebug){console.log("Total tabsWidth = %d",tabsWidth);console.log("CanvasWidth = %d",$canvas.width());}$(jqPrevId).click(function(event){var startTab=tabSlider.getStartTab();if(isDebug){console.group("prevClick");console.log("StartTab = %d",startTab);}if(startTab>0&&startTab-1<tabPositions.length){var prevPos=tabPositions[startTab-1];if(isDebug){console.log("Shifting to previous tab with position = %d",prevPos);}$canvas.animate({scrollLeft:prevPos},slideTime,function(){if(isDebug){console.log("showNextTab");}$(jqNextId).show();startTab--;tabSlider.setStartTab(startTab);if(startTab==0){$(jqPrevId).hide();}});}else{if(isDebug){console.log("no shift to left required because startTab <= 0");}}if(isDebug){console.groupEnd();}});if(isDebug){console.groupEnd();}};TabSlider.prototype.storeTabPositions=function(){var tabPositions=new Array();var $tabs=this.getTabs();if($tabs!=null){$tabs.each(function(){tabPositions.append($(this).position().left);});this.setTabPositions(tabPositions);if(isDebug){console.log("tabPositions contains %d tabs",tabPositions.length);console.log("tabPositions = %s",tabPositions.toString());}}return tabPositions;};TabSlider.prototype.getTab=function(tabNr){var $tab=null;if(tabNr>=0&&tabNr<this.getNrOfTabs()){var $tabs=this.getTabs();if($tabs!=null){$tab=$($tabs.get(tabNr));}}return $tab;};TabSlider.prototype.showTab=function($tab){var tabSlider=this;var $canvas=this.getCanvasObj();var sliderId=this.getSliderId();var elementClass=this.getElementClass();var slideTime=this.getSlideTime();var $prevBtn=this.getPrevBtn();var $nextBtn=this.getNextBtn();var $tabs=this.getTabs();var tabsWidth=this.getTabsWidth();var scrollLeft=0;var tabPosLeft=0;var tabPosRight=0;var tabPositions=this.getTabPostions();var posMin=$canvas.scrollLeft();var posMax=posMin+$canvas.width();if(isDebug){console.log("Current canvas startPos = %d, endPos = %d",posMin,posMax);}$tabs.each(function(i){if($(this).html()==$tab.html()){tabPosLeft=tabPositions[i];tabPosRight=tabPosLeft+$(this).width();return false;}});if(tabPosLeft>posMax){if(isDebug){console.log("Reposition slider");}var startTab=this.getStartTab();var scrollPos=0;while(tabPosRight>posMax&&startTab<tabPositions.length){startTab++;scrollPos=tabPositions[startTab];posMax=scrollPos+$canvas.width();}if(scrollPos>0){$canvas.animate({scrollLeft:scrollPos},slideTime,function(){$prevBtn.show();if($canvas.scrollLeft()+$canvas.width()>=tabsWidth){$nextBtn.hide();}tabSlider.setStartTab(startTab);});}}};TabSlider.prototype.showNextTab=function(){var tabSlider=this;var $canvas=this.getCanvasObj();var startTab=this.getStartTab();var tabsWidth=this.getTabsWidth();var slideTime=this.getSlideTime();var jqPrevId=this.getJqPrevId();var jqNextId=this.getJqNextId();var tabPositions=this.getTabPostions();if(isDebug){console.group("showNextTab");console.log("startTab = %d",startTab);console.log("tabPositions.length = %d",tabPositions.length);}if(startTab+1<tabPositions.length){var nextPos=tabPositions[startTab+1];var extra=0;if(isDebug){console.log("Current canvas leftposition = %d",$canvas.scrollLeft());console.log("Old first Tab = %d with leftposition = %d",startTab,tabPositions[startTab]);console.log("New first Tab = %d with leftposition = %d",startTab+1,tabPositions[startTab+1]);console.log("Extra = %d",extra);}$canvas.animate({scrollLeft:tabPositions[startTab+1]+extra},slideTime,function(){$(jqPrevId).show();if(tabPositions[startTab+1]+$canvas.width()>=tabsWidth){$(jqNextId).hide();}tabSlider.setStartTab(startTab+1);if(isDebug){console.log("First tab is now %d",tabSlider.getStartTab());}});}else{if(isDebug){console.log("No shifting because startTab + 1 <= tabSlider.getNrOfTabs()-1");}}if(isDebug){console.groupEnd();}};jQuery.removeInvalid=function jQuery$escape(s){escape_re=/[#;&,\.\+\*~':"!\^\$\[\]\(\)=>|\/\\]/;var left=s.split(escape_re,1)[0];if(left==s){return s;}return left+jQuery.removeInvalid(s.substr(left.length+1));};$(document).ready(function(){var DEFAULT_MEDIA="defaultMedia";$(".divider.navigationgroup.showMedia").each(function(){var defaultId=0;var className=$(this).getClassLike(DEFAULT_MEDIA);if(className!=""){var nr=className.substr(DEFAULT_MEDIA.length,className.length);if(nr!=""&&!isNaN(nr)&&nr<$(this).find("input.thumb").size()){defaultId=nr;}}var navGrpImgLoader=new NavGroupImgLoader($(this),500,defaultId);navGrpImgLoader.activate();});});NavGroupImgLoader=function($parent,timer,defaultId){this.timer=timer;this.$parent=$parent;this.$input=null;this.$activeLink=null;this.defaultId=defaultId;};NavGroupImgLoader.prototype.getDefaultId=function(){return this.defaultId;};NavGroupImgLoader.prototype.getParent=function(){return this.$parent;};NavGroupImgLoader.prototype.getTimer=function(){return this.timer;};NavGroupImgLoader.prototype.getInput=function(){return this.$input;};NavGroupImgLoader.prototype.setInput=function($input){this.$input=$input;};NavGroupImgLoader.prototype.setActiveLink=function($activeLink){if(this.$activeLink!=null){this.$activeLink.removeClass("active");}this.$activeLink=$activeLink;this.$activeLink.addClass("active");};NavGroupImgLoader.prototype.activate=function(){if(this.getParent()!=null){var $h4=this.getParent().find("h4");if($h4!=null){$h4.after('<a class="link" target="_blank"><img src="/html/images/spacer.gif"/><span class="videooverlay"/></a>');this.setInput(this.getParent().find("input.thumb:eq("+this.getDefaultId()+")"));this.showMedia();this.enableHover();}}};NavGroupImgLoader.prototype.showMedia=function(){var $input=this.getInput();if($input!=null){var imgSrc=$input.val();var $img=this.getParent().find("img");if($img!=null){$img.attr("src",imgSrc);var $link=$input.parent().find("a");if($link!=null){this.setActiveLink($link);var title=$.removeInvalid($link.text());$img.attr("title",title);this.getParent().find("a.link").attr("href",$link.attr("href"));}}}};NavGroupImgLoader.prototype.enableHover=function(){var navGroupImgLoader=this;this.getParent().find("li").hoverIntent({over:function(){navGroupImgLoader.setInput($(this).find("input.thumb"));navGroupImgLoader.showMedia();},timeout:navGroupImgLoader.getTimer(),out:function(){}});};if(!this.JSON){this.JSON={};}(function(){function f(n){return n<10?"0"+n:n;}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string,wrapper){wrapper=typeof (wrapper)!="undefined"?wrapper:'"';escapable.lastIndex=0;return escapable.test(string)?wrapper+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);})+wrapper:wrapper+string+wrapper;}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key);}if(typeof rep==="function"){value=rep.call(holder,key,value);}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null";}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null";}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v;}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v);}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v;}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" ";}}else{if(typeof space==="string"){indent=space;}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify");}return str("",{"":value});};}if(typeof JSON.quote!=="function"){JSON.quote=quote;}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}return reviver.call(holder,key,value);}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);});}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j;}throw new SyntaxError("JSON.parse");};}}());
