function SimpleButton_Action(loc,url){ 
      loc.location = url;
} 


function PopUp(plik,w,h,nazwa) {
	margw = 30;
	margh = 60;
	h = (h>screen.height-margh) ? screen.height-margh : h+margh;
	w = (w>screen.width-margw) ? screen.width-margw : w+margw;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition  = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',resizable=yes,scroll=Auto,scrollbars=no';
	win = window.open(plik,nazwa,settings);
	win = win.resizeTo(w,h);
};

function confirmDelete(info,delUrl) {
  if (confirm(info)) {
    document.location = delUrl;
  }
}


function getFormValue(forma) {
  myOption = -1;
  for (i=0; i<forma.pytanie.length; i++) {
		if (forma.pytanie[i].checked) {
			myOption = i;
		}
	}
//	if (myOption == -1) {
//		alert("Musisz coś zaznaczyć żeby zagłosować !!!");
//		return false;
//	}
  
  return forma.pytanie[myOption].value;
  
}

function getRealLeft(el){
	var L=0;
	var tempEl = document.getElementById(el);
	while(tempEl.parentNode){
		L+= ( tempEl.offsetLeft)? tempEl.offsetLeft: 0;
		if(tempEl == document.body) break;
		tempEl = tempEl.parentNode;
	}
	return L;
}

function getRealTop(el){
	var L=0;
	var tempEl = document.getElementById(el);
	while(tempEl.parentNode){
		L+= ( tempEl.offsetTop)? tempEl.offsetTop: 0;
		if(tempEl == document.body) break;
		tempEl = tempEl.parentNode;
	}
	return L;
}

function onLoadHandler() {

	l=document.getElementById('lpanel').offsetHeight;
	o=document.getElementById('opanel').offsetHeight;
	r=document.getElementById('rpanel').offsetHeight;

	if (l > o && l > r) {
		if (o>0) {
			document.getElementById('opanel').style.height=l;
		}
		if (r>0) {
			document.getElementById('rpanel').style.height=l;
		}
	}

	if (o > l && o > r) {
		if (l>0) {
			document.getElementById('lpanel').style.height=o;
		}
		if (r>0) {
			document.getElementById('rpanel').style.height=o;
		}
	}
	if (r > l && r > o) {
		if (o>0) {
			document.getElementById('opanel').style.height=r;
		}
		if (l>0) {
			document.getElementById('lpanel').style.height=r;
		}
	}

}

