function mouseOver(adminButton)
{
	var splittedSrc = adminButton.src.split("/");
	var restSrc = "";
	fileName = splittedSrc[splittedSrc.length-1];
	for(var i=0;i<splittedSrc.length-1;i++)
	{
		restSrc += splittedSrc[i] + "/";
	}
	var splittedFileName = fileName.split(".");
	adminButton.src =  restSrc + splittedFileName[0] + "_hov" + "." + splittedFileName[1];
}

function mouseOut(adminButton)
{
	var splittedSrc = adminButton.src.split("/");
	var restSrc = "";
	fileName = splittedSrc[splittedSrc.length-1];
	for(var i=0;i<splittedSrc.length-1;i++)
	{
		restSrc += splittedSrc[i] + "/";
	}
	var splittedFileName = fileName.split(".");	
	var newFileName = splittedFileName[0].substring(0,splittedFileName[0].length-4);
	adminButton.src =  restSrc + newFileName + "." + splittedFileName[1];
}

function replaceImage(elm, newImage)
{
	document.getElementById(elm).src = newImage;
}

function mainMenuMouseOver(obj, id, hiImg)
{
	obj.className = 'mainMenuCellActive'; 
	replaceImage('mainMenuItem_'+id, hiImg); 
	obj.style.cursor = 'pointer';
}

function mainMenuMouseOut(obj, id, img)
{
	obj.className = 'mainMenuCell'; 
	replaceImage('mainMenuItem_'+id, img); 
	obj.style.cursor = '';
}

function relocate(addr)
{
	document.location = addr;
}

function windowPrint(url, w, h)
{
	//alert(url);
	printWindow=window.open(url,"Window_print","menubar=no,scrollbars=1,left=100,top=100,width="+w +" ,height="+h +",resizable=1")
}

var exampleWindow;
function windowExample(url, w, h)
{
	//alert(url);
	if(exampleWindow)
		exampleWindow.focus();
	exampleWindow=window.open(url,"Window_print","menubar=no,scrollbars=1,left=10,top=1,width="+w +" ,height="+h +",resizable=1")
}

function openWindow(text)
{
	while((text.indexOf("%BR%") != -1))
	{
		text = text.replace("%BR%","<BR>");
	}
	myWin = window.open("","nCt", "left=400, top=300,width=180,height=30,status=no,toolbar=no,menubar=no,scrollbars=auto,resizable=yes");
	myWin.document.write("<html><head><title>Note</title></head>");
	myWin.document.write ("<body><script>function closeWindow(){window.close()} \n\n setTimeout(\"closeWindow()\",1000);</script>"+text+"</body></html>");
	//setTimeout("myWin.close()",200);
	//myWin.document.write("<center><p><input type='button' value='Afsluiten' name='close' onClick='window.close()'></p><center>");
}


function menuItemOver(menuItem)
{
	menuItem.style.backgroundColor = 'black';
}

function menuItemOut(menuItem)
{
	menuItem.style.height = "0px";
}

function subMenuItemOver(menuItem)
{
	menuItem.style.color = '#ff0000';
	menuItem.style.backgroundColor = '#0a86bf';
	menuItemId = menuItem.id;
	setMenuText(menuItemId);
}

function setMenuText(itemId, specificValue)
{
	if (specificValue != undefined)
	{
		document.getElementById('historySnippet').innerHTML = specificValue;
	}
	else
	{	
		document.getElementById('historySnippet').innerHTML = document.getElementById('content_'+itemId).value;
	}
}

function subMenuItemOut(menuItem,color)
{
	menuItem.style.backgroundColor = color;
	document.getElementById('menu_mouseover_text').value = '';
}

function changeHistoryCellColor(elmName, event)
{
	if (event != 'out')
	{		
		document.getElementById(elmName).style.cursor = 'pointer'; // Hand over TD
		document.getElementById(elmName).className = 'historyCellActive'; // Mouseover class for TD
		document.getElementById(elmName+'_text_link').className = 'historyLinkActive'; // Mouseover class for A

		setMenuText(elmName);
	}
	else
	{
		document.getElementById(elmName).className = 'historyCell'; // Mouseout class for TD
		document.getElementById(elmName+'_text_link').className = 'historyLink'; // Mouseout class for A

		setMenuText(elmName, ' ');
	}
}

function colorOverviewArea(table, event, imgSrc)
{
	if (event == 'out')
	{
		document.getElementById(table+'_image').bgColor = '';
		document.getElementById(table+'_text').bgColor = '';
		document.getElementById(table+'_image').style.borderBottom = '1px solid #fff';
		document.getElementById(table+'_text').style.borderBottom = '1px solid #fff';
		//document.getElementById(table+'_mainhead').style.display = 'block';
		//document.getElementById(table+'_mainhead_hi').style.display = 'none';
	}
	else
	{
		document.getElementById(table+'_image').bgColor = '#D9EEF7';
		document.getElementById(table+'_text').bgColor = '#D9EEF7';
		document.getElementById(table+'_image').style.borderBottom = '1px solid #0A86BF';
		document.getElementById(table+'_text').style.borderBottom = '1px solid #0A86BF';
		//document.getElementById(table+'_mainhead').style.display = 'none';
		//document.getElementById(table+'_mainhead_hi').style.display = 'block';
	}

	document.getElementById(table+'_mainhead').src = imgSrc;
}

function changeCursorToPointer(obj)
{
	obj.style.cursor = 'pointer';
}