

var initialtab=[1, '@PAGE_ACTIVE']
var turntosingle=0 //0 for no (default), 1 for yes
var disabletablinks=0 //0 for no (default), 1 for yes

var previoustab=""
if (turntosingle==1)
document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')

var hilight;
function change(id, newClass, oldClass) {
	identity=document.getElementById(id);
	
	if (hilight) {
		oldidentity=document.getElementById(hilight);
		oldidentity.className=oldClass;
	}
	
	identity.className=newClass;
	hilight = id;
}

function expandcontent(cid, class1, class2) {
	change('tab_'+cid, class1, class2)

	// if (disabletablinks==1)
	// aobject.onclick=new Function("return false")
	if (document.getElementById) {
		// highlighttab(aobject)
		if (turntosingle==0){
			if (previoustab!="")
				document.getElementById(previoustab).style.display="none"
			document.getElementById(cid).style.display="block"
			previoustab=cid
		}
	}
}

function collecttablinks(){
	var tabobj=document.getElementById("tablist")
	tabobjlinks=tabobj.getElementsByTagName("A")
}


function popup(url, width,height) { 
	window.open(url, '', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto, resizable=yes,copyhistory=no,width="+width+",height="+height); return false;
}

function popup2(url, width,height) { 
	window.open(url, '', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes, resizable=yes,copyhistory=no,width="+width+",height="+height); return false;
}

function pot(pytanie, url) {
	if ( confirm(pytanie))
   		window.location.href=url;
	else
		return false;
}


function zaokr(liczba) {
	liczba = liczba * 100;
	var wynik = Math.round(liczba)/100;
	return wynik;
}

function str_repeat(i, m) {
for (var o = ''; m-- > 0; o += i);
return o;
}

function sprintf () {
var a, f = arguments[0], fi= '', i = 1, m = [''], o = '', p;
while (f = f.substring (m[0].length)) {
m = /^([^\%]*)(?:(\x25)((\x25)|(?:(\d+)\$)?(\+)?(0|'([^$]))?(-|\^)?(\d+)?(?:\.(\d+))?([bcdefosuxX])))?/.exec(f);
if (a = m[12]) {
if (arguments.length < (i = m[5] || i))
throw("sprintf '" + m[0] + "' : No argument " + i);
a = arguments[i++];
s = (/[def]/.test(m[12]) && m[6] && a > 0) ? '+':'';
switch (m[12]) {
case 'b': a = a.toString(2); break;
case 'c': a = String.fromCharCode(a); break;
case 'd': a = parseInt(a); break;
case 'e': a = m[11] ? a.toExponential(m[11]) : a.toExponential(); break;
case 'f': a = m[11] ? parseFloat(a).toFixed(m[11]) : parseFloat(a); break;
case 'o': a = a.toString(8); break;
case 's': a = ((a = String(a)) && m[11] ? a.substring(0, m[11]) : a); break;
case 'u': a = Math.abs(a); break;
case 'x': a = a.toString(16); break;
case 'X': a = a.toString(16).toUpperCase(); break;
}
if (m[10] && (m[10] > a.length)) {
fir=fil=str_repeat(m[7] ? m[8] || '0' : ' ', m[10]-a.length);
if (m[9] == '^') {
fil = fil.substr(0, fil.length / 2);
fir = fir.substr(fil.length);
} else
m[9] == '-' ? (fil = '') : (fir = '');
a = fil + a + fir;
}
}
o += m[1] + ((m[3] ? m[4] || (s + a) : m[2]) || '');
}
return o;
}
