// JavaScript Document

function init() {
	if($('authimage')!=null) {
		getAuthImage();					
	}
	startList();
}

function getAuthImage() {
	var reference = Math.floor(Math.random() * 9999999);
	$('authimage').innerHTML = "Copy text (<a href=\"javascript:getAuthImage()\">refresh</a>) <img src='http://www.afxdesign.com/getAuthImage.php?reference= " + reference + "' /><input type='hidden' name='imagereference' value='" + reference + "' /><input type='text' name='imagetext' style='width: 60px; height: 20px;' />";
}

function setArticle(id) {
	var url = "ajaxarticles.php?id="+id;
	$('text').set('load', {method: 'get',evalScripts: true});
	$('text').load(url);
	var size = $('text').getPosition();
	$('body').scrollTo(0,size.y);
}

/* DomReady Event fires when all Elements are ready, but not images. */
window.addEvent('domready', function() {
	init();	
});

function startList() 
{
	if (document.all&&document.getElementById("nav")) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					//this.className+=" over";
					this.className += " over";
				 }
				node.onmouseout=function() {
				this.className=this.className.replace(" over", "");
				}
			}
	  }
	}
}
	


