var x=0;
    y=0;
    r=0;
    h1=0;
    h2=0;
    lang='';

function pokazHint(x)
{
	document.getElementById('hint').style.visibility=x;
}

function wybierzPlik()
{
	if(document.forms.edytor){document.getElementById('nazwapliku').innerHTML='<h3>'+document.forms.edytor.plik_upload.value+'</h3>';}
}

function load()
{
	if (GBrowserIsCompatible()) {
	  var map = new GMap2(document.getElementById("map"));
	  map.addControl(new GLargeMapControl());
	  var MapTypes = map.getMapTypes();
	  MapTypes[0].getName= function() { return "Mapa";}
	  MapTypes[1].getName = function() { return "Satelitarna";}
	  MapTypes[2].getName = function() { return "Hybrydowa";}
	  map.addControl(new GMapTypeControl());
	  map.setCenter(new GLatLng(51.11093182780932, 17.033185958862305), 16);
          if (lang==''){
                var info='<div style="background-color: #fff; width: 70px; font-size: 11px; FONT-FAMILY: Tahoma, Arial, Sans-Serif;"><B>Restauracja Bernard</B><br/>Wroc&#322;aw Rynek 35 50-102</div>';
          }else{
                var info='<div style="background-color: #fff; width: 70px; font-size: 11px; FONT-FAMILY: Tahoma, Arial, Sans-Serif;"><B>Bernard Restaurant</B><br/>Wroc&#322;aw Rynek 35 50-102</div>';
          }
          var point = new GLatLng(51.1099558, 17.0334698);
	  var marker = new GMarker(point);
	  GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(info);
	  });
	  map.addOverlay(marker);
	  marker.openInfoWindowHtml(info);
	}
}

function delay_load(l)
{
        lang=l;
        if (!l){lang='';}
        setTimeout('load();', 1800);
}

function Start()
{
        wybierz('tresc').overflow='hidden';
        h2=document.getElementById('tresc').scrollHeight;
	h1=0;
	if(h2>450){h2=451;}
	dRamke();
}

function wybierz(id)
{
	var d=document;
	d=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	if(!document.layers)d=d.style;
	return d
}

function dRamke()
{
	with(wybierz('ramka')){top=(195-(h1/2))+'px';};
	with(wybierz('tresc')){height=h1+'px';};
	r=(h2-h1)/6;
	if(h1<h2){h1=h1+r}
	if(h1<h2-0.5){setTimeout('dRamke();', 40)}
        else{
                if(h2>450){fleXenv.fleXcrollMain("tresc");}
                //wybierz('tresc').overflow='auto';
                h1++;
        };
}

function preloadImages()
{
	d=document;
	if(d.images){
		if(!d.MM_p)d.MM_p=new Array();
	       var i,j=d.MM_p.length,a=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];}
	}
}
$(document).ready(function(){
        $('a.lightbox').lightBox({
	       overlayOpacity: 0.5,
	       imageLoading: 'gfx/loading.gif',
	       imageBtnClose: 'gfx/closelabel.gif',
	       imageBtnPrev: 'gfx/prevlabel.gif',
	       imageBtnNext: 'gfx/nextlabel.gif',
	       txtImage: 'Obrazek',
	       txtOf: 'z'
        });
	$("\.sub").hover(function(){
	        $("\.submenu").slideDown(400);
	}, function(){
		$("\.submenu").slideUp(400);
	});
});

