
// function that makes the web flexible

function widthFix(){
         
    var docWidth = $(document).width();
    var leftPane = docWidth - 250;
    var headerMoveReal = 1250 - docWidth;
    var headerMoveFix = -20 - headerMoveReal;
    
    // nastaveni sirky obsahu
    if(docWidth > 1250) {
        $("#web").css("width", "1250px");
        $("#left").css("width", "948px");
        $("body").css("overflow-x", "hidden");
    }
    else if (docWidth < 994) {
        $("#web").css("width", "994px");
        $("#left").css("width", "744px");
        $("body").css("overflow-x", "auto");
    }
    else {
        $("#web").css("width", docWidth+"px");
        $("#left").css("width", leftPane+"px");
        $("body").css("overflow-x", "hidden");
    }
    
    //posunuti pozadi v hlavicce
    if (docWidth < 1278) {
        $("#header").css("background-position", headerMoveFix+"px 0px");
    }
    
    //posunuti pozadi v hlavicce
    if (docWidth > 1200) {
        $("#cover").css("width", "1200px");
    }
    
    //alert (docWidth);
    //alert (headerMoveFix);
             
}    


window.onresize = function(){
  widthFix();
}

$(document).ready(function() {

  widthFix();
                
	$('.thickbox').lightBox({
   fixedNavigation:true,
   imageLoading: 'http://www.manualy.eu/workspaces/manualy.eu/templates/js/lightbox/lightbox-ico-loading2.gif',
   imageBtnClose: 'http://www.manualy.eu/workspaces/manualy.eu/templates/js/lightbox/lightbox-btn-close.gif',
   imageBtnPrev: 'http://www.manualy.eu/workspaces/manualy.eu/templates/js/lightbox/lightbox-btn-prev.gif',
   imageBtnNext: 'http://www.manualy.eu/workspaces/manualy.eu/templates/js/lightbox/lightbox-btn-next.gif',
   overlayBgColor: '#a1aabc',
   overlayOpacity: 0.6
  });
  
});

// $(document).resize(function(){
// 
//   widthFix();
// 
// });




        
// "javascript bez javascriptu" - otevirani odkazu v novem okne - v html pro odkaz pouzijeme class="popup"

function aktualizujOdkazy() {
  if(!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if(links[i].className.match("popup")) {
      links[i].onclick = function () {
        return !window.open(this.href);
      }
    }
  }
}
window.onload=aktualizujOdkazy;
