/* Author: Derek Ahmedzai - www.sharpshooter.org

*/

$(function(){

	// Flash replacement
	$(".flash-replacement").each(function(i){
		//swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
		//alert($(this).attr('rel'));
		//alert($(this).attr('rel'));
		//alert(this.id);
		swfobject.embedSWF($(this).attr('flashsource'), this.id, $(this).attr('flashwidth'), $(this).attr('flashheight'), "9.0.0");
		//swfobject.embedSWF("http://www.machacoustics.com/flash/mach-mainmovie-003LIVE.swf", this.id, "960", "290", "9.0.0");
	});
	
	
	// Lightbox
	$("a[rel='lightbox']").colorbox({transition:"none", width:"75%", height:"75%"});

	
	// Open external links in a new window
	/*$("a[href^='http://']").click(function(){
		window.open(this.href);
		return false;
	});*/
	$("a[rel='external'").click(function(){
		window.open(this.href);
		return false;
	});
	
	
	// Landing page panels
	$(".landing-page .col").click(function(){
		window.location = $(this).find("h2 a").attr('href');
	});
	$(".landing-page .col").hover(
		function(){
			$(this).find("img").attr('src',$(this).find("img").attr('src').replace('.png', '-rollover.jpg'));
			$(this).addClass('selected');
		}, 
		function(){
			$(this).find("img").attr('src',$(this).find("img").attr('src').replace('-rollover.jpg', '.png'));
			$(this).removeClass('selected');
		}
	);
});























