var host="www.translatica.pl";
function translate(dir){
	ur = escape(document.location);
	h = location.hostname;
	//ur = "http://www.google.pl";
	loc = "http://"+host+"/tlumaczenie-portali/"+h+"/?urla="+ur+"&dir=" + dir;
	wnd = window.open(loc, "Translation_window", 'scrollbars, resizable', true);
}

function init(){
	init_x('pl','en');
	init_x('en','pl');
	init_x('pl','de');
	init_x('de','pl');
	init_x('ru','pl');
	init_x('pl','ru');
	
}
function init_x(l_in, l_out){
	a = document.getElementById("tra_"+l_in + l_out);
	//b = document.getElementById("traimg_"+l_in + l_out);
	
	
	if((a!=null)){
		b = a.firstChild;
		if((b!=null)&&(b.id == "traimg")){
			b.src = "http://" + host + "/images/portal/translate_"+l_in+"-"+l_out+".gif";
			a.href = "javascript:translate('" + l_in+l_out +"')";
			a.onmouseover=function(){
				x = document.getElementById("tra_"+l_in + l_out).firstChild;
				x.src = "http://" + host + "/images/portal/translate_"+l_in+"-"+l_out+"_over.gif";
			}
			a.onmouseout=function(){
				x = document.getElementById("tra_"+l_in + l_out).firstChild;
				x.src = "http://" + host + "/images/portal/translate_"+l_in+"-"+l_out+".gif";
			}
		}
	}

}

function hide2(l_in, l_out){
	a = document.getElementById("tra_"+l_in + l_out);
	if(a != null){
		a.style.display = "none";
	}
}

function hideTranslaticaButtons(){
	hide2('pl','en');
	hide2('en','pl');
	hide2('pl','de');
	hide2('de','pl');
	hide2('ru','pl');
	hide2('pl','ru');
}


