// adds active flash object to the page active
function loadFlash(flashMovie, width, height) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" align="middle"><param name="allowScriptAccess" value="sameDomain"><param name="movie" value="' + flashMovie + '"><param name="quality" value="high"><embed src="' + flashMovie + '" quality="high" width="' + width + '" height="' + height + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>');
}
function loadFlashClear(flashMovie, width, height) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" align="middle"><param name="allowScriptAccess" value="sameDomain"><param name="wmode" value="transparent"><param name="movie" value="' + flashMovie + '"><param name="quality" value="high"><embed src="' + flashMovie + '" quality="high" width="' + width + '" height="' + height + '" align="middle" allowScriptAccess="sameDomain" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>');
}

if(document.images) {
	// preload
	image1 = new Image();
	image1.src = "/images/nav_cats_on.gif";
	image2 = new Image();
	image2.src = "/images/nav_links_on.gif";
	image3 = new Image();
	image3.src = "/images/nav_archives_on.gif";
	image4 = new Image();
	image4.src = "/images/nav_email_on.gif";
	image5 = new Image();
	image5.src = "/images/nav_joinus_on.gif";
	image6 = new Image();
	image6.src = "/images/nav_shootsac_on.gif";
	image7 = new Image();
	image7.src = "/images/nav_go_on.gif";
	image8 = new Image();
	image8.src = "/images/btn_comment_on.gif";
	image9 = new Image();
	image9.src = "/images/btn_link_on.gif";
	image10 = new Image();
	image10.src = "/images/btn_send_on.gif";
	image11 = new Image();
	image11.src = "/images/btn_back_on.gif";
	image12 = new Image();
	image12.src = "/images/btn_more_on.gif";
}
function nav(imgName, state) {
	document.images[imgName].src = "/images/nav_" + imgName + "_" + state + ".gif";
}
function getWidth() {
	if(document.all)
		return document.body.scrollWidth;
	else
		return window.innerWidth;
}
var old_index = 0;
var timeout_id;
function clear_timeouts() {
	if(document.getElementById) {
		if(timeout_id != null)
			self.clearTimeout(timeout_id);
	}
}
function popupon(index, leftPx) {
	if(document.getElementById) {
		clear_timeouts();
		if(old_index != 0) {
			if(document.getElementById(old_index + "Sub"))
				document.getElementById(old_index + "Sub").style.display = "none";
			nav(old_index, "off");
		}
		if(document.getElementById(index + "Sub")) {
			document.getElementById(index + "Sub").style.top = 263;
			document.getElementById(index + "Sub").style.left = ((getWidth() - 980) / 2) + leftPx; 
			document.getElementById(index + "Sub").style.display = "inline";
		}
		nav(index, "on");
		old_index = index;
	}
}
function popupoff() {
	if(document.getElementById) {
		if(old_index != 0)
			timeout_id = setTimeout("if(document.getElementById(old_index + 'Sub'))document.getElementById(old_index + 'Sub').style.display = 'none';nav(old_index, 'off');", 200);
	}
}
function addComment(postID) {
	var commentWin = window.open("/comments_add.cfm?postID=" + postID, "commentWin", "width=600,height=400,scrollbars=yes,resizable=yes");
	commentWin.focus();
}
function joinList() {
	var joinWin = window.open("http://eepurl.com/bU5u", "joinWin", "width=660,height=610,scrollbars=yes,resizable=yes");
	joinWin.focus();
}
function postFacebook(u,t) {
	window.open('http://www.facebook.com/sharer.php?u='+u+'&t='+t,'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}
