// Skrypty dla www.geocontext.mobi
// info@geocontext.mobi

// Pamiętaj, kolejność skryptów jest bardzo ważna do prawidłowego działania całego skryptu.



// Def. globalne
var w = window;
var d = document;
var ti = d.title;
var nv = navigator;
var se = screen.width;
var we = screen.height;
var lh = location.href;
var lo = location.pathname;
var ll = (lo+"").substring(0,4);
var ls = (lo+"").substring(0,6);
var lq = (lo+"").substring(0,10);
var ld = (lo+"").substring(0,12);
var lp = (lo+"").substring(0,33);


// Jeśli obsługuje encodeURIComponent to referer koduje tą metodą, a jeśli nie to korzysta z przestarzałego escape,
// ale przy metodzie escape czasami pojawiały się krzaki w statystykach słów kluczowych.
// I jeszcze jedno, podczas testów nieprawidłowo działał encodeURI dlatego nie został zastosowany.
// A to stare rozwiązanie, dobre ale sporadycznie krzaki: var rf = escape(d.referrer);

var rff = d.referrer;
function kodujURI() {
 if (typeof(encodeURIComponent) == "function") {
  return encodeURIComponent(rff);
 } else {
  return escape(rff);
 }
}
var rf = kodujURI(rff);



// Def. globalne daty i czasu
var dt = new Date();
var g = dt.getHours();
var min = dt.getMinutes();
var cz = ((g < 10) ? "0" : "") + g + ((min < 10) ? "0" : "") + min;
var mies = dt.getMonth()+1;
var rok = dt.getFullYear();
var dz = dt.getDate();
var sekundy = dt.getSeconds();
 if (dz<10) dz = "0" + dz;
 if (mies<10) mies= "0" + mies;
 if (rok<1000) rok+=1900;



// Wspomaga skrypty wysyłające ciasteczka np. statystyki.
// Musi być powyżej innych skryptów.
// http://www.java2s.com/Code/JavaScript/Development/BillDortchsCookieFunctions.htm

//  Cookie Functions - "Night of the Living Cookie" Version (25-Jul-96)
//  Written by:  Bill Dortch, hIdaho Design <bdortch@hidaho.com>
//  The following functions are released to the public domain.

function getCookieVal (offset) {
  var endstr = d.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = d.cookie.length;
  return unescape(d.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = d.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (d.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = d.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}

function SetCookie (name,value,expires,path,domain,secure) {
  d.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toUTCString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    d.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


// Ustawia ważność ciasteczek
var dt1 = new Date();
 dt1.setTime (dt1.getTime() + (1000 * 60 * 60 * 24 * 6000));   // dt1 ustawia na ponad 10 lat

var dt2 = new Date();
 dt2.setTime (dt2.getTime() + (1000 * 60 * 30));               // dt2 ustawia na 30 minut

var dt3 = new Date();
 dt3.setTime (dt3.getTime() + (1000 * 60 * 60 * 24 * 60));     // dt3 ustawia na ok. 60 dni



// Ciasteczka w statystykach
if (GetCookie("c___l") == null) {
 var licznik = 1;
 var pc = "778888";
 var pp = "00000000";

 var kiedywizyta = "77" + cz + licznik;
  SetCookie("c___g_l", kiedywizyta, dt1, "/");

 var data = cz + (rok+"").substring(0,4) + mies + dz;
 var datawiz = (data+"").substring(4,12);
     // Dodaje liczbę do daty i w ten sposób zaciemnia zapis daty w format trudny
     // do odczytania. Potem przed zapisaniem do mysql sktypt php odejmuje tą wartość od daty i wszystko jest oki.
 var datawizyty = parseInt(datawiz)+12345678;

  SetCookie("c___d", datawizyty, dt1, "/");
  SetCookie("c___l", licznik, dt1, "/");
}
else {
 if (GetCookie("c___b") == null) {
  if (GetCookie("c___g_l")) {
   var pc = GetCookie("c___g_l");
  }
  if (GetCookie("c___d")) {
   var pp = GetCookie("c___d");
  }
  var licznik = parseInt(GetCookie("c___l"))+1;
  var kiedywizyta = "77" + cz + licznik;
   SetCookie("c___g_l", kiedywizyta, dt1, "/");
  var data = cz + (rok+"").substring(0,4) + mies + dz;
  var datawiz = (data+"").substring(4,12);
  var datawizyty = parseInt(datawiz)+12345678;
   SetCookie("c___d", datawizyty, dt1, "/");
   SetCookie("c___l", licznik, dt1, "/");
 }
 else {
  var pc = "778888";
  var pp = "00000000";
 }
}
// Ciacho blokujące zliczenie powrotu na witrynę przez 30 minut. Pamiętaj,
// że to ciasto wykorzystują też skrypty statystyk liczba_wizyt_sj.php
// - używa go do blokady zliczania wizyt przez noscript w przeglądarkach,
// które wczytują zawartość noscript, mimo włączonej obsługi js. Tak robił Firefox
// na pewno w wersji 2.x i był podwójnie zliczany! Ale wczytywał tylko na stronach
// prezentowanych jako aplikacja xhtml na html noscript nie wczytuje.
SetCookie("c___b", "b", dt2, "/");


// Detekcja javy
if (nv.javaEnabled()) {
 var jv = "11"; // wykryto jave
}
else {
 var jv = "10"; // javy brak
}


// Detekcja obsługi ciasteczek w przeglądarkach.
if (nv.cookieEnabled) {
 var co = "21"; // obsługuje cookie, ale niektóre starsze przeglądarki oparte na Gecko podobno źle to pokazują
}
else {
 var co = "20"; // nie obsługuje cookie
}


var id = "geocontext";
var sh = "n";
var st = "img";
var jc = jv + co;
var url = d.location.href;
var rn = Math.round(Math.random()*1000000);
var sc = screen.width+"x"+screen.height+"0010"+screen.colorDepth;
// NIE ZMIENIAJ znaku end na amp w skryptach,
// bo wtedy statystyki źle wskazują wejścia!
var dane = "?id="+id+"&referer="+rf+"&r="+sc+"&c="+pc+"&mojeparam="+pp+"&detek="+jc+"&showme="+sh+"&st="+st+"&title="+rn+"&url="+url;

var system1 = "http://www.geocontext.mobi/arkusze/zliczanie_wizyt/system-1/liczba_wizyt_sj.php"+dane;
var system2 = "http://www.geocontext.mobi/arkusze/zliczanie_wizyt/system-2/liczba_wizyt.pl?mode=img&ref="+rf;



// Kod statystyk dostosowany do różnych przeglądarek
// w zależności od tego jaką metodę obsługują.
// Mimo prób nie udało się podłączyć kreowanych obrazków do jakiegoś elementu wyświetlanego na stronie.
// Wiązało by się to z umieszczeniem ich w jakiejś function a tym samym opóźniło by się ładowanie statystyk
// aż załaduje się cała strona.

if (d.createElement) {
 if (d.getElementsByTagName) {

 var i_s1 = d.createElement("img");
  i_s1.alt = "";
  i_s1.src = system1;
  d.getElementsByTagName("head")[0].appendChild(i_s1);

 var i_s2 = d.createElement("img");
  i_s2.alt = "";
  i_s2.src = system2;
  d.getElementsByTagName("head")[0].appendChild(i_s2);

 }
}
else if (d.images) {

 var i_1 = new Image();
  i_1.src = system1;
 var i_2 = new Image();
  i_2.src = system2;

}
else {
 d.write('<p style="position: absolute; margin-left: -999em; padding: 0;"><img alt="" src="'+system1+'"> <img alt="" src="'+system2+'"></p>');
}
// Koniec statystyk



// Moduł ustawień reklam


//top link
var polecamy_na_topie_tekst = "księgarnia »";
var polecamy_na_topie_title = "Kupuj i czytaj książki geograficzno-przyrodnicze";
var polecamy_na_topie_a = "http://www.geocontext.mobi/sklep/geograficzno-przyrodniczy/";


//top baner
var top_baner_widoczny_lub_nie = "block"; // jeśli wyłączony to: none a jeśli widoczny to block
var top_baner_obj_szerokosc = "728"; // (przykłady banerów 750x100, 728x90, 468x60, 400x50)
var top_baner_obj_wysokosc = "90";


//na samym dole
var polecamy_na_stopce_tekst = " ";
var polecamy_na_stopce_title = "Opublikuj w profilu";
var polecamy_na_stopce_a = "http://www.facebook.com/sharer.php?u="+lh+"&src=sp";
var polecamy_na_stopce_img = "http://www.facebook.com/favicon.ico";
var polecamy_na_stopce_img_wysokosc = "16";
var polecamy_na_stopce_img_szerokosc = "16";


//na samym dole foto
var polecamy_stopko_propagowanie_foto_tekst = "Polecamy: ";
var polecamy_stopko_propagowanie_foto_a = "http://www.geocontext.mobi/sklep/geograficzno-przyrodniczy/nr342699-czarnobiala-fotografia-cyfrowa-poradnik-dla.html";
var polecamy_stopko_propagowanie_foto_a_tekst = "Czarno-biała fotografia cyfrowa – NATIONAL GEOGRAPHIC";



// Koniec modułu reklam



if (d.getElementById) {
if (d.getElementsByTagName) {
if (d.createElement) {



// Rozpoznaje strony /foto/
if (ls == "/foto/") { // na podstronach zawierających ciąg znaków
 if (we > 1024) {
  var css5 = d.createElement("link");
   css5.setAttribute("rel", "stylesheet");
   css5.setAttribute("type", "text/css");
   css5.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/ekran_5.css");
   d.getElementsByTagName("head")[0].appendChild(css5);
 }
 if (we > 800) {
  if (we <= 1024) {
   var css4 = d.createElement("link");
    css4.setAttribute("rel", "stylesheet");
    css4.setAttribute("type", "text/css");
    css4.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/ekran_4.css");
    d.getElementsByTagName("head")[0].appendChild(css4);
  }
 }
 if (we > 600) {
  if (we <= 800) {
   var css3 = d.createElement("link");
    css3.setAttribute("rel", "stylesheet");
    css3.setAttribute("type", "text/css");
    css3.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/ekran_3.css");
    d.getElementsByTagName("head")[0].appendChild(css3);
  }
 }
 if (we > 480) {
  if (we <= 600) {
   var css2 = d.createElement("link");
    css2.setAttribute("rel", "stylesheet");
    css2.setAttribute("type", "text/css");
    css2.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/ekran_2.css");
    d.getElementsByTagName("head")[0].appendChild(css2);
  }
 }
 if (we <= 480) {
   var css1 = d.createElement("link");
    css1.setAttribute("rel", "stylesheet");
    css1.setAttribute("type", "text/css");
    css1.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/ekran_1.css");
    d.getElementsByTagName("head")[0].appendChild(css1);
 }
}



// ładuje ikonkę
var ico = d.createElement("link");
ico.setAttribute("rel", "shortcut icon");
ico.setAttribute("type", "image/x-icon");
ico.setAttribute("href", "http://www.geocontext.mobi/favicon.ico");
d.getElementsByTagName("head")[0].appendChild(ico);



if (lp != "/sklep/geograficzno-przyrodniczy/") { // ale oprócz stron zawierających ciąg znaków.


// ładuje rss oprócz strony głównej
if (lo != "/") { // ale oprócz strony.
 if (lo != "/index.html") { // ale oprócz strony.
  var rss = d.createElement("link");
  rss.setAttribute("rel", "alternate");
  rss.setAttribute("type", "application/rss+xml");
  rss.setAttribute("lang", "la");
  rss.setAttribute("title", "Geocontext");
  rss.setAttribute("href", "http://www.geocontext.mobi/arkusze/rss/");
  d.getElementsByTagName("head")[0].appendChild(rss);
 }
}



// Wstawia informacje o adresie wyświetlanej strony i link do strony głównej oraz reklame w stopce

  if (ls != "/foto/") { // ale oprócz stron zawierających ciąg znaków.
   if (ls != "/arkus") { // ale oprócz stron zawierających ciąg znaków.
     if (ll != "/my/") { // ale oprócz stron zawierających ciąg znaków.

function szybkiInfoBoksStart() {

if (lo != "/") { // ale oprócz strony.
 if (lo != "/index.html") { // ale oprócz strony.

var elul = d.createElement("ul");
elul.setAttribute("id", "szybka_nawigacja");
elul.style.cssText = "list-style: none; color: #777; padding: 0; margin: 1.1em 4em -4.2em 3.6em; font: xx-small verdana, sans-serif;";

var wstawTutaj = d.getElementsByTagName("div")[2];
var parentP = wstawTutaj.parentNode;
parentP.insertBefore(elul, wstawTutaj);


var elli_1 = d.createElement("li");
d.getElementById("szybka_nawigacja").appendChild(elli_1);
elli_1.setAttribute("id", "adres_strony");
elli_1.style.cssText = "text-align: left; margin: 0 0 .1em 0; padding: 0;";
elli_1.appendChild(d.createTextNode("Jesteś tutaj: "));

   var elli_1_a_1 = d.createElement("a");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[0].appendChild(elli_1_a_1);
   elli_1_a_1.setAttribute("href", "http://www.geocontext.mobi");
   elli_1_a_1.appendChild(d.createTextNode("www.geocotnext.mobi"));

   var elli_1_span1 = d.createElement("span");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[0].appendChild(elli_1_span1);
   elli_1_span1.appendChild(d.createTextNode(" > "));

   if (ld == "/publikacje/") { // na stronach zawierających ciąg znaków.
   if (lo != "/publikacje/") {  // ale oprócz strony.
   var elli_1_a_2 = d.createElement("a");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[0].appendChild(elli_1_a_2);
   elli_1_a_2.setAttribute("href", "http://www.geocontext.mobi/publikacje/");
   elli_1_a_2.appendChild(d.createTextNode("Publikacje"));

   var elli_1_span2 = d.createElement("span");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[0].appendChild(elli_1_span2);
   elli_1_span2.appendChild(d.createTextNode(" > "));
   }
   }

   if (lq == "/przypisy/") { // na stronach zawierających ciąg znaków.
   if (lo != "/przypisy/") {  // ale oprócz strony.
   var elli_1_a_2 = d.createElement("a");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[0].appendChild(elli_1_a_2);
   elli_1_a_2.setAttribute("href", "http://www.geocontext.mobi/przypisy/");
   elli_1_a_2.appendChild(d.createTextNode("Przypisy"));

   var elli_1_span2 = d.createElement("span");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[0].appendChild(elli_1_span2);
   elli_1_span2.appendChild(d.createTextNode(" > "));
   }
   }

   var elli_1_span3 = d.createElement("span");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[0].appendChild(elli_1_span3);
   elli_1_span3.setAttribute("title", "Tytuł wyświetlanej strony");
   elli_1_span3.style.cssText = "";
   elli_1_span3.appendChild(d.createTextNode(ti));


var elli_2 = d.createElement("li");
d.getElementById("szybka_nawigacja").appendChild(elli_2);
elli_2.setAttribute("id", "translator");
elli_2.style.cssText = "text-align: right; margin: .4em 0 0 0; padding: 0;";

   var elli_2_a_1 = d.createElement("a");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[1].appendChild(elli_2_a_1);
   elli_2_a_1.setAttribute("title", "Translator EN");
   elli_2_a_1.setAttribute("href", "http://translate.google.com/translate?u="+lh+"&langpair=pl|en");
   elli_2_a_1.appendChild(d.createTextNode("en"));

   var elli_2_span1 = d.createElement("span");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[1].appendChild(elli_2_span1);
   elli_2_span1.appendChild(d.createTextNode(" "));

   var elli_2_a_2 = d.createElement("a");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[1].appendChild(elli_2_a_2);
   elli_2_a_2.setAttribute("title", "Translator RU");
   elli_2_a_2.setAttribute("href", "http://translate.google.com/translate?u="+lh+"&langpair=pl|ru");
   elli_2_a_2.appendChild(d.createTextNode("ru"));


var elli_3 = d.createElement("li");
d.getElementById("szybka_nawigacja").appendChild(elli_3);
elli_3.setAttribute("id", "propagatorek");
elli_3.style.cssText = "text-align: center !important; width: 100%; position: absolute; left: 0; top: 0; background-color: transparent;";
elli_3.appendChild(d.createTextNode(""));

   var elli_3_a_1 = d.createElement("a");
   d.getElementById("szybka_nawigacja").getElementsByTagName("li")[2].appendChild(elli_3_a_1);
   elli_3_a_1.setAttribute("href", polecamy_na_topie_a);
   elli_3_a_1.setAttribute("title", polecamy_na_topie_title);
   elli_3_a_1.appendChild(d.createTextNode(polecamy_na_topie_tekst));
   elli_3_a_1.style.cssText = "margin-left: 25em; color: #777; text-decoration: none; background-color: #e7e7d7; padding: 0 .4em .2em 1em; border-radius-bottomleft: .6em; -moz-border-radius-bottomleft: .6em; -webkit-border-radius-bottomleft: .6em; -opera-border-radius-bottomleft: .6em; -o-border-radius-bottomleft: .6em; -khtml-border-radius-bottomleft: .6em; -ie-border-radius-bottomleft: .6em; border-radius-bottomright: .6em; -moz-border-radius-bottomright: .6em; -webkit-border-radius-bottomright: .6em; -opera-border-radius-bottomright: .6em; -o-border-radius-bottomright: .6em; -khtml-border-radius-bottomright: .6em; -ie-border-radius-bottomright: .6em;";
 }
}


// wstawia reklamę w stopce na stronach wg szablonu i głównej
var rfooter_sz_p = d.createElement("p");
d.getElementById("footer").appendChild(rfooter_sz_p);
rfooter_sz_p.setAttribute("id", "stopko_propagowanie_sz");
rfooter_sz_p.setAttribute("title", polecamy_na_stopce_title);
rfooter_sz_p.style.cssText = "font-size: x-small; text-align: right; float: right; margin: 0; color: #777;";
rfooter_sz_p.appendChild(d.createTextNode(" "));

   var rfooter_sz_p_a1 = d.createElement("a");
   d.getElementById("stopko_propagowanie_sz").appendChild(rfooter_sz_p_a1);
   rfooter_sz_p_a1.setAttribute("id", "stopko_propagowanie_sz_a");
   rfooter_sz_p_a1.style.cssText = "color: #777; background-color: white; text-decoration: none;";
   rfooter_sz_p_a1.setAttribute("onmouseover", "this.style.cssText = 'text-decoration: underline;'");
   rfooter_sz_p_a1.setAttribute("onmouseout", "this.style.cssText = 'text-decoration: none;'");
   rfooter_sz_p_a1.setAttribute("href", polecamy_na_stopce_a);
   rfooter_sz_p_a1.appendChild(d.createTextNode(polecamy_na_stopce_tekst));


   var rfooter_sz_img = d.createElement("img");
   d.getElementById("stopko_propagowanie_sz_a").appendChild(rfooter_sz_img);
   rfooter_sz_img.style.cssText = "margin: -2em 0 0 0;";
   rfooter_sz_img.setAttribute("height", polecamy_na_stopce_img_wysokosc);
   rfooter_sz_img.setAttribute("width", polecamy_na_stopce_img_szerokosc);
   rfooter_sz_img.setAttribute("alt", "");
   rfooter_sz_img.setAttribute("src", polecamy_na_stopce_img);


// wstawia baner na topie na stronach wg szablonu i głównej
if (se >= 1024) {
var top_baner = d.createElement("div");
d.getElementById("header").appendChild(top_baner);
top_baner.setAttribute("id", "top_propagator");
top_baner.style.cssText = "text-align: center; margin: 0; padding: 0; border: 0; display: "+top_baner_widoczny_lub_nie+";";

   var span_top_baner = d.createElement("span");
   d.getElementById("top_propagator").appendChild(span_top_baner);
   span_top_baner.setAttribute("id", "span_top_propagator");
   span_top_baner.cssText = "margin: 0; padding: 0;";
   span_top_baner.appendChild(d.createTextNode(""));


   if (w.addEventListener) { // jeśli nowoczesne przeglądarki to object

   var obj_top_baner = d.createElement("object");
   d.getElementById("span_top_propagator").appendChild(obj_top_baner);
   obj_top_baner.style.cssText = "margin: .8em auto 0 auto; padding: 0; border: 0; display: block;";
   obj_top_baner.setAttribute("width", top_baner_obj_szerokosc);
   obj_top_baner.setAttribute("height", top_baner_obj_wysokosc);
   obj_top_baner.setAttribute("type", "text/html");
   obj_top_baner.setAttribute("data", "http://www.geocontext.mobi/arkusze/propagowanie/do_top.html");

   } else { // jeśli np. ie to iframe

   var objree = d.createElement("span");
   d.getElementById("span_top_propagator").appendChild(objree);
   objree.style.cssText = "margin: .8em auto 0 auto; padding: 0; border: 0; display: block;";
   objree.innerHTML = "<!--[if lte IE 8]><!--[if gte IE 7]><iframe frameborder=0 scrolling=no height="+top_baner_obj_wysokosc+" width="+top_baner_obj_szerokosc+" src=http://www.geocontext.mobi/arkusze/propagowanie/do_top.html></iframe><![endif]--><![endif]-->";

   }

}


}
if (w.addEventListener) { // aby było szybciej, zamiast "load" można wpisać "DOMContentLoaded", ale to nie jest standardowe rozwiązanie DOM
 w.addEventListener("DOMContentLoaded", szybkiInfoBoksStart, false); // uruchamia powyższą funkcję
}
}
}
}
}


if (lo != "/foto/") { // ale oprócz strony
 if (lo != "/foto/index.html") { // ale oprócz strony
  if (ls == "/foto/") { // ale na podstronach zawierających ciąg znaków



// Skrypt ładowany tylko do stron Zdjęcia, pozwala regulować wielkość zdjęć.

var css=d.createElement("link");
var hed=d.getElementsByTagName("head")[0];


if (GetCookie("c___r_f") == "s") {
 if (we > 1024) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/s-ekran_5.css");
  hed.appendChild(css);
}
 if (we > 800) {
  if (we <= 1024) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/s-ekran_4.css");
  hed.appendChild(css);
}
}
 if (we > 600) {
  if (we <= 800) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/s-ekran_3.css");
  hed.appendChild(css);
}
}
 if (we > 480) {
  if (we <= 600) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/s-ekran_2.css");
  hed.appendChild(css);
}
}
 if (we <= 480) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/s-ekran_1.css");
  hed.appendChild(css);
}
}



else if (GetCookie("c___r_f") == "m") {
 if (we > 1024) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/m-ekran_5.css");
  hed.appendChild(css);
}
 if (we > 800) {
  if (we <= 1024) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/m-ekran_4.css");
  hed.appendChild(css);
}
}
 if (we > 600) {
  if (we <= 800) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/m-ekran_3.css");
  hed.appendChild(css);
}
}
 if (we > 480) {
  if (we <= 600) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/m-ekran_2.css");
  hed.appendChild(css);
}
}
 if (we <= 480) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/m-ekran_1.css");
  hed.appendChild(css);
}
}



else if (GetCookie("c___r_f") == "l") {
 if (we > 1024) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/l-ekran_5.css");
  hed.appendChild(css);
}
 if (we > 800) {
  if (we <= 1024) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/l-ekran_4.css");
  hed.appendChild(css);
}
}
 if (we > 600) {
  if (we <= 800) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/l-ekran_3.css");
  hed.appendChild(css);
}
}
 if (we > 480) {
  if (we <= 600) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/l-ekran_2.css");
  hed.appendChild(css);
}
}
 if (we <= 480) {
  css.setAttribute("rel", "stylesheet");
  css.setAttribute("type", "text/css");
  css.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/foto-rozmiar/l-ekran_1.css");
  hed.appendChild(css);
}
}



function getNode( nodeId ) {
 if( d.getElementById )
  return d.getElementById( nodeId ).getElementsByTagName("img")[0]; // dzięki temu nie trzeba ustawiać id dla fotki bo skrypt je sam znajdzie po tej definicji
 else
  return false;
}



function rozmiar_s(object) {

if (we > 1024) {
getNode(object).style.height = "500px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}
if (we > 800) {
if (we <= 1024) {
getNode(object).style.height = "460px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}
}
if (we > 600) {
if (we <= 800) {
getNode(object).style.height = "300px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}
}
if (we > 480) {
if (we <= 600) {
getNode(object).style.height = "250px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}
}
if (we <= 480) {
getNode(object).style.height = "150px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}

setCookie("c___r_f", "s");
}



function rozmiar_m(object) {

if (we > 1024) {
getNode(object).style.height = "630px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}
if (we > 800) {
if (we <= 1024) {
getNode(object).style.height = "570px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}
}
if (we > 600) {
if (we <= 800) {
getNode(object).style.height = "440px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}
}
if (we > 480) {
if (we <= 600) {
getNode(object).style.height = "300px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}
}
if (we <= 480) {
getNode(object).style.height = "190px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
}

setCookie("c___r_f", "m");
}



function rozmiar_l(object) {
if (we > 1024) {
getNode(object).style.height = "790px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
}
if (we > 800) {
if (we <= 1024) {
getNode(object).style.height = "790px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
}
}
if (we > 600) {
if (we <= 800) {
getNode(object).style.height = "630px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
}
}
if (we > 480) {
if (we <= 600) {
getNode(object).style.height = "482px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
}
}
if (we <= 480) {
getNode(object).style.height = "345px";
d.getElementById("ustawiacz_s").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_m").style.cssText = "background-color: #928d7c; color: #eee; cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementById("ustawiacz_l").style.cssText = "background-color: #eee; color: #333; cursor: pointer; padding: 0 1px 1px 1px;";
}

setCookie("c___r_f", "l");
}



function setCookie( key, value ) {
 d.cookie = key + "=" + value + "; expires=" + dt1.toUTCString() + "; path=/";
}



// skrypt exif
var scr_exi = d.createElement("script");
scr_exi.setAttribute("type", "text/javascript");
scr_exi.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-exif/binaryajax.js");
d.getElementsByTagName("head")[0].appendChild(scr_exi);

var scr_exiw = d.createElement("script");
scr_exiw.setAttribute("type", "text/javascript");
scr_exiw.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-exif/exif.js");
d.getElementsByTagName("head")[0].appendChild(scr_exiw);

var scr_exiwu = d.createElement("script");
scr_exiwu.setAttribute("type", "text/javascript");
scr_exiwu.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-exif/imageinfo.js");
d.getElementsByTagName("head")[0].appendChild(scr_exiwu);



// funkcja dla edytora foto
function filter(strFilter) { // pobiera od elementu start zawartość class (zdefiniowane funkcję niżej) i ustawia jako adres src

var imgf = d.getElementById("start");
var srcObrazka = imgf.getAttribute("class");

var sp1 = document.createElement("img");
sp1.setAttribute("id", "newSpan");
sp1.setAttribute("src", srcObrazka);
sp1.setAttribute("id", "filterimage");

// stwórz referencję do istniejącego węzła, który ma zostać zastąpiony
var sp2 = document.getElementById("filterimage");
var parentDiv = sp2.parentNode;

// zastąp istniejący węzeł sp2 elementem span sp1
parentDiv.replaceChild(sp1, sp2);


	jsImageFX.doImage(d.getElementById("start").getElementsByTagName("img")[0], strFilter);
}



// Funkcje zamykania i otwierania edytora na stronach zdjęć
function pokaz() {

SetCookie("edytor", "widoczny", dt3, "/");

var aa = d.getElementById("exif");
aa.style.display = "inline";

var ab = d.getElementById("ustawiacz_histogram_jasny");
ab.style.display = "inline";

var ac = d.getElementById("ustawiacz_histogram_ciemny");
ac.style.display = "inline";

var ad = d.getElementById("ustawiacz_wyostrz");
ad.style.display = "inline";

var ae = d.getElementById("ustawiacz_jasno");
ae.style.display = "inline";

var af = d.getElementById("ustawiacz_ciemno");
af.style.display = "inline";

var ag = d.getElementById("ustawiacz_sepia");
ag.style.display = "inline";

var ah = d.getElementById("ustawiacz_czarno");
ah.style.display = "inline";

var ai = d.getElementById("by");
ai.style.display = "inline";

var apoki = d.getElementById("poki");
apoki.style.display = "none";

var azam = d.getElementById("zami");
azam.style.display = "inline";

}

function zamyk() {

SetCookie("edytor", "niewidoczny", dt3, "/");

var aa = d.getElementById("exif");
aa.style.display = "none";

var ab = d.getElementById("ustawiacz_histogram_jasny");
ab.style.display = "none";

var ac = d.getElementById("ustawiacz_histogram_ciemny");
ac.style.display = "none";

var ad = d.getElementById("ustawiacz_wyostrz");
ad.style.display = "none";

var ae = d.getElementById("ustawiacz_jasno");
ae.style.display = "none";

var af = d.getElementById("ustawiacz_ciemno");
af.style.display = "none";

var ag = d.getElementById("ustawiacz_sepia");
ag.style.display = "none";

var ah = d.getElementById("ustawiacz_czarno");
ah.style.display = "none";

var ai = d.getElementById("by");
ai.style.display = "none";

var apoki = d.getElementById("poki");
apoki.style.display = "inline";

var azam = d.getElementById("zami");
azam.style.display = "none";

}


// jeśli nie ma ciastka to ukrywa pasek edytor jeśli jest ciacho to go pokazuje
if (GetCookie("edytor") == null || GetCookie("edytor") == "niewidoczny") {
 var dspl = "none";
} else if (GetCookie("edytor") == "widoczny") {
 var dspl = "inline";
 var dsplbis = "none";
}


// dodaje elementy na stronach foto
function fotoStart() {


// obsługuje edytor obrazków i exif
var imgf = d.getElementById("start").getElementsByTagName("img")[0];
imgf.setAttribute("id", "filterimage");
imgf.setAttribute("data-exif", "true"); // to musi być aby zadziałał skrypt exif

imgf.onclick = function() {alert(EXIF.pretty(this));}


var srcObrazka = imgf.getAttribute("src");
d.getElementById("start").setAttribute("class", srcObrazka);

// tworzy belke i linki do ustawiania rozmiaru zdjęcia
var elBelkaF = d.createElement("p");
elBelkaF.setAttribute("id", "ustawienia");
elBelkaF.setAttribute("title", "Preferowany rozmiar zdjęcia");
elBelkaF.style.cssText = "position: fixed; top: 0; right: 0; font-size: xx-small; font-family: verdana, sans-serif; color: #eee; background-color: #928d7c; text-align: right; margin: 0; padding: 0 2.5em 2px .5em; border-radius-bottomleft: .5em; -moz-border-radius-bottomleft: .5em; -webkit-border-radius-bottomleft: .5em; -opera-border-radius-bottomleft: .5em; -o-border-radius-bottomleft: .5em; -khtml-border-radius-bottomleft: .5em; -ie-border-radius-bottomleft: .5em;";
elBelkaF.appendChild(d.createTextNode("Ustaw rozmiar zdjęcia: "));

var wstawTu = d.getElementById("top");
var parentP = wstawTu.parentNode;
parentP.insertBefore(elBelkaF, wstawTu);


var elS = d.createElement("a");
elS.setAttribute("id", "ustawiacz_s");
elS.setAttribute("title", "Małe zdjęcie");
elS.setAttribute("onclick", "rozmiar_s('start')");
elS.setAttribute("onmousedown", "this.style.background = '#ffa'");
elS.style.cssText = "cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementsByTagName("p")[0].appendChild(elS);
elS.appendChild(d.createTextNode("[S]"));

var elM = d.createElement("a");
elM.setAttribute("id", "ustawiacz_m");
elM.setAttribute("title", "Średnie zdjęcie");
elM.setAttribute("onclick", "rozmiar_m('start')");
elM.setAttribute("onmousedown", "this.style.background = '#ffa'");
elM.style.cssText = "cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementsByTagName("p")[0].appendChild(elM);
elM.appendChild(d.createTextNode("[M]"));

var elL = d.createElement("a");
elL.setAttribute("id", "ustawiacz_l");
elL.setAttribute("title", "Duże zdjęcie");
elL.setAttribute("onclick", "rozmiar_l('start')");
elL.setAttribute("onmousedown", "this.style.background = '#ffa'");
elL.style.cssText = "cursor: pointer; padding: 0 1px 1px 1px;";
d.getElementsByTagName("p")[0].appendChild(elL);
elL.appendChild(d.createTextNode("[L]"));



// tworzy belke z edytorem do zdjęcia
var elBelkaFnastaw = d.createElement("p");
elBelkaFnastaw.setAttribute("id", "ustawienia_edytor");
elBelkaFnastaw.setAttribute("title", "Ustaw preferowany wygląd zdjęcia");
elBelkaFnastaw.style.cssText = "position: fixed; z-index: 1; bottom: 0; right: 0; font-size: xx-small; font-family: verdana, sans-serif; color: #eee; background-color: #928d7c; text-align: right; margin: 0; padding: 0 0 2px 0; border-radius-topleft: .5em; -moz-border-radius-topleft: .5em; -webkit-border-radius-topleft: .5em; -opera-border-radius-topleft: .5em; -o-border-radius-topleft: .5em; -khtml-border-radius-topleft: .5em; -ie-border-radius-topleft: .5em;";
elBelkaFnastaw.appendChild(d.createTextNode(""));

var wstawTunast = d.getElementById("top");
var parentPnast = wstawTunast.parentNode;
parentPnast.insertBefore(elBelkaFnastaw, wstawTunast);


// pokaż
var btnn = d.createElement("a");
btnn.setAttribute("id", "poki");
btnn.setAttribute("title", "<< Pokaż");
btnn.setAttribute("onclick", "pokaz()");
btnn.setAttribute("onmouseover", "this.style.background = '#bba'");
btnn.setAttribute("onmouseout", "this.style.background = 'transparent'");
btnn.setAttribute("onmousedown", "this.style.background = '#ffa'");
btnn.setAttribute("onmouseup", "this.style.background = '#928d7c'");
btnn.style.cssText = "display: "+dsplbis+"; cursor: pointer; padding: 1px .6em 1px .6em; margin-right: 0; margin-left: 0; border-radius-topleft: .5em; -moz-border-radius-topleft: .5em; -webkit-border-radius-topleft: .5em; -opera-border-radius-topleft: .5em; -o-border-radius-topleft: .5em; -khtml-border-radius-topleft: .5em; -ie-border-radius-topleft: .5em;";
d.getElementsByTagName("p")[1].appendChild(btnn);
btnn.appendChild(d.createTextNode("<<"));

// zamknij
var btnnn = d.createElement("a");
btnnn.setAttribute("id", "zami");
btnnn.setAttribute("title", "Zamknij >>");
btnnn.setAttribute("onclick", "zamyk()");
btnnn.setAttribute("onmouseover", "this.style.background = '#bba'");
btnnn.setAttribute("onmouseout", "this.style.background = 'transparent'");
btnnn.setAttribute("onmousedown", "this.style.background = '#ffa'");
btnnn.setAttribute("onmouseup", "this.style.background = '#928d7c'");
btnnn.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 1px .9em 1px .9em; margin-right: .3em; margin-left: 0; border-radius-topleft: .5em; -moz-border-radius-topleft: .5em; -webkit-border-radius-topleft: .5em; -opera-border-radius-topleft: .5em; -o-border-radius-topleft: .5em; -khtml-border-radius-topleft: .5em; -ie-border-radius-topleft: .5em;";
d.getElementsByTagName("p")[1].appendChild(btnnn);
btnnn.appendChild(d.createTextNode(">>"));


function addEvent(oElement, strEvent, fncHandler) {
 if (oElement.addEventListener) {
     oElement.addEventListener(strEvent, fncHandler, false);
 } else if (oElement.attachEvent) {
            oElement.attachEvent("on" + strEvent, fncHandler);
 }
}

function prettyExif(exif) {
	var str = "";
	for (var a in exif) {
		if (exif.hasOwnProperty(a)) {
			if (typeof exif[a] == "object")
				str += "	" + a + " : [" + exif[a].length + " values]\r\n";
			else
				str += "	" + a + " : " + exif[a] + "\r\n";
		}
	}
	return str;
}

function test(src) {
	var file = src;

	var out = document.getElementById("output");
	out.value = "Loading file '" + file + "'...\r\n";
        out.style.cssText = "overflow: visible; display: block; left: 0; fixed: left; position: fixed; bottom: 0; border: 0; border-bottom: solid 1em ActiveBorder; font-size: small; padding: .5em .5em .5em .8em; background: url('http://www.geocontext.mobi/grafika/w_tle.png') top left; background: rgba(255, 255, 255, 0.75); color: #000;";
        out.setAttribute("onmouseover", "this.style.background = '#fff'");
        out.setAttribute("onmouseout", "this.style.background = 'rgba(255, 255, 255, 0.75)'");
	function callback() {
		var info = ImageInfo.getAllFields(file);
		out.value += ""
			+ "format: " + info["format"] + "\r\n"
			+ "version: " + info["version"] + "\r\n"
			+ "width: " + info["width"] + "\r\n"
			+ "height: " + info["height"] + "\r\n"
			+ "bpp: " + info["bpp"] + "\r\n"
			+ "alpha: " + info["alpha"] + "\r\n"
			+ "mimeType: " + info["mimeType"] + "\r\n"
			+ "byteSize: " + info["byteSize"] + "\r\n"
			+ "exif: " + prettyExif(info["exif"])
	};

	ImageInfo.loadInfo(file, callback);

}

var images = [
	             [srcObrazka, ""]
             ]

for (var i=0;i<images.length;i++) {
(function() {
var src = images[i][0];


var btn = d.createElement("a");
btn.setAttribute("id", "exif");
btn.setAttribute("title", "Dane EXIF");
btn.onclick = function() { test(src); }
btn.setAttribute("onmouseover", "this.style.background = '#bba'");
btn.setAttribute("onmouseout", "this.style.background = 'transparent'");
btn.setAttribute("onmousedown", "this.style.background = '#ffa'");
btn.setAttribute("onmouseup", "this.style.background = '#928d7c'");
btn.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 1px .9em 1px .9em; margin-right: .3em; margin-left: .3em;";
d.getElementsByTagName("p")[1].appendChild(btn);
btn.appendChild(d.createTextNode("EXIF"));

	})();
}

var elhist = d.createElement("a");
elhist.setAttribute("id", "ustawiacz_histogram_jasny");
elhist.setAttribute("title", "Histogram jasny");
elhist.setAttribute("onclick", "filter('histogram')");
elhist.setAttribute("onmouseover", "this.style.background = '#bba'");
elhist.setAttribute("onmouseout", "this.style.background = 'transparent'");
elhist.setAttribute("onmousedown", "this.style.background = '#ffa'");
elhist.setAttribute("onmouseup", "this.style.background = '#928d7c'");
elhist.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 1px .9em 1px .9em;";
d.getElementsByTagName("p")[1].appendChild(elhist);
elhist.appendChild(d.createTextNode("histogram/white"));

var elhistc = d.createElement("a");
elhistc.setAttribute("id", "ustawiacz_histogram_ciemny");
elhistc.setAttribute("title", "Histogram ciemny");
elhistc.setAttribute("onclick", "filter('histogram(color=0,0,0,0.5)')");
elhistc.setAttribute("onmouseover", "this.style.background = '#bba'");
elhistc.setAttribute("onmouseout", "this.style.background = 'transparent'");
elhistc.setAttribute("onmousedown", "this.style.background = '#ffa'");
elhistc.setAttribute("onmouseup", "this.style.background = '#928d7c'");
elhistc.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 1px .9em 1px .9em;";
d.getElementsByTagName("p")[1].appendChild(elhistc);
elhistc.appendChild(d.createTextNode("histogram/black"));

var elshar = d.createElement("a");
elshar.setAttribute("id", "ustawiacz_wyostrz");
elshar.setAttribute("title", "Wyostrzanie");
elshar.setAttribute("onclick", "filter('sharpen')");
elshar.setAttribute("onmouseover", "this.style.background = '#bba'");
elshar.setAttribute("onmouseout", "this.style.background = 'transparent'");
elshar.setAttribute("onmousedown", "this.style.background = '#ffa'");
elshar.setAttribute("onmouseup", "this.style.background = '#928d7c'");
elshar.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 1px .9em 1px .9em;";
d.getElementsByTagName("p")[1].appendChild(elshar);
elshar.appendChild(d.createTextNode("sharpen"));

var elbrightj = d.createElement("a");
elbrightj.setAttribute("id", "ustawiacz_jasno");
elbrightj.setAttribute("title", "Jaśniej");
elbrightj.setAttribute("onclick", "filter('brightness(brightness=20;contrast=0.1)')");
elbrightj.setAttribute("onmouseover", "this.style.background = '#bba'");
elbrightj.setAttribute("onmouseout", "this.style.background = 'transparent'");
elbrightj.setAttribute("onmousedown", "this.style.background = '#ffa'");
elbrightj.setAttribute("onmouseup", "this.style.background = '#928d7c'");
elbrightj.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 1px .9em 1px .9em;";
d.getElementsByTagName("p")[1].appendChild(elbrightj);
elbrightj.appendChild(d.createTextNode("brightness/+"));

var elbrightc = d.createElement("a");
elbrightc.setAttribute("id", "ustawiacz_ciemno");
elbrightc.setAttribute("title", "Ciemniej");
elbrightc.setAttribute("onclick", "filter('brightness(brightness=0;contrast=-0.2)')");
elbrightc.setAttribute("onmouseover", "this.style.background = '#bba'");
elbrightc.setAttribute("onmouseout", "this.style.background = 'transparent'");
elbrightc.setAttribute("onmousedown", "this.style.background = '#ffa'");
elbrightc.setAttribute("onmouseup", "this.style.background = '#928d7c'");
elbrightc.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 1px .9em 1px .9em;";
d.getElementsByTagName("p")[1].appendChild(elbrightc);
elbrightc.appendChild(d.createTextNode("brightness/-"));

var elsep = d.createElement("a");
elsep.setAttribute("id", "ustawiacz_sepia");
elsep.setAttribute("title", "Sepia");
elsep.setAttribute("onclick", "filter('sepia')");
elsep.setAttribute("onmouseover", "this.style.background = '#bba'");
elsep.setAttribute("onmouseout", "this.style.background = 'transparent'");
elsep.setAttribute("onmousedown", "this.style.background = '#ffa'");
elsep.setAttribute("onmouseup", "this.style.background = '#928d7c'");
elsep.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 1px .9em 1px .9em;";
d.getElementsByTagName("p")[1].appendChild(elsep);
elsep.appendChild(d.createTextNode("sepia"));

var eldesatru = d.createElement("a");
eldesatru.setAttribute("id", "ustawiacz_czarno");
eldesatru.setAttribute("title", "Czarno-białe");
eldesatru.setAttribute("onclick", "filter('desaturate')");
eldesatru.setAttribute("onmouseover", "this.style.background = '#bba'");
eldesatru.setAttribute("onmouseout", "this.style.background = 'transparent'");
eldesatru.setAttribute("onmousedown", "this.style.background = '#ffa'");
eldesatru.setAttribute("onmouseup", "this.style.background = '#928d7c'");
eldesatru.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 1px .9em 1px .9em;";
d.getElementsByTagName("p")[1].appendChild(eldesatru);
eldesatru.appendChild(d.createTextNode("black/white"));

var elby = d.createElement("a");
elby.setAttribute("id", "by");
elby.setAttribute("title", "Script made by Jacob Seidelin");
elby.setAttribute("href", "http://www.nihilogic.dk/labs/imagefx/");
elby.style.cssText = "display: "+dspl+"; cursor: pointer; padding: 0 1px 1px 1px; margin-left: 2.2em; margin-right: 2.5em; text-decoration: none; color: #eee;";
d.getElementsByTagName("p")[1].appendChild(elby);
elby.appendChild(d.createTextNode("©"));


// tworzy teexarea dla danych exif
var elare = d.createElement("textarea");
elare.setAttribute("id", "output");
elare.setAttribute("title", "");
elare.setAttribute("rows", "10");
elare.setAttribute("cols", "65");
elare.style.cssText = "display: none;";
elare.appendChild(d.createTextNode(""));

var wstawTuna = d.getElementById("top");
var parentPna = wstawTuna.parentNode;
parentPna.insertBefore(elare, wstawTuna);


// wstawia reklamę w stopce na stronach ze zdjęciami
var rfooter_p = d.createElement("p");
d.getElementById("footer").appendChild(rfooter_p);
rfooter_p.setAttribute("id", "stopko_propagowanie");
rfooter_p.style.cssText = "font-size: x-small; text-align: right; float: right; margin: 0; color: #777;";
rfooter_p.appendChild(d.createTextNode(polecamy_stopko_propagowanie_foto_tekst));

   var rfooter_p_a1 = d.createElement("a");
   d.getElementById("stopko_propagowanie").appendChild(rfooter_p_a1);
   rfooter_p_a1.style.cssText = "color: #777; background-color: white; text-decoration: none;";
   rfooter_p_a1.setAttribute("onmouseover", "this.style.cssText = 'text-decoration: underline;'");
   rfooter_p_a1.setAttribute("onmouseout", "this.style.cssText = 'text-decoration: none;'");
   rfooter_p_a1.setAttribute("href", polecamy_stopko_propagowanie_foto_a);
   rfooter_p_a1.appendChild(d.createTextNode(polecamy_stopko_propagowanie_foto_a_tekst));

// wstawia reklamę pod wykazem numerów zdjęć
var rnfooter_p = d.createElement("p");
rnfooter_p.setAttribute("id", "nadstopko_propagowanie");
rnfooter_p.style.cssText = "font-size: xx-small; font-family: verdana, sans-serif; color: #777; margin: .4em 0 0 0; text-align: right;";
rnfooter_p.appendChild(d.createTextNode(""));

var wstawReklamepowyzejfooter = d.getElementById("footer");
var parentR = wstawReklamepowyzejfooter.parentNode;
parentR.insertBefore(rnfooter_p, wstawReklamepowyzejfooter);


// na stronach /foto/ wstawia inną reklamę umieszczoną w object

   // słowo Reklama: zakodowane w "base64", wstawiane nad reklamami (w zdjęciach) - nie udało się precyzyjnie
   // wypozycjonować słowa "Reklama:" w css, stąd wstawiłem base64 jako graficzne tło
   var base64_reklama = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAJCAYAAACmJ6W6AAAA/klEQVR42tXUuw4BQRSAYZdEI9HpNZQewCVI6CVuvU5Qb+kZvIFaPMBWar0I0SCRSFQKIkLwTzLFZDLL2mh2ki92z+6Zc2YMgYDHYVnW65f434coJD2wRsMXTcvPMEo4+anpCGqYKc8K2ImFoGXIaWPo1DT3B9zQ175ZG2cRxxR7VNzk6sdDvDBATHlpgSLS2GiFc5gg9GmniSXE3FpuFkk85TwpXNzkqpOIozFDU0t6KIt6aoWPyDgdD667WOGqxd1cG3NNx0Osdou48myJMoKGH28dc0QdCh/kLiY9NP05Vwv2MFbu8/If5S4aNCy0g5FD4arcKdtD019zfTXeiwcgiAFhmtsAAAAASUVORK5CYII=)";

   var ospan = d.createElement("span");
   d.getElementById("nadstopko_propagowanie").appendChild(ospan);
   ospan.setAttribute("id", "nadstopko_propagowanie_span");
   ospan.style.cssText = "display: block;";

   var objr = d.createElement("object");
   d.getElementById("nadstopko_propagowanie_span").appendChild(objr);
   objr.style.cssText = "padding-top: 10px; background: transparent "+base64_reklama+" top right no-repeat;";
   objr.setAttribute("height", "150");
   objr.setAttribute("width", "180");
   objr.setAttribute("type", "text/html");
   objr.setAttribute("id", "nadstopko_propagowanie_object");
   objr.setAttribute("data", "http://www.geocontext.mobi/arkusze/propagowanie/do_zdj.html");



// skrypt do ładowania zdjęć
if (d.images) {
var scr_prefo = d.createElement("script");
scr_prefo.setAttribute("type", "text/javascript");
scr_prefo.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-preload/foto-preload.js");
d.getElementsByTagName("head")[0].appendChild(scr_prefo);
}


// skrypty foto-edytor
var js1 = d.createElement("script");
js1.setAttribute("type", "text/javascript");
js1.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-edytor/imagefx.js");
d.getElementsByTagName("head")[0].appendChild(js1);

var js2 = d.createElement("script");
js2.setAttribute("type", "text/javascript");
js2.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-edytor/imagefx_none.js");
d.getElementsByTagName("head")[0].appendChild(js2);

var js3 = d.createElement("script");
js3.setAttribute("type", "text/javascript");
js3.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-edytor/imagefx_desaturate.js");
d.getElementsByTagName("head")[0].appendChild(js3);

var js4 = d.createElement("script");
js4.setAttribute("type", "text/javascript");
js4.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-edytor/imagefx_sharpen.js");
d.getElementsByTagName("head")[0].appendChild(js4);

var js5 = d.createElement("script");
js5.setAttribute("type", "text/javascript");
js5.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-edytor/imagefx_brightness.js");
d.getElementsByTagName("head")[0].appendChild(js5);

var js6 = d.createElement("script");
js6.setAttribute("type", "text/javascript");
js6.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-edytor/imagefx_sepia.js");
d.getElementsByTagName("head")[0].appendChild(js6);

var js7 = d.createElement("script");
js7.setAttribute("type", "text/javascript");
js7.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/foto-edytor/imagefx_histogram.js");
d.getElementsByTagName("head")[0].appendChild(js7);



// tylko na małych monitorach i na stronach ze zdjęciami ustawia rozmiar czcionki dla następna i poprzednia
if (se <= 800) {
 d.getElementsByTagName("ul")[1].style.cssText = "font-size: x-small;";
}


// tylko dla określonych monitorów i tylko na stronach foto ustawia szerokość dla body inną niż w arkuszu css
if (se == 1280 && we == 800) {
 d.getElementsByTagName("body")[0].style.cssText = "max-width: 68em;";
}


}

if (w.addEventListener) { // aby było szybciej, zamiast "load" można wpisać "DOMContentLoaded", ale to nie jest standardowe rozwiązanie DOM
 w.addEventListener("DOMContentLoaded", fotoStart, false); // uruchamia powyższą funkcję
}
}
}
}
}



if (lo == "/foto/") { // tylko strona główna foto
function bodySizefoto() {

// tylko dla określonych monitorów i tylko na stronie foto ustawia szerokość dla body inną niż w arkuszu css
if (se == 1280 && we == 800) {
 d.getElementsByTagName("body")[0].style.cssText = "max-width: 68em;";
}

}

if (w.addEventListener) { // aby było szybciej, zamiast "load" można wpisać "DOMContentLoaded", ale to nie jest standardowe rozwiązanie DOM
 w.addEventListener("DOMContentLoaded", bodySizefoto, false); // uruchamia powyższą funkcję
}
}



if (lo == "/" || lo == "/index.html") { // Jeśli strona główna to wstawia style okrągłe rogi dla elementu p i półprzezroczyste graficzne tło dla starszych przeglądarek które nie obsługują css rgba. Ukryte tutaj ponieważ styl z przedrostkiem np. -moz... nie jest poprawny w css.
 function indexStart() {
  d.getElementsByTagName("p")[2].style.cssText = "-moz-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); -webkit-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); -o-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); -opera-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); -moz-border-radius: .9em; -webkit-border-radius: .9em; -opera-border-radius: .9em; -o-border-radius: .9em; -khtml-border-radius: .9em; -ie-border-radius: .9em; background: rgba(255, 255, 255, 0.75); background: url('http://www.geocontext.mobi/grafika/w_tle.png') top left; background: rgba(255, 255, 255, 0.75);";
  d.getElementsByTagName("p")[3].style.cssText = "-moz-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); -webkit-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); -o-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); -opera-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); background: url('http://www.geocontext.mobi/grafika/w_tle.png') top left; background: rgba(255, 255, 255, 0.75);";
 }

 if (w.addEventListener) { // aby było szybciej, zamiast "load" można wpisać "DOMContentLoaded", ale to nie jest standardowe rozwiązanie DOM
  w.addEventListener("DOMContentLoaded", indexStart, false); // uruchamia powyższą funkcję
 }
}
else if (lp == "/sklep/geograficzno-przyrodniczy/") { // *************************** Skrypty dla sklepu przyrodniczego ******************************

// na stronach sklepu przyrodniczego do adresów javascript dodaje zmienne co powoduje, że kolory linków są cały czas takie same, ale problem rozwiązany
// przez zastosowanie cookie do którego są zapisywane odwiedzone strony i skrypt za każdym razem sprawdza jakie to są strony i dodaje do
// znacznika <a> zawierającego href strony już odwiedzonej - kolor odwiedzonych linków - ufff...
if (GetCookie("historia_sklep_przyrodniczy") == null) {
    SetCookie("historia_sklep_przyrodniczy", lo, dt3, "/");
} else if (GetCookie("historia_sklep_przyrodniczy")) {
   var ciastko_hist = GetCookie("historia_sklep_przyrodniczy");
   SetCookie("historia_sklep_przyrodniczy", lo + ciastko_hist, dt3, "/");

   function koloruj_a() {

   var wszystkie_a_na_stronie1 = d.getElementsByTagName("a");

   for(var i=0;i<wszystkie_a_na_stronie1.length;i++) {
       var hrefOdnosnika1 = wszystkie_a_na_stronie1[i].getAttribute("href");
       var patt1=new RegExp(hrefOdnosnika1); // pobiera href
       var ssa = patt1.test(ciastko_hist);  // sprawdza czy href znajduje się w zapisanym ciastku
       if (ssa == true) {                  // jeśli taki ciąg znajduje się w ciastku to ustawia color
        wszystkie_a_na_stronie1[i].setAttribute("style", "color: #636");
       }
       var hrefOdnosnika1_caly = "/sklep/geograficzno-przyrodniczy/" + hrefOdnosnika1;
       if (hrefOdnosnika1_caly == lo) {
       wszystkie_a_na_stronie1[i].setAttribute("style", "color: #636");
      }
     }
    }

   if (w.addEventListener) { // aby było szybciej, zamiast "load" można wpisać "DOMContentLoaded", ale to nie jest standardowe rozwiązanie DOM
    w.addEventListener("DOMContentLoaded", koloruj_a, false); // uruchamia powyższą funkcję
   }
}


function orderRefresh(form_) {
form_.action = "#formularz-dane"; // po zmianie sposobu zapłaty w rozwijanej liście przeładowywuje stronę i przewija ją do tego identyfikatora
form_.submit();
}


// sprawdzanie formularza zamówienia
var green = "background-color: #ffd;";
var red = "background-color: #ffa;";
var nic = "background-color: #fff;";
function formCheck ( form ) {

if (d.getElementById("email").value == "") { // jeśli pole email puste to wyskakuje alert oraz styluje obramowanie na czerwono itd. w ponizszych
alert("Należy wpisać e-mail!");
d.getElementById("email").style.cssText = red;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
return false ;
} else { // jeśli pole jest wypełnione to już nie styluje niczego itd. w poniższych
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
}

if (d.getElementById("surname").value == "" && d.getElementById("company").value == "") {
alert("Należy wpisać imię i nazwisko (lub/i firmę)!");
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = red;
d.getElementById("surname").style.cssText = red;
d.getElementById("company").style.cssText = green;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
return false ;
} else {
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
}

if (d.getElementById("address").value == "") {
alert("Należy wpisać ulicę!");
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = red;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
return false ;
} else {
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
}

if (d.getElementById("code").value == "") {
alert("Należy wpisać kod pocztowy!");
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = red;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
return false ;
} else {
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
}

if (d.getElementById("place").value == "") {
alert("Należy wpisać miejscowość!");
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = red;
d.getElementById("payment_id").style.cssText = nic;
return false ;
} else {
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
}

if (d.getElementById("payment_id").selectedIndex == 0) {
alert("Należy wybrać formę płatności!");
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = red;
return false ;
} else {
d.getElementById("email").style.cssText = nic;
d.getElementById("name").style.cssText = nic;
d.getElementById("surname").style.cssText = nic;
d.getElementById("company").style.cssText = nic;
d.getElementById("address").style.cssText = nic;
d.getElementById("code").style.cssText = nic;
d.getElementById("place").style.cssText = nic;
d.getElementById("payment_id").style.cssText = nic;
}

if (d.getElementById("invoice").checked == true) { // a tu sprawdza formularz faktury i wyskakuje alert - nie udało się ostylować
                                                  // gdyż przy takiej próbie strona była przekierowywana dalej i to zjawisko występowało za każdym
                                                 // razem gdy umieściłem w tej części sktyptu getelementbyid color cośtam, więc pozostawiłem tylko alert

  if (d.getElementById("tax_surname").value == "" && d.getElementById("tax_company").value == "") {
  alert("Faktura: Należy wpisać imię i nazwisko (lub/i firmę)!");
  return false ;
  }

  if (d.getElementById("tax_tin").value == "") {
  alert("Faktura: Należy wpisać numer NIP!");
  return false ;
  }

  if (d.getElementById("tax_address").value == "") {
  alert("Faktura: Należy wpisać ulicę!");
  return false ;
  }

  if (d.getElementById("tax_code").value == "") {
  alert("Faktura: Należy wpisać kod pocztowy!");
  return false ;
  }

  if (d.getElementById("tax_place").value == "") {
  alert("Faktura: Należy wpisać miejscowość!");
  return false ;
  }
 }
 return true ;
}

// na stronach sklepu przyr. dodaje do adresów zmienną np. ?dataczas=2009-08-18_18-10-55 która się zmienia wraz z upływającym czasem
// dzięki czemu strony sklepu nie cachują się pernamentnie i widać zmiany w koszyku po każdej operacji dodaj/usuń a nie tak jak
// wcześniej, że strony które już były wyświetlone nie uwzględniały zmian w koszyku.
var moja_zmienna = "?dataczas=" + rok + '-' + mies + '-' + dz + 'T' + g + ':' + min + ':' + sekundy;

function roznefunc() {

var wszystkie_a_na_stronie2 = d.getElementsByTagName("a");

 for(var i=0;i<wszystkie_a_na_stronie2.length;i++) {
     var hrefOdnosnika2 = wszystkie_a_na_stronie2[i].getAttribute("href"); // tu zamienia ciąg .html jeśli występuje w href
     wszystkie_a_na_stronie2[i].setAttribute("href", hrefOdnosnika2.replace(/.html/, ".html" + moja_zmienna));
 }

var wszystkie_a_na_stronie3 = d.getElementsByTagName("a");

 for(var i=0;i<wszystkie_a_na_stronie3.length;i++) {
     var hrefOdnosnika3 = wszystkie_a_na_stronie3[i].getAttribute("href"); // tu zamienia ciąg ../../sklep/geograficzno-przyrodniczy/ na ten sam ale plus zmienna 
     wszystkie_a_na_stronie3[i].setAttribute("href", hrefOdnosnika3.replace(/..\/..\/sklep\/geograficzno-przyrodniczy\//, "../../sklep/geograficzno-przyrodniczy/" + moja_zmienna));
 }


// a tu inny skrypt dodaje zdarzenie onchange do rozwijanej listy sortowania
if (d.getElementById("sortuj")) {
var selcsort = d.getElementById("sortuj");
selcsort.setAttribute("onchange", "this.form.submit()");
selcsort.onchange = function() {this.form.submit();}; // a tu to samo co linijka wyżej tylko zadziała w ie7
}


// wysyła do formularza zdarzenie onsubmit które uruchamia skrypt powyżej sprawdzający poprawność formularza
if (d.getElementById("formularz")) {
 var formd = d.getElementById("formularz");
 formd.setAttribute("onsubmit", "return formCheck(this)");
 formd.onsubmit = function() {return formCheck(this);}; // a tu to samo co linijka wyżej tylko zadziała w ie7
}


// a tu dodaje zdarzenie onchange do rozwijanej listy sposobów płatności w formularzu zamówienia
if (d.getElementById("payment_id")) {
 var selcpay = d.getElementById("payment_id");
 selcpay.setAttribute("onchange", "orderRefresh(d.getElementById('formularz'))"); // odwołuje się do funkcji kilka skryptów wyżej
 selcpay.onchange = function() {orderRefresh(d.getElementById('formularz'));}; // a to jest to samo co linijka wyżej tylko zadziała w ie7

if (d.getElementById("dane_faktury")) {
 d.getElementById("dane_faktury").style.display = "none"; // ukrywa formularz faktury przy ładowaniu strony aby funkcja ponizej o nazwie kliknij mogła działać
}
}


// wszystkie form
if (d.getElementsByTagName("form")) {
var wszystkie_form = d.getElementsByTagName("form");
 for(var i=0;i<wszystkie_form.length;i++) { // do każdego form na stronie wstawia okrągłe rogi
     wszystkie_form[i].style.cssText = "-moz-border-radius: .3em; -webkit-border-radius: .3em; -opera-border-radius: .3em; -o-border-radius: .3em; -khtml-border-radius: .3em; -ie-border-radius: .3em;";
 }
}


if (d.getElementById("invoice")) { // dodaje onclick do elementu checked w formularzu zamówienia dzięki czemu wywołuje funkcję kliknij()
 var objinvo = d.getElementById("invoice");
 objinvo.setAttribute("onClick", "kliknij();");
 objinvo.onclick = function() {kliknij();}; // a tu to samo co linijka wyżej tylko zadziała w ie7
}


// dodaje style cieni do grafik, ukryte tutaj bo nie są poprawne wg CSS
var wszystkieimg = document.getElementsByTagName("img");

for(var i=0;i<wszystkieimg.length;i++) {
    var clasimg = wszystkieimg[i].getAttribute("class");   // wyszukuje wszystkie img na stronie i jeśli zawiera class
       if (clasimg == "photo") {                           // jeśli class to photo
        wszystkieimg[i].setAttribute("style", "-moz-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4); -webkit-box-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4);");
       }
}

if (d.getElementById("opis")) {                                     // resetuje styl powyżej dla img opis
 d.getElementById("opis").getElementsByTagName("img")[0].setAttribute("style", "-moz-box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.4); -webkit-box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.4);");
 d.getElementById("opis").style.cssText = "display: inline;"; // ten sam styl jest w css ale czasami w firefoxie chyba nie był wczytywany i coś źle wyświetlało
}

}

if (w.addEventListener) { // aby było szybciej, zamiast "load" można wpisać "DOMContentLoaded", ale to nie jest standardowe rozwiązanie DOM
 w.addEventListener("DOMContentLoaded", roznefunc, false); // uruchamia powyższą funkcję
}


function kliknij() { // pokazuje lub ukrywa formularz faktury przy zaznaczeniu checkboxa
if (d.getElementById("invoice")) { // jeśli występuje checkboks o id invoice to wykonuje funkcje
 if (d.getElementById("invoice").checked == false) {
 var objfa = d.getElementById("dane_faktury");
 objfa.style.display = "none"; // ukrywa formularz faktury
}
else {
 var objfa = d.getElementById("dane_faktury");
 objfa.style.display = "table"; // pokazuje formularz faktury
}
}
}

if (w.addEventListener) { // aby było szybciej, zamiast "load" można wpisać "DOMContentLoaded", ale to nie jest standardowe rozwiązanie DOM
 w.addEventListener("click", kliknij, false); // uruchamia powyższą funkcję
 w.addEventListener("DOMContentLoaded", kliknij, false); // uruchamia powyższą funkcję
}


}
// **********************Koniec skryptów dla sklepu przyrodniczego ***************************************************

}
}
// Koniec



// Def. dla rozpoznawania ie
var n = nv.appName;
var wer = parseFloat(nv.appVersion);
var ie = n == "Microsoft Internet Explorer";
var wrs = nv.appVersion;
if (ie) {
 var wer = parseFloat(wrs.substring((wrs.indexOf("MSIE") + 5 ),wrs.length));
}



if (ie) {
// a tu nic dla ie bo mootools wywala błąd w ie8 i wcześniejszych ie też
} else if (lo != "/sklep/geograficzno-przyrodniczy/") { // oprócz strony głównej sklepu


if (lp == "/sklep/geograficzno-przyrodniczy/") { // ale na stronach zawierających ciąg znaków.

// ładuje style do faceboksa
var cssFacebox = document.createElement("link");
cssFacebox.setAttribute("rel", "stylesheet");
cssFacebox.setAttribute("type", "text/css");
cssFacebox.setAttribute("href", "http://www.geocontext.mobi/arkusze/dodatki/mootools-facebox/facebox.css");
document.getElementsByTagName("head")[0].appendChild(cssFacebox);

// ładuje skrypt mootools
var scr_moo = d.createElement("script");
scr_moo.setAttribute("type", "text/javascript");
scr_moo.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/mootools/mootools.js");
d.getElementsByTagName("head")[0].appendChild(scr_moo);

// ładuje skrypt facebox na każdą stronę
var scr_fbx = d.createElement("script");
scr_fbx.setAttribute("type", "text/javascript");
scr_fbx.setAttribute("src", "http://www.geocontext.mobi/arkusze/dodatki/mootools-facebox/facebox.js");
d.getElementsByTagName("head")[0].appendChild(scr_fbx);

}
}



// Od tego miejsca zupa skryptów tylko dla ie.
if (ie && wer <= 8) { // jeśli wersja ie mniejsza lub równa


// To badziewie poniżej rozpoznaje wersję javascriptu, np. jscript_version 5.7 obsługiwał ie7, a 5.8 obsługuje już ie8.
/*@cc_on @*/
/*@if (@_jscript_version <= 5.8 )


if (lp == "/sklep/geograficzno-przyrodniczy/") {
 d.write('<!--[if IE 8]><style type="text/css"> fieldset { padding-left: .8em; } #produkty li ul li[title="Zdjęcie produktu"] img.photo { margin-top: 1.5em; } ul#produkty-polecamy li ul li[title="Zdjęcie produktu"] img.photo { margin-top: 1.5em; } div#header a em { background-image: url("http://www.geocontext.mobi/grafika/w_tle.png"); background-position: top left; } ul#spis-lista li ol li[title="Autorzy i twórcy dzieła"], ul#spis-lista li ol li .price { margin-left: -.45em; } ul#spis-lista li ol { margin-left: 1.5em; } ul#spis-lista li a { margin-left: -.45em; } ul#spis-lista li strong { margin-left: -.5em; }</style><![endif]-->');
 d.write('<!--[if IE 7]><style type="text/css"> #produkty li ul li[title="Zdjęcie produktu"] a { background: transparent url("http://www.geocontext.mobi/sklep/geograficzno-przyrodniczy/czytaj.png") 10px 4px no-repeat; } h1 { margin-top: -.6em; background-color: #fff; padding-left: .2em; } form#formularz li input { display: table-cell; vertical-align: middle; } form#formularz #priority { margin-left: 14.6em; } form#formularz #delivery_id { margin-left: 5.9em; } form#formularz #payment_id { margin-left: 5.1em; } form#formularz #tax_code { margin-left: 11em; } form#formularz #code { margin-left: 9.9em; } img.photo { background: url(http://www.geocontext.mobi/grafika/loading-b.gif) center 15px no-repeat; } div.aside p#propagator { color: #dcdcdc; } h2#formularz-dane { margin-top: 2em; } form#formularz p { padding-right: 9em; } form#formularz li { list-style: none; padding-right: 9em; } form#formularz legend { padding-top: .3em; border-top: dotted 1px #777; display: block; } form#formularz fieldset { border: 0; } form#formularz { text-align: right; } form#twoje_zakupy tr th[colspan="3"] + td + td { border: 0; } form#twoje_zakupy td { border-bottom: 1px solid #ccb; } input[name="recount"] { margin-bottom: -.25em; padding: 0; } form#twoje_zakupy caption { color: #fff; } div#opis .price + li { text-align: right; padding-right: 1.1em; padding-top: 3em; } div#opis ul li[title="Zdjęcie produktu"] em { margin-top: -.2em; padding-bottom: .4em; background: #fff url("http://www.geocontext.mobi/sklep/geograficzno-przyrodniczy/lupa.png") top right no-repeat; } div#opis ul li[title="Zdjęcie produktu"] { text-align: left; float: left; margin-right: 1em; } div.szukaj-boks form p strong { color: #e7e7d7; } div.szukaj-boks form { width: 35em; text-align: center; vertical-align: middle; padding: .3em .3em .35em .6em; } #content + .aside div.w_koszyku { margin-top: 19em; } ul#produkty + .nav p[title="Przejdź do kolejnej podstrony"] { border-top: dotted 1px #fff; height: 1em; width: 22em; margin: 22em auto -21.4em auto; } form p[title="Sortuj produkty według kryteriów"] { margin-top: -.6em; } h2#gwiazdki-4 { border-top: dotted 1px #fff; } ul#produkty-polecamy-naj .price { padding-left: 3.9em; padding-top: .3em; } ul#produkty-polecamy-naj [title="Zdjęcie produktu"] a {  padding-bottom: 1.1em; background: #fff url("http://www.geocontext.mobi/sklep/geograficzno-przyrodniczy/czytaj-opis.png") bottom center no-repeat; } ul#spis-lista { width: 12.5em; } ul#spis-lista li ol li ul { margin-bottom: 2em; } ul#spis-lista li ol li ul li { min-width: 10em; } ul#spis-lista li ol { background-color: #e7e7d7; margin-top: -.3em; margin-left: 1.35em; padding-bottom: 175em; } div.w_koszyku { margin-top: 1em; } .hgroup { margin-bottom: -4.6em; height: 5em; } blockquote { display: none; } ul[title="Odsyłacze nawigacyjne"] form p strong { color: #e7e7d7; } ul[title="Odsyłacze nawigacyjne"] form { position: absolute; margin-top: -.3em; vertical-align: middle; padding: .3em .3em .35em .6em; } #header a em { background-image: url("http://www.geocontext.mobi/grafika/w_tle.png"); background-position: top left; } #header a em { cursor: pointer; float: right; margin-top: -1.25em; } </style><![endif]-->');
 d.write('<!--[if lte IE 6]><style type="text/css"> #spis-lista { width: 199px; font-weight: normal; margin: 0 .7em 15em 0 !important; line-height: 1em !important; } #spis-lista li { font-size: x-small; display: block; padding-bottom: .4em; padding-top: .2em; padding-left: .9em !important; } </style><![endif]-->');
}


// Wyłącza foto edytor oraz reklamę w object bo w ie nie działa ale zamiast tego kilka skryptów niżej wstawia reklamę w iframe dla ie. A dla tła h1 img ustawiono animację loading.gif aby ładnie wyglądało bo ie8 coś brzydko ładował duże pliki grafik.
d.write('<!--[if lte IE 8]><style type="text/css"> #nadstopko_propagowanie, #ustawienia_edytor, #propagator object, #propagator-do_tekstu object { display: none !important; } #content h1 img { background: url(http://www.geocontext.mobi/grafika/loading-b.gif) center no-repeat; } </style> <link rel="shortcut icon" href="http://www.geocontext.mobi/favicon.ico" type="image/x-icon"> <![endif]-->');


// Ustawienia kolorów dla języków - taka forma jest chyba niepoprawna dla css i się nie validuje, ale ie to obsługuje.
d.write('<!--[if lte IE 8]><!--[if gte IE 7]><style type="text/css"> [lang="en"], [lang="ru"], [lang="de"], [lang="nai"], [lang="hu"], [lang="fr"], [lang="es"] { color: #664 !important; } [lang="la"] { font-style: italic !important; color: #777 !important; } a:active [lang="en"], a:active [lang="ru"], a:active [lang="de"], a:active [lang="la"], a:active [lang="nai"], a:active [lang="hu"], a:active [lang="fr"], a:active [lang="es"], a:active[lang="en"], a:active[lang="ru"], a:active[lang="de"], a:active[lang="la"], a:active[lang="nai"], a:active[lang="hu"], a:active[lang="fr"], a:active[lang="es"], a:active strong { color: #090 !important; } </style><![endif]--><![endif]-->');


// Usuwanie źle wyświetlanego elementu skocz na górę strony oraz wstawia cudzysłów dla q i słowo Polecamy przy id polecamy.
d.write('<!--[if lte IE 7]><style type="text/css"> .skocz { top: -999em; right: -999em; height: 1em; width; 1em; display: none; color: #fff; } q { -ie-xp: expression(this.parse ? 0 : ((bugFix = this.insertAdjacentText("afterBegin", "„")),this.insertAdjacentText("beforeEnd", "”"),this.parse = 1)); } #polecamy { -ie-xp: expression(this.parse ? 0 : ((bugFix = this.insertAdjacentText("afterBegin", "Polecamy: ")),this.insertAdjacentText("beforeEnd", ""),this.parse = 1)); } </style><![endif]-->');


// Wstawia słowo Reklama przy reklamach object oraz usuwa w ie6 propagatorek na topie strony na stronach wg. szablonu css.
d.write('<!--[if IE 8]><style type="text/css"> #propagator, #propagator-do_tekstu { display: block; text-align: center !important; } </style><![endif]-->');
d.write('<!--[if lte IE 7]><style type="text/css"> #propagator, #propagator-do_tekstu { -ie-xp: expression(this.parse ? 0 : ((bugFix = this.insertAdjacentText("afterBegin", "Reklama:")),this.insertAdjacentText("beforeEnd", ""),this.parse = 1)); font: x-small verdana, sans-serif; font-weight: bold; color: #c1bfb1 !important; } </style><![endif]-->');
d.write('<!--[if lte IE 6]><style type="text/css"> #propagatorek, #top_propagator { display: none; } </style><![endif]-->');


if (lo != "/foto/") { // ale oprócz strony
 if (lo != "/foto/index.html") { // ale oprócz strony
  if (ls == "/foto/") { // ale na podstronach zawierających ciąg znaków
   d.write('<!--[if IE 7]><style type="text/css"> body { max-width: 68em; } dl#notka_autorska { margin-top: 1.6em; } address { margin-top: .45em !important; } span#opis-foto { margin-top: 0; } h1 img { margin-top: .75em !important; } li[title="Numer obecnie wyświetlanego zdjęcia"] { color: #000; font-weight: bold; border: 0; background-color: #fff; } ul[title="Nawigacja"] [title="Poprzednia strona w kolejności"] { -ie-xp: expression(this.parse ? 0 : ((bugFix = this.insertAdjacentText("afterBegin", "« ")),this.insertAdjacentText("beforeEnd", ""),this.parse = 1)); } ul[title="Nawigacja"] [title="Następna strona w kolejności"] { -ie-xp: expression(this.parse ? 0 : ((bugFix = this.insertAdjacentText("afterBegin", "")),this.insertAdjacentText("beforeEnd", " »"),this.parse = 1)); } </style><![endif]-->');
   d.write('<!--[if lte IE 6]><style type="text/css"> div { margin-top: -2.45em; } dl#notka_autorska { margin-top: -2.3em; margin-bottom: 1.3em; } </style><![endif]-->');
   d.write('<!--[if lte IE 5.5000]><style type="text/css"> dl#notka_autorska { margin-top: -2.1em; text-align: left; } div p, #content ul, div h2 { font-size: 84%; } div h2 { font-size: 84% !important; } div h1 { margin-top: .1em; } </style><![endif]-->');
   d.write('<!--[if lte IE 5.2]><style type="text/css"> div h1 { margin-top: -.6em; } </style><![endif]-->');
  }
 }
}


// Oprócz stron foto - styluje content
if (ls != "/foto/") {
 d.write('<!--[if lte IE 6]><style type="text/css"> #content { font-size: 100% !important; } </style><![endif]-->');
}


// Tylko ie7 i wyżej
d.write('<!--[if IE 8]><style type="text/css"> #propagator iframe { clear: left; margin-top: .1em; } #propagator-do_tekstu iframe { clear: left; display: block; margin-top: .1em; } #propagator-do_tekstu { color: #dcdcdc; } body:focus { outline: 0; } </style><![endif]-->');
d.write('<!--[if IE 7]><style type="text/css"> #stopko_propagowanie_sz { margin: 0 0 -2em 0 !important; } #propagatorek { padding-bottom: .2em !important; } #propagator iframe { clear: left; display: block; margin-top: .1em; } #propagator-do_tekstu iframe { clear: left; display: block; margin-top: .1em; } #propagator-do_tekstu { color: #dcdcdc; } </style><![endif]-->');


// Ustawia margines przy reklamach object na stronach z działu Informacje oraz marginesy przy logo na każdej stronie.
d.write('<!--[if lte IE 8]><!--[if gte IE 7]><style type="text/css"> #top img { margin: 2px 0 4px .2em; } #info-blok #propagator { padding-bottom: .5em; color: #c1bfb1; } </style><![endif]--><![endif]-->');


// Ustawienia dla wyników wyszukiwania, copyright data 2005-..., oraz elementu dodawanego przez skrypt tzw. szybka nawigacja pokazująca adres strony i link do strony głównej.
d.write('<!--[if IE 8]><style type="text/css"> sub, sup { font-size: small; } .wyszukiwarka-wyniki dl { margin-top: 1em !important; } </style><![endif]-->');
d.write('<!--[if IE 7]><style type="text/css"> sub, sup { font-size: small; } #szybka_nawigacja { padding: 0 !important; margin: .5em 4em -4.3em 3.6em !important; } #szybka_nawigacja li { margin-bottom: -.9em !important; } #szybka_nawigacja #translator { margin-right: -999em !important; } .wyszukiwarka-wyniki dl { margin-top: 1em !important; } [title="Prawa autorskie i licencje"] { -ie-xp: expression(this.parse ? 0 : ((bugFix = this.insertAdjacentText("afterBegin", "")),this.insertAdjacentText("beforeEnd", " © 2005–2010"),this.parse = 1)); } [title="Prawa autorskie i licencje"] { color: #777; } </style><![endif]-->');
d.write('<!--[if lte IE 6]><style type="text/css"> #szybka_nawigacja { display: none; } .wyszukiwarka-wyniki dl { margin-top: 1em !important; } div#footer { -ie-xp: expression(this.parse ? 0 : ((bugFix = this.insertAdjacentText("afterBegin", "")),this.insertAdjacentText("beforeEnd", " © 2005–2010"),this.parse = 1)); color: #777; font-size: xx-small; } div#footer p { color: #777; } </style><![endif]-->');


// Strona główna
if (lo == "/" || lo == "/index.html") {
 d.write('<!--[if IE 8]><style type="text/css"> ul#spis-lista + p + h2 + p, ul#spis-lista + p + h2 + p + h3 + p { background-image: url("http://www.geocontext.mobi/grafika/w_tle.png"); background-position: top left; } ul#spis-lista li a[href="/foto/"] { display: block; margin-top: -1.9em; margin-left: 1em; border-bottom: solid 115em #e7e7d7; } ul#spis-lista li a { margin-left: -.45em; } ul#spis-lista + p img { cursor: default; } #propagator { color: #dcdcdc; } div { margin-left: 14.4em; } </style><![endif]-->');
 d.write('<!--[if IE 7]><style type="text/css"> ul#spis-lista + p + h2 + p, ul#spis-lista + p + h2 + p + h3 + p { background-image: url("http://www.geocontext.mobi/grafika/w_tle.png"); background-position: top left; } ul#spis-lista { line-height: 1.4em; } ul#spis-lista li { padding-left: .5em; } ul#spis-lista li a[href="/foto/"] { margin-bottom: 111em; } ul#spis-lista li a { margin-left: -.1em; display: block; } ul#spis-lista + p { padding-bottom: .8em; margin-left: 14.4em; } h3, ul#spis-lista + p + h2 + p { margin-left: 14.4em; } ul#spis-lista + p img { cursor: default; } div { margin: -1.8em 0 0 14.4em; } #propagator { color: #dcdcdc; } </style><![endif]-->');
 d.write('<!--[if lte IE 6]><style type="text/css"> div h3 a .note { text-decoration: none; } .sponsorowany img { margin-left: .3em; } #propagator { color: #dcdcdc; } p img { border: solid #777 2px; padding: 2px; } div p a img { border: solid 1px #777; padding: 0; float: left; margin-right: .5em; margin-bottom: .5em; } #propagator { margin-top: 1em; } h2, h3 { position: absolute; margin-left: -999em; } div h3 { position: static; margin-left: 0; } div { margin-left: 14.8em; } #spis-lista { font-weight: normal; margin: 0 .7em 15em 0 !important; line-height: 1em !important; } #spis-lista li { font-size: x-small; display: block; padding-bottom: .4em; padding-top: .2em; padding-left: .9em !important; } blockquote { margin: 1.4em 0 0 0; } ul li img { display: none; } #standardy { display: none !important; } </style><![endif]-->');
 d.write('<!--[if lte IE 5.5000]><style type="text/css"> div { margin-left: 14.7em; } #spis-lista, #spis-lista li { font-size: 90% !important; }  </style><![endif]-->');
 d.write('<!--[if lte IE 5.2]><style type="text/css"> #spis-lista + p { margin-left: -999em; } #polecamy, #propagator, #footer { display: none; } div { width: 20em; margin-top: 1em; } div h3 { display: block; width: 28em; } div p { margin-top: 1em; margin-bottom: -.4em; margin-left: 0; padding: 1em 1em 1em 1em; } #spis-lista { width: 16em; } .nav ul { clear: left; width: 66em; }  </style><![endif]-->');
}


// Wstawia: kierunek tekstu od lewej do prawej (ie5 wyświetlał po hebrajsku) oraz style na wszystkich stronach.
d.write('<!--[if lte IE 6]><style type="text/css"> body { padding-bottom: .8em; } sub, sup { font-size: small; } #info-blok #propagator { padding: 0 .5em .5em .5em; color: #c1bfb1; }  body, html, h1, h2, h3, h4, h5, h6, div, p, span, table, blockquote, ul li, ol li, dl dt, dl dd, address, cite, q, strong, dfn, abbr, acronym, em, submit, input, label, textarea { text-decoration: none; } a, a span { direction: ltr; text-decoration: underline; } ul, p { text-align: left; } form p { text-align: center; } a strong { text-decoration: underline; } </style><![endif]--> <!--[if lte IE 6]> <style type="text/css"> body, html, h1, h2, h3, h4, h5, h6, div, p, span, table, blockquote, ul li, ol li, dl dt, dl dd, address, cite, q, strong, dfn, abbr, acronym, em, submit, input, label, textarea { direction: ltr; } #top img { margin: 2px 0 4px .2em; } a:active { text-decoration: underline !important; } #footer address { margin: 2.7em 0 -1.6em 0; font-size: xx-small; } #najnowszy_komentarz:first-line { font-family: georgia, "times new roman"; font-style: italic; background-color: #dad9c7; color: #777; font-weight: bold !important; } div.wyszukiwarka-wyniki dl { width: 35em; margin: 2.2em 0 4em 0; } div ul li { display: block !important; font-weight: normal !important; list-style-position: inside; } #polecamy { font-weight: normal !important; font size: smaller !important; } #polecamy li { display: inline !important; } #podobne-blok { padding-bottom: 0; margin-bottom: 2em !important; } #podobne-blok ul { padding: 0 0 0 2em; } #podobne-blok li { display: block; font-weight: normal; list-style-position: inside; } h2#podobne { background-color: #fff !important; } #komentarze li { text-indent: -.6em !important; } #komentarze li blockquote { font-weight: normal !important; } #komentarze li blockquote p q { text-indent: 1em; } #komentarze li blockquote p { text-indent: -1em !important; } #komentarze li blockquote p.note { text-indent: 0 !important; } #komentarze li#najnowszy_komentarz blockquote p { text-indent: 0 !important; } div { padding-bottom: .6em; } .nav ul { margin: 1em 0 1em 0 !important; } .nav ul li { display: inline !important; margin: 0 .5em 0 0 !important; font-weight: bolder !important; font-size: 115% !important; } #hop { display: none !important; } .note, .przeskocz, .foto-blok, caption, form p, .wyszukiwarka-wyniki dl dd p, #skocz_do, #kontakt ul, #oferta ul, #komentarze li q, { font-size: smaller !important; } #propagator-do_tekstu { color: #dcdcdc; } #footer p { font-size: xx-small; margin-top: 0; margin-bottom: .3em; } </style><![endif]-->');
d.write('<!--[if lte IE 5.5000]><style type="text/css"> sub, sup { font-size: x-small; direction: ltr; } #propagator-do_tekstu, #propagator, #polecamy, dl#notka_autorska, #footer address { font-size: xx-small !important; } #podobne-blok { font-size: 64% !important; } #podobne-blok .nav { font-size: 100% !important; } </style><![endif]-->');
d.write('<!--[if lte IE 5.2]><style type="text/css"> caption { text-decoration: none; } sub, sup { font-size: x-small; text-decoration: none; } .foto-blok { padding-top: 1em !important; }#komentarze { margin-top: 1.6em !important; } #komentarze li { margin-top: -1.5em !important; border-bottom: solid 20px #e7e7d7; } #komentarze li .skocz { display: none; } #content { padding-top: 1em; border-bottom: 0; padding-bottom: 1em; } .note, dl#notka_autorska { text-align: left !important; } .nav ul li { -ie-xp: expression(this.parse ? 0 : ((bugFix = this.insertAdjacentText("afterBegin", "")),this.insertAdjacentText("beforeEnd", " · "),this.parse = 1)); color: #fff; }</style><![endif]-->');


if (lo == "/foto/" || lo == "/foto/index.html") {
 d.write('<!--[if lte IE 8]><style type="text/css"> ul#foto-lista + p img { cursor: default; } </style><![endif]-->');
 d.write('<!--[if IE 7]><style type="text/css"> body { max-width: 68em; } [title="Szukaj w serwisie"] { margin-top: -1.2em; } #propagator { color: #777; } </style><![endif]-->');
 d.write('<!--[if lte IE 6]><style type="text/css"> #footer { color: #777 !important; } #foto-lista { font-size: 84%; font-weight: normal; } #foto-lista li { display: block; } #propagator { margin-top: -.5em; color: #c1bfb1; } </style><![endif]-->');
 d.write('<!--[if lte IE 5.2]><style type="text/css"> .nav ul li { color: #fff; } </style><![endif]-->');
}


if (lo == "/szukaj/" || lo == "/szukaj/index.html") {
 d.write('<!--[if lte IE 6]><style type="text/css"> div#content { padding-bottom: 3.5em !important; } </style><![endif]-->');
}


// Podkreśla znacznik abbr (błąd ie).
d.write('<!--[if lte IE 6]><style type="text/css"> abbr, acronym, span.abbr { border-bottom: 1px dashed #999; } </style><![endif]-->');
function abbrStart() {
var oldBodyText, newBodyText, reg
oldBodyText = d.body.innerHTML;
reg = /<ABBR([^>]*)>([^<]*)<\/ABBR>/g;
newBodyText = oldBodyText.replace(reg, "<ABBR $1><SPAN class=\"abbr\" $1>$2</SPAN></ABBR>");
d.body.innerHTML = newBodyText;
} // startuje po wywołaniu w w.onload


// Ustawia marginesy po prawej i lewej jeśli szerokość ekranu jest większa od 800 itd.
if (800 < se) {
 d.write('<!--[if lte IE 6]><style type="text/css"> html { padding-left: 10%; padding-right: 10%; } </style><![endif]--> <!--[if lte IE 5.5000]><style type="text/css"> body { padding-left: 10%; padding-right: 10%; } </style><![endif]--> <!--[if lte IE 5.2]><style type="text/css"> .nav ul li ul { right: 15%; } </style><![endif]-->');
}
if (1024 < se) {
 d.write('<!--[if lte IE 6]><style type="text/css"> html { padding-left: 14%; padding-right: 14%; } </style><![endif]--> <!--[if lte IE 5.5000]><style type="text/css"> body { padding-left: 14%; padding-right: 14%; } </style><![endif]--> <!--[if lte IE 5.2]><style type="text/css"> .nav ul li ul { right: 15%; } </style><![endif]-->');
}
if (1152 < se) {
 d.write('<!--[if lte IE 6]><style type="text/css"> html { padding-left: 17%; padding-right: 17%; } </style><![endif]--> <!--[if lte IE 5.5000]><style type="text/css"> body { padding-left: 17%; padding-right: 17%; } </style><![endif]--> <!--[if lte IE 5.2]><style type="text/css"> .nav ul li ul { right: 23%; } </style><![endif]-->');
}
if (1280 < se) {
 d.write('<!--[if lte IE 6]><style type="text/css"> html { padding-left: 19%; padding-right: 19%; } </style><![endif]--> <!--[if lte IE 5.5000]><style type="text/css"> body { padding-left: 19%; padding-right: 19%; } </style><![endif]--> <!--[if lte IE 5.2]><style type="text/css"> .nav ul li ul { right: 23%; } </style><![endif]-->');
}
if (1360 < se) {
 d.write('<!--[if lte IE 6]><style type="text/css"> html { padding-left: 20%; padding-right: 20%; } </style><![endif]--> <!--[if lte IE 5.5000]><style type="text/css"> body { padding-left: 20%; padding-right: 20%; } </style><![endif]--> <!--[if lte IE 5.2]><style type="text/css"> .nav ul li ul { right: 29%; } </style><![endif]-->');
}
if (1400 < se) {
 d.write('<!--[if lte IE 6]><style type="text/css"> html { padding-left: 21%; padding-right: 21%; } </style><![endif]--> <!--[if lte IE 5.5000]><style type="text/css"> body { padding-left: 21%; padding-right: 21%; } </style><![endif]--> <!--[if lte IE 5.2]><style type="text/css"> .nav ul li ul { right: 29%; } </style><![endif]-->');
}
if (1440 < se) {
 d.write('<!--[if lte IE 6]><style type="text/css"> html { padding-left: 24%; padding-right: 24%; } </style><![endif]--> <!--[if lte IE 5.5000]><style type="text/css"> body { padding-left: 24%; padding-right: 24%; } </style><![endif]--> <!--[if lte IE 5.2]><style type="text/css"> .nav ul li ul { right: 29%; } </style><![endif]-->');
}
if (1600 < se) {
 d.write('<!--[if lte IE 6]><style type="text/css"> html { padding-left: 25%; padding-right: 25%; } </style><![endif]--> <!--[if lte IE 5.5000]><style type="text/css"> body { padding-left: 25%; padding-right: 25%; } </style><![endif]--> <!--[if lte IE 5.2]><style type="text/css"> .nav ul li ul { right: 32%; } </style><![endif]-->');
}
if (1680 < se) {
 d.write('<!--[if lte IE 6]><style type="text/css"> html { padding-left: 29%; padding-right: 29%; } </style><![endif]--> <!--[if lte IE 5.5000]><style type="text/css"> body { padding-left: 29%; padding-right: 29%; } </style><![endif]--> <!--[if lte IE 5.2]><style type="text/css"> .nav ul li ul { right: 34%; } </style><![endif]-->');
}


// Ładowanie zdjęć i niektórych styli dla zdjęć.
if (lo != "/foto/") { // ale oprócz strony.
 if (lo != "/foto/index.html") { // ale oprócz strony.
  if (ls == "/foto/") { // ale na podstronach zawierających ciąg znaków.

   d.write('<!--[if lte IE 7]><style type="text/css"> #ustawienia { display: none; } #stopko_propagowanie { margin-bottom: -1.3em !important; } #nadstopko_propagowanie_a_ie { margin-top: 0 !important; } </style><![endif]-->');
   d.write('<!--[if lte IE 6]><style type="text/css"> #dopisek-foto { border-top: 0 !important; margin-top: .9em !important; } #footer { color: #777 !important; } #footer address { margin-top: -1.3em !important; } div span#opis-foto { font-size: 100%; } div h1 { margin-right: .1em; } ul li ul { text-align: right; font-size: 60%; font-family: verdana; margin: 0; position: absolute; top: 2.3em; } div { margin-top: -.9em; } #content ul { font-weight: bold; margin: 0; padding: 0; } #content ul li { display: inline !important; line-height: 1.5em; margin: 0; } #content ul a:link { color: #777; border: solid 1px #ccb; background-color: #fff; padding: 0 .5em 0 .5em; margin: 0; text-decoration: none; } #content ul a:visited { color: #e7e7d7; border: solid 1px #e7e7d7; background-color: #fff; padding: 0 .5em 0 .5em; margin: 0; text-decoration: none; } #content ul a:hover { color: #fff; border: solid 1px #777; outline: solid 0px #777; background-color: #928d7c; padding: 0 .5em 0 .5em; margin: 0; text-decoration: none; } #content ul a:active { color: #090; border: solid 1px #090; outline: solid 0px #090; background-color: #ffa; padding: 0 .5em 0 .5em; margin: 0; text-decoration: none; } ul li ul li a:link { color: #777; } ul li ul li a:visited { color: #777; } ul li ul li a:active { background-color: #ffa !important; color: #090 !important; } ul li ul li a:hover { background-color: #777; color: #fff; } </style><![endif]-->');
   d.write('<!--[if lte IE 5.2]><style type="text/css"> .nav ul li { color: #fff; } </style><![endif]-->');

 if (d.images) {
    function prefotoStartIE() {
     var scr_pref=d.createElement("script");
      scr_pref.type="text/javascript";
      scr_pref.src="http://www.geocontext.mobi/arkusze/dodatki/foto-preload/foto-preload.js";
      d.getElementsByTagName("head")[0].appendChild(scr_pref);

       if (ie && wer >= 7) {
        // wstawia reklamę pod wykazem numerów zdjęć
        var rnfooter_p_ie = d.createElement("p");
        rnfooter_p_ie.setAttribute("id", "nadstopko_propagowanie_ie");
        rnfooter_p_ie.style.cssText = "font-size: xx-small; font-family: verdana, sans-serif; color: #777; margin: 1em 0 0 0; text-align: right; float: right;";
        rnfooter_p_ie.appendChild(d.createTextNode("Reklama: "));

        var wstawReklamepowyzejfooter_ie = d.getElementById("footer");
        var parentR_ie = wstawReklamepowyzejfooter_ie.parentNode;
        parentR_ie.insertBefore(rnfooter_p_ie, wstawReklamepowyzejfooter_ie);

         var objre = d.createElement("span");
         d.getElementById("nadstopko_propagowanie_ie").appendChild(objre);
         objre.style.cssText = "margin-left: 9px; border: 0; display: block;";
         objre.innerHTML = "<!--[if lte IE 8]><iframe frameborder=0 scrolling=no height=150 width=180 src=http://www.geocontext.mobi/arkusze/propagowanie/do_zdj.html></iframe><![endif]-->";

     }
    }
   }
  }
 }
}


// Rozpoznaje strony /foto/
if (ie && wer <= 6) {
 if (ls == "/foto/") { // na podstronach zawierających ciąg znaków
  if (we > 1024) {
   d.write('<!--[if lte IE 6]><style type="text/css"> h1 img { height: 370px; } </style><![endif]-->');
  }
  if (we > 800) {
   if (we <= 1024) {
    d.write('<!--[if lte IE 6]><style type="text/css"> h1 img { height: 370px; } </style><![endif]-->');
   }
  }
  if (we > 600) {
   if (we <= 800) {
    d.write('<!--[if lte IE 6]><style type="text/css"> h1 img { height: 370px; } </style><![endif]-->');
   }
  }
  if (we > 480) {
   if (we <= 600) {
    d.write('<!--[if lte IE 6]><style type="text/css"> h1 img { height: 310px; } </style><![endif]-->');
   }
  }
  if (we <= 480) {
   d.write('<!--[if lte IE 6]><style type="text/css"> h1 img { height: 190px; } </style><![endif]-->');
  }
 }
}


// A tu skrypt ze strony: http://riddle.jogger.pl/2007/05/22/wykonywanie-skryptow-po-zaladowaniu-dom/
// Przyśpiesza wczytywanie DOM i minimalizuje efektu opóźnionego ładowania niektórych elementów.
// Wywaliłem wszystko co nie dotyczy ie.

d.write('<script id="_defer" defer="true" src="//:"><\/script>');

function documentReady(callback) {
 var deferScript = d.getElementById("_defer");
  if (deferScript) {
   deferScript.onreadystatechange = function() {
    if (this.readyState == "complete") {
     callback();
    }
   };
   deferScript.onreadystatechange();
   deferScript = null;
  }
 w.onload = callback;
}

function init() {
 if (arguments.callee.done) { return; }
 arguments.callee.done = true;


   // a tu są wywoływane funkcje do uruchomienia
  // your code:


if (ie && wer <= 6) {
 abbrStart();

// style na wszystkich stronach dla elementu nad znacznikiem hr - na większości stron jest to dolne meni w znaczniku ul
d.getElementsByTagName("hr")[0].previousSibling.style.cssText = "font-weight: normal !important; font-size: x-small; margin: 1.8em 0 -.2em 0 !important;";
}


if (ie && wer <= 5.5000) {
// style na wszystkich stronach dla elementu nad znacznikiem hr - na większości stron jest to dolne meni w znaczniku ul
d.getElementsByTagName("hr")[0].previousSibling.style.cssText = "font-size: 64% !important; margin: 1.8em 0 -.2em 0 !important;";
}


if (lo != "/foto/") { // ale oprócz strony
 if (lo != "/foto/index.html") { // ale oprócz strony
  if (ls == "/foto/") { // ale na podstronach zawierających ciąg znaków
  if (ie && wer <= 6) {
   d.getElementsByTagName("ul")[3].style.cssText = "display: none;";
   }

   if (d.images) {
    prefotoStartIE();
   }

   if (ie && wer > 6) { // jeśli więcej niż ie6
    fotoStart();
   }

  }
 }
}


if (ie && wer <= 6) {
 if (lo == "/foto/" || lo == "/foto/index.html") {
  d.getElementsByTagName("hr")[0].previousSibling.style.cssText = "display: none;";
 }
}


if (lo == "/foto/") {
 bodySizefoto();
}

if (lp == "/sklep/geograficzno-przyrodniczy/") {
 koloruj_a();
 roznefunc();
 kliknij();
}


if (ie && wer >= 7) {
 if (lo != "/index.html") { // ale oprócz strony.
  if (ls != "/foto/") { // ale oprócz stron zawierających ciąg znaków.
   if (ls != "/arkus") { // ale oprócz stron zawierających ciąg znaków.
    if (ll != "/my/") { // ale oprócz stron zawierających ciąg znaków.
     if (lp != "/sklep/geograficzno-przyrodniczy/") { // ale oprócz stron zawierających ciąg znaków.
      szybkiInfoBoksStart();
     }
    }
   }
  }
 }
}


// Wstawia reklme w iframe bo ie nie obsługuje object
if (ie && wer <= 8) {
if (d.getElementById("propagator-do_tekstu")) {
 var ps = d.createElement("span");
 d.getElementById("propagator-do_tekstu").appendChild(ps);
 ps.style.cssText = "display: block;";
 ps.innerHTML = "<!--[if gte IE 5]><iframe frameborder=0 scrolling=no height=150 width=180 src=http://www.geocontext.mobi/arkusze/propagowanie/do_zdj.html></iframe><![endif]-->";
}

if (d.getElementById("propagator")) {
 var pr = d.createElement("span");
 d.getElementById("propagator").appendChild(pr);
 pr.style.cssText = "display: block;";
 pr.innerHTML = "<!--[if gte IE 5]><iframe frameborder=0 scrolling=no height=150 width=180 src=http://www.geocontext.mobi/arkusze/propagowanie/do_zdj.html></iframe><![endif]-->";
}
}


};
documentReady(init);


@end @*/
} // Koniec skryptów dla ie
