if (window.top != window.self) window.top.location.replace(window.self.location.href);

var listNames = new Array("arcade","tools","code");
quote = new Array();
quote[0] = 'all the lamest stuff ever in one place.'; 
quote[1] = 'quality web garbage since 1873.'; 
quote[2] = 'pure crap.'; 
quote[3] = 'better than a root canal.'; 
quote[4] = "pants? what pants?";
quote[5] = "quick! be funny!";
quote[6] = "web experiments gone horribly awry.";
quote[7] = "more coffee please.";
quote[8] = "alpha filter abuse at its finest."
quote[9] = "lvl 54 sk lfg";
quote[10] = "making browsers do things they shouldn't.";
quote[11] = "i love arrays";
quote[12] = "practical application? of course not.";
quote[13] = "beer++;";
quote[14] = "like the band, not the buffy.";
quote[15] = "not a single line of code written while sober.";
quote[16] = "I'm taller than Zeldman.";
quote[17] = "Wealthy Undead Warrior Florist";
quote[18] = "... .-.. .- -.-- . .-. --- ..-. ..-. .. -.-. .";
quote[19] = "Come to the DOM Side of the Force...";
quote[20] = "Why are you chasing me, mechanical yeti? WHY!?";

var openMenu="";
gecko = navigator.userAgent.toLowerCase();
gecko = gecko.indexOf('gecko');

function ocw() {
	openWin("http://slayeroffice.com/comment.html",400,250);
}

function openWin(url,wdth,hght) {
	t = (screen.width-wdth)/2;
	l = (screen.height-hght)/2;
	w=window.open(url,'cWin','nostatus,resizable=no,scrollbars=1,width='  + wdth + ',height=' + hght + ',top=' + t + ',left=' + l);
}

window.onload=init;

function init() {
	stupidQuote();
	if(document.getElementById("navigation").offsetHeight<document.getElementById("content").offsetHeight)document.getElementById("navigation").style.height=document.getElementById("content").offsetHeight+"px"
	setOldTitles();
}

function stupidQuote() {
	if(!document.getElementById)return;
	document.getElementById('mQuote').innerHTML = "\"" + quote[Math.floor(Math.random() * quote.length)] + " \"";	
	
	try {
		nTitle = document.getElementById("mContainer").getElementsByTagName("h2")[0].innerHTML;
	} catch(err) {
		nTitle = "slayeroffice | web experiments gone horribly awry";
	}

	if(nTitle.indexOf("<")==-1) {
		document.title = "slayeroffice | " + nTitle;
	}

	if(document.getElementsByTagName("h2")[0].parentNode.className != "news") {
		document.title = "slayeroffice | web experiments gone horribly awry";
		cObj = document.getElementById("content");
		div = cObj.appendChild(document.createElement("div"));
		div.className = "news";
		h2 = div.appendChild(document.createElement("h2"));
		h2.appendChild(document.createTextNode("Well, crap..."));
		p = div.appendChild(document.createElement("p"));
		p.appendChild(document.createTextNode("Sorry, we seem to be having some sort of server related issue at the moment. Hopefully we'll have it straightened out in a bit. In the meantime, the links to the right should all work just fine."));	
	}
}

function setOldTitles() {
	aObj = document.getElementsByTagName("a");
	for(i=0;i<aObj.length;i++) {
		if(aObj[i].className == "old") aObj[i].title="This is an older experiment and is only listed for historical purposes. Using it is considered unwise.";
	}
}

function openCommentWindow(newsID) {
	url = "/scripts/comment_scripts/comments.php?id=" + newsID;
	lft = (screen.width - 580)/2;
	tp = (screen.height - 400)/2;
	popWin = window.open(url,"popWin","width=580,height=400,scrollbars=yes,top=" + tp + ",left=" + lft);
}

function submitComment() {
	document.forms[0].comment_id.value = Date.parse(new Date());
	document.forms[0].submit();
}

