var szerokosc_okna = ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth );
var wysokosc_okna =  ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight );
var margin_left_right=(szerokosc_okna-100)/2;
var margin_top_bottom=(wysokosc_okna-100)/2;
var maxWidth=100;
var maxHeight=100;
var superEndNum=0;


 document.write("<div id='Full_size_1' onclick='close_window_full_size()' style='width:100%;height:100%;margin:0px;position:absolute;display:none;z-index:990;background-color:#000000;filter: alpha(opacity=80); -moz-opacity: 0.8; opacity: 0.8;'>");
 document.write("</div>");
 document.write("<div id='Full_size_2' style='width:150px;height:150px;margin:"+margin_top_bottom+"px "+margin_left_right+"px "+margin_top_bottom+"px;position:absolute;display:none;background-color:#ffffff;font-size:11px;font-family:arial,tahoma;z-index:991;'>");
 document.write("<div id='ZawartoscFullSize'></div>");
 document.write("</div>");
 document.write("<div id='Proloaders_full_size' style='display:none;width:100px;height:100px;margin:"+margin_top_bottom+"px "+margin_left_right+"px "+margin_top_bottom+"px;position:absolute;z-index:992;'><img src='Obrazki/loader.gif' style='margin:25px 25px 25px;'></div>");




function close_window_full_size()
 {
 document.getElementById('Full_size_1').style.display='none';
 document.getElementById('Full_size_2').style.display='none';
 document.getElementById('Full_size_2').style.height=150+"px";
 document.getElementById('Full_size_2').style.width=150+"px";
 document.getElementById('Full_size_2').style.marginTop = margin_top_bottom+"px";
 document.getElementById('Full_size_2').style.marginLeft = margin_left_right+"px";
 document.getElementById('ZawartoscFullSize').innerHTML='';
 superEndNum=0;
 pokazReklamy();
 }

function open_window_full_size(id_zdjecia,nazwa,dlugosc,wysokosc)
 { 
 scroll(0,0);
 document.getElementById('ZawartoscFullSize').innerHTML="<p id='ZawartoscFullSizeTXT' style='filter: alpha(opacity=0); -moz-opacity: 0.0; opacity: 0.0;text-align:left;margin:10px 12px 7px;line-height:20px;'><font style='font-size:16px;font-weight:bold;color:#0381E2;'>"+nazwa+"</font><br/>Zdjęcie zostało skonwertowane tak aby jego długość wynosiła maksymalnie 1024px.</p>";
 document.getElementById('ZawartoscFullSize').innerHTML+="<img id='toZdjecieFullSize' onclick='close_window_full_size()' onload='superStart()' style='margin:4px 10px 10px;display:none;filter: alpha(opacity=0); -moz-opacity: 0.0; opacity: 0.0;' src='Obrazki/"+id_zdjecia+"' alt='' />";
 document.getElementById('Full_size_1').style.display='block';
 document.getElementById('Full_size_2').style.display='block';
 document.getElementById('Proloaders_full_size').style.display='block';
 maxWidth = dlugosc+20;
 maxHeight = wysokosc+65;
 }

function superStart()
 {
 skaluj_X = setInterval("skaluj_Full_size_2_X()", 10);
 }



function skaluj_Full_size_2_X()
 {
 obecnaDlugosc = document.getElementById('Full_size_2').clientWidth;
 obecnaDlugosc = parseInt(obecnaDlugosc);
 obecnaDlugosc = obecnaDlugosc+16;
 obecnyMargines = document.getElementById('Full_size_2').style.marginLeft;
 obecnyMargines = obecnyMargines.replace("px", "");
 obecnyMargines = parseInt(obecnyMargines);
 obecnyMargines = obecnyMargines-8;



 if(obecnaDlugosc>=maxWidth)
  {
  clearInterval(skaluj_X)
  document.getElementById('Full_size_2').style.width=maxWidth+"px";
  skaluj_Y = setInterval("skaluj_Full_size_2_Y()", 10);
  }
 else
  document.getElementById('Full_size_2').style.width=obecnaDlugosc+"px";

 document.getElementById('Full_size_2').style.marginLeft = obecnyMargines+"px";
 }
 
function skaluj_Full_size_2_Y()
 {
 obecnaWysokosc = document.getElementById('Full_size_2').clientHeight;
 obecnaDlugosc = parseInt(obecnaDlugosc);
 obecnaWysokosc = obecnaWysokosc+32;
 obecnyMargines = document.getElementById('Full_size_2').style.marginTop;
 obecnyMargines = obecnyMargines.replace("px", "");
 obecnyMargines = parseInt(obecnyMargines);
 obecnyMargines = obecnyMargines-16;

 MarginesProLoader = document.getElementById('Proloaders_full_size').style.marginTop;
 MarginesProLoader = MarginesProLoader.replace("px", "");
 MarginesProLoader = parseInt(MarginesProLoader);
 MarginesProLoader = MarginesProLoader+16;

 if(obecnaWysokosc>=maxHeight)
  {
  clearInterval(skaluj_Y)
  document.getElementById('Proloaders_full_size').style.display='none';
  document.getElementById('toZdjecieFullSize').style.display='block';
  document.getElementById('Full_size_2').style.height=maxHeight+"px";
  superEndID = setInterval("superEnd()", 40);
  }
 else
  document.getElementById('Full_size_2').style.height=obecnaWysokosc+"px";

 if(obecnyMargines>=50)
  {
  document.getElementById('Full_size_2').style.marginTop = obecnyMargines+"px";

  }
 }

function superEnd()
 {
 superEndNum++;
 if(superEndNum>=21)
  {
  ObiektFullSize=document.getElementById('toZdjecieFullSize');
  ObiektFullSizeTXT=document.getElementById('ZawartoscFullSizeTXT');


if(navigator.appName=='Microsoft Internet Explorer')
 {
 wartosc_filtra = (superEndNum-20)*10;
 ObiektFullSize.style.filter="Alpha(Opacity="+wartosc_filtra+")";
 ObiektFullSizeTXT.style.filter="Alpha(Opacity="+wartosc_filtra+")";
 }
else
if(ObiektFullSize.style.MozOpacity>=0)
 {
 ObiektFullSize.style.MozOpacity=parseFloat(ObiektFullSize.style.MozOpacity)+0.1
 ObiektFullSizeTXT.style.MozOpacity=parseFloat(ObiektFullSizeTXT.style.MozOpacity)+0.1
 }
else 
if(ObiektFullSize.style.opacity>=0)
 {
 ObiektFullSize.style.opacity=parseFloat(ObiektFullSize.style.opacity)+0.1
 ObiektFullSizeTXT.style.opacity=parseFloat(ObiektFullSizeTXT.style.opacity)+0.1
 }
  }
 if(superEndNum>=30)
  clearInterval(superEndID)
 }