function sAS(a, section) {
	var hndl = document.getElementById("q");
	if (hndl != null && hndl.value.length > 0 ) {
		a.href=section+"?q="+hndl.value;
		}
}

function searchEncyclopedy(a) {
	var hndl = document.getElementById("q");
	if (hndl != null && hndl.value.length > 0) {
		a.href="index?show=enc&encQuery="+hndl.value;
		a.target="_blank";
	} else {
		a.href="index?show=enc";
		a.target="_self";
	}
}

function initthis() {
	
	
	if (navigator.userAgent.indexOf('Firefox')!=-1)
		{ 
		// do nothing 
		} else if (navigator.userAgent.indexOf('Opera')!=-1)	{ 
		//do nothing 
		} else if (navigator.userAgent.indexOf('MSIE')!=-1)	{
		var sethomepage = "|&nbsp;&nbsp;&nbsp;<a href=\"#\" onClick=\"this.style.behavior=\'url(#default#homepage)\'; this.setHomePage(\'http://www.siemka.pl\')\">Ustaw jako startową</a>"; 
		} else 
		
		{ 
		//do nothing 
		}
	
	//dodawanie do ulubionych //
	if (document.getElementById('adv')) {
		var adv = document.getElementById('adv');
		var fav = adv.getElementsByTagName('a')[1];
		var fav_c = "if (document.all) window.external.AddFavorite(\'http://www.siemka.pl\', \'siemka.pl\'); else if (window.sidebar) window.sidebar.addPanel(\'siemka.pl\', \'http://www.siemka.pl\', \'\')";
		fav.setAttribute("onClick", fav_c);
	
	}
	
	
	if (document.getElementById('wp')) {
	document.getElementById('wp').target = "_blank"; //otwieranie linku w nowym oknie
	}
	
	document.getElementById('q').focus(); // focus na pole wpisywania hasła
	var hndl = document.getElementById("q"); //pobieranie zapytania
	
}
window.onload = initthis;
