

function confirmAction(msg,action) {
   if (confirm(msg)){       
		document.location = action;
   }
}

function displayWindow(name,url, width, height) {
  var top = screen.height/2 - height/2;
  var left = screen.width/2 - width/2;
  var Win = window.open(url, name, 'top=' + top + ', left=' + left + ', width=' + width + ', height=' + height + ', resizable=1, scrollbars=1, menubar=0, status=0' );
}

function displayWindowNoScroll(name,url, width, height) {
  var top = screen.height/2 - height/2;
  var left = screen.width/2 - width/2;
  var Win = window.open(url, name, 'top=' + top + ', left=' + left + ', width=' + width + ', height=' + height + ', resizable=1, scrollbars=0, menubar=0, status=0' );
}
function isUndefined( f ) {
	return (typeof(f)=='undefined');
}

function checkAll( field, check ) {
var i;
	if (isUndefined(field))
		return;
	if (isUndefined(field.length)) {
		field.checked = check;
	} else {
		for(i=0; i<field.length; i++)
			field[i].checked = check;
	}
}


function addBookmark(title,url) {

  var msg_netscape = "Wiadomo Netscape";
  var msg_opera    = "Ta funkcja nie działa z tą wersj Opery. Dodaj do ulubionych ręcznie.";
  var msg_other    = "Twoja przeglądarka nie wspiera automatycznego dodawania do ulubionych. Dodaj do ulubionych ręcznie.";
  var agt          = navigator.userAgent.toLowerCase();


  if (agt.indexOf("opera") != -1) 
  {
    if (window.opera && window.print)
    {
      return true;
    } else 
    {
      alert(msg_other);
    }
  }    
  else if (agt.indexOf("firefox") != -1) window.sidebar.addPanel(title,url,"");
  else if ((agt.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >=4)) window.external.AddFavorite(url,title); 
  else if (agt.indexOf("netscape") != -1) window.sidebar.addPanel(title,url,"")         
  else if (window.sidebar && window.sidebar.addPanel) window.sidebar.addPanel(title,url,""); 
  else alert(msg_other);
  
}

function odpalAnkiete(){

//  if (!document.cookie.indexOf("ankieta")) {
	   displayWindowNoScroll("ankieta","/cms/ankieta/baner scholaris.html", 723, 210);
	//   document.cookie="ankieta = success;"     
 //}
}
	
	