$('html').addClass('js');

$(function(){
  
  //************************ IE6 ***/
  if(typeof document.body.style.maxHeight === 'undefined') {
    DD_belatedPNG.fix('#content, #content-main');
  }
  
  //************************ Fancybox ***/
  $('#gallery a').lightBox();
  
  //************************ GMap ***/
  $("#nav-main #location a").click(function(){
        $('body').append('<div id="gmap-overlay"></div><div id="gmap"></div>');
        $(window).height() > $('body').outerHeight(true) ? transp = $(window).height() : transp = $('body').outerHeight(true)
        $('#gmap-overlay').css({'width':'100%','height':transp,'opacity':.8});
        $('#gmap').css({ 'top':$(window).height()/2, 'margin-top':-($('#gmap').outerHeight(true)/2), 'margin-left':-($('#gmap').outerWidth(true)/2) });
        $(document).bind('click keydown',function(e){
           var code = (e.keyCode ? e.keyCode : e.which);
           var clicked = $(e.target);
           if (clicked.is('#gmap-overlay, #gmap .close') || code === 27) {
            $('#gmap-overlay, #gmap').fadeOut(300,function(){ $(this).remove(); });
           }
        });
        $('#gmap-overlay, #gmap').hide().fadeIn(300,function(){ $('#gmap').html('<iframe src="lokacija.html" width="480" height="480" frameborder="0" scrolling="no" /><a class="close">Zatvori</a>'); });
        return false;
      });
  
  //************************ Floating banner ***/
   //$('#floating-banner').html('<embed src="flash/banner_valentinovo.swf" width="430" height="320" wmode="transparent" /><a>Zatvori</a>');
   /*$('#floating-banner').html('<img src="images/floating_banner_072010.png" alt="" />');*/
   /*$('#floating-banner').click( function(){ $(this).remove(); }); */
   
});

$(document).ready(function() {
	$('#floating-banner-close').click(function(){
		$('#floating-banner').hide();
	});
});
