var X = 0;
var Y = 0;

function init() {
  if (window.Event) {
    document.captureEvents(Event.MOUSEMOVE);
  }
  document.onmousemove = getXY;
}


function users_selectOrg(selectBox) {
	if (selectBox.checked == true) {
		document.getElementById('div_functions_organisation_' + selectBox.value).style.display = 'block';
	} else {
		document.getElementById('div_functions_organisation_' + selectBox.value).style.display = 'none';
	}
}

function userShowPic(url, pic){
	if (document.getElementById && !document.all) {
/*firefox */
		document.getElementById('div_user_pic').style.left = X + 20;
		document.getElementById('div_user_pic').style.top = Y - 50;
	} else {
		document.getElementById('div_user_pic').style.left = X + 20 + document.body.scrollLeft;
		document.getElementById('div_user_pic').style.top = Y - 50 + document.body.scrollTop;
	}
	
	document.getElementById('img_user_pic').src = "http://" + url + "/userpic/" + pic;
	document.getElementById('div_user_pic').style.display = 'inline';
}
function userHidePic(url){
	document.getElementById('img_user_pic').src = "http://" + url + "/empty_user.gif";
	document.getElementById('div_user_pic').style.display = 'none';
}

function getXY(e) {
  X = (window.Event) ? e.pageX : event.clientX;
  Y = (window.Event) ? e.pageY : event.clientY;
}

function userListChangeShowInActive(checkbox) {
	if (checkbox.checked == true) {
		displayPage('users_edit_list', 'div_users_edit', '&userListShowInActive=1');
	} else {
		displayPage('users_edit_list', 'div_users_edit', '&userListShowInActive=0');
	}
	//alert('userListChangeShowInActive: ' + checkbox.checked);
	
}

function calEditListChangeShowInActive(checkbox) {
	if (checkbox.checked == true) {
		displayPage('calender_edit_list', 'div_calender_edit', '&calEditShowInActive=1');
	} else {
		displayPage('calender_edit_list', 'div_calender_edit', '&calEditShowInActive=0');
	}
	//alert('userListChangeShowInActive: ' + checkbox.checked);
	
}

function userListChangeShowUserLevel(selectbox) {
	x = document.getElementById('select_userlist_userlevel')[document.getElementById('select_userlist_userlevel').selectedIndex].value;
	displayPage('users_edit_list', 'div_users_edit', '&userListShowUserlevel=' + x);
}

function userListChangeShowFunc(selectbox) {
	x = document.getElementById('select_userlist_userfunction')[document.getElementById('select_userlist_userfunction').selectedIndex].value;
	displayPage('users_edit_list', 'div_users_edit', '&userListShowUserFunction=' + x);
}

function userListChangeShowOrg(selectbox) {
	x = document.getElementById('select_userlist_userorg')[document.getElementById('select_userlist_userorg').selectedIndex].value;
	displayPage('users_edit_list', 'div_users_edit', '&userListShowUserOrg=' + x);
}

function subscribeListShow() {
	document.getElementById('div_subscribeListShowHide').style.display = 'inline';
}

function subscribeListHide() {
	document.getElementById('div_subscribeListShowHide').style.display = 'none';
}

function userListChangeShowWithPic(selectbox) {
	//alert(selectbox.checked);
	if (selectbox.checked)
		displayPage('neuropianen', 'container', '&userListChangeShowWithPic=1');
	else
		displayPage('neuropianen', 'container', '&userListChangeShowWithPic=0');
}

function userListChangeShowWithPicSel() {
	tmpSel = document.getElementById('sel_showUsersWithPic').selectedIndex;
	displayPage('neuropianen', 'container', '&userListChangeShowWithPic=' + tmpSel);
}

function fiche_changeCountry() {
	x = document.getElementById('fiche_country')[document.getElementById('fiche_country').selectedIndex].value;
	if (x == 'NL') {
		document.getElementById('tr_rrn_be').style.display = 'none';
		document.getElementById('tr_rrn_nl').style.display = 'inline';
	} else {
		document.getElementById('tr_rrn_be').style.display = 'inline';
		document.getElementById('tr_rrn_nl').style.display = 'none';
	}
}

function confirmations_switchGroup() {
	x = document.getElementById('sendToGroup')[document.getElementById('sendToGroup').selectedIndex].value;
	if (x == 0){
		document.getElementById('tr_notSend').style.display = 'inline';
		document.getElementById('tr_notConfirmed').style.display = 'inline';
	} else if (x == 1) {
		document.getElementById('tr_notSend').style.display = 'inline';
		document.getElementById('tr_notConfirmed').style.display = 'none';
	} else {
		document.getElementById('tr_notSend').style.display = 'none';
		document.getElementById('tr_notConfirmed').style.display = 'inline';
	}
}




