﻿//overwrite function in dict.js
function opennewdictwin(text){
	text=text.replace(/[́!.:?,;"]/, '');
	while (text.substr(text.length-1,1)==' ') text=text.substr(0,text.length-1)
	while (text.substr(0,1)==' ') text=text.substr(1)
	if (text > '')
		ById('f1Word').value=text;
}

function tfdtab2lang(t){
	switch (t) {case '-2': return 'es';case '-3': return 'fr';case '-4': return 'de';case '-5': return 'it';case '-6': return 'el';case '-7': return 'no';case '-8': return 'nl';case '-9': return 'ru';case '-10': return 'pt';}
	return 'en';
}
function tfdselect_change(o) {
	var tb=o.options[o.selectedIndex].value;
	PageLang=tfdtab2lang(tb);
	setCookie('lang',tb);		
}
var tfdselect_cookie = getCookie('lang');	
if (tfdselect_cookie) {
	var o=ById('tfdselect')
	for (var i=0;i<o.options.length;i++)
		if (o.options[i].value==tfdselect_cookie){o.selectedIndex=i;PageLang=tfdtab2lang(tfdselect_cookie);break};
}
function add2g(t,tl,g){if (!g) g='google.com';dw('<div style="float:right"><a title="'+tl+'" target=_blank rel=nofollow href="http://www.'+g+'/ig/add?moduleurl=http%3A//www.thefreedictionary.com/_/WoD/'+t+'-module.xml"><span class="img A feed_icon"></span></a></div>')}
function add2all(t){
dw('<div style="float:right"><a title="Add to Google" target=_blank rel=nofollow href="http://www.google.com/ig/add?moduleurl=http%3A//www.thefreedictionary.com/_/WoD/'+t+'-module.xml"><span class="img A feed_icon"></span></a>');
dw('<a target=_blank rel=nofollow href="http://e.my.yahoo.com/config/cstore?.opt=content&.url=http%3A//www.thefreedictionary.com/_/WoD/rss.aspx'+(t=='wod'?'':'?type='+t)+'&.page=p1" title="Add to My Yahoo!"><span class="img A feed_icon" style="width:11px;background-position:-57px -18px;"></span></a>');
dw('<a target=_blank rel=nofollow href="http://www.thefreedictionary.com/_/WoD/rss.aspx'+(t=='wod'?'':'?type='+t)+'" title="RSS feed source"><span class="img A feed_icon" style="width:11px;background-position:-68px -18px;"></span></a>');
dw('</div>')}