$(document).ready(function(){

get_url_parameter( "DS" );
if(get_url_parameter()){
 /*
   $("#content, #logo, #menu, #footer").css({'display': 'none'});
   $("#logo").fadeIn(300, 
      function(){
          $("#menu").fadeIn(300, function(){
              $("#content").fadeIn(300, function(){
                     $("#footer").fadeIn(300);
              });
          });
          
      }
   );
   $("#menu").css({'display': 'none'});
   
   */
} 


	/*$("#send_email").validate();  */




    /*
   $("#logo").hover(
      function(){
          $(this).animate({'left': '30px'},200)
      },
      function(){
          $(this).animate({'left': '35px'},200)
      }
   );
   */

    //$(".subItem .content").slideUp();
    $(".subItem h3").toggle(
        function(){
            $(".subItem .content").slideUp("fast");
            $(this).parent().find(".content").slideDown("fast");
        },
        function(){
            $(this).parent().find(".content").slideUp("fast");
        }
    );
   
    $("#menu a").hover(function(){
          $(this).find("span").css({"color":"#fff"});
          if($(this).attr("class") == "active"){
              $(this).find("span").css({"color":"#f96969"});
          }
   	},function(){
          $(this).find("span").css({"color":"#cd0000"});
          if($(this).attr("class") == "active"){
              $(this).find("span").css({"color":"#f96969"});
          }
    });
    //$('p.round').corner("round");
    
    //$(".gal").lightBox();
    var galleryHeight   = $(".galeryBlock").height() - 50;
    var galleryWidth    = $(".galeryBlock").width() - 100;
    
    $(".gal").each(function(){
        var rotation  = Math.floor(Math.random() * 80) - 40;
        var posX      = Math.floor(Math.random() * galleryWidth) - 40;
        var posY      = Math.floor(Math.random() * galleryHeight) - 40;
        
        $(this).find("img").attr('width', $(this).width());
        $(this).wrap("<div class='galWrap'></div>") ;
        var galWrap   = $(this).parent();
        //galWrap.css({'left': posX+'px', 'top': posY+'px'})
        //galWrap.css({'-moz-transform':'rotate('+rotation+'deg)', '-webkit-transform':'rotate('+rotation+'deg)'});
        
    });
    
    $(".gal").hover(
       function(){
          $(this).stop().animate({'height':'120px'});
       },
       function(){
           $(this).stop().animate({'height':'100px'});
       }
    );
    
    /*
    var preventClick=false;
    
    $(".gal").bind("click",function(e){
  		if(preventClick)
  		{
  			e.stopImmediatePropagation();
  			e.preventDefault();
  		}
  	});
      
  	$(".galWrap").draggable({
  		containment: 'parent',
  		start: function(e,ui){
  			preventClick=true;
  			//alert(preventClick);
  		},
  		
  		stop: function(e, ui) {
  			setTimeout(function(){ preventClick=false; }, 250);
  		}
  	});
    
  	$('.galWrap').mousedown(function(e){
  								 
  		
  		var maxZ = 0;
  		
  		
  		$('.galWrap').each(function(){
  			var thisZ = parseInt($(this).css('zIndex'))
  			if(thisZ>maxZ) maxZ=thisZ;
  		});
  		
  		if($(e.target).hasClass("galWrap"))
  		{
  			$(e.target).css({zIndex:maxZ+1});
  		}
  		else $(e.target).closest('.galWrap').css({zIndex:maxZ+1});
  	});
   */
  
    
    
  });
  
function get_url_parameter(){
    var _s = window.location.href
    var _m = 'cz'; // needle
    var _c = 0;
    for (var i=0;i<_s.length;i++) {
        if (_m == _s.substr(i,_m.length))
        _c++;
    }
    if(_c > 1) return false;
    else return true;
}
/*
$(document).ready(function(){
    $("a.small_img").each(function(){
           $(this).removeAttr("href");
    })
	$("a.small_img").hover(function(){
		var image = $(this).parent().find(".foto_big img");
		image.attr("src",$(this).attr("rel"));
	});
});     */

