//zapisz ciastko
function writeCookie(ciastko, wartosc){ 
    document.cookie = escape(ciastko) + "=" + escape(wartosc) + ";expires=" + 60*60*24*7;
};
//pobierz ciastko
function getcookis(name) {
    name = name + "=" ; var carray = document. cookie . split ( ';' ) ;
    for ( var i = 0 ; i <  carray. length ; i ++ ) {
        var c = carray [ i ];
        while ( c. charAt ( 0 ) == ' ' ) c = c. substring ( 1 , c. length );
        if ( c. indexOf ( name ) == 0 ) return c. substring ( name . length , c. length );
    }
}
                    function pokaz(a,b,c,d){
                       //document.getElementById('b1').style.display = a;
                       document.getElementById('b2').style.display = b;
                       document.getElementById('b3').style.display = c;
		       document.getElementById('b4').style.display = d;
		       ciasteczko = getcookis('stan');
		       
		       if (ciasteczko <= 1) {
			
		       document.getElementById('a1').style.color = "#ffffff";
                       document.getElementById('a2').style.color = "#003274";
                       document.getElementById('a3').style.color = "#003274";
		       document.getElementById('a4').style.color = "#003274";
		       document.getElementById('a1').style.background = "url('grafika/a1h.png')";
		       document.getElementById('a2').style.background = "url('grafika/a2.png')";
		       document.getElementById('a3').style.background = "url('grafika/a3.png')";
		       document.getElementById('a4').style.background = "url('grafika/a4.png')";
		       var locat = 'home';
			window.location.replace(locat);
		       
		       }
		       if (ciasteczko == 2) {
		       document.getElementById('a1').style.color = "#003274";
                       document.getElementById('a2').style.color = "#ffffff";
                       document.getElementById('a3').style.color = "#003274";
		       document.getElementById('a4').style.color = "#003274";
		       document.getElementById('a1').style.background = "url('grafika/a1.png')";
		       document.getElementById('a2').style.background = "url('grafika/a2h.png')";
		       document.getElementById('a3').style.background = "url('grafika/a3.png')";
		       document.getElementById('a4').style.background = "url('grafika/a4.png')";
		       }
		       if (ciasteczko == 3) {
		       document.getElementById('a1').style.color = "#003274";
                       document.getElementById('a2').style.color = "#003274";
                       document.getElementById('a3').style.color = "#ffffff";
		       document.getElementById('a4').style.color = "#003274";
		       document.getElementById('a1').style.background = "url('grafika/a1.png')";
		       document.getElementById('a2').style.background = "url('grafika/a2.png')";
		       document.getElementById('a3').style.background = "url('grafika/a3h.png')";
		       document.getElementById('a4').style.background = "url('grafika/a4.png')";
		       }
		       if (ciasteczko == 4) {
		       document.getElementById('a1').style.color = "#003274";
                       document.getElementById('a2').style.color = "#003274";
                       document.getElementById('a3').style.color = "#003274";
		       document.getElementById('a4').style.color = "#ffffff";
		       document.getElementById('a1').style.background = "url('grafika/a1.png')";
		       document.getElementById('a2').style.background = "url('grafika/a2.png')";
		       document.getElementById('a3').style.background = "url('grafika/a3.png')";
		       document.getElementById('a4').style.background = "url('grafika/a4h.png')";
		       }
                    }
