/* clientlist popup */

function cl_show() {
	document.getElementById('clientlist-popup').style.top="130px";
	document.getElementById('clientlist-popup').style.left="550px";
	document.getElementById('clientlist-popup').style.visibility="visible";
}

function cl_hide() {
	document.getElementById('clientlist-popup').style.top="-300px";
		document.getElementById('clientlist-popup').style.left="-550px";
	document.getElementById('clientlist-popup').style.visibility="hidden";
}

/* menu rollovers */
function registerMenuItem(img) {
	// compile alternative src
	img._src_original = img.src;
	img._src_alt = img.src.replace('/menu/off/', '/menu/on/');
	
	// preload
	img._img_alt = new Image();
	img._img_alt.src = img._src_alt;
	
	// attach events
	img.onmouseover = function() {
		this.src = this._src_alt;
	}
	
	img.onmouseout = function() {
		this.src = this._src_original;
	}
}

function initMenu() {
	imgs = document.getElementsByTagName('img');
	for (x=0;x<imgs.length;x++) {
		img = imgs[x];
		if (img.src.search('/menu/off/')) registerMenuItem(img);
	}	
}



/* random images */
function randomizeImage() {
	p = document.getElementById('random_image');
	if (!p) return;
	random = Math.round((Math.random()*9));
	if (random<1) random = 1;
	if (random>9) random = 9;
	p.innerHTML = '<img src="lib/img/random/image'+random+'.jpg" alt="Mari Mererid Williams" />';
}

function bbblink() {
	link = document.getElementById('bbb-link');
	if (!link) return;
	link.onmouseover = function() {
		this.src='lib/img/other/credit_on.gif';
	}
	
	link.onmouseout = function() {
		this.src='lib/img/other/credit_off.gif';
	}
}
/* onload */
window.onload = function() {
	initMenu();
	bbblink();
}