$(window).bind('load', function() {
								 						 
	
	$('#header li:eq(0)').animate({ left:'-='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(1)').animate({ left:'+='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(2)').animate({ left:'-='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(3)').animate({ left:'+='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(4)').animate({ left:'-='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(5)').animate({ left:'+='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(6)').animate({ left:'-='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(7)').animate({ left:'+='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(8)').animate({ left:'-='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(9)').animate({ left:'+='+Math.floor(Math.random()*31),opacity:1 });
	$('#header li:eq(10)').animate({ left:'-='+Math.floor(Math.random()*31),opacity:1 });
    
	
	

   // $('#content-text').imagesLoaded(function(){
	  
		  
		  $('#content-text').css('left',0);
		  
		  var $f1 = $('.post-entry-home:eq(0)');
		  if ($f1.length>0) {
			var $f1pic = $('.post-entry-home:eq(0) img');
			var $f1title = $('.post-entry-home:eq(0) .post-title');
			var $f1summary = $('.post-entry-home:eq(0) .post-summary');
			if (!$f1pic.width()) {
				var $f1x = 150;
				var $f1y = 155;
			} else {
				$f1pic.css("height",$f1pic.height() - 50 + "px");
				var $f1x = $f1pic.width();
				var $f1y = $f1pic.height();
			}
			$f1.css({"position":"absolute", "height":$f1y,"left":350-$f1x+"px","top":320-$f1y+"px"});
			$f1title.css('left',$f1x+15);
			$f1title.css('bottom',$f1summary.height()+90);
			$f1summary.css('left',$f1x+15);
			var $f1pos = $f1.position();
			var pageBottom = $f1pos.top;
		  }
	  

		  
		  var $f2 = $('.post-entry-home:eq(1)');
		  if ($f2.length>0) {
			var $f2pic = $('.post-entry-home:eq(1) img');
			var $f2title = $('.post-entry-home:eq(1) .post-title');
			var $f2summary = $('.post-entry-home:eq(1) .post-summary');
			if (!$f2pic.width()) {
				var $f2x = 150;
				var $f2y = 155;
			} else {
				$f2pic.css("height",$f2pic.height() - 50 + "px");
				var $f2x = $f2pic.width();
				var $f2y = $f2pic.height();
			}
			var f2offsetx = -40;
			var f2left = $f1pos.left + $f1x + f2offsetx - 25;
			$f2.css({"position":"absolute", "height":$f2y, "width":$f2x ,"left":f2left, "top":$f1pos.top + $f1y -9 + "px" });
			$f2title.css('left',"-380px");
			$f2title.css('bottom',$f2summary.height() + 60);
			$f2summary.css('left',"-380px");
			var $f2pos = $f2.position();
			var pageBottom = $f2pos.top;
		  }
	  
	  
	  
	  
		  
		  var $f3 = $('.post-entry-home:eq(2)');
		  if ($f3.length>0) {
			var $f3pic = $('.post-entry-home:eq(2) img');
			var $f3title = $('.post-entry-home:eq(2) .post-title');
			var $f3summary = $('.post-entry-home:eq(2) .post-summary');
			if (!$f3pic.width()) {
				var $f3x = 150;
				var $f3y = 155;
			} else {
				$f3pic.css("height",$f3pic.height() - 40 + "px");
				var $f3x = $f3pic.width();
				var $f3y = $f3pic.height();
			}
			//$f3.css("height",$f3y - 30 + "px");
			var f3offsetx = -20;
			var f3left = 370 - $f3x + f3offsetx;
			$f3.css({"position":"absolute", "height":$f3y,"left":f3left,"top":$f2pos.top + $f2y -9 + "px" });
			$f3title.css('left',$f3x + 10);
			$f3title.css('bottom',$f3summary.height() + 60);
			$f3summary.css('left',$f3x + 10);
			var $f3pos = $f3.position();
			var pageBottom = $f3pos.top;
		  }
	  
	  
	  
	  
		  
		  var $f4 = $('.post-entry-home:eq(3)');
		  if ($f4.length>0) {
			var $f4pic = $('.post-entry-home:eq(3) img');
			var $f4title = $('.post-entry-home:eq(3) .post-title');
			var $f4summary = $('.post-entry-home:eq(3) .post-summary');
			if (!$f4pic.width()) {
				var $f4x = 150;
				var $f4y = 155;
			} else {
				$f4pic.css("height",$f4pic.height() - 30 + "px");
				var $f4x = $f4pic.width();
				var $f4y = $f4pic.height();
			}
			//$f4.css("height",$f4y - 30 + "px");
			var f4offsetx = -40;
			var f4left = $f1pos.left + $f3x + f4offsetx - 25;
			$f4.css({"position":"absolute", "height":$f4y, "width":$f4x ,"left":f4left, "top":$f3pos.top + $f3y -9 + "px" });
			$f4title.css('left',"-380px");
			$f4title.css('bottom',$f4summary.height() + 60);
			$f4summary.css('left',"-380px");
			var $f4pos = $f4.position();
			var pageBottom = $f4pos.top;
		  }
		  
		  
	  
	  
	  
	  
		  var $f5 = $('.post-entry-home:eq(4)');
		  if ($f5.length>0) {
			var $f5pic = $('.post-entry-home:eq(4) img');
			var $f5title = $('.post-entry-home:eq(4) .post-title');
			var $f5summary = $('.post-entry-home:eq(4) .post-summary');
			if (!$f5pic.width()) {
				var $f5x = 150;
				var $f5y = 155;
			} else {
				$f5pic.css("height",$f5pic.height() - 55 + "px");
				var $f5x = $f5pic.width();
				var $f5y = $f5pic.height();
			}
			//$f5.css("height",$f5y - 40 + "px");
			var f5offsetx = -20;
			var f5left = 370 - $f5x + f5offsetx;
			$f5.css({"position":"absolute", "height":$f5y+"px","left":f5left,"top":$f4pos.top + $f4y -9 + "px" });
			$f5title.css('left',$f5x + 10);
			$f5title.css('bottom',$f5summary.height() + 60);
			$f5summary.css('left',$f5x + 10);
			var $f5pos = $f5.position();
			var pageBottom = $f5pos.top;
		  }
	  
	  
	  
	  
		  var $f6 = $('.post-entry-home:eq(5)');
		  if ($f6.length>0) {
			var $f6pic = $('.post-entry-home:eq(5) img');
			var $f6title = $('.post-entry-home:eq(5) .post-title');
			var $f6summary = $('.post-entry-home:eq(5) .post-summary');
			if (!$f6pic.width()) {
				var $f6x = 150;
				var $f6y = 155;
			} else {
				$f6pic.css("height",$f6pic.height() - 70 + "px");
				var $f6x = $f6pic.width();
				var $f6y = $f6pic.height();
			}
			//$f6.css("height",$f6y - 30 + "px");
			var f6offsetx = -40;
			var f6left = $f1pos.left + $f6x + f6offsetx - 25;
			$f6.css({"position":"absolute", "height":$f6y, "width":$f6x ,"left":f6left, "top": $f5pos.top + $f5y - 9  });
			$f6title.css('left',"-380px");
			$f6title.css('bottom',$f6summary.height() + 60);
			$f6summary.css('left',"-380px");
			var $f6pos = $f6.position();
			var pageBottom = $f6pos.top;
		  }
		  
		  
	  
	  
	  
	  
		  var $f7 = $('.post-entry-home:eq(6)');
		  if ($f7.length>0) {
			var $f7pic = $('.post-entry-home:eq(6) img');
			var $f7title = $('.post-entry-home:eq(6) .post-title');
			var $f7summary = $('.post-entry-home:eq(6) .post-summary');
			if (!$f7pic.width()) {
				var $f7x = 150;
				var $f7y = 155;
			} else {
				$f7pic.css("height",$f7pic.height() - 80 + "px");
				var $f7x = $f7pic.width();
				var $f7y = $f7pic.height();
			}
			//$f7.css("height",$f7y - 30 + "px");
			var f7offsetx = -20;
			var f7left = 370 - $f7x + f7offsetx;
			$f7.css({"position":"absolute", "height":$f7y,"left":f7left,"top":$f6pos.top + $f6y -9 + "px" });
			$f7title.css('left',$f7x + 10);
			$f7title.css('bottom',$f7summary.height() + 60);
			$f7summary.css('left',$f7x + 10);
			var $f7pos = $f7.position();
			var pageBottom = $f7pos.top;
		  }
	  
	  
	  
	  
	  
	  
		  var $f8 = $('.post-entry-home:eq(7)');
		  if ($f8.length>0) {
			var $f8pic = $('.post-entry-home:eq(7) img');
			var $f8title = $('.post-entry-home:eq(7) .post-title');
			var $f8summary = $('.post-entry-home:eq(7) .post-summary');
			if (!$f8pic.width()) {
				var $f8x = 150;
				var $f8y = 155;
			} else {
				$f8pic.css("height",$f8pic.height() - 70 + "px");
				var $f8x = $f8pic.width();
				var $f8y = $f8pic.height();
			}
			//$f6.css("height",$f6y - 30 + "px");
			var f8offsetx = -40;
			var f8left = $f1pos.left + $f8x + f8offsetx - 25;
			$f8.css({"position":"absolute", "height":$f8y, "width":$f8x ,"left":f8left, "top": $f7pos.top + $f7y - 9  });
			$f8title.css('left',"-380px");
			$f8title.css('bottom',$f8summary.height()+60);
			$f8summary.css('left',"-380px");
			var $f8pos = $f8.position();
			var pageBottom = $f8pos.top;
		  }
		  
		  
	  
	  
	  
	  
		  var $f9 = $('.post-entry-home:eq(8)');
		  if ($f9.length>0) {
			var $f9pic = $('.post-entry-home:eq(8) img');
			var $f9title = $('.post-entry-home:eq(8) .post-title');
			var $f9summary = $('.post-entry-home:eq(8) .post-summary');
			if (!$f9pic.width()) {
				var $f9x = 150;
				var $f9y = 155;
			} else {
				$f9pic.css("height",$f9pic.height() - 80 + "px");
				var $f9x = $f9pic.width();
				var $f9y = $f9pic.height();
			}
			//$f9.css("height",$f9y - 30 + "px");
			var f9offsetx = -20;
			var f9left = 370 - $f9x + f9offsetx;
			$f9.css({"position":"absolute", "height":$f9y,"left":f9left,"top":$f8pos.top + $f8y -9 + "px" });
			$f9title.css('left',$f9x + 10);
			$f9title.css('bottom',$f9summary.height() + 60);
			$f9summary.css('left',$f9x + 10);
			var $f9pos = $f9.position();
			var pageBottom = $f9pos.top;
		  }
	  
	  
	  
	  
	  
	  
	  
		  var $f10 = $('.post-entry-home:eq(9)');
		  if ($f10.length>0) {
			var $f10pic = $('.post-entry-home:eq(9) img');
			var $f10title = $('.post-entry-home:eq(9) .post-title');
			var $f10summary = $('.post-entry-home:eq(9) .post-summary');
			if (!$f10pic.width()) {
				var $f10x = 150;
				var $f10y = 155;
			} else {
				$f10pic.css("height",$f10pic.height() - 70 + "px");
				var $f10x = $f10pic.width();
				var $f10y = $f10pic.height();
			}
			//$f6.css("height",$f6y - 30 + "px");
			var f10offsetx = -40;
			var f10left = $f1pos.left + $f10x + f10offsetx - 25;
			$f10.css({"position":"absolute", "height":$f10y, "width":$f10x ,"left":f10left, "top": $f9pos.top + $f9y - 9  });
			$f10title.css('left',"-380px");
			$f10title.css('bottom',$f10summary.height() + 60);
			$f10summary.css('left',"-380px");
			var $f10pos = $f10.position();
			var pageBottom = $f10pos.top;
		  }
		  
		  
	  
	  
		  var $f11 = $('.post-entry-home:eq(10)');
		  if ($f11.length>0) {
			var $f11pic = $('.post-entry-home:eq(10) img');
			var $f11title = $('.post-entry-home:eq(10) .post-title');
			var $f11summary = $('.post-entry-home:eq(10) .post-summary');
			if (!$f11pic.width()) {
				var $f11x = 150;
				var $f11y = 155;
			} else {
				$f11pic.css("height",$f11pic.height() - 80 + "px");
				var $f11x = $f11pic.width();
				var $f11y = $f11pic.height();
			}
			//$f11.css("height",$f11y - 30 + "px");
			var f11offsetx = -20;
			var f11left = 370 - $f11x + f11offsetx;
			$f11.css({"position":"absolute", "height":$f11y,"left":f11left,"top":$f10pos.top + $f10y -9 + "px" });
			$f11title.css('left',$f11x + 10);
			$f11title.css('bottom',$f11summary.height() + 60);
			$f11summary.css('left',$f11x + 10);
			var $f11pos = $f11.position();
			var pageBottom = $f11pos.top;
		  }
		  
		  
	  
	  
		  
		  
		  var $heights = 0;
		  var isCategoryPage = 0;
		  $('.post-entry-home').each( function() {
			  isCategoryPage = 1;
			  $heights = $heights + parseInt( $(this).height() ) + 40;
		  });
		  
		  if (isCategoryPage==1) {
			  $('#content-text').css('height', $heights );
		  }
		  
		  
		  // Canvas animated circles
		  /*
		  if (thisPage=="repertoire") {
			  var paper = Raphael("special", 620, 620);
			  var c1 = paper.ellipse(250, 250, 175, 170);
			  var c2 = paper.ellipse(250, 250, 230, 180);
			  var c3 = paper.ellipse(250, 250, 202, 175);
			  c1.attr({fill: "rgba(256,256,256,0.05)",stroke: "#ccc"});
			  c2.attr({fill: "rgba(256,256,256,0.09)",stroke: "none"});
			  c3.attr({stroke: "#bbb"});
		  } else {
			  */
			  var paper = Raphael("special", 550, 550); 
			  var c1 = paper.ellipse(120, 110, 205, 170);
			  var c2 = paper.ellipse(120, 110, 240, 180);
			  var c3 = paper.ellipse(120, 110, 222, 165);
			  c1.attr({fill: "rgba(25,1,1,0.15)",stroke: "#600"});
			  c2.attr({fill: "rgba(1,1,1,0.20)",stroke: "#600"});
			  c3.attr({stroke: "#700"});
		  //}
		  var ellipseSpin1 = function () {
			  c1.attr({rotation: 0}).animate({rotation: 360}, 22000, ellipseSpin1);
		  }
		  var ellipseSpin2 = function () {
			  c2.attr({rotation: 0}).animate({rotation: 360}, 17500, ellipseSpin2);
		  }
		  var ellipseSpin3 = function () {
			  c3.attr({rotation: 0}).animate({rotation: 360}, 10000, ellipseSpin3);
		  }
		  ellipseSpin1();
		  ellipseSpin2();
		  ellipseSpin3();
		  
		  

    //});

	
	$('#first-name-comment').focus();


});
