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>');
}

if(document.images) {
	// preload
	nav0 = new Image();
	nav0.src = "/images/nav_home_on.gif";
	nav1 = new Image();
	nav1.src = "/images/nav_cats_on.gif";
	nav2 = new Image();
	nav2.src = "/images/nav_galleries_on.gif";
	nav3 = new Image();
	nav3.src = "/images/nav_resources_on.gif";
	nav4 = new Image();
	nav4.src = "/images/nav_links_on.gif";
	nav5 = new Image();
	nav5.src = "/images/nav_connect_on.gif";
	nav6 = new Image();
	nav6.src = "/images/btn_go_on.gif";
	
	image6 = new Image();
	image6.src = "/images/btn_comment_on.gif";
	image7 = new Image();
	image7.src = "/images/btn_send_on.gif";
	image8 = new Image();
	image8.src = "/images/btn_link_on.gif";
	image11 = new Image();
	image11.src = "/images/btn_products_on.gif";
	image12 = new Image();
	image12.src = "/images/btn_school_on.gif";
	image13 = new Image();
	image13.src = "/images/btn_forum_on.gif";
	image14 = new Image();
	image14.src = "/images/btn_contests_on.gif";
}
function nav(imgName, state) {
	document.images[imgName].src = "/images/nav_" + imgName + "_" + state + ".gif";
}
function getWidth() {
	if(document.all)
		availableWidth = document.body.scrollWidth;
	else {
		availableWidth = window.innerWidth;
		if(availableWidth < 982)
			availableWidth = 982;
	}
	return availableWidth;
}
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 = 201;
			document.getElementById(index + "Sub").style.left = ((getWidth() - 982) / 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');", 100);
	}
}
function addComment(postID) {
	if(document.getElementById("commentDiv" + postID).style.display == "none")
		viewComments(postID);
	var commentWin = window.open("/comments_add.cfm?postID=" + postID, "commentWin", "width=600,height=400,scrollbars=yes,resizable=yes");
	commentWin.focus();
}
function viewComments(postID) {
	if(document.getElementById("commentDiv" + postID).style.display == "none") {
		document.getElementById("commentDiv" + postID).style.display = "block";
		document.getElementById("commentsShow" + postID).style.display = "none";
		document.getElementById("commentsHide" + postID).style.display = "inline";
	}
	else {
		document.getElementById("commentDiv" + postID).style.display = "none";
		document.getElementById("commentsShow" + postID).style.display = "inline";
		document.getElementById("commentsHide" + postID).style.display = "none";
	}
}
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;
}

