function print_mail(id, sub, lang, do_what) {
	window.open('struct/print_mail/'+lang+'/'+do_what+'.php?id='+id+'&sub='+sub+'&lang='+lang+'&do_what='+do_what, 'popup', 'scrollbars=1,resize=yes,top=40,left=40,screenX=40,screenY=40,width=650,height=480');
}


function setColor(li_id, id){
	var a, b;
	
	for (var j = 0; j < li_id.length; j++){
		if (j==0 && j!=id){
			a = document.getElementById(li_id[j]);
			a.onmouseover = setActiveColorFirst;
			a.onmouseout = setDefaultColorFirst;
		}else if (j==li_id.length-1 && j!=id){
			a = document.getElementById(li_id[j]);
			a.onmouseover = setActiveColorLast;
			a.onmouseout = setDefaultColorLast;
		}else{
			if (j!=id){
				a = document.getElementById(li_id[j]);
				a.onmouseover = setActiveColor;
				a.onmouseout = setDefaultColor;
			}
		}
	}
}
	
function setActiveColor(){
	this.style.backgroundImage= 'url(gfx/menu_black.gif)';
}

function setDefaultColor(){
	this.style.backgroundImage= 'url(gfx/menu_red.gif)';
}

function setActiveColorFirst(){
	this.style.backgroundImage= 'url(gfx/menu_black.gif)';
	document.getElementById('li_first').style.backgroundImage= 'url(gfx/menu_left_corner_black.gif)';
}

function setDefaultColorFirst(){
	this.style.backgroundImage= 'url(gfx/menu_red.gif)';
	document.getElementById('li_first').style.backgroundImage= 'url(gfx/menu_left_corner_red.gif)';
}

function setActiveColorLast(){
	this.style.backgroundImage= 'url(gfx/menu_black.gif)';
	document.getElementById('li_last').style.backgroundImage= 'url(gfx/menu_right_corner_black.gif)';
}

function setDefaultColorLast(){
	this.style.backgroundImage= 'url(gfx/menu_red.gif)';
	document.getElementById('li_last').style.backgroundImage= 'url(gfx/menu_right_corner_red.gif)';
}

function openWinNS(plik,w,h) {
	window.open(plik,'popup','scrollbars=0,resize=0,top=40,left=40,screenX=40,screenY=40,width=' + w + ',height=' + h);
} 

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function submitPopup(formName, windowName) {
	var f,nw;
	nw=window.open('',windowName,'scrollbars=0,resize=0,top=40,left=40,screenX=40,screenY=40,width=300,height=250');
	nw.focus();
	f=MM_findObj(formName);
	f.target=windowName;
	f.submit();
}

function openWin(plik, w, h) {
	window.open(plik, 'popup', 'scrollbars=1,resize=0,top=40,left=40,screenX=40,screenY=40,width=' + w + ',height=' + h);
}

