var createNamespace;if(!createNamespace||typeof createNamespace!="function"){createNamespace=function(str){var a=str.split(".");var o=window;for(var i=0;i<a.length;i++){if(!o[a[i]]){o[a[i]]={}}o=o[a[i]]}}}createNamespace("Ninemsn.External");String.prototype.truncateIS=function(len){if(this.length>len+9){return this.substring(0,len)+"...(more)"}else{return this}};Ninemsn.External.LiveSearch=function(){var config=InlineSearchBoxConfiguration;if(!config.liveSearchURL)config.liveSearchURL="http://search.live.com/results.aspx";if(!config.prevButtonSrc)config.prevButtonSrc="http://search.live.com/s/siteowner/glyph_back_rest.gif";if(!config.prevPageLink)config.prevPageLink="http://search.live.com/s/siteowner/glyph_back_hover.gif";if(!config.nextButtonSrc)config.nextButtonSrc="http://search.live.com/s/siteowner/glyph_next_rest.gif";if(!config.nextPageLink)config.nextPageLink="http://search.live.com/s/siteowner/glyph_next_hover.gif";if(!config.webResultFooterLiveLink)config.webResultFooterLiveLink="http://search.live.com/?FORM=LSBTOL";if(!config.webResultFooterLiveText)config.webResultFooterLiveText="Try Live Search";if(!config.liveJsonUrl)config.liveJsonUrl="http://search.live.com/json.aspx?q=";if(!config.liveLinkText)config.liveLinkText="Try this on Live.com";if(!config.liveLogoPng)config.liveLogoPng="services.ninemsn.com.au/share/external/search/img/logo_live.png";if(!config.liveAltText)config.liveAltText="Live Search";if(!config.liveCloseButton)config.liveCloseButton="services.ninemsn.com.au/share/external/search/img/btn_close.gif";if(!config.liveSearchWatermark)config.liveSearchWatermark="services.ninemsn.com.au/share/external/search/img/logo_watermark.gif";if(!config.liveSearchButton)config.liveSearchButton="services.ninemsn.com.au/share/external/search/img/btn_search.png";if(!config.liveSearchPrefix)config.liveSearchPrefix="powered by";if(!config.liveLink)config.liveLink="live.com";var HL_DIV_ID="WL_inlineSearch";var HL_BORDER_STYLE="2px solid white";var SEARCH_BOX_ID="inlineSearchbox";var SEARCH_BG_STYLE="url("+HTTP_PROTOCOL+config.liveSearchWatermark+") no-repeat right 50%";var MIN_WIDTH="170px";var searchInProgress=false;var activeScopeButton="ScopeButtonInnerDiv0";var isNonStandardCSS=(document.compatMode&&document.compatMode=="BackCompat");var width=(parseInt(config.width)<parseInt(MIN_WIDTH)?MIN_WIDTH:config.width);document.write("<div id='WL_inlineSearchBox'>");document.write("	<div id='"+HL_DIV_ID+"' style='border:"+HL_BORDER_STYLE+";width:"+(parseInt(width)+(isNonStandardCSS?29:32))+"px;'>");document.write("	<table cellpadding='0px' cellspacing='0px'>");document.write("		<tr>");document.write("			<td>");document.write("				<input title='Search for' id='"+SEARCH_BOX_ID+"' name='q' value='"+config.scopes[0].defaultText+"' type='text' onfocus='nmsnlis.highlight()' onblur='nmsnlis.unhighlight()' onkeypress='if(event.keyCode==13){return nmsnlis.doSearch();}' style='background:"+SEARCH_BG_STYLE+";border-style:solid none solid solid;border-color:"+config.themeBorder+";border-width:1px;width:"+width+"' />");document.write("			</td>");document.write("			<td>");document.write("				<!--[if IE]><style>#"+SEARCH_BOX_ID+"{margin:-1px 0;}</style><input title='Search' id='WLSearchBoxButton' src='"+HTTP_PROTOCOL+"services.ninemsn.com.au/share/img/s.gif' align='absbottom' type='image' onclick='return nmsnlis.doSearch();' style='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+HTTP_PROTOCOL+config.liveSearchButton+"\",sizingMethod=\"scale\");border:1px solid "+config.themeBorder+";width:23px;height:20px;background-color:"+config.themeBtnBg+";'><![endif]-->");document.write("				<![if !IE]><input title='Search' id='WLSearchBoxButton' src='"+HTTP_PROTOCOL+config.liveSearchButton+"' align='absbottom' type='image' onclick='return nmsnlis.doSearch();' style='border:1px solid "+config.themeBorder+";width:23px;height:20px;background-color:"+config.themeBtnBg+";'><![endif]>");document.write("			</td>");document.write("		</tr>");document.write("	</table>");document.write("	</div>");document.write("<div id='FloatPaneDivShadow' style='position:"+(config.isInline?"absolute":"relative")+";"+(config.isInline?"display:none;":"")+(config.alignCorner=="right"?"right:"+(isNonStandardCSS?"16":"-2")+"px;":"left:6px;")+"background-color:gray;height:"+(parseInt(config.resultsHeight)+67)+"px;width:"+(parseInt(config.resultsWidth)+2)+"px;'>");document.write("<div id='FloatPaneDiv' style='display:block;"+(config.isInline?"top:-5px;":"top:-3px;")+(config.alignCorner=="right"?"right:4px;":"left:-4px;")+"border:1px solid "+config.themeBorder+";width:"+(parseInt(config.resultsWidth)+2)+"px;'>");document.write("	<div id='ScopeBarDiv' style='border-bottom:1px solid "+config.themeBorder+";background-color:"+config.themeResBarBg+";'>");document.write("		<div id='ScopeDiv'>");for(var i=0;i<config.scopes.length;i++){document.write("<!--[if lte IE 6]><div id='ScopeButtonDiv"+i+"' class='ScopeButtonDiv' style='background-color:"+config.themeResBtnBg+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+HTTP_PROTOCOL+"services.ninemsn.com.au/share/external/search/img/tab_bg.png\",sizingMethod=\"scale\");'><div id='ScopeButtonInnerDiv"+i+"' class='"+(i==0?"ScopeButtonSelected":"ScopeButton")+"' onclick='nmsnlis.scopeSearch(this.id);'>"+config.scopes[i].caption+"</div></div><![endif]-->");document.write("<![if !lte IE 6]><div id='ScopeButtonDiv"+i+"' class='ScopeButtonDiv' style='background:"+config.themeResBtnBg+" url("+HTTP_PROTOCOL+"services.ninemsn.com.au/share/external/search/img/tab_bg.png);'><div id='ScopeButtonInnerDiv"+i+"' class='"+(i==0?"ScopeButtonSelected":"ScopeButton")+"' onclick='nmsnlis.scopeSearch(this.id);'>"+config.scopes[i].caption+"</div></div><![endif]>")}document.write("		</div>");document.write("		<div id='ScopeClose'>");document.write("			<span id='poweredBy'>"+config.liveSearchPrefix+"</span>");document.write("			<!--[if lte IE 6]><a href='"+HTTP_PROTOCOL+config.liveLink+"'><img id='LogoImage' src='"+HTTP_PROTOCOL+"services.ninemsn.com.au/share/img/s.gif' style='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+HTTP_PROTOCOL+config.liveLogoPng+"\",sizingMethod=\"scale\");' alt='"+config.liveAltText+"' width='60' height='24' /></a><![endif]-->");document.write("			<![if !lte IE 6]><a href='"+HTTP_PROTOCOL+config.liveLink+"'><img id='LogoImage' src='"+HTTP_PROTOCOL+config.liveLogoPng+"' alt='"+config.liveAltText+"' width='60' height='24' /></a><![endif]>");document.write("			<img id='CloseImage' src='"+HTTP_PROTOCOL+config.liveCloseButton+"' alt='Close' width='18' height='18' onclick='document.getElementById(\"FloatPaneDivShadow\").style.display = \"none\";' />");document.write("		</div>");document.write("	</div>");document.write("	<div id='ResultViewDiv'>");document.write("		<div id='ScopeButtonResultDiv'>");document.write("			<div id='WebResultDiv' class='WebResultDivNoAds'>");document.write("				<div id='WebResultViewDiv' style='height:"+config.resultsHeight+";width:"+config.resultsWidth+";'></div>");document.write("				<div id='WebResultFooterDiv' style='border-top:1px solid "+config.themeBorder+";'>");document.write("					<div id='WebResultFooterLiveDiv'>");document.write("						<a href='http://g.msn.com/0PR_/enus' target='_blank'>Privacy</a>");document.write("					</div>");document.write("					<div id='WebResultFooterPageDiv'></div>");document.write("					<div id='WebResultHeaderNumberDiv'></div>");document.write("				</div>");document.write("			</div>");document.write("		</div>");document.write("	</div>");document.write("</div>");document.write("</div>");document.write("</div>");function liveSearchCallback(responseElement,params){if(responseElement&&responseElement.web&&responseElement.web!=undefined){if(config.tryOnLiveLink){var liveLink;if(document.getElementById("WebResultFooterLiveLink")){liveLink=document.getElementById("WebResultFooterLiveLink")}else{liveLink=document.createElement("a");liveLink.id="WebResultFooterLiveLink";liveLink.target="_blank"}liveLink.href=config.liveSearchURL+"?q="+escape(trim(document.getElementById(SEARCH_BOX_ID).value))+"&FORM=LSBTOL";liveLink.innerHTML=config.liveLinkText;if(!document.getElementById("WebResultFooterLiveLink")){document.getElementById("WebResultFooterLiveDiv").appendChild(document.createTextNode(" | "));document.getElementById("WebResultFooterLiveDiv").appendChild(liveLink)}}if(responseElement.web.total>responseElement.web.results.length){document.getElementById("WebResultFooterPageDiv").innerHTML="";var resultPages=1+parseInt(responseElement.web.total/config.count);if(offsetValue>1){var prevButtonSrc=config.prevButtonSrc;var prevPageLink=document.createElement("img");prevPageLink.id="PrevPageLink";prevPageLink.src=prevButtonSrc;prevPageLink.className="WebResultFooterPrevPageImage";prevPageLink.onclick=prevPage;prevPageLink.onmouseover=function(){this.src=config.prevPageLink};prevPageLink.onmouseout=function(){this.src=prevButtonSrc};document.getElementById("WebResultFooterPageDiv").appendChild(prevPageLink)}var displayPages=(resultPages>5?5:resultPages);var pages=new Array(displayPages);var startIndex=currentPage-2;if(currentPage<=3){startIndex=1}else{if(currentPage==resultPages-1){startIndex=currentPage-3}else if(currentPage==resultPages){startIndex=currentPage-4;if(startIndex<1){startIndex=1}}}for(var i=startIndex;i<startIndex+pages.length;i++){var pageLink=document.createElement("span");pageLink.id="Page"+i;pageLink.innerHTML=i;if(i==currentPage){pageLink.className="WebResultFooterCurrentPageLink"}else{pageLink.className="WebResultFooterPageLink";pageLink.onclick=gotoPage}document.getElementById("WebResultFooterPageDiv").appendChild(pageLink)}if(resultPages>1&&currentPage!=resultPages){var nextButtonSrc=config.nextButtonSrc;var nextPageLink=document.createElement("img");nextPageLink.id="NextPageLink";nextPageLink.src=nextButtonSrc;nextPageLink.className="WebResultFooterNextPageImage";nextPageLink.onclick=nextPage;nextPageLink.onmouseover=function(){this.src=config.nextPageLink};nextPageLink.onmouseout=function(){this.src=nextButtonSrc};document.getElementById("WebResultFooterPageDiv").appendChild(nextPageLink)}}document.getElementById("WebResultHeaderNumberDiv").innerHTML="Page "+currentPage+" of "+responseElement.web.totalLocaleString+" result(s)"}else{var searchText=document.getElementById(SEARCH_BOX_ID).value;searchText=replaceAll(searchText,"<","&lt;");searchText=replaceAll(searchText,">","&gt;");var resultTitle=document.createElement("p");resultTitle.className="WLpaneMsg";resultTitle.innerHTML="No results found for <b>"+searchText+"</b>.";document.getElementById("WebResultViewDiv").innerHTML="";document.getElementById("WebResultViewDiv").appendChild(resultTitle);document.getElementById("WebResultHeaderNumberDiv").innerHTML="";if(document.getElementById("WebResultFooterLiveLink")){document.getElementById("WebResultFooterLiveLink").href=config.webResultFooterLiveLink;document.getElementById("WebResultFooterLiveLink").innerHTML=config.webResultFooterLiveText}}searchInProgress=false}this.highlight=function(){var hlDiv=document.getElementById(HL_DIV_ID);hlDiv.style.border="2px solid "+config.themeHighlight;var sbox=document.getElementById(SEARCH_BOX_ID);if(sbox.value==config.scopes[0].defaultText){sbox.value=""}sbox.style.background=""};this.unhighlight=function(){var hlDiv=document.getElementById(HL_DIV_ID);hlDiv.style.border=HL_BORDER_STYLE;var sbox=document.getElementById(SEARCH_BOX_ID);if(sbox.value==""){sbox.value=config.scopes[0].defaultText;sbox.style.background=SEARCH_BG_STYLE}};this.doSearch=function(){if(!searchInProgress){currentPage=1;offsetValue=1;newSearch()}return false};this.scopeSearch=function(elemId){if(!searchInProgress){currentPage=1;offsetValue=1;activeScopeButton=elemId;newSearch();for(var i=0;i<config.scopes.length;i++){var scopeBtn=document.getElementById("ScopeButtonInnerDiv"+i);scopeBtn.className=(scopeBtn.id==activeScopeButton?"ScopeButtonSelected":"ScopeButton")}}};function nextPage(){if(!searchInProgress){offsetValue+=config.count;currentPage++;newSearch()}}function prevPage(){if(!searchInProgress){offsetValue-=config.count;currentPage--;newSearch()}}function gotoPage(){if(!searchInProgress){var pageNum=this.innerHTML;offsetValue+=(pageNum-currentPage)*config.count;currentPage=pageNum;newSearch()}}function newSearch(){searchInProgress=true;document.getElementById("FloatPaneDivShadow").style.display="block";if(trim(document.getElementById(SEARCH_BOX_ID).value)==""){searchInProgress=false;var resultTitle=document.createElement("p");resultTitle.className="WLpaneMsg";resultTitle.innerHTML="Please enter a search query.";document.getElementById("WebResultViewDiv").appendChild(resultTitle);document.getElementById("WebResultHeaderNumberDiv").innerHTML="";if(document.getElementById("WebResultFooterLiveLink")){document.getElementById("WebResultFooterLiveLink").href=config.webResultFooterLiveLink;document.getElementById("WebResultFooterLiveLink").innerHTML=config.webResultFooterLiveText}}else{document.getElementById("WebResultViewDiv").innerHTML="<iframe width='100%' height='100%' MARGINHEIGHT='0' MARGINWIDTH='0' scrolling='no' border='0' frameborder='0' src='"+HTTP_PROTOCOL+"services.ninemsn.com.au/share/external/search/inlineresults.html?q="+escape(document.getElementById(SEARCH_BOX_ID).value)+"&config="+escape(config.configURL)+"&scope="+activeScopeButton.substring(19)+"&offsetValue="+offsetValue+"'></iframe>";var scopeID=activeScopeButton.substring(19);var searchParams=config.scopes[scopeID].searchParam+"&first="+offsetValue;var jsonPropList=new Ninemsn.Global.ContentManager.JsonProp(null,null,null,"LiveSearchGetResponse",Ninemsn.Global.ContentManager.Json.ResponseFunction.Identical);var liveJsonUrl=config.liveJsonUrl+escape(trim(document.getElementById(SEARCH_BOX_ID).value))+escape(" ")+searchParams+"&mkt="+config.searchMkt+"&count="+config.count+"&FORM="+config.formCode;Ninemsn.Global.ContentManager.GetContent(liveJsonUrl,liveSearchCallback,jsonPropList)}}function trim(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"")}function replaceAll(stringToReplace,findText,repText){return stringToReplace.replace(new RegExp(findText,"g"),repText)}};var nmsnlis=new Ninemsn.External.LiveSearch();