﻿eval("try {document.execCommand('BackgroundImageCache', false, true);} catch(e) {}");

function vytisknoutstranku(tisknout)
{
	document.write('<a href="#" id="print" onclick="window.print();return false;">'+tisknout+'</a></a> <span class="hidden"> | </span>'); 
};


jQuery.noConflict();

jQuery(document).ready( /* jQuery no conflict block */
	function($) {

	}
)

jQuery(document).ready( /* jQuery no conflict block */
	function($) {

  /* Zalozkovy box - tabs */
  // prototype
  $.prototype.makeTabs = function() {
  	var tabs = $("#" + this.attr("id") + " li a");
  	if(tabs.length == 0) return;
  	for (var ti=0; ti < tabs.length; ti++)
  	{
  		$("div[class*='tabs-box-" + $(tabs[ti]).attr("href").substring(1) + "']").hide();
  		$(tabs[ti]).bind("mouseover", function() {
  			for (var tiin=0; tiin < tabs.length; tiin++)
  			{
  				$(tabs[tiin]).removeClass("active");
  				$("div[class*='tabs-box-" + $(tabs[tiin]).attr("href").substring(1) + "']").hide();
  			}
  			$(this).addClass("active");
  			$("div[class*='tabs-box-" + $(this).attr("href").substring(1) + "']").show();
  			return false;
  		});
  	}
  	$("#" + this.attr("id") + " li a:first").addClass("active");
  	$("div[class*='tabs-box-" + $(tabs[0]).attr("href").substring(1) + "']").show();
  }
  // bind
	$("#tabs-box").makeTabs();

  /* END - Zalozkovy box - tabs */

  /* Fivebox */

    $('#fivebox-menu a').each(function (i) {  // nahrazeni bilych znaku za obycejne mezery
		$(this).text($(this).text().replace(/\s/g, " "));
	});
	$('#fivebox-menu a:contains("ČEZ, a. s.")').css("text-transform", "none"); // ČEZ, a. s.
  
    $(".fivebox-box").hide(); // skryj vsechny boxy
	
	if(/^#[1-5]$/.test(location.hash)) { // pomoci kotvy #polozka1 otevrit adekvatni polozku v multiboxu
		var i = location.hash.substr(location.hash.length-1);
		$("#fivebox-"+i).show();
		i = i-1;
		$("#fivebox-menu a:eq("+i+")").addClass("current"); 
	} else { 
		$("#fivebox-1").show();; // zobraz prvni
		$("#fivebox-menu a:eq(0)").addClass("current"); // zvyrazni 1. odkaz
	}

    $("#fivebox-menu a").mouseover(function(){
        var index = $("#fivebox-menu a").index(this) + 1; // item id indexed from 1
//        alert( index );
        $(".fivebox-box").hide(); // skryj vsechny boxy
        $("#fivebox-"+index).show();
        $("#fivebox-"+index).show();        
        $("#fivebox-menu a").removeClass("current");
        $(this).addClass("current");
    });

  /* END - Fivebox */ 

  /* Fourbox - hover change styles + add link to box */

    $("#fourthbox .text").mouseover(function(){
       // zapamatuji si soucasne hodnoty
       color = $(this).css("color");
       bgColor = $(this).css("background-color");
       bgImage = $(this).css("background-image");
       // nastavim hover hodnoty
       $(this).css("cursor","pointer");
       $(this).find('a').css("color","#ffffff");
       $(this).css("color","#ffffff");
       $(this).css("background-color","#F24F00");
       $(this).css("background-image","none");
       //get link href
       link = $(this).find('a').attr("href"); 
        // nastavi odkaz na celem bloku
        $(this).click(function () { 
          window.location.href = link; 
        });
    }).mouseout(function(){
       $(this).css("cursor","auto");
       $(this).find('a').css("color","#EB4D00");
/*
       $(this).css("color","#666");
       $(this).css("background-color","#ffffff");
*/
       $(this).css("color",color);
       $(this).css("background-color",bgColor);
       $(this).css("background-image",bgImage);
    });


  /* Threebox - add link to box */
    $("#threebox .visualt").css("cursor","pointer");
    $("#threebox .visualt").each(function() {
        $(this).click(function () { 
          window.location.href = $(this).find('h1 a').attr("href"); 
        });        
         
    });

  /* Fivebox - add link to image */
    $(".fivebox-box .visual-image").css("cursor","pointer");
    $(".fivebox-box .visual-image").each(function() {
        $(this).click(function () { 
          window.location.href = $(this).find('h2 a').attr("href"); 
        });        
         
    });
    


//    alert( getEnvPrefix() );

  /* END - Fourbox - hover change styles */


})