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

function disableFilterInputs(){
	document.getElementById("publicationDateValue").disabled=true;
	document.getElementById("publicationDateType").disabled=true;
}

function initialise(){	
	if(document.getElementById("filter").checked) {
		enableFilterInputs();}
	else {
		disableFilterInputs();
	}
	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,end) {
  	var objdiv = document.getElementById("toolbox" + gearId);
  	if (end == 0) {
  		if (document.getElementById('td_serv'+gearId+'0') == null && document.getElementById('td_serv'+gearId+'material0') == null) {
  		  	objdiv.style.display='none';
  		}
  	}
}
function go() {
	var loc;
	for (i=0 ; i<document.listform.listbox.length ; i++) {
		if(document.listform.listbox.options[i].selected == true) {
			loc = document.listform.listbox.options[i].value;
		}
	}
	window.location.href=loc;
}
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 windowOpen(filepath) {
	newWindow = window.open(filepath, 'wpop', 'menubar=No,toolbar=No,titlebar=No,location=No,height=550px,width=650px,scrollbars=yes,resizable=yes,status=yes');
	newWindow.self.focus();
}
function windowOpen2(filepath) {
	window.open(filepath, 'wpop', 'menubar=No,toolbar=No,titlebar=No,location=No,height=550px,width=650px,scrollbars=yes,resizable=yes,status=yes');
}

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