jQuery(document).ready(function($){

//var page = $(location).attr('href');


// if() {
// 	$('#suckerfish').css();
// }

var $imgmed = $("img.size-medium");
$imgmed.parent().hover( function () {
	$(this).addClass(".added");
});
$imgmed.parent("a").lightBox({
	overlayBgColor: '#fff',
	overlayOpacity: 0.8,
	containerResizeSpeed: 300,
	imageBtnClose: 'http://theagentc.com/indiecollege.com/wp-content/themes/IndieCollege/images/lightbox-btn-close.gif'
});
$('[rel="lightbox"]').lightBox({
 	overlayBgColor: '#FFF',
 	overlayOpacity: 0.8,
 	containerResizeSpeed: 300,
 	imageBtnClose: 'http://theagentc.com/indiecollege.com/wp-content/themes/IndieCollege/images/lightbox-btn-close.gif'
});

var clearMePrevious = '';
var $clearme = $('input.clearMeFocus');
// clear input on focus
$clearme.focus(function()	{
	if($(this).val()==$(this).attr('title'))
	{
	clearMePrevious = $(this).val();
	$(this).val('');
	}
	});
	// if field is empty afterward, add text again
	$clearme.blur(function()
	{
	if($(this).val()=='')
	{
	$(this).val(clearMePrevious);
	}
});

//hover posts
$("div.post").hover(function(){
		$(this).css('background','#ccc');
	},
	function(){
		$(this).css('background','#dddddd');
	}
);

$("div.featured").hover(function(){
		$(this).css('opacity','.8');
	},
	function(){
		$(this).css('opacity','1');
	}
);

//click anywhere in the posts div to go to full post
$("div.post").click(function(){
	window.location=$(this).find("a").attr("href"); 
	return false;
});

//end document ready
});

jQuery(function($){
	//twitter followers
	var twitterurl = 'http://api.twitter.com/1/statuses/followers.json?screen_name=indiecollege&callback=?';

	$.getJSON(twitterurl, function(data){
		for(var i=0; i<15; i++) {
	    	var sname = data[i].screen_name,
	    		turl = data[i].profile_image_url;
	    	$("#twitter-followers").append('<span class="friend"><a href="http://twitter.com/'+sname+'" target="_BLANK" title="'+sname+'"><img src="'+turl+'" width="48" height="48" /><div class="name">'+sname+'</div></a></span>');
		}
	});
//end
});
