function processListInputs(status){
	document.getElementById("publicationDateListShared").disabled=status;
	document.getElementById("overviewListShared").disabled=status;
	document.getElementById("authorListShared").disabled=status;
	document.getElementById("taxonomyListShared").disabled=status;
	document.getElementById("attachedFileListShared").disabled=status;
	document.getElementById("numberListShared").disabled=status;
	document.getElementById("publicationDateListFull").disabled=status;
	document.getElementById("overviewListFull").disabled=status;
	document.getElementById("authorListFull").disabled=status;
	document.getElementById("taxonomyListFull").disabled=status;
	document.getElementById("attachedFileListFull").disabled=status;
	document.getElementById("numberListFull").disabled=status;
	document.getElementById("maxNumberListFull").disabled=status;
	document.getElementById("criteriaDisplayList").disabled=status;
	document.getElementById("orderDisplayList").disabled=status;
	
	if (status == true) {
		status = false;
	} else {
		status = true;
	}
	document.getElementById("keywordSearch").disabled=status;
	document.getElementById("categorySearch").disabled=status;
	document.getElementById("keywordSearchno").disabled=status;
	document.getElementById("categorySearchno").disabled=status;
	document.getElementById("numberSearch").disabled=status;
	document.getElementById("publicationDateSearch").disabled=status;
	document.getElementById("overviewSearch").disabled=status;
	document.getElementById("authorSearch").disabled=status;
	document.getElementById("taxonomySearch").disabled=status;
	document.getElementById("attachedFileSearch").disabled=status;
	document.getElementById("criteriaDisplaySearch").disabled=status;
	document.getElementById("orderDisplaySearch").disabled=status;
}

function processFilterInputs(status){
	document.getElementById("publicationDateValue").disabled=status;
	document.getElementById("publicationDateType").disabled=status;
}

function enableGearTitle(){
	if(document.getElementById("geartitle").checked){
		document.getElementById("geartitlelabel").disabled=false;
	} else {
		document.getElementById("geartitlelabel").disabled=true;
	}
	
}

function initialise(){	
	if(document.getElementById("displayMode").checked){
		processListInputs(false);
	} else {
		processListInputs(true);
	}
	if(document.getElementById("publicationDateFilter").checked){
		processFilterInputs(false);
	} else {
		processFilterInputs(true);
	}
	enableGearTitle();
}

function enableEmailInputs(){
	document.getElementById("materialEmail").disabled=false;
}

function disableEmailInputs(){
	document.getElementById("materialEmail").disabled=true;
}

function initialize(){
	checkEmailInputs();
}

function checkEmailInputs(){
	if (document.getElementById("check_eipf_service_000003").checked) {
		enableEmailInputs();
	} else {
		disableEmailInputs();
	}
}
function hide(gearId, fin) {
	var objdiv = document.getElementById("toolbox" + gearId);
	var end = fin;
	if (end == 0) {
		if (document.getElementById('td_serv' + gearId + '0') == null) {
		  objdiv.style.display='none';
		}
	}
}
function popupAttach(path){
	newWindow = window.open(path, 'wpop', 'menubar=No,toolbar=No,titlebar=No,location=No,height=550px,width=650px,scrollbars=yes,resizable=yes,status=yes');
	newWindow.self.focus();
}
function openLink(url) {	
	var popup = window.open(url,'materialrequest','width=500,height=400,scrollbars=yes,status=no,toolbar=no,resizable=yes,menubar=no,location=no,modal');
	popup.focus();
}

function popitup(url,name,params)
  {
	newwindow=window.open(url,name,params);
	if (window.focus) {newwindow.focus()}
	return false;
  }

function switchOnOff(id){
	if (document.getElementById(id).style.display == 'inline'){
		document.getElementById(id).style.display = 'none';
	}else if(document.getElementById(id).style.display == 'none'){
		document.getElementById(id).style.display = 'inline';
	}else{
		document.getElementById(id).style.display = 'none'
	}
}