jQuery.noConflict(); var $ = jQuery;
$(function() {
	$("#sidebar").css('opacity','1');
	initImg();
	$('.menu').animate({'opacity':'1'},{queue:false},1000);	
	$(".post").each(function(){
		var txt = $(this).find(".description").html();
		$("#unit_"+$(this).attr('id')).fadeIn();		
	});

});

/********************************************************************************/
//initImg
/********************************************************************************/

function initImg(){

	$(".post").each(function(){
		if($(this).find("p").data('rescaled') !='true'){
			var txt = $(this).find(".description").html();
			$("#info").append("<div class='unit' id='unit_"+$(this).attr('id')+"'><div class='info_title'>"+$(this).find(".post_title").html()+"</div>"+txt+"</div>");
			//alert("added");
		}
	});

	$(".post p").each(function(){
		if($(this).data('rescaled') !='true'){
			$(this).find("a").attr('href','#');
			if($(this).data('rescaled')==null){
				$(this).data('rescaled','true');		
				var myParent = "#"+$(this).parent().attr('id');
				//var num = $(myParent).find("p").index(this)+1;
				//$(this).append("<div class='img_num'>"+num+"</div>");
				var max = 3;
				var n = Math.floor(Math.random()*max+1)
				if(n==1){
					$(this).css('width','600px');
				}else{
					$(this).css('width','280px');
				}
				var max = 3;
				var n = Math.floor(Math.random()*max+1)
				$(this).css('margin-top',80*n+"px");
			}
		}
	});
	
}



