$.fn.expandBox=function(a){$(this).parent().append('<div id="'+$(this)[0].id+'_ghostExpandBox" class="expandBox textBox ghostExpandBox"></div>');var d="#"+$(this)[0].id+"_ghostExpandBox";$(d).css("width",$(this).width()-12+"px");$(d).css("height","auto");$(d).css("font-family",$(this).css("font-family"));$(d).css("font-size",$(this).css("font-size"));var b=0;$(this).keydown(function(){if(Math.abs($(this).val().length-b)>5){$(d).html(c($(this).val()+"<br />"));var e=$(d).height()+20;if(e>$(this).height()){if(e<a){e=a}$(this).height(e)}b=$(this).val().length}});function c(e){e=escape(e);re_nlchar=null;if(e.indexOf("%0D%0A")>-1){re_nlchar=/%0D%0A/g}else{if(e.indexOf("%0A")>-1){re_nlchar=/%0A/g}else{if(e.indexOf("%0D")>-1){re_nlchar=/%0D/g}}}return unescape(e.replace(re_nlchar,"<br />"))}};if(typeof($.fn.expandBox)=="function"){$(".expandBox").each(function(){$(this).expandBox(70)})};FR.onLoad.addLoadSetup(function(){var h=null;if(Sys.WebForms==undefined){if(typeof ImpressionsSetup!="undefined"){ImpressionsSetup()}}else{if(typeof ImpressionsSetup!="undefined"){Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(ImpressionsSetup)}}var f=document.createTextNode("Add to favourites");var e=document.getElementById("fav");if(window.sidebar){e.appendChild(f);e.style.color="#076CCD";e.style.cursor="pointer";e.onclick=function(){window.sidebar.addPanel(document.title,self.location,"")}}else{if(window.external){e.appendChild(f);e.style.color="#076CCD";e.style.cursor="pointer";e.onclick=function(){window.external.AddFavorite(self.location,document.title)}}else{if(window.opera){e.appendChild(f);e.style.color="#076CCD";e.style.cursor="pointer";e.onclick=function(){var o=document.createElement("a");o.setAttribute("href",self.location);o.setAttribute("title",document.title);o.setAttribute("rel","sidebar");o.click()}}}}var g=200;var j=5000;try{var a="while (this.value.length > "+j+"){this.value = this.value.substring(0,this.value.length-1)}";var n=document.getElementsByTagName("input");var b=[];b.push("onkeyup");b.push("onkeydown");b.push("onmouseup");b.push("onmousedown");b.push("onblur");var d;for(i=0;i<n.length;i++){d=n[i];if(d.getAttribute("type")=="text"){if(d.getAttribute("maxlength")===null&&d.getAttribute("DontLimitLength")===null){d.setAttribute("maxlength",g)}}}}catch(c){alert(c);window.status=c}$("ul.resultlist span.info").live("click",function(){if(!h){h=$(this).find("a").attr("href");if(h){window.location.href=h}}});if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/Moblie/i)){$("#imbar_holder").hide()}$("div.each-comment .delcomment").live("click",function(){$(this).parent().parent().slideUp()});if(FR.util.getCookie("friendPrivacyHelp")!="off"){var l='<div class="friendPrivacyHelp"><h2><a href="#" class="showHide"><span>Close</span></a>Friendships and privacy have changed!</h2>';l+="<p class='fpHeader'>We've made some changes to friendships and privacy to help you stay in control. The new options are:</p>";l+="<div class='follow'><h3>Following</h3><p>You'll get updates on a friend's activity without having to contact them.</p></div>";l+="<div class='friends'><h3>Friends/Family</h3><p>You'll need to send them a friend request, but when accepted, you'll be able to share items marked as private.</p><div class='clear'></div><a class='moreLink' href='http://www.friendsreunited.co.uk/blog/read/Team/28680'>Find out more &#0187;</a><div class='clear'></div>";l+="</div></div>";$("div.myFriends, div.friendSearch, div.friendRequests, div.suggestedMembers").before(l);$("div.friendPrivacyHelp").hide().slideDown();$("div.friendPrivacyHelp h2 a.showHide").click(function(){var p=new Date();p.setDate(p.getDate()+365);var o="/";document.cookie="friendPrivacyHelp=off"+((p===null)?"":("; expires="+p.toGMTString()))+((o===null)?"":("; path="+o));$("div.friendPrivacyHelp").slideUp();return false})}else{var k=new Date();k.setDate(k.getDate()+365);var m="/";document.cookie="friendPrivacyHelp=off"+((k===null)?"":("; expires="+k.toGMTString()))+((m===null)?"":("; path="+m))}$("span.links span.friendshipstate").live("click",function(){$(this).parent().find("a.lnkManage").trigger("click");return false});$("ul.resultlist span.info a.primary-link").live("click",function(){h=$(this).attr("href")});$("ul.resultlist div.listSubForm").hide();$("#searchsection button.primary-button").live("click",function(){$(this).addClass("on").blur()});$("a.bubbleTip").each(function(){$(this).append('<div class="bubbleTip"><div class="leftSide"></div><div class="content">'+$(this).attr("title")+"</div></div>").removeAttr("title")});if(typeof document.body.style.maxHeight!="undefined"){$("#topnav-places li.my").hover(function(){$("#topnav-places li.my a, #topnav-places .morelink").css("color","white")},function(){$("#topnav-places li.my a, #topnav-places .morelink").css("color","#076CCD")});$("#topnav-places li.my-place, #topnav-places li.find, #topnav-places li.recently").hover(function(){$(this).find("a").css("color","white")},function(){$(this).find("a").css("color","#076CCD")})}$("a.Opentipslink").click(function(){$(".tipsheader").animate({height:"6"},200,function(){$(".tipsheader").toggleClass("toptipsheaderOpen")});$(".tipscontent").slideDown(200);$(".Opentipslink").hide(0);$(".Closetipslink").show(0);return false});$("a.Closetipslink").click(function(){$(".tipscontent").slideUp(200);$(".Closetipslink").hide(0);$(".Opentipslink").show(0);return false})});var iKeyCode;var sSearchType;function addHandler(c,b,a){var d;if(c.addEventListener){d=function(f){return a.call(c,f)};c.addEventListener(b,d,false)}else{if(c.attachEvent){d=function(){return a.call(c,window.event)};c.attachEvent("on"+b,d)}}}function searchOption(){this.oParent=null;this.sAction=null;this.sTrackClick=null;this.sValue1=null;this.sValue2=null;this.sClassName=null;this.sOtherTypes=null;this.sErrorMessage=null;this.sErrorMessage2=null;this.sHelpComment=null;this.sName=null}searchOption.prototype.clickSelect=function(){this.oParent.oInput1.setAttribute("value",this.sValue1);this.oParent.oInput2.setAttribute("value",this.sValue2);this.oParent.oForm.action=this.sAction+this.sTrackClick;if(this.oParent.oTarget.className=="on"){this.oParent.oTarget.className="off"}else{this.oParent.oTarget.className="on"}if(this.oParent.oInput2.onkeyup!=""){this.oParent.oInput2.setAttribute("storedOnKeyUp",this.oParent.oInput2.onkeyup)}if(this.oParent.oInput2.getAttribute("storedOnKeyUp")!=""){if(this.bFireOnKeyUp){this.oParent.oInput2.onkeyup=this.oParent.oInput2.storedOnKeyUp}else{this.oParent.oInput2.onkeyup=""}}this.oParent.oInput1.setAttribute("name",this.sName1);this.oParent.oInput2.setAttribute("name",this.sName2);if(this.sValue1!=""){layeron(this.oParent.oInput1);this.oParent.oInput2.className="srch_half"}else{layeroff(this.oParent.oInput1);this.oParent.oInput2.className="srch_full"}$("#searchsection #QSmissingInput").hide()};function searchSwitcher(e,g,d,b,f,a){this.oTarget=e;if(!g){this.oForm=e.getElementsByTagName("form")[0]}else{this.oForm=document.getElementById(g)}if(!d){this.oInput1=e.getElementsByTagName("input")[0]}else{this.oInput1=document.getElementById(d)}if(!b){this.oInput2=e.getElementsByTagName("input")[1]}else{this.oInput2=document.getElementById(b)}if(!f){this.oSelector=e.getElementsByTagName("select")[0]}else{this.oSelector=document.getElementById(f)}this.oTrackClick="rf="+a;layeron(this.oSelector);this.oSelector.aChildren=this.oSelector.getElementsByTagName("option");this.aSearchOptions=[];var c=new searchOption();c.oParent=this;c.sAction="/Member.page/List?";c.sTrackClick=this.oTrackClick;c.sValue1="Forename";c.sValue2="Surname";c.sName1="Forename";c.sName2="Surname";c.sClassName="nameSrch";c.sErrorMessage="Please add a forename";c.sErrorMessage2="Please add a surname";c.bFireOnKeyUp=true;this.aSearchOptions.member=c;c=new searchOption();c.oParent=this;c.sAction="/School.page/primary%20school/List?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a school name here";c.sName1="bl";c.sName2="term";c.sClassName="primarySchoolSrch";c.sErrorMessage="Please add the name of<br />a primary school to search for";c.bFireOnKeyUp=false;this.aSearchOptions["primary school"]=c;c=new searchOption();c.oParent=this;c.sAction="/School.page/secondary%20school/List?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a school name here";c.sName1="bl";c.sName2="term";c.sClassName="secondarySchoolSrch";c.sErrorMessage="Please add the name of<br />a secondary school to search for";c.bFireOnKeyUp=false;this.aSearchOptions["secondary school"]=c;c=new searchOption();c.oParent=this;c.sAction="/School.page/university/List?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a university or college name here";c.sName1="bl";c.sName2="term";c.sClassName="uniSrch";c.sErrorMessage="Please add the name of<br />a college or university to search for";c.bFireOnKeyUp=false;this.aSearchOptions.uni=c;c=new searchOption();c.oParent=this;c.sAction="/work.page/List?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a workplace here";c.sName1="bl";c.sName2="term";c.sClassName="workSrch";c.sErrorMessage="Please add the name of<br />a workplace to search for";c.bFireOnKeyUp=false;this.aSearchOptions.work=c;c=new searchOption();c.oParent=this;c.sAction="/Sport and activities.page/List?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a team name here";c.sName1="bl";c.sName2="term";c.sClassName="sportAndActivitiesSrch";c.sErrorMessage="Please add the name of<br />a sport or activity to search for";c.bFireOnKeyUp=false;this.aSearchOptions["sport and activities"]=c;c=new searchOption();c.oParent=this;c.sAction="/Clubs and charities.page/List?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a club name here";c.sName1="bl";c.sName2="term";c.sClassName="clubsAssociationsAndCharitiesSrch";c.sErrorMessage="Please add the name of<br />a club or charity to search for";c.bFireOnKeyUp=false;this.aSearchOptions["clubs and charities"]=c;c=new searchOption();c.oParent=this;c.sAction="/Pubs.page/List?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a pub name here";c.sName1="bl";c.sName2="term";c.sClassName="pubsSrch";c.sErrorMessage="Please add the name of<br />a pub to search for";c.bFireOnKeyUp=false;this.aSearchOptions.pubs=c;c=new searchOption();c.oParent=this;c.sAction="/street.page/List?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a street name here";c.sName1="bl";c.sName2="term";c.sClassName="streetSrch";c.sErrorMessage="Please add the name of<br />a street to search for";c.bFireOnKeyUp=false;this.aSearchOptions.street=c;c=new searchOption();c.oParent=this;c.sAction="/forces.page/List?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type an armed force unit name here";c.sName1="bl";c.sName2="term";c.sClassName="unitSrch";c.sErrorMessage="Please add the name of<br />an armed force to search for";c.bFireOnKeyUp=false;this.aSearchOptions.forces=c;c=new searchOption();c.oParent=this;c.sAction="/UserGroup.page/Results?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a group name here";c.sName1="bl";c.sName2="name";c.sClassName="groupSrch";c.sErrorMessage="Please add the name of<br />a group to search for";c.bFireOnKeyUp=false;this.aSearchOptions.group=c;c=new searchOption();c.oParent=this;c.sAction="/Album.page/SearchPhotos?";c.sTrackClick=this.oTrackClick;c.sValue1="";c.sValue2="Type a keyword or place name";c.sName1="bl";c.sName2="term";c.sClassName="ptSrchOpt";c.sErrorMessage="Please add the name of<br />a photo to search for";c.bFireOnKeyUp=false;this.aSearchOptions.ptsearch=c;this.oSelector.onchange=this.changeSelect.bind(this);addHandler(this.oInput1,"focus",this.inputFocus.bind(this,0));addHandler(this.oInput2,"focus",this.inputFocus.bind(this,1));addHandler(this.oInput1,"blur",this.inputBlur.bind(this,0));addHandler(this.oInput2,"blur",this.inputBlur.bind(this,1));this.oForm.onsubmit=this.submitForm.bind(this);this.aSearchOptions[this.oSelector.value].clickSelect()}searchSwitcher.prototype.changeSelect=function(){this.aSearchOptions[this.oSelector.value].clickSelect()};searchSwitcher.prototype.submitForm=function(){if(iKeyCode==13&&this.aSearchOptions[this.oSelector.value].sValue1!=""){if(this.oInput1.value==this.aSearchOptions[this.oSelector.value].sValue1){this.oInput1.focus();return false}else{if(this.oInput2.value==this.aSearchOptions[this.oSelector.value].sValue2){this.oInput2.focus();return false}else{if(this.oInput1.value!=this.aSearchOptions[this.oSelector.value].sValue1&&this.oInput2.value!=this.aSearchOptions[this.oSelector.value].sValue2){}else{iKeyCode="";return false}}}}if((this.oInput1.value==this.aSearchOptions[this.oSelector.value].sValue1||this.oInput1.value=="")&&this.aSearchOptions[this.oSelector.value].sValue1!=""){$("#searchsection #QSmissingInput #QSmissingInputT").html(this.aSearchOptions[this.oSelector.value].sErrorMessage);$("#searchsection #QSmissingInput").css({left:(this.oInput1.offsetLeft-30)+"px"}).show();$("#searchsection #QSmissingInputRB").css({height:($("#searchsection #QSmissingInputL").height()-48)+"px"});$("#searchsection button.primary-button").removeClass("on");return false}if((this.oInput2.value==this.aSearchOptions[this.oSelector.value].sValue2||this.oInput2.value=="")&&this.aSearchOptions[this.oSelector.value].sValue1!=""){$("#searchsection #QSmissingInput #QSmissingInputT").html(this.aSearchOptions[this.oSelector.value].sErrorMessage2);$("#searchsection #QSmissingInput").css({left:(this.oInput2.offsetLeft-30)+"px"}).show();$("#searchsection #QSmissingInputRB").css({height:($("#searchsection #QSmissingInputL").height()-48)+"px"});$("#searchsection button.primary-button").removeClass("on");return false}if((this.oInput2.value==this.aSearchOptions[this.oSelector.value].sValue2||this.oInput2.value=="")&&this.aSearchOptions[this.oSelector.value].sValue1==""){$("#searchsection #QSmissingInput #QSmissingInputT").html(this.aSearchOptions[this.oSelector.value].sErrorMessage);$("#searchsection #QSmissingInput").css({left:(this.oInput2.offsetLeft-30)+"px"}).show();$("#searchsection #QSmissingInputRB").css({height:($("#searchsection #QSmissingInputL").height()-48)+"px"});$("#searchsection button.primary-button").removeClass("on");return false}};searchSwitcher.prototype.inputFocus=function(a){switch(a){case 0:if(this.oInput1.value==this.aSearchOptions[this.oSelector.value].sValue1){this.oInput1.setAttribute("value","");$("#searchsection #QSmissingInput").hide()}break;case 1:if(this.oInput2.value==this.aSearchOptions[this.oSelector.value].sValue2){this.oInput2.setAttribute("value","");$("#searchsection #QSmissingInput").hide()}break}};searchSwitcher.prototype.inputBlur=function(a){switch(a){case 0:if(this.oInput1.value==""){this.oInput1.setAttribute("value",this.aSearchOptions[this.oSelector.value].sValue1)}break;case 1:if(this.oInput2.value==""){this.oInput2.setAttribute("value",this.aSearchOptions[this.oSelector.value].sValue2)}break}};var resetTarget=[];var resetCheck=null;function resetChecker(){var a=[];for(var b=0;b<resetTarget.length;b++){if(!resetTarget[b].active){resetTarget[b].oParent.clearDrops();resetTarget[b].oParent.clearHighLights()}else{a.push()}}resetTarget=a}function list(a){this.oParent=null;this.oTarget=a;this.active=false;this.bClicked=false}list.prototype.initialise=function(){this.oLink=this.oTarget.getElementsByTagName("a")[0];if(this.oLink.innerHTML.toLowerCase().indexOf("0")>=0&&this.oLink.innerHTML.toLowerCase().indexOf("mess")>=0){this.oLink.innerHTML="My mail"}this.oList=this.oTarget.getElementsByTagName("div")[0];this.Shield=this.oTarget.getElementsByTagName("iframe")[0];if(this.oList){this.oLink.className="DDMenu";this.listLinks=this.oList.getElementsByTagName("li");this.setListLinks();this.oTarget.onmouseover=this.turnOn.bind(this)}else{this.oTarget.onmouseover=this.turnOn.bind(this);this.oTarget.onclick=this.followLink.bind(this)}this.oTarget.onmouseout=this.clearHighlights.bind(this)};list.prototype.killLink=function(){return false};list.prototype.followLink=function(){document.location.href=this.oLink.href;return false};list.prototype.turnOn=function(){this.highLight();this.oParent.clearDrops();if(this.bClicked){this.oParent.clearHighLights()}else{this.oTarget.className="navSelected";if(this.oList){this.height=this.oList.offsetHeight;this.width=this.oList.offsetWidth;this.shieldUp()}this.bClicked=true}return false};list.prototype.highLight=function(){this.startResetCheck();this.active=true;this.oParent.clearHighLights();if(this.oTarget.className!="navSelected"){this.oTarget.className="highLighted"}};list.prototype.clearHighlights=function(){this.active=false;this.oParent.clearHighLights(this.oTarget)};list.prototype.setListLinks=function(){for(l=0;l<this.listLinks.length;l++){this.listLinks[l].oParent=this;this.listLinks[l].shref=this.listLinks[l].getElementsByTagName("a")[0].href;if(this.listLinks[l].getElementsByTagName("a")[0].id){var a=this.listLinks[l].getElementsByTagName("a")[0].id;if(a.indexOf("currentSelection")>-1){this.nCurrentSelection=l}}this.listLinks[l].onmouseover=function(){this.oParent.active=true};this.listLinks[l].onmouseout=function(){this.oParent.active=false};this.listLinks[l].onclick=function(){document.location.href=this.shref;return false}}};list.prototype.shieldUp=function(){this.Shield.style.height=(this.height-3)+"px";this.Shield.style.width=this.width+"px";this.Shield.style.zIndex=-10;this.Shield.removeAttribute("allowTransparency");if(this.nTopAdjust){this.Shield.style.top=this.nTopAdjust+"px"}this.Shield.style.visibility="visible";this.Shield.style.display="block"};list.prototype.shieldDown=function(){if(this.Shield){this.Shield.style.visibility="hidden";this.Shield.style.display="none"}};list.prototype.startResetCheck=function(){resetTarget.push(this);if(resetCheck){clearTimeout(resetCheck)}resetCheck=setTimeout(resetChecker,1000)};function dropNav(a){this.oTarget=a;this.aHeadLinks=[];this.aDrops=[]}dropNav.prototype.clearDrops=function(){for(i=0;i<this.aDrops.length;i++){if(!this.aDrops[i].active){this.aDrops[i].oTarget.className="";this.aDrops[i].bClicked=false;this.aDrops[i].shieldDown();if(this.aDrops[i].upDown){this.aDrops[i].oList.style.zIndex=20}}}};dropNav.prototype.clearHighLights=function(a){for(i=0;i<this.aDrops.length;i++){if(this.aDrops[i].oTarget.className!="navSelected"&&this.aDrops[i].oTarget!=a){this.aDrops[i].oTarget.className=""}}};dropNav.prototype.initialise=function(){if(this.oTarget){var a=this.oTarget.getElementsByTagName("li");for(i=0;i<a.length;i++){if(a[i].id){var b=new list(a[i]);b.initialise();b.oParent=this;this.aDrops.push(b)}}}};function upDownlist(a){dropNav.call(this,a)}upDownlist.prototype=new list();upDownlist.prototype.turnOn=function(){this.oList.style.zIndex=2000;if(this.bClicked){this.oParent.clearDrops();this.oParent.clearHighLights()}else{this.startResetCheck();this.oParent.clearDrops();this.oTarget.className="navSelected";this.height=this.oList.offsetHeight;this.width=this.oList.offsetWidth;this.nTopAdjust=-((this.height/(this.listLinks.length))*this.nCurrentSelection);this.oList.style.top=this.nTopAdjust+"px";this.shieldUp();this.bClicked=true}return false};function upDowndropNav(a){dropNav.call(this,a)}upDowndropNav.prototype=new dropNav();upDowndropNav.prototype.initialise=function(){if(this.oTarget){this.upDown=true;var a=this.oTarget.getElementsByTagName("li");for(i=0;i<a.length;i++){if(a[i].id){var b=new upDownlist(a[i]);b.oParent=this;b.initialise();this.aDrops.push(b)}}}};function AutoSuggestControl(b,a,c){this.cur=-1;this.layer=null;this.buttonLayer=null;this.provider=a;this.textbox=b;this.searchButtonText=c;this.init()}AutoSuggestControl.prototype.autosuggest=function(a,b){if(a.length>0){if(b){this.typeAhead(a[0])}this.showSuggestions(a)}else{this.hideSuggestions()}};AutoSuggestControl.prototype.createDropDown=function(){var a=this;this.layer=document.createElement("div");this.layer.className="suggestions";this.layer.style.visibility="hidden";this.layer.onmousedown=this.layer.onmouseup=this.layer.onmouseover=function(b){b=b||window.event;oTarget=b.target||b.srcElement;if(b.type=="mousedown"){a.textbox.value=oTarget.firstChild.nodeValue;a.handleOnChange();a.hideSuggestions()}else{if(b.type=="mouseover"){a.highlightSuggestion(oTarget)}else{a.textbox.focus()}}};document.body.appendChild(this.layer)};AutoSuggestControl.prototype.createSearchButton=function(){var a=this;var b=this.textbox.parentNode;this.buttonLayer=document.createElement("button");this.buttonLayer.className="AutoSuggestSearchButton";this.buttonLayer.onclick=function(){a.pushSearch(a)};this.buttonLayer.value=this.searchButtonText;b.insertBefore(this.buttonLayer,document.getElementById(this.textbox.id+"Key").nextSibling);if(this.searchButtonText==""){layeroff(this.buttonLayer)}};AutoSuggestControl.prototype.getLeft=function(){var b=this.textbox;var a=0;while(b&&(b.tagName!="BODY")){a+=b.offsetLeft;b=b.offsetParent}return a};AutoSuggestControl.prototype.getTop=function(){var b=this.textbox;var a=0;while(b&&(b.tagName!="BODY")){a+=b.offsetTop;b=b.offsetParent}return a};AutoSuggestControl.prototype.handleKeyDown=function(a){switch(a.keyCode){case 38:this.previousSuggestion();break;case 40:this.nextSuggestion();break;case 13:this.hideSuggestions();break}};AutoSuggestControl.prototype.handleKeyUp=function(b){var a=b.keyCode;if(a==8||a==46){this.provider.populateSuggestions(this,true);bLocalTypeAhead=false;this.provider.requestSuggestions(this,false)}else{if(a<32||(a>=33&&a<46)||(a>=112&&a<=123)){}else{this.provider.populateSuggestions(this,true);bLocalTypeAhead=bTypeAhead;if(!bGetValues){this.provider.requestSuggestions(this,bTypeAhead)}this.handleOnChange()}}};AutoSuggestControl.prototype.hideSuggestions=function(){this.layer.style.visibility="hidden";this.buttonLayer.style.visibility="visible"};AutoSuggestControl.prototype.highlightSuggestion=function(c){for(var a=0;a<this.layer.childNodes.length;a++){var b=this.layer.childNodes[a];if(b==c){b.className="current"}else{if(b.className=="current"){b.className=""}}}};AutoSuggestControl.prototype.init=function(){var a=this;this.textbox.onkeyup=function(b){if(!b){b=window.event}a.handleKeyUp(b)};this.textbox.onkeydown=function(b){if(!b){b=window.event}a.handleKeyDown(b)};this.textbox.onblur=function(){a.hideSuggestions()};this.createDropDown();this.createSearchButton()};AutoSuggestControl.prototype.nextSuggestion=function(){var a=this.layer.childNodes;if(a.length>0&&this.cur<a.length-1){var b=a[++this.cur];this.highlightSuggestion(b);this.textbox.value=b.firstChild.nodeValue;this.handleOnChange()}};AutoSuggestControl.prototype.previousSuggestion=function(){var a=this.layer.childNodes;if(a.length>0&&this.cur>0){var b=a[--this.cur];this.highlightSuggestion(b);this.textbox.value=b.firstChild.nodeValue;this.handleOnChange()}};AutoSuggestControl.prototype.selectRange=function(c,a){if(this.textbox.createTextRange){var b=this.textbox.createTextRange();b.moveStart("character",c);b.moveEnd("character",a-this.textbox.value.length);b.select()}else{if(this.textbox.setSelectionRange){this.textbox.setSelectionRange(c,a)}}this.textbox.focus()};AutoSuggestControl.prototype.showSuggestions=function(a){var b=null;this.layer.innerHTML="";for(var c=0;c<a.length;c++){b=document.createElement("div");b.appendChild(document.createTextNode(a[c]));this.layer.appendChild(b)}if(a.length!==0){this.buttonLayer.style.visibility="hidden"}else{this.buttonLayer.style.visibility="visible"}this.layer.style.left=this.getLeft()+"px";this.layer.style.top=(this.getTop()+this.textbox.offsetHeight)+"px";this.layer.style.visibility="visible"};AutoSuggestControl.prototype.typeAhead=function(a){if(this.textbox.createTextRange||this.textbox.setSelectionRange){var b=this.textbox.value.length;this.textbox.value=a;this.handleOnChange();this.selectRange(b,a.length)}};function getArrayPosFromValue(a,c){var b=false;for(var d=0;d<a.length;d++){if(a[d]==c){b=true;return d}}if(b===false){return -1}}AutoSuggestControl.prototype.handleOnChange=function(){var a=getArrayPosFromValue(arOutputValues,this.textbox.value);if(a>=0){document.getElementById(this.textbox.id+"Key").value=arOutputKeys[a]}else{document.getElementById(this.textbox.id+"Key").value=-1}};AutoSuggestControl.prototype.pushSearch=function(a){a.provider.populateSuggestions(a,false);if(!bGetValues){a.provider.requestSuggestions(a,bTypeAhead)}a.handleOnChange()};var arOutputKeys=[];var arOutputValues=[];var bGetValues=false;var bTypeAhead=false;var bLocalTypeAhead=false;function handleSearchSuggest(sStrIn){eval(sStrIn);if(bGetValues){oTextbox.provider.names=arOutputValues;oTextbox.provider.requestSuggestions(oTextbox,bLocalTypeAhead)}}function getPostParameters(b){var a="sSearch="+encodeURI(b);return a}function ForenameSuggestions(){this.names=[]}ForenameSuggestions.prototype.requestSuggestions=function(c,b){var a=[];var e=c.textbox.value;if(e.length>0){for(var d=0;d<this.names.length;d++){if(this.names[d].toLowerCase().indexOf(e.toLowerCase())===0){a.push(this.names[d])}}}c.autosuggest(a,b)};ForenameSuggestions.prototype.populateSuggestions=function(b,c){oTextbox=b;bGetValues=true;var e=b.textbox;if(e.value.length<2){bGetValues=false}if(bGetValues===true){var a=e.value;if(a.indexOf(" - ")>0){a=a.substr(0,a.indexOf(" - "))}var d="/Suggest.ashx?WCI=SuggestForenames&member_key=0&sSearch="+encodeURI(a);$.get(d,handleSearchSuggest)}};function SurnameSuggestions(){this.names=[]}SurnameSuggestions.prototype.requestSuggestions=function(c,b){var a=[];var e=c.textbox.value;if(e.length>0){for(var d=0;d<this.names.length;d++){if(this.names[d].toLowerCase().indexOf(e.toLowerCase())===0){a.push(this.names[d])}}c.autosuggest(a,b)}};SurnameSuggestions.prototype.populateSuggestions=function(b,c){oTextbox=b;bGetValues=true;var e=b.textbox;if(e.value.length<2){bGetValues=false}if(bGetValues===true){var a=e.value;if(a.indexOf(" - ")>0){a=a.substr(0,a.indexOf(" - "))}var d="/Suggest.ashx?WCI=SuggestSurnames&member_key=0&sSearch="+encodeURI(a);$.get(d,handleSearchSuggest)}};addLoadEvent(function(){var b=window.location.toString();if(!(b.indexOf("WorkGroup.aspx")>-1)&&(document.namesearch!=null)){var c=new AutoSuggestControl(document.namesearch.search_forename,new ForenameSuggestions(),"");var a=new AutoSuggestControl(document.namesearch.search,new SurnameSuggestions(),"")}});(function(e){var d;var a="";var h=function(k){return function(){k.parent().hide();k.parent().next().show()}};function c(){e(".AddFriend").live("click",function(k){k.preventDefault();d=e(this);pic1=new Image();pic1.src="/webimage/manageControl/follow.png";pic2=new Image();pic2.src="/webimage/manageControl/friend-on.png";pic3=new Image();pic3.src="/webimage/manageControl/follow-hvr.png";pic4=new Image();pic4.src="/webimage/manageControl/friend.png";pic5=new Image();pic5.src="/webimage/manageControl/friend-hvr.png";pic6=new Image();pic6.src="/webimage/manageControl/friend-on.png";if(e("#managePop").length==0){e("body").prepend(e('<div id="managePop" style="display:none;"></div>'))}var l=e("#managePop").empty();FRdialogueInit(l);e.post(e(this).attr("href"),{},function(m,n){l.html(m);FRdialoguePosition(l);l.fadeIn();l.find("a.CLOSE").click(function(o){o.preventDefault();FRdialogueClose(e("#managePop"))});e("#btnSave").bind("click",function(){k.preventDefault();var p,o;if(e("#lnkAddXFollow").hasClass("on")){p=4;o=e("#lnkAddXFollow").attr("member_key")}else{p=5;o=e("#lnkAddXFollow").attr("member_key")}f(o,p,h(d));FRdialogueClose(e("#managePop"))});e("#lnkAddXFollow").bind("click",function(){g()});e("#AddFriend").bind("click",function(){j()})})});e(".addFriendExtender").live("click",function(k){k.preventDefault();d=e(this);if(e("#managePop").length==0){e("body").prepend(e('<div id="managePop" style="display:none;"></div>'))}h="";h=function(m){return function(){m.hide();e(".friend-state").show();e(".lnkManageProfile").parent().show()}};var l=e("#managePop").empty();FRdialogueInit(l);e.post(e(this).attr("href"),{},function(m,n){l.html(m);FRdialoguePosition(l);l.fadeIn();l.find("a.CLOSE").click(function(o){o.preventDefault();FRdialogueClose(e("#managePop"))});e("#btnSave").bind("click",function(){k.preventDefault();var p,o;if(e("#lnkAddXFollow").hasClass("on")){p=4;o=e("#lnkAddXFollow").attr("member_key")}else{p=5;o=e("#lnkAddXFollow").attr("member_key")}f(o,p,h(d));FRdialogueClose(e("#managePop"))});e("#lnkAddXFollow").bind("click",function(){g()});e("#AddFriend").bind("click",function(){j()})})});e(".addFriendSuggest").live("click",function(k){k.preventDefault();d=e(this);if(e("#managePop").length==0){e("body").prepend(e('<div id="managePop" style="display:none;"></div>'))}a="Y";h="";h=function(m){return function(){i()}};var l=e("#managePop").empty();FRdialogueInit(l);e.post(e(this).attr("href"),{},function(m,n){l.html(m);FRdialoguePosition(l);l.fadeIn();l.find("a.CLOSE").click(function(o){o.preventDefault();FRdialogueClose(e("#managePop"))});e("#btnSave").bind("click",function(){k.preventDefault();var p,o;if(e("#lnkAddXFollow").hasClass("on")){p=4;o=e("#lnkAddXFollow").attr("member_key")}else{p=5;o=e("#lnkAddXFollow").attr("member_key")}f(o,p,h(d));FRdialogueClose(e("#managePop"))});e("#lnkAddXFollow").bind("click",function(){g()});e("#AddFriend").bind("click",function(){j()})})})}e(".AcceptFriend").live("click",function(k){k.preventDefault();d=e(this);f(e(this).attr("member_key"),6,onAddProfile(d))});e(".AcceptFriendProfile").live("click",function(m){m.preventDefault();d=e(this);var k="";var l=function(n){return function(){n.parent().hide();n.parent().next().attr("class","friend-state family").show();n.parent().next().next().show()}};f(e(this).attr("member_key"),6,l(d))});e(".IgnoreFriendProfile").live("click",function(m){m.preventDefault();d=e(this);var l="";var k=function(n){return function(){n.parent().hide()}};f(e(this).attr("member_key"),7,k(d))});e(".removeFriendSuggest").live("click",function(k){k.preventDefault();e.post(e(this).attr("href"),{},function(l,m){e("#__suggestionsList").empty().prepend(l)})});function g(){e("#lnkAddXFollow").attr("class","lnkAddXFollow on");e("#AddFriend").attr("class","lnkAddFriend");return false}function j(){e("#AddFriend").attr("class","lnkAddFriend on");e("#lnkAddXFollow").attr("class","lnkAddXFollow");return false}function i(){e.post("/Member.Page/FriendSuggestions",{},function(k,l){e("#__suggestionsList").empty().prepend(k)})}function b(){}function f(k,l,m){e.ajax({type:"GET",url:"/Services/ClientService.svc/UpdateFriendRelationship?memberKey="+k+"&updateType="+l,dataType:"json",async:true,success:function(n){m()},error:function(n){}})}FR.onLoad.addLoadSetup(c)})(jQuery);
