

// the following two functions are so that
// the three columns appear to be the same height

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

$(document).ready(function() {
	equalHeight($(".column"));
	
	//Configuration Options
	var max_width = 282; 	//Sets the max width, in pixels, for every image
	var selector = '.blogpostmain img'; 	//Sets the syntax for finding the images.  Defaults to all images.
				//For images inside of a particular element (id="abc") or class (class="abc"),
				//use '.abc img' or '#abc img' respectively.  Don't leave off the img tag!!!
	//End configuration options.  You don't need to change anything below here.
	
 	var $j = jQuery.noConflict();
	$j(selector).each(function(){
		var width = $j(this).width();
		var height = $j(this).height();
		if (width > max_width) {
			//Set variables	for manipulation
			var ratio = (height / width );
			var new_width = max_width;
			var new_height = (new_width * ratio);
 
			//Shrink the image and add link to full-sized image
			$j(this).height(new_height).width(new_width);
			$j(this).hover(function(){
				$(this).attr("title", "This image has been scaled down.  Click to view the original image.")
				$(this).css("cursor","pointer");
				});
			$j(this).click(function(){
				window.location = $j(this).attr("src");
			});
		} //ends if statement
	} //ends each function
	); //ends each argument
	
	
	var config = {
		embed: 					"feature-replace",
		minimumFlashVersion: 	"9",
		src: 					"_swf/homepage-feature.swf",			
		width: 					"946",
		height: 				"257",
		expressInstall: 		"_swf/express-install.swf",
		params: { 
			scale: 				"noscale", 
			bgcolor: 			"#000000", 
			menu: 				"false", 
			wmode: 				"opaque", 
			allowScriptAccess: 	"always" 
		},
		attributes: { id: 'homefeature',	name: 'homefeature' }
	};	
		
	swfobject.embedSWF(config.src, config.embed, config.width, config.height, config.minimumFlashVersion, config.expressInstall, config.vars, config.params, config.attributes); 
	
	
	
	$j("#scrolltop").click(function(){
			$j("html, body").animate({ scrollTop: 0 }, {
	        duration: 'slow',
	        easing: 'easeInOutQuad'
	    });
	    return false;
	}); 
	
	
    $j(".tweet").tweet({
  		count: 3,
  		query: "from:camdeniff",
  		loading_text: "Loading tweets..."
    });
    
    $j("#moduleleft").css({position: 'absolute', left:'0px', bottom:'0px'});

});
