/*


      88P                                                                          988
     88'    oooo                                   .o8   o8o                        '88
    o88     `88'                                   "88   `"'                         88o
    888      88   oo. .o.     .oooo.   .oooo.   .ooo88   ooo   ooo  ooo    .ooo.o    888
    88'      88   `88P"Y8b   d8' `"8  d8' `8b  d8' `88   `88   `88  `88   d8(  "8    '88
  o88        88    88   88   88       88   88  88   88    88    88   88   `"Y8b.       88o 
    88o      88    88   88   88   .8  88   88  88   88    88    88   88   o.  )8b     o88 
    888     o88o  o88o o88o  `Y8bdP'  `Y8bdP'  `Y8bd8P"  o88o   `V8V"VP'  8""88P'     888
    988                                                                               88P
     88.              C R E A T I V E   W E B   D E V E L O P M E N T                .88 
      88o                                                                           o88	


						Copyright 2010 Incodius - www.incodius.com 
*/

$(document).ready(function(){
	var timer = 0;					   
						   
	$(".featimages").css({"opacity":"0.7"});
	timer = setTimeout(loopFlashing, 2000);
	
	$(".featimages").mouseover(function() {
		$(".featimages").stop();
		clearTimeout(timer);
		$(this).animate({"opacity":"1"}, 200);
	});
	
	$(".featimages").mouseout(function() {
		timer = setTimeout(loopFlashing, 1400);
		$(this).animate({
			"opacity":"0.7"}, 200);
	});
	
	$(".sn-icons").mouseover(function() {
		
		$(this).html("<img src=\"/images/"+this.id+"-blue.jpg\" height=\"20px\" alt=\"\" />");
	});
	
	$("#tweetbox").mouseout(function() {
		
		sntimer =setTimeout(sngreyout, 200);
	});
	
});

function sngreyout() {
		//alert("yo");
		$("#twitter-icon").html("<img src=\"/images/twitter-icon-grey.jpg\" height=\"20px\" alt=\"\" />");
		$("#facebook-icon").html("<img src=\"/images/facebook-icon-grey.jpg\" height=\"20px\" alt=\"\" />");	
}

function loopFlashing() {
	//alert ("in!");
	$("#featimages1").animate({"opacity":"1"}, 200, function() {
		$("#featimages1").animate({"opacity":"0.7"}, 200);
		$("#featimages2").animate({"opacity":"1"}, 200, function() {
			$("#featimages2").animate({"opacity":"0.7"}, 200);
			$("#featimages3").animate({"opacity":"1"}, 200, function() {
					$("#featimages3").animate({"opacity":"0.7"}, 200);
					timer = setTimeout(loopFlashing, 1400);
				
			});
		});
	});
}
