//funkcje do podmiany zdjec
function fon(n){document.images[n].src='img/'+n+'_on.gif';}
function foff(n){document.images[n].src='img/'+n+'.gif';}


function tdon(td,linkid) {

	td.className = 'menuItemOn';
	document.getElementById(linkid).className = 'linkOn';
}

function tdoff(td,linkid) {
	td.className = 'menuItem';
	document.getElementById(linkid).className = '';
}

//funkcja do wyswietlania popupu
var okno='';
function popup(wi,he,uerel,alignx,aligny,scrol)
{
  if(he>screen.availHeight) {
					he= screen.avilHeight-20;
					scrol = 'yes';
					wi = wi + 20;
	}
	if(okno &&!okno.closed){okno.close()}
	if(wi=='100%'){wi=screen.availWidth-30}
	if(he=='100%'){he=screen.availHeight-0}
	if(alignx=='left'){xx=0}
	else if(alignx=='right'){xx=(screen.availWidth-wi)-10}
	else{xx=(screen.availWidth-wi)/2}
	if(aligny=='top'){yy=0}
	else if(aligny=='bottom'){yy=(screen.availHeight-he)}
	else{yy=(screen.availHeight-he)/2}
	okno=window.open(uerel, '_blank', 'scrollbars='+scrol+',height='+he+',width='+wi+',top='+yy+',left='+xx);
}

//ladowanie do casch-u zdjec
foto=new Array('firma','home','oferta','kontakt');
menuA=new Array();menuB=new Array();
for(n=0;n<foto.length;n++){
	menuA[n]=new Image();
	menuA[n].src='img/'+foto[n]+'_on.gif';
	menuB[n]=new Image();
	menuB[n].src='img/'+foto[n]+'.gif';
}

function blurall() {
	var links = document.getElementsByTagName('a');
	for (var i=0;i<links.length;i++)
	{
		links[i].onfocus = blurme;
  }
}

function blurme()
{
	this.blur();
} 

function hilight (what,path) {

	document.getElementById(what).src = path+'grafika/menu/'+what+'_on.gif';
}  

function shade (what,path) {
	document.getElementById(what).src = path+'grafika/menu/'+what+'.gif';
}

function prinversion(id){
	var okno='';
	(okno && !okno.closed)?okno.close():'';
	he=400;wi=730;
	xx=(screen.availHeight-he)/2-10;
	yy=(screen.availWidth-wi)/2;
	okno=window.open('drukuj.php?produkt='+id, '_blank', 'menubar=yes,scrollbars=yes,height='+he+',width='+wi+',top='+xx+',left='+yy);
}