function show_form(){
	opener.location.href='http://www.kibr.gda.pl/index.php?mod=content&spath=29';
	window.close();
}
function checkValue()
{
	var i = document.getElementById('search');
	
	if (i.value == "")
	{
		alert('Proszę wpisać tekst do wyszukania.');
	}
	
}

function clearInput(id)
{
	if (id.value == "Wpisz szukane słowo") {
		id.value = "";
	}
}
function showOpinion(id)
{
	var s = document.getElementById('opinionDiv_'+id);
	if(s.style.display == "block") {
		s.style.display = "none";
	} else if(s.style.display == "none") {
		s.style.display = "block";		
	}
}

function OpenImage(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");
}
function ONW(Url,wys, szer) {
   window.open(Url,'', "height=" + wys + ",width=" + szer + ",status=no,resizable=no,scrollbars=no,menubar=no,location=no");
}

function ONWS(Url,wys, szer) {
   window.open(Url,'', "height=" + wys + ",width=" + szer + ",status=no,resizable=no,scrollbars=yes,menubar=no,location=no");
}
function set_cars_od_ilosc(val) {
	f = document.getElementById('select_cars');				
	f.target='ifr_cars';
	f.action='cms/_actions/select_cars.php';
	f.od_ilosc.value=val;	
	f.submit();
}
function set_cars_orderby(val) {
	f = document.getElementById('select_cars');				
	f.target='ifr_cars';
	f.action='cms/_actions/select_cars.php';
	f.orderby.value=val;
	f.submit();
}
function set_cars_desc(val) {
	f = document.getElementById('select_cars');				
	f.target='ifr_cars';
	f.action='cms/_actions/select_cars.php';
	f.desc.value=val;
	f.submit();
}
function set_cars_sort(val) {
	f = document.getElementById('select_cars');				
	f.target='ifr_cars';
	f.action='cms/_actions/select_cars.php';
	f.sort.value=val;
	f.submit();
}
function set_cars_demo(val) {
	f = document.getElementById('select_cars');				
	f.target='ifr_cars';
	f.action='cms/_actions/select_cars.php';
	f.demo.value=val;
	f.submit();
}
function updateSubCat(tag,mark) {
	advAJAX.download(tag, 'cms/_actions/cars_model.php?mark='+mark);
}

function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.newsletterEmail.value)){
return (true)
}
alert("Niepoprawny adres e-mail.Proszę wpisac ponownie")
return (false)
}