 window.status = "Witaj w systemie nauczania przez internet: www.e-sgh.pl/pup";

 function pokazPozostale(id,time) {
   if(time == 'prev') {
     var prev = id - 1;
   } else {
     var prev = id + 1;
   }
   
   document.getElementById("a"+id).style.display = 'block';
   document.getElementById("a"+prev).style.display = 'none'; 
 }
 
 function otworz(url, rozmx, rozmy, scrolls) {
    mywin=window.open(url,'window','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+scrolls+',resizable=1,copyhistory=0,width='+rozmx+',height='+rozmy+',screenX=100,screenY=75,left=100,top=75');
    mywin.focus();
 } 

 function zaloguj_sie() {
    document.forms.logowanie.akcja.value = 'zaloguj_sie';
    var login = document.forms.logowanie.login.value;
    var haslo = document.forms.logowanie.haslo.value;
    if (login.length<4) {
        alert("Proszę wpisać poprawny login");
        document.forms.logowanie.login.focus();
    }
    else if (haslo.length<4) {
        alert("Proszę wpisać poprawne hasło");
        document.forms.logowanie.haslo.focus();
    }
    else document.forms.logowanie.submit();
 }

 function zaloguj() {
    var login = document.forms.logowanie.login.value;
    var haslo = document.forms.logowanie.haslo.value;
    if (login.length<4) {
        alert("Proszę wpisać poprawny login");
        document.forms.logowanie.login.focus();
	return false;
    }
    else if (haslo.length<4) {
        alert("Proszę wpisać poprawne hasło");
        document.forms.logowanie.haslo.focus();
	return false;
    }
    document.forms.logowanie.akcja.value = 'zaloguj_sie';
    return true;
 }

 function przyslij_haslo() {
    document.forms.logowanie.akcja.value = 'przyslij_haslo';
    var login = document.forms.logowanie.login.value;
    if (login.length<4) {
        alert("Proszę wpisać poprawny login");
        document.forms.logowanie.login.focus();
    }
    else document.forms.logowanie.submit();
 }

 testchar="¶";
 hostTime = 1046681048880;

 
 function init() {
    if (typeof(News)!='undefined') {
	News.createItem();
	News.runNews();
    }
 }

 function init_komunikat() {
    if(is.ns4 ||is.ns6) {
	available_width=innerWidth;
	available_height=innerHeight;
	layerSetup();
    }
    else
 {
	if(is.ie4 || is.ie5) {
	    available_width=document.body.clientWidth;
	    available_height=document.body.clientHeight;
	    layerSetup();
	}
    }
 }

 function hide(object) {
    if (document.getElementById && document.getElementById(object) != null)
	node = document.getElementById(object).style.visibility='hidden';
    else if (document.layers && document.layers[object] != null)
	document.layers[object].visibility = 'hidden';
    else if (document.all)
	document.all[object].style.visibility = 'hidden';
 }

 function Is() {
    agent  = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns = ((agent.indexOf('mozilla') != -1) && 
	      (agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1) &&
	      (agent.indexOf('opera') == -1) &&
	      (agent.indexOf('webtv') == -1));	
    this.ns2   = (this.ns && (this.major      ==    3));
    this.ns3   = (this.ns && (this.major      ==    3));
    this.ns4   = (this.ns && (this.major      ==    4));
    this.ns6   = (this.ns && (this.major      >=    5));
    this.ie    = (agent.indexOf("msie")       !=   -1);
    this.ie3   = (this.ie && (this.major      < 4));
    this.ie4   = (this.ie && (this.major      ==    4) && (agent.indexOf("msie 5.0")   ==   -1));
    this.ie5   = (this.ie && (this.major      ==    4) && (agent.indexOf("msie 5.0")   !=   -1));
    this.ieX = (this.ie && !this.ie3 && !this.ie4); 
 }

 var is = new Is();

function layerObject(id,position,left,top,visibility) {
     if (is.ie5||is.ns6) {
	      this.obj = document.getElementById(id).style;
		 this.obj.position = position;
		 this.obj.left = left;
		 this.obj.top = top;
		 this.obj.visibility = visibility;
		 return this.obj;
	 } else if(is.ie4) {
	      this.obj = document.all[id].style;
		 this.obj.position = position;
		 this.obj.left = left;
		 this.obj.top = top;
		 this.obj.visibility = visibility;
		 return this.obj;
     } else if(is.ns4) {
	 	 this.obj = document.layers[id];
		 this.obj.position = position;
		 this.obj.left = left;
		 this.obj.top = top;
		 this.obj.visibility = visibility;
		 return this.obj;
	 } 
}

function layerSetup() {
    centerLyr = new layerObject('komunikat','absolute', available_width/2-124,250,'visible');
}

function pokazWarstwe(id) {
	document.getElementById(id).style.display='block';
}

function ukryjWarstwe(id) {
	document.getElementById(id).style.display='none';
}

