/* Not over the area */
function normalCSS(obj){
	cssNameSwap(obj, "Active", "Normal");
	cssNameSwap(obj, "Hover",  "Normal");
}

/* Hovering, no click */
function hoverCSS(obj){
	cssNameSwap(obj, "Normal", "Hover");
	cssNameSwap(obj, "Active", "Hover");
}

/* Once clicked, and still hovering */
function activeCSS(obj){
	cssNameSwap(obj, "Normal", "Active");
	cssNameSwap(obj, "Hover",  "Active");
}

/* Swaps out names partial or whole, so be careful */
function cssNameSwap(obj, oldClass, newClass){
	obj.className = strRep(obj.className, oldClass, newClass);
}

/* Not written too well actually, searches string repeatedly until all
   search is swaped wtih replace */
function strRep(str, search, replace){
	if(search == replace)
		return str;

	while((i = str.indexOf(search)) >= 0){
		str = str.substring(0,i) + replace + str.substring(i+search.length,str.length);
	}

	return str;
}


function openNewImageWindow(url)
{ 
	new_window = window.open(url,'window_name','toolbar=0,menubar=0,resizable=0,dependent=0,status=0,width=630,height=480,left=25,top=25')
	new_window.focus();
}
