function confirmAction(message,action) {
	if (confirm(message)) {
		document.location = action;
	}
}

//*******************************************************************************************************************************************************************
//******** Highlight TABLE CELLS*************************************************************************************************************************************
//******** http://www.dynamicdrive.com/dynamicindex11/highlighttable.htm ********************************************************************************************


//Specify highlight behavior. "TD" to highlight table cells, "TR" to highlight the entire row:
var highlightbehavior="TR"

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
	source=ie? event.srcElement : e.target
	if (source.tagName=="TABLE")
	return
	while(source.tagName!=highlightbehavior && source.tagName!="HTML")
	source=ns6? source.parentNode : source.parentElement
	if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
	source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
	while (slave.parentNode)
	if ((slave = slave.parentNode) == master)
	return true;
	return false;
}

function changeback(e,originalcolor){
	if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
		return
	else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
		return
	if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
	source.style.backgroundColor=originalcolor
}


//*******************************************************************************************************************************************************************
//******** Show and hide div's subnavigations ***********************************************************************************************************************

// MAILINGLIST DIV
function toggleMailingLists(link, divid) {
    var div = document.getElementById(divid);
    if (div.style.display == 'none') {
        div.style.display = 'block';
		document.downUp2.src = '../wwwroot/imgs/layout/contacts/up.jpg';
        /*link.innerHTML = 'up.jpg';*/
    } else {
        div.style.display = 'none';
		document.downUp2.src = '../wwwroot/imgs/layout/contacts/down.jpg';
        /*link.innerHTML = 'down.jpg';*/
    }
}
// CONTACTS DIV
function toggleContacts(link, divid) {
    var div = document.getElementById(divid);
    if (div.style.display == 'none') {
        div.style.display = 'block';
		document.downUp3.src = '../wwwroot/imgs/layout/contacts/up.jpg';
        /*link.innerHTML = 'up.jpg';*/
    } else {
        div.style.display = 'none';
		document.downUp3.src = '../wwwroot/imgs/layout/contacts/down.jpg';
        /*link.innerHTML = 'down.jpg';*/
    }
}

// CLIENTS SELECTBOX
function toggleClients(field, status) {
    var div = document.getElementById(field);
    	div.style.display = status;
}

// GROUP SELECTBOX
function toggleGroups(field, status) {
    var div = document.getElementById(field);
    	div.style.display = status;
}

//*******************************************************************************************************************************************************************
//******** Show and hide div's main navigation **********************************************************************************************************************


// nieuwe array om over te loopen
var contextMenuArray = new Array()
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
// array bevolken
function addContextMenu(id) {
	contextMenuArray[contextMenuArray.length] = id;
}
// om div te tonen
function DisplayMenu(id)	{
	document.getElementById(id).style.visibility = 'visible';
}
// alles verstoppen
function hideMenuAll() {
	for (i = 0;i <= contextMenuArray.length-1;i++) {
		document.getElementById(contextMenuArray[i]).style.visibility = 'hidden';
	}
}

function jumpto(e){
	var firingobj=ie5? event.srcElement : e.target
	if (firingobj.getAttribute("target"))
		window.open(firingobj.getAttribute("url"),firingobj.getAttribute("target"))
	else
		window.location=firingobj.getAttribute("url")
}
// alles verstoppen als ge ergens in het venster klikt
document.onclick = hideMenuAll;


//*******************************************************************************************************************************************************************
//******** OPENING CENTERED WINDOW **********************************************************************************************************************************

function openW(mypage,myname,w,h,features) {
if(screen.width){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
}else{winl = 0;wint =0;}
	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;
	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += features;
	win = window.open(mypage,myname,settings);
	win.window.focus();
}


//*******************************************************************************************************************************************************************
//******** ENABLE AND DISABLE FORM FIELDS****************************************************************************************************************************

function enableField(field1,field2)
{
document.frm[field1].disabled=false;
document.frm[field2].disabled=false;
}

function disableField(field)
{
document.frm[field].disabled=true;
}

// *** CHECK CHECKBOX
//--------------------
function check(chckField) 
{	
document.frm[chckField].checked = true;
}

