/* google Analytics code */
var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-22297402-1']);
    _gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

/* google Analytics code */

function openRepoLink(cform, curl, ilang, cq) {
 if (cform) {
    cqv=cform.SearchText.value;
    //alert(cform.SearchText.name +"="+ cqv);
    if (!cqv) {if (cq) {cqv=cq;}}
    if (!cqv) {
	if (cform.PhraseSearchText) {
	    cqv=cform.PhraseSearchText.value;
	    if (cqv) {
		cqv='"' + cqv + '"';
	    }
	}
    }
    if (cqv) {
	crr=cform.RepoRange;
	crepo=crr.options[crr.selectedIndex].value;
	//alert(crepo);
	if (!crepo) {crepo="publication";}
	clang="pl";
    	if (ilang==2) {clang="en";}
	if (!clang) {clang="pl";}
	//alert(curl+"<");
	if (!curl) {
	    curl="http://www.elka.pw.edu.pl/";
	}
	clen=curl.length-1;
	if (curl.substr(curl.length-1,1) != '/'){
	    curl=curl+"/";
	}
	chref=curl + "RepoPW/resultList.seam?lang=" + clang + "&r=" + crepo + "&q=" + cqv;
	reswin=cform.ResultWindow.checked;
	//alert(chref);
	if (reswin) {
	    wnam="Repo";
	    conf="";
	    wnam=window.open(chref,wnam,conf);
	    wnam.focus();
	} else {
	    location.href=chref;
	}
    } else {
	alert('Empty query !')
    }
 }
}

