// 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;
}

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 ProhoditObrazek(id){
		var idcko = $("#reference_nahled_value").val();
		$("#reference_nahled_"+idcko).hide('highlight',{},1000,function(){
																		$("#reference_nahled_"+id).show('highlight',{},10);
																	   });
		$("#reference_nahled_value").val(id);
	}
	$(document).ready(function(){
    $('#flash').flash(
        { src: '/reference/reference.swf',
          width: 980,
          height: 300,
          wmode: 'transparent' },
        { version: 8 }
    );
    $('#flash-mapa').flash(
        { src: '/flash/mapa.swf',
          width: 600,
          height: 245 },
        { version: 8 }
    );
	$('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() {
    	setInterval( "slideSwitch()", 7000 );
	});
});
function GetId(id){
	return document.getElementById(id);
}
function Aktualizovat(value){
	if(GetId('strediska-content').innerHTML!=value){
		GetId('strediska-content').innerHTML = value;
	}
}
