/* Javascript */

$(document).ready(function(){
		
		/*$.ajax({
			type: "POST",			
			url: "includes/control.php",
			data: "count=1",
			dataType: "text",			
			success: function(data){
				$("#stat_obsah").html(data);
			}
		});*/
	
	var width = screen.width/2;
	var height = screen.height/2;	
	$('a.lightbox').lightBox({maxHeight: height, maxWidth: width}); 
	
	$("#left").find("ul").hide();		
	var which = $("#left").find("span").html();
	if(which == 0) $("#left").find("ul").hide();
	if(which == 1) $("#menu01").find("ul").show(0);				
	if(which == 2) $("#menu02").find("ul").show(0);		
	if(which == 3) $("#menu03").find("ul").show(0);					
	
	$("#menu01").click(function(){	
		/* Ošklivý IE6 hack */
		$("#left").hide();
		$("#left").show();		
		$("#menu01").find("ul").show(200);		
		$("#menu02").find("ul").hide(200);
		$("#menu03").find("ul").hide(200);
	});	
	
	$("#menu02").click(function(){
		/* Ošklivý IE6 hack */		
		$("#left").hide();
		$("#left").show();			
		$("#menu01").find("ul").hide(200);		
		$("#menu02").find("ul").show(200);
		$("#menu03").find("ul").hide(200);
	});	
	
	$("#menu03").click(function(){
		/* Ošklivý IE6 hack */		
		$("#left").hide();
		$("#left").show();			
		$("#menu01").find("ul").hide(200);		
		$("#menu02").find("ul").hide(200);
		$("#menu03").find("ul").show(200);
	});	
    
	/* Školní poradenské centrum */
	$("#spp1").live('click',function(){
		$("#detspp1").show();
		$("#detspp2").hide();
		$("#detspp3").hide();
		$("#detspp4").hide();                		
	});  
    
	$("#spp2").live('click',function(){
		$("#detspp1").hide();
		$("#detspp2").show();
		$("#detspp3").hide();
		$("#detspp4").hide();                		
	}); 
    
	$("#spp3").live('click',function(){
		$("#detspp1").hide();
		$("#detspp2").hide();
		$("#detspp3").show();
		$("#detspp4").hide();                		
	}); 
    
	$("#spp4").live('click',function(){
		$("#detspp1").hide();
		$("#detspp2").hide();
		$("#detspp3").hide();
		$("#detspp4").show();                		
	}); 
    
    $("a").each(  
        function() {  
            if(this.href.lastIndexOf("mailto") != -1){ 
                this.title = this.href.substring(7, this.href.length);  
            }
        }  
    );                  	
	
});

