function pokaz(blok,td) {
       document.getElementById(blok).style.visibility="visible";
       document.getElementById(td).style.cursor="pointer";
}

function GO(url){
	document.location.href=url;
}

function Browser() {
  var ua,s,i;
  this.isIE=false; this.isOP=false; this.isNS=false;
  this.version=null;
  ua = navigator.userAgent;
  s="Opera";		if ((i = ua.indexOf(s)) >= 0) {this.isOP = true;this.version=parseFloat(ua.substr(i + s.length));return;}
  s="Netscape6/";	if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;this.version = parseFloat(ua.substr(i + s.length));return;}
  s="Gecko";		if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;this.version = 6.1;return;}
  s="MSIE";			if ((i = ua.indexOf(s))) {this.isIE = true;this.version = parseFloat(ua.substr(i + s.length));return;}
}

function GoOf(i){
    document.location.href="oferta.aspx?id="+String(i);
}

// oferta.js //

var scroll=0;
var scrollValue = 0;
var scrollrodzaj=1;
var gal=document.getElementById("galeria");

function scrolldown(i){
	scroll=1;
	scrollrodzaj=i;	
}
function scrollout(){
	scroll=0;	
}
function startscroll(){
	gal=document.getElementById("galeria");
	var dcx=window.setInterval("step()",50); 
	
	scrollValue = 0;
}
function step(){
	if (scroll==1){
	    gal=document.getElementById("galeria");
	    
	    scrollValue += scrollrodzaj;
	    
	    if (scrollValue < 0) scrollValue = 0;
	    gal.style.marginTop = -scrollValue*20 + "px"	 
	}
}

function Taba(i,prefix){
	if (!prefix)prefix="";
	var x=document.getElementById(prefix+"tab"+String(i));
	if (x.style.display!="block"){x.style.display="block"} else {x.style.display="none"};
}
function Pokaz(o){
	var x=document.getElementById(o);
	if (x.style.display!="block"){x.style.display="block"} else {x.style.display="none"};
}
function Big(i){
	window.open("virgobig.ashx?"+String(i));

}
function OpenMap(i){
	var de=window.open("mapa.aspx?id="+i,"","width=600,height=400")
}

function ShowPrint(i){
	var w=window.open("wydruk.aspx?id="+i,"","width=700,scrollbars=yes,resizable=yes,menubar=yes ");
}

    function hideTab($tabId) {
        document.getElementById('ctl00_cntMain_div' + $tabId).style.display = "none";
        document.getElementById('ctl00_cntMain_div' + $tabId).className = "";
    }
    function hideTabs() {
        hideTab('Brief');
        hideTab('Main');
        hideTab('Map');
        hideTab('Form');
    }
    
    function showTab($tabId) {
        hideTabs();
        document.getElementById('ctl00_cntMain_div' + $tabId).style.display = "block";
        document.getElementById('ctl00_cntMain_div' + $tabId).attributes["class"] = "selected";
    }
    
    function openWin( windowURL, windowName, windowFeatures ) { 
	    return window.open( windowURL, windowName, windowFeatures ) ; 
	}
	
	function SetNotatnikCount() {    
	    var c = readCookie('notatnik');

	    if (c != null) {
	        var idx_count = 0;
	        var idx = c.split(",");
    	    
	        for (i=0; i<idx.length; i++)
	            if (idx[i] > 0) 
	                idx_count++;
    	    
    	    if (idx_count > 0)
    	        if ($('NotatnikCount') != null) {
	                $('NotatnikCount').innerHTML = idx_count;
	            }
	        else
	            if ($('NotatnikCount') != null) {
	                $('NotatnikBox').hide();
	            }
	    } else {
	        if ($('NotatnikBox') != null) $('NotatnikBox').hide();
	    }
	}
