﻿// JavaScript Document
function ZmienObrazek(id,plik,typ)
{
if(typ=='on')
{
var dot=plik.indexOf('_');
document.getElementById(id).src=plik.substring(0,dot)+'.jpg';
document.getElementById(id+'h').className='lewe_menu';
}
else
{
document.getElementById(id).src=plik;
document.getElementById(id+'h').className='lewe_menu1';
}
}

function wysz(prefix) {
    var rodz = document.getElementById("ctl00_lstRodzaje");

    rodz.onclick = function() {
       var pok = document.getElementById("ctl00_trpokoje");
            
       if (this.value == "2") {
           pok.style.visibility = "hidden";
           pok.style.display = "none";
       } else {
           pok.style.visibility = "visible";
           pok.style.display = "table-row";
       }
    };
}

function kalk() {
        if (document.getElementById("c_n")) {
            kalkinit();
        } else {
            if (document.getElementById("kwota")) {
                kalkinit2();
            }
        }
}

function pokaz(blok,td) {
       document.getElementById(blok).style.visibility="visible";
       document.getElementById(td).style.cursor="pointer";
//       odslon(blok,0);
}
function odslon(blok,bottom) {
       var max=200;

       if (bottom<max) {
           document.getElementById(blok).style.clip="rect(auto,500,"+bottom+",auto)";
           bottom++;
           setTimeout("odslon('"+blok+"',"+bottom+")",1);
       }
}
function ukryj(blok,td) {
       document.getElementById(blok).style.visibility="hidden";
}
function podmenu_over(id) {
       document.getElementById(id).style.color="#ffff00";
}
function podmenu_out(id) {
       document.getElementById(id).style.color="#ffffff";
}

function ukryj_wyszukiwarke(id)
    {
        ukryj(id);
//        alert(stan);
//        stan = (document.getElementById(id).style.display == "none") ? true : false;
//        document.getElementById(id).style.display = (stan) ? "block" : "none";

        //stan = (document.getElementById(id).style.display == "none") ? true : false;
        
        //if (stan == false) document.getElementById('javascript_hiding').innerHTML = "ukryj wyszukiwarkę";
        //if (stan == true) document.getElementById('javascript_hiding').innerHTML = "pokaż wyszukiwarkę";

//        if (document.getElementById(id).value == "Hide") 
//            {
//                document.getElementById(id).value = "Show";
//                document.getElementById('javascript_hiding').innerHTML = "ukryj wyszukiwarkę";
//            }
//        else 
//            {
//                document.getElementById(id).value = "Hide";        
//                document.getElementById('javascript_hiding').innerHTML = "pokaż wyszukiwarkę";
//            }
    }
    
function ukryj(id)
    {
        stan = (document.getElementById(id).style.display == "none") ? true : false;
        document.getElementById(id).style.display = (stan) ? "block" : "none";
        document.getElementById(id).style.position = "static";
    }    

function ukryj_formularz_kontaktowy(id)
    {
        stan = (document.getElementById(id).style.display == "none") ? true : false;
        document.getElementById(id).style.display = (stan) ? "block" : "none";
        document.getElementById(id).style.position = "static";
        

        stan = (document.getElementById(id).style.display == "none") ? "Rozwiń" : "Zwiń";
        document.getElementById('formularz_kontaktowy_link').innerHTML = stan;
        
    } 

function podmiana(zakladka)
    {

        document.getElementById('zakladka_szczegolowe_dane').style.display = "none";
        document.getElementById('zakladka_opis').style.display = "none";
        document.getElementById('zakladka_mapa').style.display = "none";


        if (zakladka == 1) document.getElementById('zakladka_szczegolowe_dane').style.display = "block";
        if (zakladka == 2) document.getElementById('zakladka_opis').style.display = "block";
        if (zakladka == 3) document.getElementById('zakladka_mapa').style.display = "block";

        if ($('zakladka_1').hasClassName("active"))
            {        
                $('zakladka_1').removeClassName('active');
                $('zakladka_1').toggleClassName('unactive');
            }
        if ($('zakladka_2').hasClassName("active"))
            {        
                $('zakladka_2').removeClassName('active');
                $('zakladka_2').toggleClassName('unactive');
            }
        if ($('zakladka_3').hasClassName("active"))
            {        
                $('zakladka_3').removeClassName('active');
                $('zakladka_3').toggleClassName('unactive');
            }
            
        if (zakladka == 1)
            {
                $('zakladka_1').removeClassName('unactive');
                $('zakladka_1').toggleClassName('active');
            }    
        if (zakladka == 2)
            {
                $('zakladka_2').removeClassName('unactive');
                $('zakladka_2').toggleClassName('active');
            }    
        if (zakladka == 3)
            {
                $('zakladka_3').removeClassName('unactive');
                $('zakladka_3').toggleClassName('active');
            }    
            
            
    }
    
    function wirtualna_wycieczka(w,h,webi)
        {
            var iMyWidth;
            var iMyHeight;
            var wWidth = w;
            var wHeight = h;
            var swfWidth = w-20;
            var swfHeight = h-20;
            iMyWidth = (window.screen.width/2) - wWidth/2;
            iMyHeight = (window.screen.height/2) - wHeight/2;
            var win2 = window.open("","Window2","status=no,height="+wHeight+",width="+wWidth+",resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no");
            win2.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\" /><title></title></head><body bgcolor=\"#F2EFE6\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+swfWidth+"\" height=\""+swfHeight+"\" id=\"fileUploader\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\""+webi+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#F2EFE6\" /><embed src=\""+webi+"\" quality=\"high\" bgcolor=\"#F2EFE6\" width=\""+swfWidth+"\" height=\""+swfHeight+"\" name=\"fileUploader\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object></body></html>");
            win2.focus();
        }
