  //VARIABLE FOR BANNER
 //SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
 var popupStatus = 0;

//IMAGES PRELOAD



function really(question)
{
	if (confirm(question)) return true;
	else return false;
}

function zmenObrazok(path)
{
	var newImage = new Image();
	newImage.src = path;
	
	alert(newImage.src);

	$('hlavnyObrazok').src=newImage;
	
}


function mycarousel_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > mycarousel_itemList.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(mycarousel_getItemHTML(mycarousel_itemList[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
    }
};


function mycarousel_itemLoadCallback2(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > mycarousel_itemList2.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(mycarousel_getItemHTML2(mycarousel_itemList2[i-1])).get(0);

        // Apply thickbox
        //tb_init(item);

        carousel.add(i, item);
    }
};
/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    var url_m = item.url.replace(/_s.jpg/g, '_m.jpg');
    return '<a href="' + url_m + '" title="' + item.title + '"><img src="' + item.url + '" width="220" height="128" border="0" alt="' + item.title + '" /></a>';
};

function mycarousel_getItemHTML2(item)
{
        
    
    return ' <div class="box"><a href="' + item.title + '"><img src="' + item.url + '" width="125" height="53" border="0"  /></a></div>';
};



  
//=================================================================================================
//======banner
//=================================================================================================
  
  /***************************/
//@Author: Adrian "yEnS" Mato Gondelle
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/
 

//loading popup with jQuery magic!
function loadPopup(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupContact").fadeIn("slow");
		
		//BANNER ISSUE
		$("#content").fadeOut("slow");
		$("#adsPanel").fadeOut("slow");		
		//BANNER ISSUE END
		
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupContact").fadeOut("slow");
		
		//BANNER ISSUE
		$("#content").fadeIn("slow");
		$("#adsPanel").fadeIn("slow");
		//BANNER ISSUE END
		
		popupStatus = 0;
	}
}

//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact").height();
	var popupWidth = $("#popupContact").width();
	//centering
	$("#popupContact").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}


function showBanner(){
			//centering with css
			centerPopup();
			//load popup
			loadPopup();
		}

//=================================================================================================
//======jquery
//=================================================================================================

  $(document).ready(function()
  {

        $("#infolineRss").load("./include/get-rss.php");//CHYBA???????

        $("ul.sf-menu").superfish({ 
            pathClass:  'current',
            delay:         500,
            autoArrows:    false,     
            disableHI:     true,  
            onBeforeShow: function()
            {
                this.css("margin-left",this.parent().attr("value")+"px");
            }
        }); 
        $("ul.sf-menu li.sf-breadcrumb ul").css("margin-left",$("ul.sf-menu li.sf-breadcrumb").attr("value")+"px");
        
        
        
        /*
        $(".sf-menu li a").mouseover(function()
        {
 
              $(this,".leftHover").css("visibility","visible");
              $(".sf-menu li .rightHover").css("visibility","visible");
        });
        
        $(".sf-menu li a").mouseout(function()
        {
              $(".sf-menu li .leftHover").css("visibility","hidden");
              $(".sf-menu li .rightHover").css("visibility","hidden");
        });

 */

  });
  
  