function preload(imgID, suffix) {
	if (document.images) {            		eval(imgID + 'over = new Image()');		eval(imgID + 'over.src = "images/core/' + imgID + '_on.' + suffix + '"');		eval(imgID + 'reg = new Image()');		eval(imgID + 'reg.src = "images/core/' + imgID + '_off.' + suffix + '"');		}	}

function m_over(type, num) {	if (document.images) {		imgOver = eval(type + 'over.src');		document[type + num].src = imgOver;
		}	}

function m_out(type, num) {	if (document.images) {		imgReg = eval(type + 'reg.src');		document[type + num].src = imgReg;		}	}
		
function toggle(divName) {
	var currentA;

	currentA = (getStyleObject(divName).display == 'none') ? 'block' : 'none';
	getStyleObject(divName).display = currentA;
	}

function off(divName) {
	getStyleObject(divName).display = 'none';
	}
	
function on(divName) {
	getStyleObject(divName).display = 'block';
	}
function getStyleObject(objectId) {    if(document.getElementById && document.getElementById(objectId)) {		return document.getElementById(objectId).style;		} else if (document.all && document.all(objectId)) {		return document.all(objectId).style;	 	} else if (document.layers && document.layers[objectId]) {		return document.layers[objectId];    	} else {		return false;    	}    }
    
function switchTo (which) {
	off('alert');
	off('search');
	off('columns');
	off('loginform');
	off('about');
	
	on(which);
	}
	
function moveMap (direction) {
	var the_style = getStyleObject("smallmap");
	
	var the_top;
	if (direction == "up") {
		the_top = parseInt(the_style.top) - 40;
		} else {
		the_top = parseInt(the_style.top) + 40;
		}
		
	if (document.layers) { 
		the_style.top = the_top; 
		} else { 
		the_style.top = the_top + "px"; 
		}
	}

function findTag (number) {
	switchTo('search');
	showTags(number);
	window.scroll(0,150); 
	}

function showPost(nmbr) { 
	xmlHttp=GetXmlHttpObject();
 
	var url="search.php";
	url = url + "?p=" + nmbr;
	url = url + "&t=" + count;
	count++;
	
	postNo = nmbr;
	
	xmlHttp.onreadystatechange = stateChangePost;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	}
	
function findMusic() {
	xmlHttp=GetXmlHttpObject();
 
	var url="music.php";
	url = url + "?t=" + count;

	count++;
	
	xmlHttp.onreadystatechange = stateMusic;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
	var t=setTimeout("findMusic();",180000);
	}
	
var timer = new Array();
var flags = new Array();

function startclock(divis, pid) {
	flags[divis] = 1;
	//timer[divis] = setTimeout("popuptimer(" + divis + ", '" + pid + "');", 500);
	popuptimer(divis, pid);
	}
	
function stopclock(divis) {
	flags[divis] = 0;
	//timer[divis] = setTimeout("popuptimer(" + divis + ", '');", 100);
	popuptimer(divis,'');
	}
	
function popuptimer(divis, pid) {
	if (flags[divis]) {
		on('tools' + divis);
		on('tools' + divis + 'top');
		
		if (pid) { gat('Post', 'Viewed', pid); }
		} else {
		off('tools' + divis);
		off('tools' + divis + 'top');
		}
	}
	
function stateMusic() {
	if (xmlHttp.readyState==4) {
		if (xmlHttp.responseText != "no") {	
			on('music');
		
		    if(document.getElementById && document.getElementById("musicnew")) {				document.getElementById("musicnew").innerHTML = xmlHttp.responseText;				} else if (document.all && document.all("musicnew")) {				document.all("musicnew").innerHTML = xmlHttp.responseText;		 		} else if (document.layers && document.layers["musicnew"]) {				document.layers["musicnew"].innerHTML = xmlHttp.responseText;		    	}
		    } else {
		    off('music');
		    }
	    }    }
    
function gat(cat, act, lab) {
	_gaq.push(['_trackEvent', cat, act, lab]);
	}