 $(document).ready(function(){
	CreateMenu('elektro-oaza');
	function CreateMenu(items){
		$('a.'+items).mouseover(function() {										
			$('div.'+items).show();
		});
	   $('a.'+items).mouseout(function() {										
			$('div.'+items).hide();
		});
	   $('div.'+items).mouseover(function() {										
			$('div.'+items).show();
		});
	   $('div.'+items).mouseout(function() {										
			$('div.'+items).hide();
		});
	}
  
    $('a[rel*=trackevent]').click(function(event)
    {
        try
        {
            var parts = this.rev.split(/\|/);
            
            if (parts.length == 2)
            {
                _gaq.push(['_trackEvent',
                    parts[0],
                    parts[1],
                    this.href]);
            }
        }
        catch (err)
        {
        }
    });  
 });
 // JavaScript Document
function CheckId(id){
	var hod = document.getElementById(id).value;
	if(hod==''){
		return false;
	}else{
		return true;	
	}
}
function CheckForm(){
	var ret = CheckId('jmeno');
	ret = CheckId('kontakt') && ret;
	ret = CheckId('dotaz') && ret;
	return ret;
}

// slideshow

function slideSwitch() {
    var $active = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');

    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    	setInterval( "slideSwitch()", 5000 );
	});



	$(document).ready(function(){
	$('a.popup').lightBox();
   // $('#gallery a').lightBox();
	//$("table.kontakt tr:even").css("background-color", "#f3f9f5");
	//$("div.slider_ref").accordion({autoHeight: false,collapsible: true,active:false});


});
function GetId(id){
	return document.getElementById(id);
}
function Aktualizovat(value){
	if(GetId('strediska-content').innerHTML!=value){
		GetId('strediska-content').innerHTML = value;
	}
}


