var Domain='acronymfinder.com';
if (top!=window) top.location=window.location;
var word = '';
var IE = (navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf("Opera") == -1 ? 1 : 0);
function dw(t){document.write(t)}
function ById(id){return document.getElementById(id)}
var AdResults=0, OResults='', GResults='', IsG=true;
var AdsNum = 6, Ads = [], RAd, CurrentAd = 0, AdBlocks = [];
var g_client = google_ad_client = "ca-pub-6540158310198554"; google_kw_type = "broad"; google_ad_output = "js"; google_language = 'en'; google_encoding = "UTF-8"; google_feedback = 'on';
var google_afs_client = "pub-6540158310198554", afs_pageOptions = null;
var ad_channel='';
var OriginalURL=document.location;

var g_fburl='http:/'+'/services.google.com/feedback/online_hws_feedback';
function g_attr(){return '<a href="'+ (typeof(window["google_info"])!="undefined" && google_info?google_info.feedback_url:g_fburl) +'" target=_new>Ads by Google</a>';}
function google_radlink_request_done(radlinks) {if (radlinks.length) RAd=radlinks};
function google_ad_request_done(google_ads){
	google_ad_client = g_client; google_kw_type = "broad"; google_ad_output = "js"; google_encoding = "utf-8"; google_page_url = OriginalURL; google_ad_channel = ad_channel;
	if (!google_ads || google_ads.length == 0) {
		if (g_kw && Ads.length == 0) {
			google_ad_channel += "+7767591855"; g_kw = 0;
			dw('<script language="JavaScript1.1" src="http:/' + '/pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
		}
		return;
	}
	if (google_ads[0].type.substring(0,4)=='text' && Ads.length==0) {
		Ads=google_ads;
		IsG=true;
		GResults=google_ads.length;
	}
	else if (google_ads[0].type == 'image')
		ImgAd='<a href="'+google_ads[0].url+'"><img src="'+google_ads[0].image_url+'" height="'+google_ads[0].image_height+'" width="'+google_ads[0].image_width+'" border="0"></a>';
	else if (google_ads[0].type == "flash") 
		ImgAd='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+google_ad.image_width+'" HEIGHT="'+google_ad.image_height+'"><PARAM NAME="movie" VALUE="'+google_ad.image_url+'"><PARAM NAME="quality" VALUE="high"><PARAM NAME="AllowScriptAccess" VALUE="never"><EMBED src="'+google_ad.image_url+'" WIDTH="'+google_ad.image_width+'" HEIGHT="'+google_ad.image_height+'" TYPE="application/x-shockwave-flash" AllowScriptAccess="never" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
}
function ad(url,visible_url,line1,line2,line3){this.url=url;this.visible_url=visible_url;this.line1=line1;this.line2=line2;this.line3=line3;}
function write_ad(ad) {
	var t1 = ad.line1, t2 = ad.line2;
	if (ad.line3) t2 += ' ' + ad.line3;
	if (IsG) { t1 = highlight(t1); t2 = highlight(t2) };
	var link = '<a href="' + ad.url + '" onMouseOver="return m_over(\'' + (IsG ? 'go to ' : 'http://') + ad.visible_url + '\')" onMouseOut="m_out()">'
	return link + '<span class=OvTitle>' + t1 + '</span></a><br><span class=OvDescr>' + t2 + '</span><br>' + link + '<span class=OvURL>' + ad.visible_url + '</span></a>';
}
function write_ads(AdsNum, Br) {
	if (afs_pageOptions) {
		dw('<div id="afs_adcontainer' + AdBlocks.length + '"></div>');
		if (Br) dwhile('<br clear=all>');
		AdBlocks.push({ 'container': 'afs_adcontainer' + AdBlocks.length, 'lines': 3, 'width': 500, 'number': AdsNum, 'fontSizeDomainLink': 11, 'colorDomainLink':'#0448d2','colorTitleLink':'#0448d2' });
	}
	else dw(populate_ads(AdsNum, Br));
}
function populate_ads(AdsNum, Br) {
	var res = '';
	if (Ads.length && Ads.length > CurrentAd) {
		res = '<div class=Ov><div class=OvBorder><span class=by>' + g_attr() + '</span>';
		for (i = 0; CurrentAd < Ads.length && i < AdsNum; i++) {
			if (i) res += '<div class=AdSep></div>';
			res += write_ad(Ads[CurrentAd]);
			CurrentAd += 1;
		}
		res += '</div></div>';
		if (Br) res += '<br>';
	}
	return res;
}
function myerror(){window.onerror=null;return true;}
function highlight(t) {
	var k = word;
	if (k) k = k.replace(/[(),.:;"]/g, '');
	if (k && t > '') {
		var q = k.split(' ');
		for (var i = 0;i<q.length;i++)
			if (q[i].length>2) {
				var rexp = new RegExp(q[i],'ig');
				t = t.replace(rexp, '<b>'+q[i]+'</b>');
			}
}
return t;
}
var rad_start = 0;
function WriteRAd1(num) {
	if (!num) num = 20;
	if (RAd && RAd.length > rad_start) {
	var cnt = Math.min(num + rad_start, RAd.length)
	dw('<table cellpadding=0 cellspacing=0 width="100%" id=relatedAds><caption>Related Ads</caption><tr><td width=100% valign=top>');
	for (i = rad_start; i < cnt; ++i) {
		//if (i>0 && i==Math.ceil(cnt/2)) dw('</td><td width=50% valign=top>');
		dw('&#x25AA; <a href="/~/search/related.aspx?w='+encodeURIComponent(word)+'&q='+RAd[i].url_escaped_term+'&c='+encodeURIComponent(ad_channel)+'&rt='+RAd[i].radlink_token+'&google_page_url='+encodeURIComponent(window.location)+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'\';return true;">'+highlight(RAd[i].term)+'</a><br>');
	}
	rad_start = i;
	dw('</td></tr></table>');
}}
function m_over(url){window.status=url;return true;}
function m_out(){window.status = '';}

function validate_required(field,alerttxt){
	with (field){
		if (value==null||value=="")
		  {alert(alerttxt);return false;}
		else return true;
	}
}
function validate_form(thisform){
	with (thisform)
	{
	if (validate_required(Acronym,"Please enter something to search for")==false)
	 {Acronym.style.backgroundColor = "#FFFF99";Acronym.focus();return false;}
	}
}
function toggleLayer(l)	{
	var style2 = document.getElementById(l).style;
	style2.display = style2.display? "":"none"
}
function getCookie(name){
	var dc=document.cookie;
	var prefix=name+'=';
	var s = dc.indexOf('; ' + prefix);
	if (s==-1){
		s=dc.indexOf(prefix);
		if (s != 0) return null;
	}
	else
		 s+=2;
	var e=dc.indexOf(';', s);
	if (e==-1)
		 e=dc.length;
	return unescape(dc.substring(s+prefix.length, e));
}
function setCookie(name, value){
	document.cookie=name+'='+escape(value)+
	(name=='t2'?'; expires=Thu, 1 Jan 2015 05:00:00 UTC':'')+'; path=/; domain='+Domain;
}
function AsyncRequest(url){
	var scr=document.createElement('script');
	scr.type='text/javascript';
	scr.defer=true;
	scr.src=url;
	document.getElementsByTagName('head').item(0).appendChild(scr);
}
function goog_search(q) {
	dw('<a href="/~/search/google.aspx?q=' + q + '&f=a&cx=partner-pub-6540158310198554:ol1an1ktc1p&cof=FORID:10&ie=UTF-8"><img src="/~/st/i/find2.gif" width=21 height=21 border=0></a>')
}
function track() {
	if (!getCookie('track')) AsyncRequest('http://www.acronymfinder.com/~/access/track.ashx?ref=' + encodeURIComponent(document.referrer) + '&loc=' + encodeURIComponent(document.location) + '&r=' + Math.random());
	if (AdBlocks.length) {
		new google.ads.search.Ads(afs_pageOptions, AdBlocks[0]);
		ById(AdBlocks[0].container).firstChild.onload = delayedads;
	}
	AsyncRequest('http://apis.google.com/js/plusone.js');
}
function delayedads() {setTimeout('delayedads2()', 20)}
function delayedads2() {
	var ad_block=ById(AdBlocks[0].container);
	if (ad_block.scrollHeight == 0 && Ads.length > 0) {
		ad_block.style.height = 'auto';		
		ad_block.innerHTML = populate_ads(AdBlocks[0].number);
	}	
}
function LikeHP() { dw('<iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href=http:' + encodeURIComponent('//www.acronymfinder.com') + '&layout=standard&show_faces=true&width=180&amp;action=like&colorscheme=light&amp;height=70" scrolling="no" frameborder="0" style="border:none;overflow:auto;width:180px;height:70px;position:absolute" allowTransparency="true"></iframe>') }

var iSavedCaretIndex = 0;
var searchTextfieldID = "f1Word";
function restoreCaret() {
	var tf = ById(searchTextfieldID);
	if (!tf.selectionStart)
		setCaretPos(tf, ++iSavedCaretIndex, false);
};
function saveCaret(oField) {
	if (IE && !oField.selectionStart) {
		var Sel = document.selection.createRange();
		Sel.moveStart('character', -oField.value.length);
		iSavedCaretIndex = Sel.text.length;
	}
}

function SAYTBind(fn, self, var_args) {
	var ba = fn.boundArgs_ || [];
	ba = ba.concat(Array.prototype.slice.call(arguments, 2));
	if (typeof fn.boundSelf_ != "undefined") self = fn.boundSelf_;
	if (typeof fn.foundFn_ != "undefined") fn = fn.boundFn_;
	var nf = function() {
		var args = ba.concat(Array.prototype.slice.call(arguments));
		return fn.apply(self, args);
	}
	nf.boundArgs_ = ba;
	nf.boundSelf_ = self;
	nf.boundFn_ = fn;
	return nf;
}
function SearchAhead() {
	this.disabled = false;
	this.Tab = 1;
	this.HoverColor = '#E4EAED';
	this.NormalBg = 'white';
	this.QueryURL = '/~/search/suggest.ashx?jsonp=SAYT.Callback&query=';
	this.LinkURL;
	this.MIN_STRING = 2;

	this.LastTF = null;
	this.SugDiv = null;
	this.SelIndex = -1;
	this.TimeID;
	this.Keys = new Array();
	this.Values = new Array();
	this.Count = new Array();
	this.rsp = null;
}
SearchAhead.prototype = {
	"Disable": function() {
		setCookie('sayt', 1);
		this.disabled = true;
		this.JustHide();		
	},

	"OnBlur": function(event) {
		if (this.disabled) return;
		if (this.LastTF && this.LastTF.savedText != null) setTimeout('SAYT.LastTF.value = SAYT.LastTF.savedText', 800);
		this.JustHide();
	},

	"Morph": function() {
		if (this.SugDiv != null) {
			this.SugDiv.style.width = (this.LastTF.offsetWidth - (IE ? 1 : 7)) + "px";
			this.SugDiv.style.left = (this.GetLoc(this.LastTF, true)) + "px";
			this.SugDiv.style.top = (this.GetLoc(this.LastTF, false) + this.LastTF.offsetHeight) + "px";
		}
	},

	"Suggest": function(obj, event) {
		if (getCookie('sayt')) this.disabled = true;
		if (this.disabled) return;
		this.LinkURL = '/~/search/af.aspx?string=exact&Acronym=';
		if (event.keyCode == 13) {
			var str = this.LinkURL + encodeURIComponent(this.LastTF.value);
			window.location.href = str;
			return;
		}

		if (this.LastTF && this.LastTF.found) clearTimeout(this.TimeID);

		this.LastTF = obj;
		this.LastTF.onblur = SAYTBind(this.OnBlur, this);
		this.Morph();

		if (event.keyCode == 27) {//esc
			if (this.LastTF != null) {
				this.LastTF.value = this.LastTF.savedText;
				var elem = document.getElementById("SAYTk" + this.SelIndex);
				if (elem != null) {
					elem.style.backgroundColor = this.NormalBg;
				}
			}
			this.Popup(null, false);
			return;
		}

		var sValue = obj.value;
		if (sValue.length < this.MIN_STRING) {
			this.Popup(null, false);
			return;
		}

		if (this.SugDiv == null) {
			this.SugDiv = document.createElement("DIV");
			this.SugDiv.className = "sayt"
			document.body.appendChild(this.SugDiv);
			this.SugDiv.onmouseover = SAYTBind(this.Keep, this);
			this.SugDiv.onmouseout = SAYTBind(this.Hide, this);
		}

		var keyUp = event.keyCode == 38;
		var keyDown = event.keyCode == 40;

		if ((keyUp || keyDown)) this.KeyUp(keyUp);
		else {

			var sKey = this.LastTF.value;
			this.LastTF.savedText = sKey;

			for (var i = this.Keys.length - 1; i >= 0; i--) {
				if (sKey == this.Keys[i]) {
					this.SugDiv.innerHTML = this.Values[i];
					this.LastTF.elCount = this.Count[i];
					this.LastTF.found = true;

					if (event.type != "click") this.Popup(sKey, true);
					return;
				}
			}
			AsyncRequest(this.QueryURL + encodeURIComponent(obj.value));
		}
	},

	"Keep": function(evt) {
		if (!evt) evt = window.event;
		if (this.IsInside(evt)) clearTimeout(this.TimeID);
	},

	"Hide": function(evt) {
		if (!evt) evt = window.event;
		if (this.IsInside(evt)) return;

		this.TimeID = setTimeout(SAYTBind(this.JustHide, this), 2000);
	},

	"IsInside": function(evt) {
		var x = evt.clientX;
		var y = evt.clientY;

		var dx = this.GetLoc(this.SugDiv, true);
		var dy = this.GetLoc(this.SugDiv, false);

		var cornerX = dx + this.SugDiv.offsetWidth;
		var cornerY = dy + this.SugDiv.offsetHeight;

		if (x > dx && x < cornerX && y > dy && y < cornerY) return true;
		return false;
	},

	"JustHide": function() {
		if (this.SugDiv != null) {
			var elem = document.getElementById("SAYTk" + this.SelIndex);
			if (elem != null) elem.style.backgroundColor = this.NormalBg;
			this.SelIndex = -1;
			this.SugDiv.style.visibility = "hidden";
		}
	},


	"GetLoc": function(elem, left) {
		var ret = 0;
		while (elem != null) {
			ret += (left ? elem.offsetLeft : elem.offsetTop);
			elem = elem.offsetParent;
		}
		return ret;
	},

	"KeyUp": function(keyUp) {
		if (this.LastTF.found) this.SugDiv.style.visibility = "visible";
		else return;

		var savedIndex = this.SelIndex;

		if (keyUp) {
			if (this.SelIndex > 0) this.SelIndex--;
			else this.Popup(null, false);
		} else {
			if (this.SelIndex == -1) this.SelIndex = 0;
			else if (this.SelIndex < this.LastTF.elCount - 1) this.SelIndex++;
		}

		if (savedIndex == this.SelIndex) return;

		this.UnSelectAll();
		document.getElementById("SAYTk" + this.SelIndex).style.backgroundColor = this.HoverColor;
		this.LastTF.value = this.LastTF.rsp[1][this.SelIndex][0];
	},

	"UnSelectAll": function() {
		for (var i = 0; i < this.LastTF.elCount; i++)
			document.getElementById("SAYTk" + i).style.backgroundColor = this.NormalBg;
	},

	"Mouse": function(obj, isOver, idx) {
		this.UnSelectAll();
		if (isOver) {
			obj.style.backgroundColor = this.HoverColor;
			this.SelIndex = idx;
		}
	},

	"Submit": function(idx) {
		if (SAYT.LastTF.onblur) {
			this.LastTF.onblur = null;
			location = this.LinkURL + encodeURIComponent(this.LastTF.rsp[1][idx][0]) + '&tab=' + this.Tab;
		}
	},

	"Callback": function(rsp) {
		var txt = ''
		var iCount = 0;
		var u = this.LinkURL;
		function link(tab, idx) { return '<a href="/' + u + encodeURIComponent(rsp[1][idx][0])+ '">'; }
		for (var idx in rsp[1]) {
			txt += '<div style="clear:both;height:' + (IE ? 11 : 14) + 'px;cursor:pointer;cursor:hand" onmousedown="SAYT.Submit(' + idx + ')" onmouseover="SAYT.Mouse(this,true,' + idx + ')" onmouseout="SAYT.Mouse(this,false)" id="SAYTk' + idx + '">';
			txt += '<a onmousedown="SAYT.LastTF.onblur=null" style="float:left" href="' + u + encodeURIComponent(rsp[1][idx][0]) + '">';
			txt += rsp[1][idx][0] + '</a>';
			txt += '</div>';
			iCount++;
		}
		txt += '<a style="float:right;font-size:8pt;text-decoration:underline" href="javascript:void()" onmousedown="SAYT.Disable()">Disable suggestions</a>'
		this.SugDiv.innerHTML = txt;
		this.LastTF.elCount = iCount;
		this.LastTF.rsp = rsp;
		this.LastTF.found = iCount > 0;

		if (rsp[1].length > 0) {
			var found = false;

			for (var ix = this.Keys.length - 1; ix >= 0; ix--) {
				if (rsp[0] == this.Keys[ix]) {
					found = true;
					break;
				}
			}

			if (!found) {
				this.Keys.push(rsp[0]);
				this.Values.push(txt);
				this.Count.push(iCount);
			}

			this.Popup(rsp[0], true);

		} else this.Popup(null, false);
	},

	"Popup": function(key, showElem) {

		if (!showElem || (key != this.LastTF.value)) {
			this.JustHide();
			return;
		}

		this.Morph();
		this.SugDiv.style.visibility = "visible";
	}
};
var SAYT = new SearchAhead;

var alpha = new Array();
function SelLetter(letter) {
    if (letter == ' ') letter = 'first';
    for (var i = 0; i < alpha.length; i++) {
        var ptrs = document.getElementById('p_' + alpha[i]);
        if (ptrs != null) ptrs.style.display = (letter == alpha[i]) ? 'block' : 'none';
        var anch = document.getElementById('a_' + alpha[i]);
        if (anch != null) { 
            anch.className = (letter == alpha[i]) ? 'a_named' : 'alphabet';
        }
    }
}

