document.write('<link rel="stylesheet" type="text/css" href="/Style%20Library/css/js.css" media="all"/>');var CSS=new Class({local:{self:"CSS",limited:["dpi","border-radius"],_rule:""},options:{rules:{}},xhtml:{_style:null},initialize:function(a){this.local=$merge(this.local,this.options,a,this.xhtml)},destroy:function(){if(this.local._style){this.local._style.destroy()}},refresh:function(){var a="";Hash.each(this.local.rules,function(c,b){this.local._rule="";Hash.each(c,this._glue,this);a+=(this.local._rule==""?"":b+"\n{\n"+this.local._rule+"}\n")},this);this.destroy();this.local._style=new Element("style").set("type","text/css").inject(document.head);switch(Browser.Engine.name){case"trident":this.local._style.styleSheet.cssText=a;break;default:this.local._style.set("text",a);break}return this},_glue:function(b,a){if(this[Browser.Engine.name+"_"+a]){var c;if(c=this[Browser.Engine.name+"_"+a](b,a)){this.local._rule+="\t"+c[0]+":"+c[1]+";\n"}}else{if(!this.local.limited.contains(a)){this.local._rule+="\t"+a+":"+b+";\n"}}},add_prop:function(a,c,b){var d={};d[a]={};d[a][c]=b;return this.add_rules(d)},add_rule:function(a,b){var c={};c[a]=b;return this.add_rules(c)},add_rules:function(a){this.local.rules=$merge(this.local.rules,a);return this},remove_prop:function(a,b){delete this.local.rules[a][b];return this},remove_rule:function(a){delete this.local.rules[a];return this},remove_rules:function(a){if(a){a.each(this.remove_rule,this)}else{this.local.rules={}}return this},check_rule:function(a){return $defined(this.local.rules[a])}});CSS.implement({trident_opacity:function(b,a){return["filter","alpha(opacity="+(b*100)+")"]},trident_dpi:function(b,a){if($defined(window.screen.deviceXDPI)){return["font-size",((96/window.screen.deviceXDPI)*b).round()+"%"]}else{return["font-size",b+"%"]}},"gecko_border-radius":function(b,a){return["-moz-"+a,b]},"webkit_border-radius":function(b,a){return["-webkit-"+a,b]}});var findPos={x:function(b){var a=0;if(b.offsetParent){do{a+=b.offsetLeft}while(b=b.offsetParent);return a}},y:function(b){var a=0;if(b.offsetParent){do{a+=b.offsetTop}while(b=b.offsetParent);return a}}};var cleardefaulttext=function(d,e,a){var d=$(d);if(d){var f=d.value;var c=d.getStyle("color");var b=d.getStyle("borderColor");d.addEvents({domready:function(){if(e!=undefined){d.setStyle("color",e)}},focus:function(){if(d.value==f){d.value=""}if(e!=undefined){d.setStyle("color",c)}if(a!=undefined){d.setStyle("borderColor",a)}},blur:function(){if(d.value==""){d.value=f;if(e!=undefined){d.setStyle("color",e)}if(a!=undefined){d.setStyle("borderColor",b)}}}})}};var createTabs=function(d,f,a){if(d){var b;d.contains(".")?b=$E(d):b=$(d);if(b!=undefined){var e=new Element("div",{id:"tabhdrs","class":"cf"}).injectTop(b);var c=$$(".tab");c.each(function(h,g){if(g!=0){h.addClass("js-hide")}});$$(".tab "+f).each(function(k,j){if(j==0){k.addClass("on")}var m=k.innerHTML;k.empty();var h=new Element("a",{href:"#",title:m,html:m,events:{}}).injectInside(k);if(a!=""){h.addEvent("click",function(n){pageTracker._trackEvent(a,h.innerText)})}var l=$$(d+" "+f);h.addEvent("click",function(n){n.stop();l.each(function(o){o.removeClass("on")});k.addClass("on");c.each(function(o){o.addClass("js-hide")});c[j].removeClass("js-hide")});k.injectInside("tabhdrs");var g=b.getParent(".hide-while-load-delayed");if(g!=undefined){g.removeClass("hide-while-load-delayed")}})}}};var shortcutEsc=function(c){if(c!=null){var b=$E("a",c);b.setProperty("title",b.getProperty("title")+" (shortcut Esc key)");var a=function(g){var f=27;var d=(window.event)?event.keyCode:g.keyCode;if(d==f){window.location.href=b.href;if(window.top!=window.self){window.top.location=b.href}return false}};(!(navigator.appVersion).match(/msie/i))?window.onkeydown=a:document.onkeydown=a}};var correctSafariTabbing=function(){$$(".skip-nav").each(function(a){var b=$$(".skip-links");a.addEvents({focus:function(){b.setStyle("left","0")},blur:function(){b.setStyle("left","-10000px")}})})};var pageUtils=function(){var e=$E(".page-utilities-content");if(!e){return false}var d=(!(navigator.appVersion).match(/msie 6/i));var a={open:-1,last:null};var h;var f;var b=$$(".page-utilities dd a");e.injectTop($E(".page-utilities"));var c={reset:function(j,k){j.setStyles({position:"relative",marginTop:"0"}).setProperties({src:"/Style%20Library/img/btns/"+k+".png"})},selected:function(j,k){var l="/Style%20Library/img/btns/"+k+"-selected.png";j.setStyles({position:"relative",marginTop:"-1px",filter:l}).setProperties({src:l})}};$$(".utility h3").each(function(j){var k=new Element("a",{title:"Close",href:"#",html:'<img class="btn png" src="/Style%20Library/img/btns/close.png" alt="Close"/>',events:{click:function(l){l.stop();c.reset($E(".page-utilities dd a."+a.curr+" img"),a.curr);pageTracker._trackEvent("ChooseWallpaper","close")}}});k.inject(j,"top")});if($E(".carousel")!=null){styleSwitcher()}b.each(function(j,k){$E("img",j).addClass("btn");j.addEvents({click:function(n){if(n){n.stop()}a.curr=b[k].getProperty("class");c.selected($E(".page-utilities dd a."+a.curr+" img"),a.curr);h=$E(".page-utilities-content ."+a.curr);if(a.last==null){a.last=a.curr;f=h}else{f=$E(".page-utilities-content ."+a.last)}if(e.hasChild(a.curr)){var l=new Fx.Morph(e,{duration:"short",transition:Fx.Transitions.Expo.easeInOut,onStart:function(){if(e.offsetHeight==0||e.offsetHeight==1){a.open=-1}},onComplete:function(){if(e.offsetHeight>0){if(e.offsetHeight!=1){a.open=0}else{a.open=-1;a.last=null}}}});$$(".utility h3 a").each(function(o){o.addEvent("click",function(){h.addClass("js-hide");l.start({height:0,opacity:[1,0]})})});if(a.open==-1){h.removeClass("js-hide").setOpacity(0).setStyles({position:"absolute",left:findPos.x($("logo"))+70});l.start({height:[0,h.offsetHeight],opacity:[0,1]});d?(function(){h.fade("in")}).delay(500):(function(){h.setOpacity(1)}).delay(500)}else{if(a.last!=a.curr){var m=f.offsetHeight;d?f.fade("out").addClass("js-hide"):f.setOpacity(0).addClass("js-hide");h.removeClass("js-hide").setOpacity(0).setStyles({position:"absolute",left:findPos.x($("logo"))+70});c.reset($E(".page-utilities dd a."+a.last+" img"),a.last);a.last=a.curr;l.start({height:[m,h.offsetHeight],opacity:1});d?(function(){h.fade("in")}).delay(500):(function(){h.setOpacity(1)}).delay(500)}else{d?h.fade("out").addClass("js-hide"):h.setOpacity(0).addClass("js-hide");c.reset($E(".page-utilities dd a."+a.curr+" img"),a.curr);l.start({height:0,opacity:[1,0]})}}}}})});var g=$E(".page-utilities dd a.wallpaper");if(location.search.test("panel=open")&&g){g.fireEvent("click")}};var btnHover=function(a,d,c){var b=(!(navigator.appVersion).match(/msie 6/i));var g=function(j){var h=j.src;(h.search(/(.png)|(blank.gif)/,"i")!=-1)?h="png":((h.search(/(.gif)/,"i")!=-1)?h="gif":h="jpg");return h};var e=function(j,l,k){var h;ext=g(j);ext!="png"?(h=j.src):(b?h=j.src:h=j.getStyle("filter"));if(!h.match(k,"i")){if(h.match(l+"."+ext)!=null){h=h.replace(l+"."+ext,"."+ext)}h=h.replace("."+ext,l+"."+ext);ext!="png"?(j.setProperty("src",h)):(b?j.setProperty("src",h):j.setStyle("filter",h))}};var f=function(j,l,k){var h;ext=g(j);if(ext=="png"&&!b){h=(j.getStyle("filter")).replace(l+"."+ext,"."+ext);if(!h.match(k,"i")){j.setStyle("filter",h)}}else{h=(j.src).replace(l+"."+ext,"."+ext);if(!h.match(k,"i")){j.setProperty("src",h)}}};$$(a).each(function(h,j){h.addEvents({mouseover:function(){e(this,d,c)},mouseout:function(){f(this,d,c)},focus:function(){h.fireEvent("mouseover")},blur:function(){h.fireEvent("mouseout")}});if(h.getParent("a")){h.getParent().addEvents({focus:function(){h.fireEvent("mouseover")},blur:function(){h.fireEvent("mouseout")}})}})};var renderInPageMessage=function(c,a){var b;$$("a.close-btn").each(function(d){d.addEvents({click:function(f){f.stop();c.addClass("js-hide")}})})};var styleSwitcher=function(){var a=new CreateCarousel({container:$E(".carousel"),slider:$E(".carousel fieldset"),items:$$(".carousel label.item"),movethismany:4,leftctrlAnalyticsEvent:"ChooseWallpaper",leftctrlAnalyticsValue:"left",rightctrlAnalyticsEvent:"ChooseWallpaper",rightctrlAnalyticsValue:"right"});$$(".carousel label").each(function(c,b){c.addEvents({click:function(d){d.stop();$$(".checked").each(function(e){e.removeClass("checked")});c.addClass("checked");document.getElementById("hdnStyle").value=c.getProperty("for");document.forms[0].submit()}})})};var getColChip=function(c){var b=["","default",""];if((!c.getParent(".breadcrumb")&&c.getParents("#header")!="")||c.getParents("#footer")!=""){b[1]="nav"}else{if(c.getProperty("class").test("closed")){b[2]="-closed"}var a=["highlight","service","categories-list","categories-topics","explicit-messages","hot-topic","msg-brd-categories","msg-brd-thread","msg-brd-topic","quick-topic-links","search-msg-brd","thread-list","offsite","poll","status-ok","status-error","-org","-red","-prp","your-locker","what-think","alerts","my-profile","mood-tracker","things-created","childline-email"];if(c.getParents("body").getProperty("class")!=""){a=["highlight","theme","service","your-locker","box","status-ok"];b[0]=c.getParents("body").getProperty("class")+"/"}for(i=(a.length-1);i>=0;i--){if(c.getProperty("class").test(a[i])){b[1]=a[i];break}}if(b[1]=="-org"){b[1]="orange"}if(b[1]=="-prp"){b[1]="purple"}if(b[1]=="-red"){b[1]="red"}}return b};var roundedCorners=function(a){a.each(function(f){if(!f.getProperty("class").test("roundedfix")){var c=getColChip(f);var d=new Element("div",{"class":"rctop cf",html:'<div class="lft"><img class="png" src="/Style%20Library/img/bgs/'+c[0]+"rc-"+c[1]+'.png"/></div><div class="rgt"><img class="png" src="/Style%20Library/img/bgs/'+c[0]+"rc-"+c[1]+'.png"/></div>'});var h=new Element("div",{"class":"rcbtm cf",html:'<div class="rcfill"><div class="colour">&nbsp;</div><div class="op4">&nbsp;</div><div class="op3">&nbsp;</div><div class="op2">&nbsp;</div><div class="op1">&nbsp;</div></div><div class="lft"><img class="png" src="/Style%20Library/img/bgs/'+c[0]+"rc-"+c[1]+c[2]+'.png"/></div><div class="rgt"><img class="png" src="/Style%20Library/img/bgs/'+c[0]+"rc-"+c[1]+c[2]+'.png"/></div>'});f.set("html",'<div class="rcinner"><div class="rccontent">'+f.get("html")+"</div></div>");d.inject(f,"top");h.inject(f,"bottom")}else{if(!f.getProperty("class").test("imageset")){var c=getColChip(f);var g="/Style%20Library/img/bgs/"+c[0]+"rc-"+c[1]+".png";var b="/Style%20Library/img/bgs/"+c[0]+"rc-"+c[1]+c[2]+".png";f.getElements("div.topfix img").each(function(e){e.setProperty("src",g)});f.getElements("div.btmfix img").each(function(e){e.setProperty("src",b)})}}})};var redrawBtmCorners=function(a){a.each(function(d){var b=getColChip(d);var c=a.getProperty("id");var f="tmpid";a.setProperty("id",f);$$("#tmpid div.rcbtm img").each(function(e){e.setProperty("src","/Style%20Library/img/bgs/"+b[0]+"rc-"+b[1]+b[2]+".png")});a.setProperty("id",c)})};if((navigator.appVersion).match(/msie 6/i)){window.addEvents({scroll:function(){var a=$(document.body).getScroll();$$(".panic").setStyle("top",a.y+"px");$$("#secure").setStyle("top",a.y+"px")}});var secure=$("secure");if(secure){window.addEvents({scroll:function(){var a=$(document.body).getScroll();secure.setStyle("top",a.y+"px")}})}}var NumikoVideoModule=new Class({Implements:[Options,Events],options:{descriptionAndTranscriptUri:"/_vti_bin/ChildLineAjaxService.asmx/GetVideoDescriptionAndTranscript",container:"VideoFieldControl1clip-XXX",videoUrl:"",bslUrl:"",videoPosterImage:"./Style%20Library/img/dummy/physical_large.jpg",linkedVideos:{},linkedVideosLinks:"#mycarousel .carousel-clip-region .carousel-list li a",descriptionDiv:"#VideoFieldControl1clip-description-XXX",transcriptLink:"#VideoFieldControl1clip-menu-XXX a.transcript",transcriptDiv:"#VideoFieldControl1clip-transcript-XXX",bslLink:"#VideoFieldControl1clip-menu-XXX a.bsl",subtitlesLink:"#VideoFieldControl1clip-menu-XXX a.subtitles",playerSwf:"/style%20library/flash/player.swf",playerWidth:446,playerHeight:335,playerSkin:"/style%20library/flash/nspcc-skin.swf",captionsFile:"",initialCaptions:false},videoUrl:null,videoBslUrl:null,videoPosterImage:null,videoCaptionsFile:null,containerEl:null,linkedVideoLinkEls:null,descriptionDivEl:null,transcriptLinkEl:null,transcriptDivEl:null,bslLinkEl:null,subtitlesLinkEl:null,videoObj:null,useCaptions:false,showBsl:false,initialize:function(a){this.setOptions(a);this.useCaptions=this.options.initialCaptions;this.containerEl=$(this.options.container);this.descriptionDivEl=$E(this.options.descriptionDiv);this.transcriptLinkEl=$E(this.options.transcriptLink);this.transcriptDivEl=$E(this.options.transcriptDiv);this.bslLinkEl=$E(this.options.bslLink+" a.bslLink");this.subtitlesLinkEl=$E(this.options.subtitlesLink);this.linkedVideoLinkEls=$$(this.options.linkedVideosLinks);this.videoUrl=this.options.videoUrl;this.videoBslUrl=this.options.bslUrl;this.videoPosterImage=this.options.videoPosterImage;this.videoCaptionsFile=this.options.captionsFile;this.transcriptLinkEl.addEvent("click",function(b){b.stop();this.transcriptDivEl.toggleClass("js-hide")}.bind(this));this.bslLinkEl.addEvent("click",function(b){b.stop();this.showBsl=!this.showBsl;this.setupVideo()}.bind(this));if(this.videoBslUrl!=undefined&&this.videoBslUrl!=""){this.bslLinkEl.removeClass("js-hide")}else{this.bslLinkEl.addClass("js-hide")}this.linkedVideoLinkEls.each(function(b){b.addEvent("click",function(c){c.stop();var d=b.getAttribute("rel");this.setupForVideoID(d)}.bind(this))}.bind(this));if(this.options.captionsFile.length){this.subtitlesLinkEl.addEvent("click",function(b){b.stop();this.useCaptions=!this.useCaptions;this.setupVideo()}.bind(this))}else{if(!this.subtitlesLinkEl.hasClass("js-hide")){this.subtitlesLinkEl.addClass("js-hide")}}this.setupVideo()},getVideoDescriptionAndTranscript:null,setupForVideoID:function(a){if(this.options.linkedVideos[a]!==undefined){this.videoUrl=this.options.linkedVideos[a].videoUrl;this.videoBslUrl=this.options.linkedVideos[a].bslUrl;if(this.videoBslUrl!=null&&this.videoBslUrl!=""){this.bslLinkEl.removeClass("js-hide")}else{this.bslLinkEl.addClass("js-hide")}this.videoPosterImage=this.options.linkedVideos[a].videoPosterImage;if(this.options.linkedVideos[a].captionsFile&&this.options.linkedVideos[a].captionsFile.length){this.videoCaptionsFile=this.options.linkedVideos[a].captionsFile;if(this.subtitlesLinkEl.hasClass("js-hide")){this.subtitlesLinkEl.removeClass("js-hide")}}else{if(!this.subtitlesLinkEl.hasClass("js-hide")){this.subtitlesLinkEl.addClass("js-hide")}}this.getVideoDescriptionAndTranscript=new NumikoVideoDescriptionAndTranscript({requestPath:this.options.descriptionAndTranscriptUri,videoId:a,descriptionDiv:this.options.descriptionDiv,transcriptDiv:this.options.transcriptDiv});this.getVideoDescriptionAndTranscript.request();this.setupVideo()}else{}},setupVideo:function(){if(this.showBsl){this.setupBslVideo()}else{this.setupMainVideo()}},setupMainVideo:function(){var a={file:this.videoUrl,image:this.videoPosterImage,skin:this.options.playerSkin};if(this.useCaptions){a["captions.file"]=this.videoCaptionsFile;a.plugins="captions-1"}this.videoObj=new Swiff(this.options.playerSwf,{container:$(this.options.container),id:this.options.container+"-video",width:this.options.playerWidth,height:this.options.playerHeight,params:{wmode:"opaque",bgcolor:"#bbb",allowfullscreen:"true",allowscriptaccess:"always"},vars:a})},setupBslVideo:function(){var a={file:this.videoBslUrl,image:this.videoPosterImage,skin:this.options.playerSkin};this.videoObj=new Swiff(this.options.playerSwf,{container:$(this.options.container),id:this.options.container+"-video-bsl",width:this.options.playerWidth,height:this.options.playerHeight,params:{wmode:"opaque",bgcolor:"#bbb",allowfullscreen:"true",allowscriptaccess:"always"},vars:a})}});var NumikoHomePageHeroModule=new Class({Implements:[Options,Events],options:{images:null,tabs:null,waitTillSwitch:6,numTabs:3,selectedTab:1},imageEls:null,tabEls:null,timer:null,setupTimer:null,numTabs:3,selectedTab:0,initialize:function(a){this.setOptions(a);this.numTabs=this.options.numTabs;this.selectedTab=this.options.selectedTab-1;this.imageEls=$$(this.options.images);this.tabEls=$$(this.options.tabs);this.tabEls.each(function(b){b.getElement("a").addEvent("click",function(c){c.stop();this.setTab(this.getTabId(b));$clear(this.timer);this.timer=this.switchTab.periodical((this.options.waitTillSwitch*1000),this)}.bind(this))}.bind(this));this.setupTimer=this.initSetup.periodical(100,this);this.timer=this.switchTab.periodical((this.options.waitTillSwitch*1000),this)},initSetup:function(){$clear(this.setupTimer);this.setupUi()},setupUi:function(){for(var a=0;a<this.numTabs;a++){if(a!=this.selectedTab){this.tabEls[a].removeClass("on");this.imageEls[a].removeClass("on")}else{this.tabEls[a].addClass("on");this.imageEls[a].addClass("on")}}},setTab:function(a){if(a!=this.selectedTab){this.selectedTab=a;this.setupUi()}},getTabId:function(b){for(var a=0;a<this.numTabs;a++){if(this.tabEls[a]==b){return a}}return 0},switchTab:function(){this.selectedTab++;if(this.selectedTab==this.numTabs){this.selectedTab=0}this.setupUi()}});window.addEvents({domready:function(){correctSafariTabbing();shortcutEsc($E(".panic"));pageUtils();var b=$E(".breadcrumb");if(b){b.setStyle("width",$E(".breadcrumb dl").offsetWidth+9+"px")}var a=new CSS({rules:{".rounded, #locker #content .rounded, .chat-tools .rounded":{padding:"0",background:"none"}}}).refresh();roundedCorners($$(".rounded"));btnHover(".btn","-hover","-selected");cleardefaulttext("nav-search","#777","#1fb25a");cleardefaulttext("search-help");cleardefaulttext("search");cleardefaulttext("notfound-search");SqueezeBox.assign($$("a.boxed"),{parse:"rel"})},load:function(){var a=$$(".hide-while-load");if(a){a.each(function(b){b.removeClass("hide-while-load")})}}});function delayedShow(){var a=$$(".hide-while-load-delayed");if(a){a.each(function(b){b.removeClass("hide-while-load-delayed")})}}function getCookie(c){var b=document.cookie;var e=c+"=";var d=b.indexOf("; "+e);if(d==-1){d=b.indexOf(e);if(d!=0){return null}}else{d+=2}var a=document.cookie.indexOf(";",d);if(a==-1){a=b.length}return unescape(b.substring(d+e.length,a))}function utmvCookieCheck(b){var a=getCookie("__utmv");if(a==null){return false}a=a.replace(/^\d*\./,"");return(a==b)?true:false}var NumikoJSONWebServiceInterface=new Class({Implements:[Options,Events],options:{requestPath:"/_vti_bin/ChildLineAjaxService.asmx/SubmitFeedback",requestData:{},onComplete:$empty,headers:{"Content-type":"application/json; charset=utf-8"}},request:null,response:null,sending:false,failed:true,failureType:"None",initialize:function(a){this.setOptions(a);this.request=new Request.JSON({url:this.options.requestPath,onSuccess:function(b){this.sending=false;this.failed=false;this.response=b;this.failureType="None";this.sendCallback(true,b)}.bind(this),onFailure:function(b){this.sending=false;this.failed=true;this.response=b;this.failureType="Failure";this.sendCallback(false,b)}.bind(this),urlEncoded:false,onException:function(b){this.sending=false;this.failed=true;this.response=b;this.failureType="Exception";this.sendCallback(false,b)}.bind(this),headers:this.options.headers})},send:function(){this.sending=true;this.failed=false;this.request.send(JSON.encode(this.options.requestData))},sendCallback:function(a,b){this.fireEvent("complete",[a,b],50)}});var NumikoVideoDescriptionAndTranscript=new Class({Implements:[Options,Events],options:{requestPath:"/_vti_bin/ChildLineAjaxService.asmx/GetVideoDescriptionAndTranscript",videoId:"aVideoId",descriptionDiv:"",transcriptDiv:""},descriptionEl:null,transcriptEl:null,description:"",transcript:"",webServiceInterface:null,initialize:function(a){this.setOptions(a);this.descriptionEl=$E(this.options.descriptionDiv);this.transcriptEl=$E(this.options.transcriptDiv)},request:function(){this.webServiceInterface=new NumikoJSONWebServiceInterface({requestPath:this.options.requestPath,requestData:{strVideoID:this.options.videoId},headers:{SOAPAction:"http://www.childline.org.uk/GetVideoDescriptionAndTranscript"},onComplete:this.requestComplete.bind(this)});this.webServiceInterface.send()},requestComplete:function(a,b){if(a&&b.d!==null){this.description=b.d[0];this.transcript=b.d[1];this.descriptionEl.innerHTML=this.description;this.transcriptEl.innerHTML="<h2>Transcript</h2>"+this.transcript}}});var NumikoCouncilorFact=new Class({Implements:[Options,Events],options:{requestPath:"/_vti_bin/ChildLineAjaxService.asmx/GetCouncillorFact",currentFact:"1",imgElementId:"imgId",sendElementId:"sendId"},sendEl:null,imgEl:null,webServiceInterface:null,initialize:function(a){this.setOptions(a);this.sendEl=$(this.options.sendElementId);this.imgEl=$(this.options.imgElementId);this.sendEl.addEvent("click",function(b){b.stop();this.requestCouncilorFact()}.bind(this))},requestCouncilorFact:function(){this.webServiceInterface=new NumikoJSONWebServiceInterface({requestPath:this.options.requestPath,requestData:{intCurrentFact:this.options.currentFact},headers:{SOAPAction:"http://www.childline.org.uk/GetCouncillorFact"},onComplete:this.requestComplete.bind(this)});this.webServiceInterface.send()},requestComplete:function(a,b){if(a&&b.d!==null){this.setUiSuccess(b.d)}},setUiSuccess:function(a){this.options.currentFact=a[0];this.imgEl.src=a[1];this.imgEl.alt=a[2]}});var NumikoSubmitPoll=new Class({Implements:[Options,Events],options:{requestPath:"/_vti_bin/ChildLineAjaxService.asmx/SubmitPollResponse",pollId:"85456cec-db71-4705-9528-a0e37eca76ec",MOSSSiteUrl:"/Polls/School",enclosingElementId:"encId",answerElements:["answer1","answer2","answer3","answer4","answer5","answer6"],sendElementId:"btnSubmitPollba20feaa-b832-437b-9e1f-e0aa1711952f",sendingCopy:"Sending...",failedCopy:"Posting your poll preference failed, click here to try again.",cookieDomain:"",cookiePath:"/",cookieDuration:false,cookieSecure:false},answerEls:null,sendEl:null,enclosingEl:null,sendingCopy:null,failedCopy:null,resultsEl:null,webServiceInterface:null,initialize:function(a){this.setOptions(a);this.answerEls=[];this.options.answerElements.each(function(b){this.answerEls.push($(b))}.bind(this));this.sendEl=$(this.options.sendElementId);this.enclosingEl=$(this.options.enclosingElementId);this.sendEl.addEvent("click",function(b){b.stop();if(this.getAnswer().length){this.sendPoll()}}.bind(this))},getAnswer:function(){var a="";this.answerEls.each(function(b){if(b!=null){if(b.checked){a=b.value}}return""}.bind(this));return a},sendPoll:function(){this.setUiSending();this.webServiceInterface=new NumikoJSONWebServiceInterface({requestPath:this.options.requestPath,requestData:{strMOSSSiteUrl:this.options.MOSSSiteUrl,strPollID:this.options.pollId,strItemTitleToUpdate:this.getAnswer()},headers:{SOAPAction:"http://www.childline.org.uk/SubmitPollResponse"},onComplete:this.requestComplete.bind(this)});this.webServiceInterface.send()},requestComplete:function(a,b){if(a&&b.d!==null){this.setUiSuccess(b.d)}else{this.setUiFailed()}},setUiSending:function(){this.enclosingEl.setStyle("display","none");this.sendEl.setStyle("display","none");this.sendingCopy=new Element("p",{html:this.options.sendingCopy}).inject(this.enclosingEl,"after")},setUiSuccess:function(h){var b=h[0].length;var g=0;for(var f=0;f<b;f++){g+=parseInt(h[1][f])}var e=g/100;var a="<dt>Results</dt>";for(var f=0;f<b;f++){var j=h[0][f];var c=h[1][f]/e;a+="<dl><dt>"+j+'</dt><dd class="bargraph"><div style="width:'+Math.round(c)+'%;"></div></dd><dd>'+Math.round(c)+"%</dd></dl>"}a+="</dd>";this.sendingCopy.destroy();this.resultsEl=new Element("dl",{"class":"results",html:a}).inject(this.enclosingEl,"after");this.sendEl.setStyle("display","none");this.setCookie()},setUiFailed:function(){this.sendingCopy.destroy();this.failedCopy=new Element("p",{html:'<a href="#"">'+this.options.failedCopy+"</a>"}).inject(this.enclosingEl,"after");this.failedCopy.addEvent("click",function(a){a.stop();this.failedCopy.destroy();this.enclosingEl.setStyle("display","block")}.bind(this))},setCookie:function(){cookieOptions={path:this.options.cookiePath,duration:this.options.cookieDuration,secure:this.options.cookieSecure};if(this.options.cookieDomain.length){cookieOptions.domain=this.options.cookieDomain}var c=Cookie.read("PollsCookie");var a="";if(c==null){a=this.options.pollId+"="+this.options.pollId}else{decoded={};items=c.split("&");for(var b=0;b<items.length;b++){itemsdata=items[b].split("=");decoded[itemsdata[0]]=itemsdata[1]}decoded[this.options.pollId]=this.options.pollId;for(b=0;b<decoded.length;b++){if(b>0){a+="&"}a+=decoded[b]+"="+decoded[b]}}c=Cookie.write("PollsCookie",a,cookieOptions)}});var NumikoSubmitFeedback=new Class({Implements:[Options,Events],options:{requestPath:"/_vti_bin/ChildLineAjaxService.asmx/SubmitFeedback",questionId:"0",enclosingElementId:"formId",answerElementId:"suggestpoll",sendElementId:"btnAskaQuestion",sendingCopy:"Sending...",successCopy:"Thanks for your feedback.",failedCopy:"Your feedback failed, please click here to try again."},answerEl:null,sendEl:null,enclosingEl:null,sendingCopy:null,successCopy:null,failedCopy:null,webServiceInterface:null,initialize:function(a){this.setOptions(a);this.answerEl=$(this.options.answerElementId);this.sendEl=$(this.options.sendElementId);this.enclosingEl=$(this.options.enclosingElementId);this.sendEl.addEvent("click",function(b){b.stop();if(this.answerEl.value.length){this.sendFeedback()}}.bind(this))},sendFeedback:function(){this.setUiSending();this.webServiceInterface=new NumikoJSONWebServiceInterface({requestPath:this.options.requestPath,requestData:{strAnswer:this.answerEl.value,strQuestionID:this.options.questionId},headers:{SOAPAction:"http://www.childline.org.uk/SubmitFeedback"},onComplete:this.requestComplete.bind(this)});this.webServiceInterface.send()},requestComplete:function(a,b){if(a&&b.d!==null){if(b.d.length>0){this.options.successCopy=b.d}this.setUiSuccess()}else{this.setUiFailed()}},setUiSending:function(){this.enclosingEl.setStyle("display","none");this.sendingCopy=new Element("p",{html:this.options.sendingCopy}).inject(this.enclosingEl,"after")},setUiSuccess:function(){this.sendingCopy.destroy();this.successCopy=new Element("p",{html:this.options.successCopy}).inject(this.enclosingEl,"after")},setUiFailed:function(){this.sendingCopy.destroy();this.failedCopy=new Element("p",{html:'<a href="#"">'+this.options.failedCopy+"</a>"}).inject(this.enclosingEl,"after");this.failedCopy.addEvent("click",function(a){a.stop();this.failedCopy.destroy();this.enclosingEl.setStyle("display","block")}.bind(this))}});function SearchOnEnter(a,c){var d;if(window.event){d=window.event.keyCode}else{d=a.which}if(d==13){if(!a.altKey&&!a.ctrlKey&&!a.shiftKey){var b=document.getElementById(c);b.click();window.event.cancel=true;return false}}return true}function GetValidator(b){for(var c=0;c<Page_Validators.length;c++){var a=Page_Validators[c];if(a.id==b){return a;break}}}function getCookie(c){var b=document.cookie;var e=c+"=";var d=b.indexOf("; "+e);if(d==-1){d=b.indexOf(e);if(d!=0){return null}}else{d+=2}var a=document.cookie.indexOf(";",d);if(a==-1){a=b.length}return unescape(b.substring(d+e.length,a))}function utmvCookieCheck(b){var a=getCookie("__utmv");if(a==null){return false}a=a.replace(/^\d*\./,"");return(a==b)?true:false};
