
	
	
	var hover = false;
	var moving = false;
	var profileByRow = 4;
	var profileWidth = 118; // 118*4 = 472,  118 = 7 + 103 + 8
	var cntr = 0;
	var speed = 2000;
	var delay = 5000;
	var ads = '';
	var loadedImage = new Array();
	
	$(document).ready(function(){		
		cnt_girls = $('.ads img').size();
		ads = $(".floating_container");		
		$('.ads img').each(function(){	
				cntr++;
				img = $(this).attr("src");
				loadedImage[img] = new Image();
    			loadedImage[img].src = img;				
			if(cntr == cnt_girls){
				setTimeout("slideAds()", delay);		
			}
		});		
		
		$(".profile").hover(function(){
			$(this).find(".user_info, .user_info2").animate({'marginTop': 36, 'height': 50, 'opacity': .8}, 'fast');				
		}, function(){			
			$(this).find(".user_info, .user_info2").animate({'marginTop': 56 , 'height': 30, 'opacity': .3 }, 'fast');
		})	
	});

	function slideAds(){	
		moving = true;
		if(hover) return ;
		var curWidth = parseInt(ads.css("marginLeft").replace("px", ""));
		var newWidth = curWidth - (profileWidth * profileByRow);
		newWidth =  newWidth;
		ads.animate({marginLeft: newWidth}, speed, wait);		
	}
		
	
	function wait(){
		moving = false;		
		ads.css({marginLeft:0});
		ads.find(".profile:lt(" + profileByRow + ")").appendTo(ads);			
		setTimeout("slideAds()",delay);		
	}
		
