function twitterWidget() {
	new TWTR.Widget({
	version: 2,
	type: 'profile',
	rpp: 4,
	interval: 6000,
	width: 203,
	height: 300,
	theme: {
		shell: {
			background: '#ffffff',
			color: '#000000'
		},
		tweets: {
			background: '#eff5f1',
			color: '#000000',
			links: '#0c491c'
		}
	},
	features: {
		scrollbar: false,
		loop: false,
		live: false,
		hashtags: true,
		timestamp: true,
		avatars: false,
		behavior: 'all'
	}
	}).render().setUser('shotgunmusic').start();
}

var framewt = 1200;
var hdrleft = 400;
var contleft = 375;

var windowht;
var windowwt;
function windowdims() {
	windowht = $(window).height();
	windowwt = $(window).width();
}

function header() {
	windowdims();
	if (windowwt > 1200) {
		$("#header").css("left",(windowwt-framewt)/2+hdrleft+"px");
	} else {
		$("#header").css("left",hdrleft+"px");
	}
	$("#header").css("visibility","visible");
}

function content() {
	windowdims();
	$("#content").css("height",windowht-250+"px");
	if (windowwt > 1200) {
		$("#content").css("left",(windowwt-framewt)/2+contleft+"px");
	} else {
		$("#content").css("left",contleft+"px");
	}
	$("#content").css("visibility","visible");
}

function showstable() {
	$("tr:odd").css("background","#dfe5db");
}

function join() {
	$("#join table").attr("cellpadding","0");
	$("#join table span").css("font-size","12px");
	$("#join table input").each(function() {
		if ($(this).attr("type") == "submit") {
			$(this).css({"width":"100px","cursor":"pointer","font-weight":"bold"});
		}
	});
}

function blog() {
	$(".blogitem a").each(function() {
		if ($(this).attr("rel") == "nofollow") {
			$(this).hide();
		}
	});
}

var imgratio = (1450/630);
function bgresize() {
	windowdims();
	$("#fixed").css("height",windowht);
	$("#fixed").css("width",windowwt);
	var windowratio = (windowwt/(windowht-170));
	var ratio = (imgratio/windowratio);
	if (ratio > 1) {
		$("#bg img").css("height",(windowht-170)+"px");
		$("#bg img").css("width","auto");
		$("#bg").css("left",((ratio-1)*(-100))+"px");
	} else {
		$("#bg img").css("width",windowwt+"px");
		$("#bg img").css("height","auto");
	}
	$("body").css("overflow-y","auto");
}

function navresize() {
	windowdims();
	//var bodyht = $("body").height();
	var bght = $("#bg").height();
	var navht = $("#nav").height()+90;
	if (windowht > navht) {
		$("body").css("overflow-y","hidden");
		$("#navframe").css("height",windowht-80+"px");
	} else {
		//$("body").css("height",bght+170+"px");
		$("#navframe").css("height",navht-90+"px");
		//$("#navframe").css("height",bght+80+"px");
		//$("body").css("overflow-y","auto");
	}
}

$(window).resize(function() {
	header();
	if($("#content").length > 0) { content(); }
	bgresize();
	navresize();
});

$(window).load(function() {
	header();
	if($("#content").length > 0) { content(); }
	if($("#showstable").length > 0) { showstable(); }
	if($("#join").length > 0) { join(); }
	if($(".blogitem").length > 0) { blog(); }
	bgresize();
	$("#twidget").load(function() {
		navresize();
	});
});
