// JavaScript Document


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

window.onload = function() {
	MM_preloadImages('../images/ico_zamow_ov.gif','../images/ico_pobierz_ov.gif','../images/ico_napisz_ov.gif','../images/ico_porozmawiaj.gif');
}

function przenies(link) {
        document.location=link;
}
 
 function otworzOkno(plik,nazwa,a,b) {
        oknoNowe = window.open(plik,nazwa,'resizable=yes,  scrollbars=yes, width='+a+', height='+b+', status=yes, menubar=yes, location=no')
}

function open_window(imageName,alt) {
        newWindow = window.open("","okno","width=20,height=20,left=50,top=50");
        newWindow.document.open();
        newWindow.document.write('<html><title>'+alt+'</title>');
        newWindow.document.write('<script TYPE="text/javascript">');
        newWindow.document.write('function dopasuj() {szer = document.fotografia.width;wys = document.fotografia.height;top.window.resizeTo(szer+10,wys+60);  napis.style.display = "none"; napis2.style.display = ""}');
        newWindow.document.write('</script>');        
        newWindow.document.write('<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"  onLoad="dopasuj();">'); 
        newWindow.document.write('<center>');        
        newWindow.document.write('<div id="napis"><p style="font-family: Verdana,Tahoma,Arial; font-size: 11px; color: #ffffff; margin:10;">Otwieram plik...</p></div>');          
        newWindow.document.write('<img src='+imageName+' name="fotografia" alt='+alt+'>'); 
        newWindow.document.write('<div id="napis2" style="display: none" align="center"><a href="javascript: window.print()" style="font-family: Verdana,Tahoma,Arial; font-size: 11px; color: #ffffff; margin:10;">[ Drukuj ]</a>&nbsp;&nbsp;<a href="javascript: window.close()" style="font-family: Verdana,Tahoma,Arial; font-size: 11px; color: #ffffff; margin:10;">[ Zamknij ]</a></div>');                           newWindow.document.write('</center>');          
        newWindow.document.write('</body></html>');
        newWindow.document.close();
        newWindow.focus();
}



function whichname()
{
var bname = navigator.appName;
alert("Twoja przeglądarka to" + bname);
alert(navigator.appCodeName);
} 


//////////////////////////////////////// PHOTO GALLERY 1.4.1  by Łukasz Olechowski PROVIDER
//Źródła zawarte w tym pliku są własnością autora oraz firmy PROVIDER.
//Zabrania się rozpowszechniania,używania tego źródła w celach komercyjnych oraz dokonywania jakich kolwiek zmian w częsci lub w całości źródła
//Jakiekolwiek ich rozpowszechnianie lub użycie bez zezwolenia jest regulowane ustawą o prawach autorskich.

function showlupa(name,e) {
document.getElementById(name).style.display = '';
return false; 
}
function hidelupa(name,e) {
document.getElementById(name).style.display = 'none';
return false; 
}
function popup(parametr,name,nazwa,des,e) {
var szer='';
var wys='';
var szerokosc = document.body.clientWidth ;
var wysokosc = document.body.clientHeight ; 
var top='';
var left='';
var div=document.getElementById('image_show');
var master_width='';
var bodyWidth='';
var bodyHeight='';
var realwidth='';
if(navigator.appName=='Microsoft Internet Explorer'){
  bodyWidth = document.body.scrollWidth;
  bodyHeight = document.body.scrollHeight
}
else{
  bodyWidth  = document.documentElement.clientWidth;
  bodyHeight = document.documentElement.clientHeight;
}
document.getElementById('bg').style.width = bodyWidth;
document.getElementById('bg').style.height = bodyHeight;
document.getElementById('bg').style.display = '';
document.getElementById('okno').style.display = 'none';

///if (document.documentElement) {
 //IE6 +4.01
  //      top=document.documentElement.scrollTop;
  //      left=document.documentElement.scrollLeft;
//}
//else {
        top=document.body.scrollTop;
        left=document.body.scrollLeft;     
//};
        var img=new Image();
        img.onload=function() {
                  if(navigator.appName=='Microsoft Internet Explorer'){
                    document.getElementById('image_show').innerHTML = '<img src='+parametr+' name="img_div" id="img_div" border=1 style="border: 1px solid Black;">';
                    szer = document.all['img_div'].width;
                    document.getElementById('okno').style.width = szer+30; 
                    realwidth=img.width-30;
                    document.getElementById('okno').style.top = ((wysokosc/2)-((img.height/2)-top))-20;
                    document.getElementById('okno').style.left = (bodyWidth/2)-(realwidth/2);    
                  }else{
                      div.style.width=(img.width);                 
                      master_width=img.width; 
                      document.getElementById('okno').style.top = ((wysokosc/2)-((img.height/2)-top))-20;
                      document.getElementById('okno').style.left = (bodyWidth/2)-((master_width-30)/2);
                      div.style.height=(img.height)+'px';        
                      div.getElementsByTagName('img')[0].src=img.src;                
                      document.getElementById('okno').style.width = master_width+30;                
                  }
        }
        img.src=parametr;
document.getElementById('text_show').innerHTML = nazwa ;
document.getElementById(name).style.display = 'none';
//if(navigator.appName=='Microsoft Internet Explorer'){
 // realwidth=img.width-30;
//  document.getElementById('okno').style.top = ((wysokosc/2)-((img.height/2)-top))-20;
//  document.getElementById('okno').style.left = (bodyWidth/2)-(realwidth/2);//}
//document.getElementById('okno').style.top = (e.clientY+top)-260
//document.getElementById('okno').style.left = (e.clientX+left)-250;


//////////////////////////////
if(des!=''){
document.getElementById('des_show').style.display = '';
document.getElementById('space').style.display = 'none';
//////////////////////////////////////////////////////////////////////////////////////////

document.getElementById('href_show').onclick = function(e){
    document.getElementById('bg2').style.width = bodyWidth;
    document.getElementById('bg2').style.height = bodyHeight;
    document.getElementById('bg2').style.display = '';
    
    
    
        var img2=new Image();
        img2.onload=function() {
                  if(navigator.appName=='Microsoft Internet Explorer'){
                    document.getElementById('image_show2').innerHTML = '<img src='+parametr+' name="img_div2" id="img_div2" border=1 style="border: 1px solid Black;">';
                    szer = document.all['img_div2'].width;
                    document.getElementById('okno2').style.width = szer+30; 
                    realwidth=img.width-30;
                    document.getElementById('okno2').style.top = ((wysokosc/2)-((img.height/2)-top))-20;
                    document.getElementById('okno2').style.left = (bodyWidth/2)-(realwidth/2);  
                    
                    document.getElementById('okno_des').style.top = (((wysokosc/2)-((img.height/2)-top))-20)+50;
                    document.getElementById('okno_des').style.left = (bodyWidth/2)-((realwidth-30)/2)+50;
                      
                  }else{
                      div.style.width=(img.width); 
                      master_width=img2.width; 
                      document.getElementById('okno2').style.top = ((wysokosc/2)-((img.height/2)-top))-20;
                      document.getElementById('okno2').style.left = (bodyWidth/2)-((master_width-30)/2);
        
                      document.getElementById('okno_des').style.top = (((wysokosc/2)-((img.height/2)-top))-20)+50;
                      document.getElementById('okno_des').style.left = (bodyWidth/2)-((master_width-30)/2)+50;
         
                      div.style.height=(img.height)+'px';        
                      document.getElementById('image2').src=img2.src;                
                      document.getElementById('okno2').style.width = master_width+30;                
                  }
        }
        img2.src=parametr;
    
    
    
    document.getElementById('okno2').style.display = '';
    document.getElementById('text_show2').innerHTML = nazwa ;
    document.getElementById('des_show2').innerHTML = des ;
    document.getElementById('okno_des').style.display = '';
return false;
} 
/////////////////////////////////////////////////////////////////////////////////
}else{
document.getElementById('space').style.display = '';
document.getElementById('des_show').style.display = 'none';
}
////////////////////////////

document.getElementById('okno').style.display = '';
return false; 
}



function zamknij_div(loading_src)
{
var div=document.getElementById('image_show');
div.getElementsByTagName('img')[0].src=loading_src; 
div.getElementsByTagName('img')[0].style.border= 'none'; 
document.getElementById('okno').style.display = 'none';
document.getElementById('bg').style.display = 'none';
}
function zamknij_div2(loading_src)
{
document.getElementById('bg2').style.display = 'none';
document.getElementById('okno2').style.display = 'none';
document.getElementById('okno_des').style.display = 'none';
}
function zamknij_div3()
{
document.getElementById('okno_des').style.display = 'none';
}
//////////////////////////////////////////////////////////////////////////////////////



//if(navigator.appName=='Microsoft Internet Explorer'){
//}else{
//document.getElementById('image_show').innerHTML = '<img src='+parametr+' name="img_div" id="img_div" border=1 style="border: 1px solid Black;">';
//szer = document.all['img_div'].width;
//document.getElementById('okno').style.width = szer+30;
//}
//alert(parametr); 
//e.clientY+document.body.scrollTop
//document.getElementById('okno').style.top = 300;
//document.getElementById('okno').style.left = (szerokosc/2)-125;
//alert((e.clientY+document.body.scrollTop)-260);
//var roznica=180-((e.clientY+document.body.scrollTop)-260);
//if(roznica>0){
//document.getElementById('okno').style.top = ((e.clientY+document.body.scrollTop)-260)+roznica;
//}else{
//document.getElementById('okno').style.top = (e.clientY+document.body.scrollTop)-260;
//}
//document.getElementById('div_order_no').focus();

//alert(parametr);
//alert(name);
//alert(nazwa);
//document.getElementById('image_show').innerHTML = '<img src='+parametr+' name="img_div" id="img_div" border=1 style="border: 1px solid Black;">';
//szer = document.getElementById('img_div').width;
//alert(szer); 
//alert(document.getElementById('img_div').offsetWidth);
//alert(document.getElementById('img_div').width);
//alert(document.getElementById('img_div').width);

//alert(document.getElementById('img_div').width);
//var ssz = document.getElementById('img_div').width;
//alert(document.getElementById('img_div').naturalWidth);
//alert(document.all['img_div'].width);
//alert(document.images['img_div'].width); 
//alert(document.getElementById('img_div').width);
//var v = document.getElementById('img_div').focus;
//alert(document.images['img_div'].width);


function resize(){
if(navigator.appName=='Microsoft Internet Explorer'){
szer = document.all['img_div'].width;
}else{
document.getElementById('img_div').focus();
szer = 510;
}
document.getElementById('okno').style.width = szer+30;
return false; 
}




