var m_svCountry="";var m_svRegion="";var m_svCity="";var m_svPostcode="";var citationCallback={success:function(o){var _312=document.getElementById("unauthorized_citation");if(_312&&o&&o.responseText!==undefined){try{var _313=YAHOO.lang.JSON.parse(o.responseText);_312.innerHTML=_313.citations[0].citation;}catch(err){_312.innerHTML="Unable to retrieve citation.";}}},failure:function(o){var _315=document.getElementById("unauthorized_citation");if(_315){_315.innerHTML="Unable to retrieve citation.";}},argument:{}};function getCitation(_316,nId){var _318=_316+"="+nId;YAHOO.util.Connect.asyncRequest("POST","/citation.do",citationCallback,_318);}function getSEFCitation(svTa,svUh){var _31b="ta="+svTa;if(svUh){_31b+="&uh="+svUh;}YAHOO.util.Connect.asyncRequest("POST","/citation.do",citationCallback,_31b);}function getClients(_31c,_31d,_31e){m_svCity=_31c;m_svPostcode=_31d;if(!_31d){if(m_svCountry=="xx"){alert(login_wayf_bycity_alert_country);return false;}if(m_svRegion=="xx"){alert(login_wayf_bycity_alert_region);return false;}if(_31c=="xx"){alert(login_wayf_bycity_alert_city);return false;}}var _31f={success:function(o){if(o.responseText!==undefined){try{var _321=YAHOO.lang.JSON.parse(o.responseText);displayClients(_321,_31e);}catch(err){displayClients(null,null);}}},failure:function(o){displayClients(null,null);},argument:{}};var _323="";if(m_svPostcode&&m_svPostcode!=""){_323="postcode="+m_svPostcode;}else{if(_31e&&_31e!=""){_323="ip="+_31e+"&max=9";}else{if(m_svCountry&&m_svCountry!=""&&m_svCountry!="xx"){_323="country="+m_svCountry;}if(m_svRegion&&m_svRegion!=""&&m_svRegion!="xx"){_323+="&region="+m_svRegion;}if(m_svCity&&m_svCity!=""&&m_svCity!="xx"){_323+="&city="+m_svCity;}}}YAHOO.util.Connect.asyncRequest("POST","/clientlocation.do",_31f,_323);return false;}function displayClients(_324,_325){var _326=document.getElementById("geoResults");var _327=false;if(!_326){return;}while(_326.hasChildNodes()){_326.removeChild(_326.firstChild);}if(!login_wayf_bycity_opt_region){login_wayf_bycity_opt_region="must define login_wayf_bycity_opt_region";}if(!login_wayf_bycity_opt_city){login_wayf_bycity_opt_city="must define login_wayf_bycity_opt_city";}if(!login_wayf_liblist_pubtitle){login_wayf_liblist_pubtitle="must define login_wayf_liblist_pubtitle";}if(!login_wayf_liblist_univtitle){login_wayf_liblist_univtitle="must define login_wayf_liblist_univtitle";}if(!login_wayf_liblist_geotitle){login_wayf_liblist_geotitle="must define login_wayf_liblist_geotitle";}if(!login_wayf_liblist_geodesc){login_wayf_liblist_geodesc="must define login_wayf_liblist_geodesc";}if(!login_wayf_liblist_searchtitle){login_wayf_liblist_searchtitle="must define login_wayf_liblist_searchtitle";}if(!login_wayf_liblist_searchdesc){login_wayf_liblist_searchdesc="must define login_wayf_liblist_searchdesc";}if(!login_wayf_liblist_trysearch){login_wayf_liblist_trysearch="must define login_wayf_liblist_trysearch";}if(!login_wayf_liblist_notavail){login_wayf_liblist_notavail="must define login_wayf_liblist_notavail";}if(!login_wayf_liblist_noneavail){login_wayf_liblist_noneavail="must define login_wayf_liblist_noneavail";}if(!_324){_326.innerHTML=login_wayf_liblist_notavail;return;}var _328=document.createElement("table");var _329=document.createElement("tbody");var tr=document.createElement("tr");var _32b=new Array();_32b[0]=document.createElement("td");_32b[1]=document.createElement("td");_32b[2]=document.createElement("td");tr.appendChild(_32b[0]);tr.appendChild(_32b[1]);tr.appendChild(_32b[2]);_329.appendChild(tr);var _32c=document.createElement("caption");_32c.innerHTML=login_wayf_liblist_searchtitle;_328.appendChild(_32c);_328.appendChild(_329);var _32d=parseInt(_324.length/3);if(_324.length%3>0){_32d++;}var _32e=0;for(var i=0;i<_324.length;i++){var _330=_324[i];clientP=document.createElement("p");if(_330.loginUrl){clientA=document.createElement("a");clientA.setAttribute("href",_330.loginUrl);clientA.innerHTML=_330.name;clientP.appendChild(clientA);}else{if(_330.website){clientA=document.createElement("a");clientA.setAttribute("href",_330.website);clientA.innerHTML=_330.name;clientP.appendChild(clientA);}else{clientA=document.createElement("span");clientA.innerHTML=_330.name;clientP.appendChild(clientA);}}clientP.appendChild(document.createElement("br"));var _331=_330.street+", "+_330.city;if(_330.region){_331+=", "+_330.region;}addrSpan=document.createElement("span");addrSpan.innerHTML=_331;clientP.appendChild(addrSpan);if((i>0)&&(i%_32d)==0){_32e++;}_32b[_32e].appendChild(clientP);_327=true;}if(_327){_326.appendChild(_328);}else{_326.innerHTML=login_wayf_liblist_noneavail;}YAHOO.util.grids.columnfix.fix($("wayf"));}function getRegions(_332){var _333=document.getElementById("sregion");var _334=document.getElementById("scity");_333.style.visibility="hidden";_334.style.visibility="hidden";if(_332=="xx"){m_svCountry="";return;}else{m_svCountry=_332;}var _335={success:function(o){if(o.responseText!==undefined){try{var _337=YAHOO.lang.JSON.parse(o.responseText);while(_333.hasChildNodes()){_333.removeChild(_333.firstChild);}var _338=document.createElement("option");_338.setAttribute("value","xx");if("us"==_332||"au"==_332||"mx"==_332){_338.innerHTML=login_wayf_bycity_opt_state;}else{if("ca"==_332){_338.innerHTML=login_wayf_bycity_opt_prov;}else{_338.innerHTML=login_wayf_bycity_opt_region;}}_333.appendChild(_338);for(var i=0;i<_337.length;i++){var _33a=_337[i];var _33b;var _33c;if(_33a.name){_33b=_33a.name;_33c=_33a.code;}else{_33b="All";_33c="";}_338=document.createElement("option");_338.setAttribute("value",_33c);_338.innerHTML=_33b;_333.appendChild(_338);}if(_337.length==1){getCities("");}else{_333.style.visibility="visible";}}catch(err){alert(err.description);}}},failure:function(o){},argument:{}};var _33e="country="+m_svCountry;YAHOO.util.Connect.asyncRequest("POST","/clientlocation.do",_335,_33e);}function getCities(_33f){var _340=document.getElementById("scity");_340.style.visibility="hidden";if(_33f=="xx"){m_svRegion="";return;}else{m_svRegion=_33f;}var _341={success:function(o){if(o.responseText!==undefined){try{var _343=YAHOO.lang.JSON.parse(o.responseText);while(_340.hasChildNodes()){_340.removeChild(_340.firstChild);}var _344=document.createElement("option");_344.setAttribute("value","xx");_344.innerHTML=login_wayf_bycity_opt_city;_340.appendChild(_344);for(var i=0;i<_343.length;i++){var city=_343[i];_344=document.createElement("option");_344.setAttribute("value",city.name);_344.innerHTML=city.name;_340.appendChild(_344);}_340.style.visibility="visible";}catch(err){alert(err.description);}}},failure:function(o){},argument:{}};var _348="country="+m_svCountry+"&region="+m_svRegion;YAHOO.util.Connect.asyncRequest("POST","/clientlocation.do",_341,_348);}function zipSearch(e,_34a){var _34b;if(e&&e.which){e=e;_34b=e.which;}else{e=event;_34b=e.keyCode;}if(_34b==13){getClients("",_34a);return false;}else{return true;}}function ipSearch(e,_34d){var _34e;if(e&&e.which){e=e;_34e=e.which;}else{e=event;_34e=e.keyCode;}if(_34e==13){getClients("","",_34d);return false;}else{return true;}}var wayfWhyOverlay;var wayfWhyTimer;function wayfWhyRollover(_34f){if(wayfWhyTimer){clearTimeout(wayfWhyTimer);}wayfWhyTimer=setTimeout("wayfWhyRolloverHelper('"+_34f+"')",timerDelay);}function wayfWhyMouseout(){clearTimeout(wayfWhyTimer);}function wayfWhyRolloverHelper(_350){wayfWhyOverlay=new YAHOO.widget.Panel("wayf_why_overlay",{context:[_350,"tl","tr"],visible:false,constraintoviewport:true,monitorresize:true,underlay:"shadow",close:true,draggable:true,width:"400px",overflow:"auto",autofillheight:"body"});wayfWhyOverlay.setHeader(login_wayf_whyask);wayfWhyOverlay.setBody(login_wayf_whyask_answer);wayfWhyOverlay.setFooter(" ");wayfWhyOverlay.render($("wayf_holder"));wayfWhyOverlay.show();}function showHelp(){if(!login_wayf_help_notavail){login_wayf_help_notavail="Unable to retrieve help at this moment; please try again later.";}var _351={success:function(o){if(o.responseText!==undefined){try{var _353=document.getElementById("wayf_help_cont");if(_353){while(_353.hasChildNodes()){_353.removeChild(_353.firstChild);}_353.innerHTML=o.responseText;_353.style.display="block";YAHOO.util.grids.columnfix.fix($("wayf_results"));}else{alert(login_wayf_help_notavail);}}catch(err){alert(login_wayf_help_notavail);}}},failure:function(o){var _355=document.getElementById("wayf_help_cont");if(_355){while(_355.hasChildNodes()){_355.removeChild(_355.firstChild);}_355.innerHTML=login_wayf_help_notavail;_355.style.display="block";}else{alert(login_wayf_help_notavail);}},argument:{}};YAHOO.util.Connect.asyncRequest("GET","/wayfhelp.do",_351);return false;}function setAutoComplete(){var _356="/clientsuggest.do";var _357=["cs","c","id"];var _358=new YAHOO.widget.DS_XHR(_356,_357);_358.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;_358.scriptQueryAppend="max=100";var _359=new YAHOO.widget.AutoComplete("cn_auto_complete_input","cn_auto_complete_suggestions",_358);_359.prehighlightClassName="yui-ac-prehighlight";_359.useShadow=true;_359.queryDelay=0.25;_359.maxResultsDisplayed=100;_359.formatResult=function(_35a,_35b,_35c){var _35d=_35a[0];if(_35d){return _35d.replace(new RegExp("("+_35b+")","i"),"<strong>$1</strong>");}else{return "";}};var _35e=function(_35f,_360){var _361=_360[2];var _362=_361[1];var _363={success:function(o){if(o.responseText!==undefined){var _365=YAHOO.lang.JSON.parse(o.responseText);if(_365.length==1){var _366=_365[0];if(_366.loginUrl){document.location.href=_366.loginUrl;}else{if(_366.website){document.location.href=_366.website;}else{if(_366.id){document.location.href="/logincard.do?clientid="+_366.id;}else{displayClients(_365);alert("No login location configured for client");}}}}else{displayClients(_365);}}},failure:function(o){},argument:{}};YAHOO.util.Connect.asyncRequest("GET","/clientlocation.do?id="+_362,_363,null);};_359.itemSelectEvent.subscribe(_35e);var _368=function(_369){};_359.unmatchedItemSelectEvent.subscribe(_368);}