function chImg(e){
//grafike np. obrazek.gif podmienia na obrazek2.gif 
 var tab = e.src.split('.gif')
 e.src = tab[0]+'2.gif'
}

function chImgReset(e){
 var tab = e.src.split('2.gif')
 e.src = tab[0]+'.gif'
}


function view_news(e){
	
    var tab = new Array()

	for(var a=0;a<3;a++){
	//wypelnianie tablicy idkami do odkrywania (jesli one istnieja)
	if(document.getElementById('n'+a)) tab[a] = 'n'+a;
	}

   for(b=0;b<tab.length;b++){
   //zapalenie jednego, inne zgaszone
   (e==tab[b])? document.getElementById(tab[b]).style.display = 'block':document.getElementById(tab[b]).style.display = 'none';
   
   }

}

/* ---------------- */


function open_box_l(nr1)
{
 	
 	//alert(nr1.substr(6))  alert(nr2.substr(7))
 	
 	
	//informacja o ilosci boxow lewych w zmiennej a
	a=0
	do{
 		document.getElementById('box_left_nr'+a)
 		a++
 	}
 	while(document.getElementById('box_left_nr'+a))
 	
 	for(b=0;b<a;b++)
 	{
	  if(nr1.substr(6)==b)
		{
		 //zapalanie pojedynczego boxa
			var obj1 = document.getElementById(nr1);
		 	(obj1.style.display=='none')?obj1.style.display='block':obj1.style.display='none'

		 }
		 else
		 {
		 //zgaszanie pozostalych
		  
		  if(document.getElementById('box_l_'+b)) document.getElementById('box_l_'+b).style.display='none'


		 }
	 } 	
}


/* ---------------- */

function chm(nr)
{
//podswietla dana pozycje w spisie
document.getElementById('spis_'+nr).src = "images/spis_"+nr+"b.gif";
}

function se(user,domain)
{
//send email
locationstring = "mailto:" + user + "@" + domain;window.location = locationstring;
}

/* ---------------- */

function drukuj(content)
{
	//tekst
	var c = content

	//poszukiwanie aktywnych linkow i killowanie ich
	c=c.replace(/href=\"[^\"]+/gi,'href=\"javascript:void(0)')
	c=c.replace(/onClick=\"[^\"]+/gi,'onClick=\"return false')
	c=c.replace(/action=[^ ]+/gi,'onsubmit=\"return false\"')
		
	with(open('','druk','status=yes,menubar=yes,toolbar=no,scrollbars=yes,resizable=yes,left=0,top=0'))
	{
	document.write('<html><head><META HTTP-EQUIV="imagetoolbar" CONTENT="no"><title> Wersja do druku - PODGLĄD </title>'+
	'<script type="text/javascript">'+
	'function hide_el(){'+
	'if(document.getElementById(\'addtoico\'))document.getElementById(\'addtoico\').style.display=\'none\';'+
 	'if(document.getElementById(\'bannerb\'))document.getElementById(\'bannerb\').style.display=\'none\';'+
 	'if(document.getElementById(\'no_druk\'))document.getElementById(\'no_druk\').style.display=\'none\';'+
	'}'+
	'</script>'+
	'<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=ISO-8859-2">'+
	'<LINK href="inc/style.css" rel="StyleSheet" type="text/css"></head>'+	
	'<body class="druk" onLoad="hide_el();a=setInterval(function(){window.print();clearInterval(a);window.status=\'\'},7000);window.status=\'Za chwilę rozpocznie się proces drukowania...\'" style="margin:20px">'+
	'<DIV style="width:519px"><p style="text-align:center"><img src="images/stopka_druk.gif" style="margin-bottom:20px"></p>'+
	c+
	'<div class="fcze" align="center" style="clear:both;padding-top:10px">Wydruk pochodzi ze strony http://www.iso9000.pl</div></DIV>'+
	'</body></html>')
	document.close();
	}
}

/* ---------------- */

function chF(id,pos,col){
  (id.value.length==0)?id.style.top=pos+"px":id.style.top='1px';id.style.borderColor=col;
}

/* ---------------- */

function ow(plik,w, h)
{ ustawienia= "width=" + w + "," +"height=" + h + ",top=0,left=0," +"innerWidth=" + w + "," +"innerHeight=" + h + ","+"toolbar=no," +"location=no," +"directories=no,"+"status=no," +"menubar=no," +"scrollbars=yes," +"resizable=no"
noweOkienko=window.open(plik,'',ustawienia);
}

/* ---------------- */

function oi(x){
 with(open('','f','width=400,height=250,left=0,top=0')){
document.write('<html><head><META HTTP-EQUIV="imagetoolbar" CONTENT="no"><title> Galeria - powiększenie </title>'+
'<script type="text/javascript">function L(I){'+
'I.parentNode.style.visibility="visible";'+
'focus();resizeTo(I.width+6,I.height+24);}<\/script></head>'+
'<body style="background-color:white;'+'border:0px;font:normal bold 14px Verdana">'+
'<div id="wai" style="font-family:franki,tahoma;font-size:12px;color:#994D4D;font-weight:bold;position:relative;top:50%;"><center>proszę czekać... trwa wczytywanie zdjęcia.</center></div><div style="overflow:hidden;'+
'position:absolute;visibility:hidden;left:0px;top:0px">'+
'<img onerror="L=parentNode.previousSibling;L.innerHTML='+
'\'loading error... sorry\';L.style.backgroundColor=\'white\'" onload="L(this)"  src="'+x+'"></div></body></html>')
document.close() }
}


function oi2(x){
 with(open('','f','width=400,height=250,left=0,top=0,scrollbars=yes')){
document.write('<html><head><META HTTP-EQUIV="imagetoolbar" CONTENT="no"><title> Powiększenie </title>'+
'<script type="text/javascript">function L(I){'+
'I.parentNode.style.visibility="visible";'+
'focus();resizeTo(I.width+23,550);}<\/script></head>'+
'<body style="background-color:white;'+'border:0px;font:normal bold 14px Verdana">'+
'<div id="wai" style="font-family:franki,tahoma;font-size:12px;color:#994D4D;font-weight:bold;position:relative;top:50%;"><center>proszę czekać... trwa wczytywanie zdjęcia.</center></div><div style="overflow:hidden;'+
'position:absolute;visibility:hidden;left:0px;top:0px">'+
'<img onerror="L=parentNode.previousSibling;L.innerHTML='+
'\'loading error... sorry\';L.style.backgroundColor=\'white\'" onload="L(this)"  src="'+x+'"></div></body></html>')
document.close() }
}

/* ---------------- */

function AddToBookmarks (url,title) 
{ 
window.external.AddFavorite(url,title); 
} 

/* ---------------- */

function gotourl(s) 
{
	if (s.selectedIndex!=0)
	{
		var gourl = s.options[s.selectedIndex].value;	
		parent.location.href = gourl;
	}
}
