var dv1;
var oft;


function openCard2(link) {

	newwindow = window.open('/cms/mod_knowbase/site.mod/torun.lodzka.galeria.php?text='+link,'','height=600, width=700, status=no, toolbar=no, menubar=yes, location=no, scrollbars=yes');

}

function openCard(lnk,tg) {
	
var q = location.search;
var s = q.split("&");

for(i=0;i<s.length;i++) {

	var c = s[i].split('=');
	if(c[0]=='path_karty' && c[1]=='1') {
		window.open(lnk,tg);
		
	} else void(0);
}
}


function highlight() {
	var e = document.getElementById(this);
	
		e.style.backgroundColor="black";
}

function showl(n) {
	var e = document.getElementById("submenu"+n);
	if (e.style.display=="none") {
		e.style.display = "block";
	} else {
		e.style.display="none";
	}
}

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");
}

function ONWwh(url,w,h) {
 window.open(url,'_blank','width='+w+',height='+h+',scrollbars=no,menubar=yes,status=no,resizable=no,location=no');
}


function redirectOutput(myForm) {
var w = window.open('about:blank','Popup_Window','width=475, height=350,scrollbars=no,menubar=yes,status=no,resizable=no,location=no');
myForm.target = 'Popup_Window';
return true;
}

function openSubGallery(name,number) {
	window.open("/cms/_actions/showSubGallery.php?name="+name+"&number="+number+"", "Galeria", "width=910");
}
