NewMind.registerNameSpace("NewMind.ETWP.env");NewMind.registerNameSpace("NewMind.ETWP.ControlData");if(NewMind.env.page.gatrackexitlinks){$(function(){if(typeof pageTracker==="object"||typeof _gaq==="object"){$("a[href*='://'],a[href*='%3A%2F%2F']").live("click",function(){var href=unescape($(this).attr("href"));if(href.indexOf(window.location.hostname.replace("www.",""))!==-1){return true;}var linkStartIndex=href.indexOf("://")+3;var fakePageName=href.substr(linkStartIndex);var utmVarsStartIndex=fakePageName.indexOf("utm_source");if(utmVarsStartIndex!==-1){fakePageName=fakePageName.substr(0,utmVarsStartIndex-1);}fakePageName='/external-link/'+fakePageName.replace('www.','');if(typeof _gaq==="object"){_gaq.push(['_trackPageview',fakePageName]);}else{pageTracker._trackPageview(fakePageName);}});}});}$(function(){var objQueryData=NewMind.GetQuerystringData();if(objQueryData["widget_marketsource"]!==undefined){$("a:not([href*='widget_marketsource'])").attr("target","_blank");}});function AddEventListener(obj,type,action){NewMind.dom.addEventListener(obj,type,action);}function GetEventSource(pthis){if(!document.all){var x=pthis;}else{var x=window.event.srcElement;}return x;}function returnFalse(e){var ev=e||window.event;if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}}function findAncestorNode(el,strAncestorNode,strAncestorClassName){var ancestorNode=el;do{ancestorNode=ancestorNode.parentNode;}while(ancestorNode.nodeName.toLowerCase()!=strAncestorNode.toLowerCase()&&ancestorNode.className!=strAncestorClassName);return ancestorNode;}function iefix(){try{objects=document.getElementsByTagName("object");for(var i=0;i<objects.length;i++){if(objects[i].className=='iefix'){objects[i].outerHTML=objects[i].outerHTML;}}}catch(e){}}AddEventListener(window,'load',iefix);function getAnchorPosition(anchorname){var useWindow=false;var coordinates=new Object();var x=0,y=0;var use_gebi=false,use_css=false,use_layers=false;if(document.getElementById){use_gebi=true;}else if(document.all){use_css=true;}else if(document.layers){use_layers=true;}if(use_gebi&&document.all){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else if(use_gebi){var o=document.getElementById(anchorname);x=AnchorPosition_getPageOffsetLeft(o);y=AnchorPosition_getPageOffsetTop(o);}else if(use_css){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else if(use_layers){var found=0;for(var i=0;i<document.anchors.length;i++){if(document.anchors[i].name==anchorname){found=1;break;}}if(found==0){coordinates.x=0;coordinates.y=0;return coordinates;}x=document.anchors[i].x;y=document.anchors[i].y;}else{coordinates.x=0;coordinates.y=0;return coordinates;}coordinates.x=x;coordinates.y=y;return coordinates;}function getAnchorWindowPosition(anchorname){var coordinates=getAnchorPosition(anchorname);var x=0;var y=0;if(document.getElementById){if(isNaN(window.screenX)){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else{x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}}else if(document.all){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else if(document.layers){x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}coordinates.x=x;coordinates.y=y;return coordinates;}function AnchorPosition_getPageOffsetLeft(el){var ol=el.offsetLeft;while((el=el.offsetParent)!=null){ol+=el.offsetLeft;}return ol;}function AnchorPosition_getWindowOffsetLeft(el){return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;}function AnchorPosition_getPageOffsetTop(el){var ot=el.offsetTop;while((el=el.offsetParent)!=null){ot+=el.offsetTop;}return ot;}function AnchorPosition_getWindowOffsetTop(el){return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;}function ElementScrollTo(objEleSrc){if((!window.scroll)||(!objEleSrc))return false;var intImageStart=AnchorPosition_getWindowOffsetTop(objEleSrc);if(isNaN(parseInt(intImageStart)))return false;var OFFSET_TOP=16;var intImageHeight=parseInt(objEleSrc.height);if(isNaN(intImageHeight)||(intImageHeight<=0)&&!isNaN(objEleSrc.offsetHeight))intImageHeight=parseInt(objEleSrc.offsetHeight);var intScrollPosY=GetScrollPosY();var intViewHeight=GetViewHeight();if(isNaN(intImageHeight)||(intImageHeight<=0)||(intScrollPosY==null)||(intViewHeight==null)){var intScrollToY=intImageStart-OFFSET_TOP;if(intScrollToY<0)intScrollToY=0;scroll(0,intScrollToY);return true;}var intImageEnd=intImageStart+intImageHeight;if((intScrollPosY>intImageStart)||(intScrollPosY+intViewHeight<intImageEnd)){var intScrollToY=intImageStart-OFFSET_TOP;if(intScrollToY<0)intScrollToY=0;scroll(0,intScrollToY);}return true;function GetScrollPosY(){var intScrollY=null;if(document.all){if(!document.documentElement.scrollTop)intScrollY=document.body.scrollTop;else intScrollY=document.documentElement.scrollTop;}else intScrollY=window.pageYOffset;if(isNaN(parseInt(intScrollY)))intScrollY=null;return intScrollY;}function GetViewHeight(){if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientHeight;}else if(document.body){return document.body.clientHeight;}return null;}}NewMind.ETWP.GetRelativeSizeFromPixels=function(strPixels){if(!strPixels)return strPixels;strPixels=String(strPixels);if(strPixels.length<3)return strPixels;if(strPixels.substring(strPixels.length-2).toUpperCase()!="PX")return strPixels;var intPixels=parseInt(strPixels,10);if(isNaN(intPixels))return strPixels;return(intPixels/16)+"em";};function ControlScriptEnablerInit(bPrevCtrl){var strId="ElScriptEnabler"+parseInt(Math.random()*1000000000);document.write("<div id=\""+strId+"\"><!-- --></div>");var fncEnable=function(){Enable(bPrevCtrl);};setTimeout(fncEnable,1);return;function Enable(bPrevCtrl){if((typeof(bPrevCtrl)==="undefined")||(bPrevCtrl!==true))bPrevCtrl=false;var objEle=document.getElementById(strId);if(!objEle)return;var objEleCtrl=findAncestorNode(objEle,"div","sys_control");if(!objEleCtrl)return;if(bPrevCtrl){objEleCtrl=PreviousSibling(objEleCtrl);if(!objEleCtrl)return;}if(!objEleCtrl.hasChildNodes())return;for(var intIndex=0;intIndex<objEleCtrl.childNodes.length;intIndex++)ApplyScriptClass(objEleCtrl.childNodes[intIndex]);return;function ApplyScriptClass(objEle){if(IsTextNode(objEle))return;var strScriptEnabled="ScriptEnabled";var strClass=objEle.className;if((" "+strClass+" ").indexOf(" "+strScriptEnabled+" ")===-1)strClass=strClass+" "+strScriptEnabled;objEle.className=strClass;}function PreviousSibling(objEle){while(1){objEle=objEle.previousSibling;if(!objEle)return null;if(!IsTextNode(objEle))return objEle;}}function IsTextNode(objEle){return((!objEle)||(typeof(objEle.tagName)==="undefined")||(objEle.tagName==="!"));}}}function externalLinks(){if(!document.getElementsByTagName)return;var arrLinks=document.getElementsByTagName("a");for(var i=0;i<arrLinks.length;i++){var objLink=arrLinks[i];if((objLink.getAttribute("href"))&&((" "+objLink.getAttribute("rel")+" ").indexOf(" external ")!==-1)){objLink.onclick=GenNewFunc(TargetAttribCheat,(typeof(objLink.onclick)==="undefined")?null:objLink.onclick);}}function GenNewFunc(fncNew,fncOld){var objLink=null;return function(){fncNew.apply(this,arguments);if(fncOld!=null)return fncOld.apply(this,arguments);};}function TargetAttribCheat(e,bEnable,bAutoDisable,intAutoDisTimeout){e=e||window.event;if(!e)return;var objSrc=e.srcElement||e.target;if(!objSrc)return;while(String(objSrc.tagName).toUpperCase()!=="A"){if((!objSrc)||(objSrc.parentNode===objSrc))return;objSrc=objSrc.parentNode;}if((typeof(bEnable)==="undefined")||(bEnable!==false))bEnable=true;if((typeof(bAutoDisable)==="undefined")||(bAutoDisable!==false))bAutoDisable=true;if((typeof(intAutoDisTimeout)==="undefined")||isNaN(intAutoDisTimeout))intAutoDisTimeout=100;Work(objSrc,bEnable,bAutoDisable,intAutoDisTimeout);function Work(objSrc,bEnable,bAutoDisable,intAutoDisTimeout){if(bEnable){if((typeof(objSrc.targetOldNM)==="undefined")||(objSrc.targetOldNM===null)){if(typeof(objSrc.target)==="undefined")objSrc.targetOldNM="";else objSrc.targetOldNM=objSrc.target;}objSrc.target="_blank";if(bAutoDisable)setTimeout(function(){Work(objSrc,false);},intAutoDisTimeout);}else{if(typeof(objSrc.targetOldNM)!=="undefined"){objSrc.target=objSrc.targetOldNM;try{deleteobjSrc["targetOldNM"];}catch(e){objSrc.targetOldNM=null;}}}}}}AddEventListener(window,'load',externalLinks);NewMind.ETWP.GetQuerystringData=NewMind.GetQuerystringData;NewMind.ETWP.GetControlKey=function(node){var nodeClass=String($(node).attr('class'));var arrSegments=nodeClass.split(" ");var iControlKey=0;for(iIndex=0;iIndex<arrSegments.length;iIndex++){var strSegment=arrSegments[iIndex];if(strSegment.substring(0,1)==="c"){strSegment=strSegment.substring(1,strSegment.length);var iKey=parseInt(strSegment,10);if(!isNaN(iKey)){iControlKey=iKey;break;}}}return iControlKey;};NewMind.ETWP.MouseOver=function(){return{init:function(sSelector){$(sSelector).mouseover(function(){$(this).addClass('ie-hover');}).mouseout(function(){$(this).removeClass('ie-hover');});}};}();NewMind.ETWP.TabSwitcherHelpers=function(){return{IsInTabControl:function($control){if(typeof($control.jquery)==="undefined"){return;}var bIsInTabControl=false;if(typeof(NewMind.ETWP.TabSwitcher)!=="undefined"){bIsInTabControl=$control.parents("div.ctl_Tabs").length>0;}return bIsInTabControl;},CheckForTabReSize:function($control){if(typeof($control.jquery)==="undefined"){return;}if(typeof(NewMind.ETWP.TabSwitcher)!=="undefined"){var $tabContainer=$control.parents("div.ctl_Tabs");if($tabContainer.length>0){var tabVariableName='tabs'+NewMind.ETWP.GetControlKey($tabContainer[0]);var tabToResize=NewMind.ETWP.ActiveTabSwitchers[tabVariableName];if(typeof(tabToResize)!=="undefined"){tabToResize.ResizeContainerFromJQueryObject($control);}}}}};}();NewMind.ETWP.AjaxForms=function(){var doPostBack=function(node){var $node=$(node);var postbackURL=$node.attr('action');var $parentSysContainer;$parentSysContainer=$node.parents('div.sys_control');var iControlKey=NewMind.ETWP.GetControlKey($parentSysContainer);if($node.parents('div.blockMsg').length>0){$parentSysContainer=$node.parents('div.blockMsg').find('div.sys_control');iControlKey=NewMind.ETWP.GetControlKey($parentSysContainer);}var strUrl=String(postbackURL);if(strUrl.indexOf("?")===-1){strUrl=postbackURL+"?PartialRenderControlList="+iControlKey;}else{strUrl=postbackURL+"&PartialRenderControlList="+iControlKey;}$.ajax({type:'post',url:strUrl,data:$node.serialize(),success:function(data,iControlKey){var rawdata=eval(data);if(NewMind.ETWP.FormPostBack[0].redirectURL){window.location=NewMind.ETWP.FormPostBack[0].redirectURL;}if(NewMind.ETWP.FormPostBack[0].formHTML){$html=$(NewMind.ETWP.FormPostBack[0].formHTML);$parentSysContainer.html($html);NewMind.ETWP.TabSwitcherHelpers.CheckForTabReSize($node);}return false;},error:function(){$.unblockUI();$node.unbind('submit').submit();}});};return{postback:function(node){doPostBack(node);return false;}};}();NewMind.ETWP.ColumnResizer=function(){var resizeCols=function(sSelectors){var iHeight=0;$(sSelectors).each(function(){if($(this).height()>iHeight){iHeight=$(this).height();}}).height(iHeight);};return{init:function(){},resize:function(sSelectors){resizeCols(sSelectors);}};}();NewMind.ETWP.TwoColumnMaker=function(){var makeCols=function(sContainer,bKeepHeader){var $items=$(sContainer);var $parent=$items.parent();if(bKeepHeader){$items.before($items.find("h2"));}$items.before('<div class="oddColumn"></div><div class="evenColumn"></div>');$items.find("h3:odd").each(function(i){var $this=$(this);var $objChild=$this.next();$parent.find('.oddColumn').append($this).append($objChild);});$items.find("h3").each(function(i){var $this=$(this);var $objChild=$this.next();$parent.find('.evenColumn').append($this).append($objChild);});$items.remove();};var makeCols2=function(sSelector,sParent,breakPosition,offset){var $items=$(sSelector);var $parent=$(sParent);$parent.empty();if(offset>0){$parent.append($items.slice(0,offset));}$parent.append('<div class="oddColumn"></div><div class="evenColumn"></div>');$parent.find('.oddColumn').append($items.slice(offset,breakPosition));$parent.find('.evenColumn').append($items.slice(breakPosition,$items.length));};return{init:function(){},makeCols:function(sContainer,bKeepHeader){makeCols(sContainer,bKeepHeader);},makeCols2:function(sSelector,sParent,breakPosition,offset){makeCols2(sSelector,sParent,breakPosition,offset);}};}();NewMind.ETWP.GetResource=function(sResource,sDefault){try{return eval(sResource)||sDefault;}catch(e){return sDefault;}};NewMind.ETWP.GetScrollDistanceFromTopOfBody=function(){var scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;}else if(document.body&&(document.body.scrollTop)){scrOfY=document.body.scrollTop;}else if(document.documentElement&&(document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;}return scrOfY;};NewMind.ETWP.NoCache=(function(){var objQuerystring=NewMind.ETWP.GetQuerystringData();var strNoCache=objQuerystring.get("nocache");if(strNoCache===null)return false;strNoCache=String(strNoCache).toLowerCase();return((strNoCache==="1")||(strNoCache==="true"));})();NewMind.ETWP.GetFirstHashItem=function(){var hash=window.location.hash;var aryHashItems=hash.split('=&');var strfirstHashItem;strfirstHashItem=aryHashItems[0];return strfirstHashItem;};
(function(){NewMind.registerNameSpace('NewMind.ETWP');NewMind.ETWP.MediaSwitcher=function(){var msTimer;var msDuration;var pauseCycle=function(e){clearTimeout(msTimer);};var resumeCycle=function(e){if(isNaN(msDuration)){msTimer=setTimeout(cycleMedia,2500);}else{msTimer=setTimeout(cycleMedia,msDuration);}};var cycleMedia=function(e){clearTimeout(msTimer);var $uls=$("ul.galControls").filter(function(){return this.className.indexOf('slideShow')>0;});var bStartTimer=0;$uls.each(function(){if(isNaN(msDuration)){msDuration=this.className.slice(this.className.indexOf('slideShow')+9);if(isNaN(msDuration)||msDuration<1000){msDuration=2500;}}bStartTimer=1;var iNum=0;var $this=$(this);var $gcls=$this.find("li");var gclsLen=$gcls.length;var i=0;$gcls.each(function(index){var $this=$(this);if($this.hasClass('current')){iNum=index+1;if(iNum===gclsLen){iNum=0;}return false;}});$gcls.each(function(index){var $this=$(this);if(index===iNum){$this.addClass('current');}else{$this.removeClass('current');}});var $gis=$this.parents("div.ctl_Media").find("div");var j=0;$gis.each(function(){var $this=$(this);if($this.hasClass("galItem")){if(j===iNum){$this.removeClass("hide");}else{if(!$this.hasClass('hide')){$this.addClass("hide");}}j=j+1;}});});if(bStartTimer===1){msTimer=setTimeout(cycleMedia,msDuration);}};var switchMedia=function(e){var ev=e||window.event;if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}var obj=GetEventSource($(this));var iNum=Number($(this).text());if(iNum===0){iNum=Number($(this).find('img').attr('alt'));}var $gcls=$(obj).parents("ul.galControls").find("li");var i=0;$gcls.each(function(){var $this=$(this);if(i+1===iNum){$this.addClass("current");}else{$this.removeClass('current');}i=i+1;});var $gis=$(obj).parents("div.ctl_Media").find("div");var j=1;$gis.each(function(){var $this=$(this);if($this.hasClass('galItem')){if(j===iNum){$this.removeClass('hide');}else{if(!$this.hasClass('hide')){$this.addClass('hide');}}j++;}});};var getNextImage=function(obj){var $container=$(obj).parents("div.ctl_Media");var imageData=NewMind.ETWP.ControlData[NewMind.ETWP.GetControlKey($container[0])];if(imageData!=undefined&&$container.find("div").length>=imageData.length){return;}var image=imageData["image"+$container.find("div").length];loadImage(image,$container);};var getImages=function(obj){var $container=$(obj).parents("div.ctl_Media");var imageData=NewMind.ETWP.ControlData[NewMind.ETWP.GetControlKey($container[0])];if(imageData!=undefined&&$container.find("div").length>=imageData.length){return true;}$.each(imageData,function(index,image){loadImage(image,$container);});};var loadImage=function(image,$container){if(image!==undefined){var newImage='<img src="'+image.file+'" alt="'+image.title+'" />';if(image.url.length>0){newImage='<a href="'+image.url+'">'+newImage+'</a>';}if(image.desc.length>0){newImage+='<div class="mediaNote"><h3>'+image.title+'</h3><p>'+image.desc+'</p></div>';}$container.append('<div class="galItem hide" style="background: url('+NewMind.ETWP.GetResource('NewMind.env.imgs.resources.media["loadinganimation"]','/engine/shared_gfx/ajax-loader-arrows-white.gif')+') no-repeat;">'+newImage+'</div>');}};var mediaSwitcherInit=function(){if(!document.getElementsByTagName){return;}var $arrLists=$("ul.galControls");$arrLists.each(function(){var $this=$(this);var $objEleMediaControl=$this.parents("div.ctl_Media");if($objEleMediaControl.hasClass("ScriptEnabled")){return true;}$objEleMediaControl.addClass("ScriptEnabled");var arrLinks=$this.find("a").click(switchMedia).mouseover(pauseCycle).mouseout(resumeCycle);if(arrLinks.length>1){$this.removeClass("hide");}getImages(this);var $arrImageConts=$objEleMediaControl.find("div");$arrImageConts.each(function(){var $this=$(this);if($this.hasClass("galItem")){$this.mouseover(pauseCycle).mouseout(resumeCycle);}});});resumeCycle();};return{init:function(){mediaSwitcherInit();}};}();$(function(){NewMind.ETWP.MediaSwitcher.init();});})();(function(){NewMind.registerNameSpace('NewMind.ETWP');NewMind.ETWP.YouTube=function(){var ajaxUpdate=function(e){var postbackURL=$(this).attr('href');var container=$(this).parents('div.ytPlaylistWrapper').find('div.ytVideo');var parentSysContainer=$(this).parents('div.sys_control');var iControlKey=NewMind.ETWP.GetControlKey(parentSysContainer);var URL=postbackURL+"&AsyncAction=YTVideoUpdate&PartialRenderType=html&PartialRenderControlList="+iControlKey;container.html('<img src="'+NewMind.ETWP.GetResource('NewMind.env.imgs.resources.media["youtube"]["loadinganimation"]','/engine/shared_gfx/ajaxload-black.gif')+'" alt="'+NewMind.ETWP.GetResource('NewMind.env.lang.resources.media["youtube"]["loading"]','loading')+'" />');$.get(URL,function(data){container.replaceWith($(data).find('div.ytVideo'));});e.preventDefault();};return{init:function(){$('ol.ytPlaylist li a').click(ajaxUpdate);}};}();$(function(){NewMind.ETWP.YouTube.init();});})();
NewMind.ETWP.TextSizeSwitcher=function(){var $mainText;var currentSize;var SetTextSizeFromCookie=function(){if(getCookie('font_size')!==''){$mainText.css('font-size',getCookie('font_size'));}};var InitTextSizeSwitcher=function(){var SwitchNumericTextSize=function(sAction){if(sAction=='larger'){num=num*1.4;}else if(sAction=='smaller'){num=num/1.4;}SetTextSize(num+unit);return false;};var SwitchTextSize=function(sAction){var newSize;currentSize=getCurrentFontSize();var sizes=["xx-small","x-small","small","medium","large","x-large","xx-large"];var currentSizePosition=jQuery.inArray(currentSize,sizes);if(sAction=='larger'){if(currentSizePosition<sizes.length){newSize=sizes[currentSizePosition+1];}}else if(sAction=='smaller'){if(currentSizePosition>0){newSize=sizes[currentSizePosition-1];}}SetTextSize(newSize);return false;};var SetTextSize=function(newSize){$mainText.css('font-size',newSize);setCookie('font_size',newSize,30);};var getCurrentFontSize=function(){var txtSize;if($.browser.msie){var objEleTemp=document.createElement("div");objEleTemp.style.width="1em";document.body.appendChild(objEleTemp);txtSize=$(objEleTemp).width()+"px";document.body.removeChild(objEleTemp);}else{txtSize=String($mainText.css('font-size'));}return txtSize;};currentSize=getCurrentFontSize();var unit;if(currentSize.indexOf("%")>0){unit="%";}else{unit=currentSize.slice(-2);}switch(String(unit).toLowerCase()){case "em":case "px":case "pt":case "%":var num=parseFloat(currentSize,10);$('a.changer').click(function(){SwitchNumericTextSize(this.id);});break;case "ll":case "um":case "ge":$('a.changer').click(function(){SwitchTextSize(this.id);});break;default:if(typeof(console)!=="undefined"){console.warn("unrecognised unit type");}else{}break;}};var setCookie=function(c_name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+'='+escape(value)+((expiredays===null)?'':';expires='+exdate.toGMTString());};var getCookie=function(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+'=');if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(';',c_start);if(c_end==-1){c_end=document.cookie.length;}return unescape(document.cookie.substring(c_start,c_end));}}return '';};return{Init:function(){$mainText=$('body');SetTextSizeFromCookie();InitTextSizeSwitcher();}};}();
NewMind.registerNameSpace("NewMind.ETWP.SiteSearch");NewMind.ETWP.SiteSearch=function(){return{DefaultText:function(){$('.ctl_SiteSearchForm .field input').focus(function(){var strDefaultText=$(this).attr('title');if(strDefaultText!==''){if($(this).val()===strDefaultText)$(this).val('').parent().removeClass('defaultText');}}).blur(function(){var strDefaultText=$(this).attr('title');if(strDefaultText!==''){if($(this).val()==='')$(this).val(strDefaultText).parent().addClass('defaultText');}}).blur();}};}();NewMind.dom.addEventListener(window,'load',NewMind.ETWP.SiteSearch.DefaultText);
NewMind.ETWP.FeaturedGallery=function(){var GalleryRendered=false;var GalleryRendering=false;var eventGalleryRendered=new NewMind.CustomEvent();var eventGalleryRendering=new NewMind.CustomEvent();var setupGallery=function(objGallery,objGalleryFullData){var bSlideShow=objGalleryFullData.SlideShow;var iSlideShowInterval=objGalleryFullData.SlideShowInterval;if(iSlideShowInterval<2500){iSlideShowInterval=2500;}var bShowNPNav=objGalleryFullData.ShowNPNav;var bShowTickerCtrls=objGalleryFullData.ShowTickerCtrls;var bShowTBNav=objGalleryFullData.ShowTBNav;var iTBNavItmGrp=parseInt(objGalleryFullData.TBNavItmGrp,10);var bShowScrollingThumbNav=objGalleryFullData.ScrollingThumbNav;var iScrollingThumbNavLimit=objGalleryFullData.ScrollingThumbNavLimit;var objGalleryData=objGalleryFullData.FeatData;var iTotalCount=objGalleryData.length;var objGalItem=objGallery.find('.galItem');function setCurrentGalleryItem(iIndex){objGallery.find('ul.galTBnav > li > div').removeClass();objGallery.find('ul.galTBnav > li:eq('+iIndex+') > div').addClass('current');if(bSlideShow){objGalItem.fadeOut('slow',function(){$(this).html(objGalleryData[iIndex].Content).fadeIn("slow");});}else{objGalItem.html(objGalleryData[iIndex].Content);}}function setScrollingThumbNav(iIndex){var iScrollListItmCount=0;if(iScrollingThumbNavLimit===0||iScrollingThumbNavLimit>iTotalCount){iScrollingThumbNavLimit=iTotalCount;}for(iGalItmCount=iIndex;iScrollListItmCount<iScrollingThumbNavLimit;iGalItmCount++){if(iScrollListItmCount===0){galTBnav.empty();}if(iGalItmCount>(iTotalCount-1)&&iTotalCount>iScrollingThumbNavLimit){iGalItmCount=0;}objCurrentListItm=$('<li>'+objGalleryData[iGalItmCount].Thumbnail+'</li>').attr('class','itm_'+iGalItmCount).appendTo(galTBnav);if(iGalItmCount===iIndex){objCurrentListItm.find('div').addClass('current');}iScrollListItmCount++;}objGallery.find('.galTBnav > li').click(function(){var iCurrentItm=$(this).attr('class').replace('itm_','');setCurrentGalleryItem(iCurrentItm);}).dblclick(function(){var iCurrentItm=$(this).attr('class').replace('itm_','');var $content=$(objGalleryData[iCurrentItm].Content);window.location=$content.find('a').attr('href');});}function resetSlideShow(oldItm){StopSlideShow();oldSlideShowGalleryItem=oldItm;galleryItemTimeout=setTimeout(galleryItemRotate,iSlideShowInterval);}function StopSlideShow(){clearTimeout(galleryItemTimeout);galleryItemTimeout=false;}function StartSlideShow(){if(!galleryItemTimeout){galleryItemTimeout=setTimeout(galleryItemRotate,500);}}function ToggleTicker($this){if($this.hasClass('started')){StopTicker($this);}else if($this.hasClass('stopped')){StartTicker($this);}}function StopTicker($this){if($this.hasClass('started')){StopSlideShow();var sText=NewMind.ETWP.GetResource('NewMind.env.lang.resources.featuredgallery["play"]','Play');$this.toggleClass('started').toggleClass('stopped').find('span').text(sText);}}function StartTicker($this){if($this.hasClass('stopped')){StartSlideShow();var sText=NewMind.ETWP.GetResource('NewMind.env.lang.resources.featuredgallery["pause"]','Pause');$this.toggleClass('started').toggleClass('stopped').find('span').text(sText);}}if(bSlideShow){var currentSlideShowGalleryItem=0,oldSlideShowGalleryItem=0;var galleryItemTimeout;var rotateInProgress=false;var galleryItemRotate=function(){if(!rotateInProgress){rotateInProgress=true;galleryItemTimeout=false;currentSlideShowGalleryItem=(Number(oldSlideShowGalleryItem)+1)%iTotalCount;setCurrentGalleryItem(currentSlideShowGalleryItem);rotateInProgress=false;if(!galleryItemTimeout){galleryItemTimeout=setTimeout(galleryItemRotate,iSlideShowInterval);}oldSlideShowGalleryItem=currentSlideShowGalleryItem;}};galleryItemTimeout=setTimeout(galleryItemRotate,iSlideShowInterval);objGalItem.hover(function(){StopSlideShow();},function(){if(bShowTickerCtrls&&objGallery.find('ul.galNPnav li.start_stop').hasClass('stopped')){return;}StartSlideShow();});}if(bShowTBNav||bShowScrollingThumbNav){var iGalItmCount=0,iListItmCount=0,iListCount=0,iScrollListCount=0,iScrollListItmCount=0;var galTBnav;var objCurrentListItm;if(bShowScrollingThumbNav){if(iScrollListItmCount===0){galTBnav=$("<ul/>").attr('class','galTBnav '+'gr_'+iScrollListCount);objGallery.append(galTBnav);}setScrollingThumbNav(0);}else{if(iTBNavItmGrp===0){iTBNavItmGrp=iTotalCount;}for(iGalItmCount=0;iGalItmCount<iTotalCount;iGalItmCount++){if(iListItmCount===0){iListCount++;galTBnav=$("<ul/>").attr('class','galTBnav '+'gr_'+iListCount);objGallery.append(galTBnav);}objCurrentListItm=$('<li>'+objGalleryData[iGalItmCount].Thumbnail+'</li>').attr('class','itm_'+iGalItmCount).appendTo(galTBnav);if(iGalItmCount===0){objCurrentListItm.find('div').addClass('current');}iListItmCount++;if(iListItmCount===iTBNavItmGrp){iListItmCount=0;}}}objGallery.find('.galTBnav > li').click(function(){var iCurrentItm=parseInt($(this).attr('class').replace('itm_',''));if(isNaN(iCurrentItm)){iCurrentItm=0;}setCurrentGalleryItem(iCurrentItm);if(bSlideShow){resetSlideShow(iCurrentItm);}}).dblclick(function(){var iCurrentItm=$(this).attr('class').replace('itm_','');var $content=$(objGalleryData[iCurrentItm].Content);window.location=$content.find('a').attr('href');});}if((bShowNPNav||bShowScrollingThumbNav||bShowTickerCtrls)&&iTotalCount>1){var galNPnav=$('<ul class="galNPnav">');if(bShowTickerCtrls){var sPause=NewMind.ETWP.GetResource('NewMind.env.lang.resources.featuredgallery["pause"]','Pause');galNPnav.append($('<li class="start_stop started"><span>'+sPause+'</span></li>'));}var sPrev=NewMind.ETWP.GetResource('NewMind.env.lang.resources.featuredgallery["prev"]','Prev');var sNext=NewMind.ETWP.GetResource('NewMind.env.lang.resources.featuredgallery["next"]','Next');galNPnav.append($('<li class="prev"><span>'+sPrev+'</span></li>'));galNPnav.append($('<li class="next"><span>'+sNext+'</span></li>'));objGallery.append(galNPnav);if(bShowScrollingThumbNav){var objGalThumbNav=objGallery.find('.galTBnav');galNPnav.children().click(function(){var iCurrent=parseInt(objGalThumbNav.find('li:first').attr('class').replace('itm_',''),10);var sCurrentClass=$(this).attr('class');var i=iTotalCount-1;if(sCurrentClass==='prev'&&iTotalCount<iScrollingThumbNavLimit){if((iCurrent-iScrollingThumbNavLimit)<0){i=(iTotalCount-1)+(iCurrent-iScrollingThumbNavLimit);}else{i=(iCurrent-iScrollingThumbNavLimit);}setScrollingThumbNav(i);}else if(sCurrentClass==='next'&&iCurrent<iTotalCount){i=(iCurrent+iScrollingThumbNavLimit)%iTotalCount;setScrollingThumbNav(i);}});}else{galNPnav.children().click(function(){var $this=$(this);if($this.hasClass('start_stop')){ToggleTicker($this);}else{var iCurrent=parseInt(objGalItem.find('div').attr('class').replace('itm_',''),10);var sCurrentClass=$this.attr('class');var i=iTotalCount-1;if(sCurrentClass==='prev'&&iCurrent>0){i=iCurrent-1;}else if(sCurrentClass==='next'){i=(iCurrent+1)%iTotalCount;}setCurrentGalleryItem(i);if(bShowTickerCtrls){StopTicker($this.siblings('.start_stop'));}else if(bSlideShow){resetSlideShow(i);}}});}}GalleryRendered=true;eventGalleryRendered.fire();};return{Init:function(){if(GalleryRendered===true||GalleryRendering===true){return false;}GalleryRendering=true;eventGalleryRendering.fire();var arrFeaturedCtrlIds=[];$('.gallery').each(function(){arrFeaturedCtrlIds[arrFeaturedCtrlIds.length]=$(this).attr('id').replace('gallery_','');});if(arrFeaturedCtrlIds.length!==0){$.getScript("?PartialRenderControlList="+arrFeaturedCtrlIds.join(","),function(obj){$('.gallery').each(function(){var intCtrlKey=$(this).attr('id').replace('gallery_','');var objFeaturedData=NewMind.ETWP.ControlData[intCtrlKey];if(!objFeaturedData){try{console.log("FeaturedGallery.Init: $.script callback failed to initialise data, attempting additional eval");}catch(e){}eval(obj);objFeaturedData=NewMind.ETWP.ControlData[intCtrlKey];}setupGallery($(this),objFeaturedData);var title=$(this).find("div.galItem h3").text();$(this).find("ul span.title:contains('"+title+"')").parents('li').click();if(NewMind.env.install.IPTV){$("div.itm_0").find('a').focus();}});});}return false;},GalleryRendered:eventGalleryRendered,GalleryRendering:eventGalleryRendering};}();
NewMind.ETWP.Navigation=function(){return{InitialiseQuickFind:function(){var sels=document.getElementsByTagName('SELECT');if(sels!=null){for(var i=0;i<sels.length;i++){if(sels[i].className=='quickfindDrop'){NewMind.dom.addEventListener(sels[i],'change',NewMind.ETWP.Navigation.QuickFind_OnChange);}}}},QuickFind_OnChange:function(){var sel=GetEventSource(this);var elmForm=sel;do{elmForm=elmForm.parentNode;}while(elmForm.nodeName!='FORM'&&elmForm.nodeName!='BODY');if(elmForm.nodeName=='FORM'){elmForm.action=sel.value;elmForm.submit();}}};}();NewMind.dom.addEventListener(window,'load',NewMind.ETWP.Navigation.InitialiseQuickFind);

