$(document).ready(function(){
	
	$.getFeed({
		url: "proxy.php?url=http://www.thoughts.derooted.com/feed/",
		success: function(feed) {
       		for(var i = 0; i < feed.items.length; i++) {
       			var item = feed.items[i];
       			var maxlen = 160;
       			var str = item.description
       			if ( str.length > maxlen ) {
       				str = str.substring(0, maxlen);
       			}
       			$("#news-rotator").append("<div><a href='http://thoughts.derooted.com/'><img src='public/images/pictures/blog.png' alt='Tehran Bureau' /></a><p>" + str + " <a href='" + item.link + "'>read on ..</a></p></div>")
       		}		
	       	$('#news-rotator').cycle({ 
		   		fx:     'fade', 
		    	speed:   500, 
		    	timeout: 4000, 
		    	next:   '#news-rotator', 
		    	pause:   1 
			});	
		}
	});

	//$(".viewer UL LI A IMG").css("display", "block");

	/* $('#viewer').jCarouselLite({
        visible: 1,
        btnNext: ".next-slide",
        btnPrev: "#prev"
    }); */

	
	
	$('#clients-rotator').cycle({ 
	    fx:     'fade', 
	    speed:   500, 
	    timeout: 3000, 
	    next:   '#clients-rotator', 
	    pause:   1 
	});
	
	$('#text-rotator').cycle({ 
	    fx:     'fade', 
	    speed:   500, 
	    timeout: 5000, 
	    next:   '#text-rotator', 
	    pause:   1 
	});
	
	$('#banner-rotator').cycle({ 
	    fx:     'fade', 
	    speed:   500, 
	    timeout: 3000, 
	    next:   '#banner-rotator', 
	    pause:   1 
	});
	
	$("A.close").click(function(){
		$(".process-info").css("display", "none");
		$(".overlay").css("display", "none");
	});
	
    
	
});
