var dv1;
var oft;

function popImage(file)
{
	window.open("/cms/openimage.php?id="+file, "obrazek", "toolbar=no , menubar=0, status=no, top=250, left=225" );
}

function get_akt(id,title){
	window.open('/cms/mod_news/aktualnosci_popup.php?path='+id, 'title'+id, 'height=540, width=660, status=no, toolbar=no, menubar=yes, location=no, scrollbars=yes');
}
function get_content(id,title){
	window.open('/cms/mod_content/content_popup.php?path='+id, 'title'+id, 'height=540, width=660, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes');
}
function swap(dv) {
	var d = document.getElementById(dv);
	if (dv=="libraries") {
		var b = document.getElementById('tdlibs');
		
	}
	

	
	if (d.style.display=="none") {
		d.style.display = "block";
		if (dv=="libraries") {		
			b.style.height="200";
		}	
		foldifr.location.href="_actions/setfold.php?code=" + dv + "&foldtype=show";
	} else {
		if (dv=="libraries") {	
			b.style.height="0";
		}	
		d.style.display = "none";
		foldifr.location.href="_actions/setfold.php?code=" + dv + "&foldtype=hide";
	}
}	

function show(dv) {
	var d = document.getElementById(dv);
		if (dv=="libraries") {
		var b = document.getElementById('tdlibs');		
	}	
	d.style.display = "block";
		if (dv=="libraries") {		
		b.style.height="200";
	}	
		
	
}
function hide(dv) {
	var d = document.getElementById(dv);
		if (dv=="libraries") {
		var b = document.getElementById('tdlibs');		
	}	
	d.style.display = "none";
		if (dv=="libraries") {		
		b.style.height="0";
	}		
}


function set(dv, val) {
	if (val=="1") {
		show(dv);
	} else {
		hide(dv);
	}
}

function ONWHelp(Url, nazwa, wys, szer) {
   window.open(Url, nazwa, "height=" + wys + ",width=" + szer + ",status=no,resizable=no,scrollbars=yes,menubar=no,location=no");
}

function HideSearch(){
	parent.document.getElementById('cms-wyszuk').style.display='none';
}
function HideStats(){
	parent.document.getElementById('cms-stats').style.display='none';
}

//funkcja do ustawiania praw dostepu
function swapbtns(id) {

	var vl = document.getElementById('cms-rights-value-'+id);

	
	if (vl.value==1) {
		newval = 3;
	} else if (vl.value==2) {
		newval = 2;
	} else if (vl.value==3) {
		newval=1;
	}
	
	var im = document.getElementById('cms-rights-image-'+id);
	
	im.src='/cms/pix/ico.rights.'+newval+'.gif';
	vl.value = newval;

}

function swapbtnswv(id,val) {

	var vl = document.getElementById('cms-rights-value-'+id);

	if (vl.value!=2) {
		newval = val;
		
	
	
	var im = document.getElementById('cms-rights-image-'+id);
	
	im.src='/cms/pix/ico.rights.'+newval+'.gif';
	vl.value = newval;
	}

}

function ONWGal(Url, nazwa, wys, szer) {
   window.open(Url, nazwa, "height=" + wys + ",width=" + szer + ",status=no,resizable=no,scrollbars=yes,menubar=no,location=no");
}
