var m_svCountry="";var m_svRegion="";var m_svCity="";var m_svPostcode="";var citationCallback={success:function(o){var _2=document.getElementById("unauthorized_citation");if(_2&&o&&o.responseText!==undefined){try{var _3=YAHOO.lang.JSON.parse(o.responseText);_2.innerHTML=_3.citations[0].citation;}catch(err){_2.innerHTML="Unable to retrieve citation.";}}},failure:function(o){var _5=document.getElementById("unauthorized_citation");if(_5){_5.innerHTML="Unable to retrieve citation.";}},argument:{}};function getCitation(_6,_7){var _8=_6+"="+_7;YAHOO.util.Connect.asyncRequest("POST","/citation.do",citationCallback,_8);}function getSEFCitation(_9,_a){var _b="ta="+_9;if(_a){_b+="&uh="+_a;}YAHOO.util.Connect.asyncRequest("POST","/citation.do",citationCallback,_b);}function getClients(_c,_d,_e){m_svCity=_c;m_svPostcode=_d;if(!_d){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(_c=="xx"){alert(login_wayf_bycity_alert_city);return false;}}var _f={success:function(o){if(o.responseText!==undefined){try{var _11=YAHOO.lang.JSON.parse(o.responseText);displayClients(_11,_e);}catch(err){displayClients(null,null);}}},failure:function(o){displayClients(null,null);},argument:{}};var _13="";if(m_svPostcode&&m_svPostcode!=""){_13="postcode="+m_svPostcode;}else{if(_e&&_e!=""){_13="ip="+_e+"&max=9";}else{if(m_svCountry&&m_svCountry!=""&&m_svCountry!="xx"){_13="country="+m_svCountry;}if(m_svRegion&&m_svRegion!=""&&m_svRegion!="xx"){_13+="&region="+m_svRegion;}if(m_svCity&&m_svCity!=""&&m_svCity!="xx"){_13+="&city="+m_svCity;}}}YAHOO.util.Connect.asyncRequest("POST","/clientlocation.do",_f,_13);return false;}function displayClients(_14,_15){var _16=document.getElementById("geoResults");var _17=false;if(!_16){return;}while(_16.hasChildNodes()){_16.removeChild(_16.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(!_14){_16.innerHTML=login_wayf_liblist_notavail;return;}var _18=document.createElement("table");var _19=document.createElement("tbody");var tr=document.createElement("tr");var _1b=new Array();_1b[0]=document.createElement("td");_1b[1]=document.createElement("td");_1b[2]=document.createElement("td");tr.appendChild(_1b[0]);tr.appendChild(_1b[1]);tr.appendChild(_1b[2]);_19.appendChild(tr);var _1c=document.createElement("caption");_1c.innerHTML=login_wayf_liblist_searchtitle;_18.appendChild(_1c);_18.appendChild(_19);var _1d=parseInt(_14.length/3);if(_14.length%3>0){_1d++;}var _1e=0;for(var i=0;i<_14.length;i++){var _20=_14[i];clientP=document.createElement("p");if(_20.loginUrl){clientA=document.createElement("a");clientA.setAttribute("href",_20.loginUrl);clientA.innerHTML=_20.name;clientP.appendChild(clientA);}else{if(_20.website){clientA=document.createElement("a");clientA.setAttribute("href",_20.website);clientA.innerHTML=_20.name;clientP.appendChild(clientA);}else{clientA=document.createElement("span");clientA.innerHTML=_20.name;clientP.appendChild(clientA);}}clientP.appendChild(document.createElement("br"));var _21=_20.city;if(_20.region){_21+=", "+_20.region;}addrSpan=document.createElement("span");addrSpan.innerHTML=_21;clientP.appendChild(addrSpan);if((i>0)&&(i%_1d)==0){_1e++;}_1b[_1e].appendChild(clientP);_17=true;}if(_17){_16.appendChild(_18);}else{_16.innerHTML=login_wayf_liblist_noneavail;}YAHOO.util.grids.columnfix.fix($("wayf"));}function getRegions(_22){var _23=document.getElementById("sregion");var _24=document.getElementById("scity");_23.style.visibility="hidden";_24.style.visibility="hidden";if(_22=="xx"){m_svCountry="";return;}else{m_svCountry=_22;}var _25={success:function(o){if(o.responseText!==undefined){try{var _27=YAHOO.lang.JSON.parse(o.responseText);while(_23.hasChildNodes()){_23.removeChild(_23.firstChild);}var _28=document.createElement("option");_28.setAttribute("value","xx");if("us"==_22||"au"==_22||"mx"==_22){_28.innerHTML=login_wayf_bycity_opt_state;}else{if("ca"==_22){_28.innerHTML=login_wayf_bycity_opt_prov;}else{_28.innerHTML=login_wayf_bycity_opt_region;}}_23.appendChild(_28);for(var i=0;i<_27.length;i++){var _2a=_27[i];var _2b;var _2c;if(_2a.name){_2b=_2a.name;_2c=_2a.code;}else{_2b="All";_2c="";}_28=document.createElement("option");_28.setAttribute("value",_2c);_28.innerHTML=_2b;_23.appendChild(_28);}if(_27.length==1){getCities("");}else{_23.style.visibility="visible";}}catch(err){alert(err.description);}}},failure:function(o){},argument:{}};var _2e="country="+m_svCountry;YAHOO.util.Connect.asyncRequest("POST","/clientlocation.do",_25,_2e);}function getCities(_2f){var _30=document.getElementById("scity");_30.style.visibility="hidden";if(_2f=="xx"){m_svRegion="";return;}else{m_svRegion=_2f;}var _31={success:function(o){if(o.responseText!==undefined){try{var _33=YAHOO.lang.JSON.parse(o.responseText);while(_30.hasChildNodes()){_30.removeChild(_30.firstChild);}var _34=document.createElement("option");_34.setAttribute("value","xx");_34.innerHTML=login_wayf_bycity_opt_city;_30.appendChild(_34);for(var i=0;i<_33.length;i++){var _36=_33[i];_34=document.createElement("option");_34.setAttribute("value",_36.name);_34.innerHTML=_36.name;_30.appendChild(_34);}_30.style.visibility="visible";}catch(err){alert(err.description);}}},failure:function(o){},argument:{}};var _38="country="+m_svCountry+"&region="+m_svRegion;YAHOO.util.Connect.asyncRequest("POST","/clientlocation.do",_31,_38);}function zipSearch(e,_3a){var _3b;if(e&&e.which){e=e;_3b=e.which;}else{e=event;_3b=e.keyCode;}if(_3b==13){getClients("",_3a);return false;}else{return true;}}function ipSearch(e,_3d){var _3e;if(e&&e.which){e=e;_3e=e.which;}else{e=event;_3e=e.keyCode;}if(_3e==13){getClients("","",_3d);return false;}else{return true;}}var wayfWhyOverlay;var wayfWhyTimer;function wayfWhyRollover(_3f){if(wayfWhyTimer){clearTimeout(wayfWhyTimer);}wayfWhyTimer=setTimeout("wayfWhyRolloverHelper('"+_3f+"')",timerDelay);}function wayfWhyMouseout(){clearTimeout(wayfWhyTimer);}function wayfWhyRolloverHelper(_40){wayfWhyOverlay=new YAHOO.widget.Panel("wayf_why_overlay",{context:[_40,"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 _41={success:function(o){if(o.responseText!==undefined){try{var _43=document.getElementById("wayf_help_cont");if(_43){while(_43.hasChildNodes()){_43.removeChild(_43.firstChild);}_43.innerHTML=o.responseText;_43.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 _45=document.getElementById("wayf_help_cont");if(_45){while(_45.hasChildNodes()){_45.removeChild(_45.firstChild);}_45.innerHTML=login_wayf_help_notavail;_45.style.display="block";}else{alert(login_wayf_help_notavail);}},argument:{}};YAHOO.util.Connect.asyncRequest("GET","/wayfhelp.do",_41);return false;}function setAutoComplete(){var _46="/clientsuggest.do";var _47=["cs","c","id"];var _48=new YAHOO.widget.DS_XHR(_46,_47);_48.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;_48.scriptQueryAppend="max=100";var _49=new YAHOO.widget.AutoComplete("cn_auto_complete_input","cn_auto_complete_suggestions",_48);_49.prehighlightClassName="yui-ac-prehighlight";_49.useShadow=true;_49.queryDelay=0.25;_49.maxResultsDisplayed=100;_49.formatResult=function(_4a,_4b,_4c){var _4d=_4a[0];if(_4d){return _4d.replace(new RegExp("("+_4b+")","i"),"<strong>$1</strong>");}else{return "";}};var _4e=function(_4f,_50){var _51=_50[2];var _52=_51[1];var _53={success:function(o){if(o.responseText!==undefined){var _55=YAHOO.lang.JSON.parse(o.responseText);if(_55.length==1){var _56=_55[0];if(_56.loginUrl){document.location.href=_56.loginUrl;}else{if(_56.website){document.location.href=_56.website;}else{if(_56.id){document.location.href="/logincard.do?clientid="+_56.id;}else{displayClients(_55);alert("No login location configured for client");}}}}else{displayClients(_55);}}},failure:function(o){},argument:{}};YAHOO.util.Connect.asyncRequest("GET","/clientlocation.do?id="+_52,_53,null);};_49.itemSelectEvent.subscribe(_4e);var _58=function(_59){};_49.unmatchedItemSelectEvent.subscribe(_58);}
