
	$(document).ready(function(){
		//Animations on the pages
		$('#col1').show(1000);
		if (window.location == 'http://localhost/solaris/index.php/fr/medias/photos/test')
			$('#col2').show(10);
		else
			$('#col2').show(1500);
		$("#col1 a").click(function(){
		   	if(($(this).attr("class"))!='link'){
			  	$("#col1").hide(1000);
				$("#col2").hide(1000);
			}	
	 	});
		//Animations on the menu
	/*	$("#col1 a").hover(function(){ 
			$this.animate({ 
	        color: "red",
	      }, 500 );
		});*/
		function resizeWindow( e ) {
			var newWindowHeight = $(window).height();
			if (newWindowHeight < 768){
				$("#container_master").css("margin-top", -newWindowHeight/2 );
			}else{
				$("#container_master").css("margin-top", -384 );
			}
			var newWindowWidth = $(window).width();
			if (newWindowWidth < 1024){
				$("#container_master").css("margin-left", -newWindoWidth/2 );
			}else{
				$("#container_master").css("margin-left", -512 );
			}
		}
		resizeWindow();
		//If the User resizes the window, adjust the #container height
		$(window).bind("resize", resizeWindow);
		
		// Using multiple unit types within one animation.
	   	$(".gallery a img").animate({ 
			width: "100px"
	    }, 1500 );
	 
		$('#col2 div.gallery a').nyroModal();
		$('#col2 a.slide').nyroModal();
	
	});
	
$(function() {
  $.nyroModalSettings({
    processHandler: function(settings) {
      var from = settings.from;
      if (from.href.indexOf('http://www.youtube.com/watch?v=') == 0) {
        $.nyroModalSettings({
          type: 'swf',
          height: 600,
          width: 800,
          url: from.href.replace(new RegExp("watch\\?v=", "i"), 'v/')
        });
      }
    }
  });
});
$(function(){
  function preloadImg(image) {
    var img = new Image();
    img.src = image;
  }
  preloadImg('../img/ajaxLoader.gif');
  preloadImg('../img/prev.gif');
  preloadImg('../img/next.gif');
});
