function URLencode(sStr)
{return escape(sStr).replace(/\+/g,'%2C').replace(/\"/g,'%22').replace(/\'/g,'%27').replace(/\//g,'%2F').replace(/\./g,'%2E');}
function goLtr(ltr)
{if(ltr=='*')
{location.href="http://www.abbreviations.com/justadded.aspx";return;}
if(ltr=='$')
{location.href="http://www.abbreviations.com/random.aspx";return;}
var goLtrURL="http://www.abbreviations.com/abbreviations/"+ltr+"/1";location.href=goLtrURL;}
function doSearch(newwindow)
{if(document.mainform.SE.value==1||document.mainform.SE.value==-1)
{var searchURL="http://www.abbreviations.com/"+URLencode(document.mainform.SEARCHEB.value).toUpperCase();}
if(document.mainform.SE.value==2||document.mainform.SE.value==3)
{var searchURL="http://www.abbreviations.com/bs.aspx?st="+URLencode(document.mainform.SEARCHEB.value)+"&SE="+document.mainform.SE.value;}
else if(document.mainform.SE.value==4)
{var searchURL="http://www.abbreviations.com/bs2.aspx?st="+URLencode(document.mainform.SEARCHEB.value)+"&SE="+document.mainform.SE.value;}
else if(document.mainform.SE.value==5)
{var searchURL="http://www.abbreviations.com/searchAmazon.aspx?st="+URLencode(document.mainform.SEARCHEB.value)+"&SE="+document.mainform.SE.value;}
else if(document.mainform.SE.value==6)
{var searchURL="http://www.abbreviations.com/searchgoogle.aspx?st="+URLencode(document.mainform.SEARCHEB.value)+"&SE="+document.mainform.SE.value;}
else if(document.mainform.SE.value==7)
{var searchURL="http://www.netlingo.com/searchaction.cfm?wordsearch="+URLencode(document.mainform.SEARCHEB.value);window.open(searchURL);return false;}
if(newwindow)
window.open(searchURL);else
location.href=searchURL;return false;}
function getXmlHttpRequestObject()
{var http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!http_request){alert('Giving up :( Cannot create an XMLHTTP instance');return false;}
return http_request;}
var searchReq=getXmlHttpRequestObject();var selidx=0;function searchSuggest(field,evt)
{var keyCode=document.layers?evt.which:document.all?event.keyCode:document.getElementById?evt.keyCode:0;if(keyCode==40)
{var itm=document.getElementById('row'+selidx);if(itm)
{itm.className='suggest_link_over';document.getElementById('SEARCHEB').value=itm.getAttribute("value");if(selidx>0)
{var perv=selidx-1;var itm=document.getElementById('row'+perv);itm.className='suggest_link';}
selidx++;}
return;}
else if(keyCode==38)
{if(selidx<2)
return;selidx--;var prev=selidx-1;var itm=document.getElementById('row'+prev);document.getElementById('SEARCHEB').value=itm.getAttribute("value");if(itm)
{itm.className='suggest_link_over';var itm=document.getElementById('row'+selidx);itm.className='suggest_link';}
return;}
selidx=0;if((searchReq.readyState==4||searchReq.readyState==0)&&document.mainform.SE.value=='1')
{var str=escape(document.getElementById('SEARCHEB').value);searchReq.open("GET",'http://www.abbreviations.com/getsugg.aspx?ltrs='+str,true);searchReq.onreadystatechange=handleSearchSuggest;searchReq.send(null);}}
function GetAttribute(node,attr)
{return node.getAttribute(attr);}
function GetInnerText(node)
{return(node.textContent||node.innerText||node.text||getNodeText(node));}
function getNodeText(node)
{if(node.nodeType==3||node.nodeType==4)
return node.data;for(var i=0;i<node.childNodes.length;i++){var text=getNodeText(node.childNodes[i]);if(text)
return text;}
return null;}
function doSuggSearch(query)
{var searchURL="http://www.abbreviations.com/"+URLencode(query);if(newwindow)
window.open(searchURL);else
location.href=searchURL;return false;}
function handleSearchSuggest()
{if(searchReq.readyState==4)
{var ss=document.getElementById('search_suggest')
ss.innerHTML='';var xmldoc=searchReq.responseXML;var suggestionsNode=xmldoc.getElementsByTagName('suggestions').item(0);var suggNodes=suggestionsNode.getElementsByTagName('sugg');if(suggNodes.length==0)
{ss.style.visibility="hidden";return;}
var idValue;var textValue;var suggest="";suggest+="<table bgcolor=\"EEEEEE\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:180px;\">";suggest+="<tr>";suggest+='<td height="25" valign="middle" class="suggest_link_over" style="font-family:arial;color:#000055" size="100%" align="left" colspan="2">';suggest+="<b>&nbsp;&nbsp;Select a suggestion...</b>";suggest+="</td>";suggest+="</tr>";for(var i=0;i<suggNodes.length;i++)
{textValue=GetInnerText(suggNodes[i]);idValue=GetAttribute(suggNodes[i],'count');suggest+='<tr value="'+textValue.replace('\'','\\\'')+'" id="row'+i+'"  class="suggest_link" cellpadding="0" cellspacing="0" onmouseover="suggestOver(this);" onmouseout="suggestOut(this);" onclick="doSuggSearch(\''+textValue.replace('\'','\\\'')+'\');"> ';suggest+='<td><b>';suggest+=textValue;suggest+='</b></td>';suggest+='<td align="right" style="font-size:10;" >';if(idValue!='1')
suggest+=''+idValue+' definitions';else
suggest+=''+idValue+' definition';suggest+='</td>';suggest+='</tr>';}
suggest+='<tr size="100%">';suggest+='<td height="25" valign="middle" class="suggest_link_over" style="font-family:arial;" size="100%" align="right" colspan="2">';suggest+='<b><a href="preferences.asp">disable suggestions</a></b>';suggest+='</td>';suggest+="</tr>";suggest+="</table>";ss.innerHTML=suggest;ss.style.visibility="";}}
function suggestOver(div_value)
{div_value.className='suggest_link_over';}
function suggestOut(div_value)
{div_value.className='suggest_link';}
function hideDiv(divName){return;tempDiv=document.getElementById(divName);if(!tempDiv){return;}
if(tempDiv.style.display=="block"){tempDiv.style.display="none";}}
function showDiv(divName){return;tempDiv=document.getElementById(divName);if(!tempDiv){return;}
if(tempDiv.style.display=="none"){tempDiv.style.display="block";}}
function hideDiv2(divName)
{tempDiv=document.getElementById(divName);if(!tempDiv){return;}
tempDiv.style.display='none';}
function showDiv2(divName)
{var tempDiv=document.getElementById(divName);if(!tempDiv){return;}
tempDiv.style.display='inline';}
function addBookmark(title,url){if(window.sidebar){window.sidebar.addPanel(title,url,"");}else if(document.all){window.external.AddFavorite(url,title);}else if(window.opera&&window.print){return true;}}
function addFavs()
{var text="Add us to your"
var ieText=" Favorites!"
var otherText=" Bookmarks!"
var ver=navigator.appName
var agt=navigator.userAgent.toLowerCase()
var is_mac=(agt.indexOf("mac")!=-1)
var is_ns=(agt.indexOf("netscape")!=-1)
var num=parseInt(navigator.appVersion);if(((ver=="Microsoft Internet Explorer")&&(num>=4))||(window.sidebar&&(!is_ns))){var message="";if(document.all){message=text+ieText;}else{message=text+otherText;}
document.write('<img width=16 height=16 src="images/favo.png">&nbsp;<span style="vertical-align: top;"><b>&laquo;<a style="color:#666666;" href="javascript:addBookmark(\'Abbreviations.com\', \'http://www.abbreviations.com\');"> ');document.write(message+'</a>&raquo;</b>&nbsp;</span>');}else if(is_mac){text+=otherText+" (Cmd+D)";document.write(text);}
else{text+=otherText+" (Ctrl+D)";document.write(text);}}