function changeState(category_name,custom_category_name) {
	custom_category = eval('document.forms[0].' + custom_category_name);
	category_obj = eval('document.forms[0].' + category_name);
	str = category_obj.options[category_obj.selectedIndex].text
   	if(str == 'Other') {
   	  custom_category.disabled=false;
	  custom_category.value="";
	}
	else {
	  custom_category.value="";
	  custom_category.disabled=true;
	}
}

function categoryInit(name, custom_string, category_string){
	
	custom_category = eval('document.forms[0].' + name);	
	
	if (custom_string.length < 1) {
		if (category_string == 'Other') {
   			custom_category.disabled=false;
			custom_category.value=custom_string;
		} else{
			custom_category.value="";
			custom_category.disabled=true;
		}
	} else {
		custom_category.disabled=false;
		custom_category.value=custom_string;
	}
}

function changeType(type_name,url_name,document_name){

	url = eval('document.forms[0].'+url_name);
	type = eval('document.forms[0].'+type_name);
	document_obj = eval('document.forms[0].'+document_name);
	str = type.options[type.selectedIndex].text
	if(str == 'Demo' || str == 'Application') {
		document_obj.disabled=true;
		url.disabled=false;
	}
	else {
		document_obj.disabled=false;
		url.disabled=true;
	}
}
function initType(type_value,url_name,document_name){
	document_obj = eval('document.forms[0].'+document_name);
	url = eval('document.forms[0].'+url_name);
	if(type_value == 'Application' || type_value == 'Demo') {
		url.disabled=false;
		document_obj.disabled=true;
	}
	else {
		url.disabled=true;
		document_obj.disabled=false;
	}
}

function changeSelectedInstitution() {
	institution = eval(document.account_form.institution);	

	other = eval(document.account_form.other_institution);
	selected = institution.options[institution.selectedIndex].text;
	
	if ('Other Institution' == selected) {
		other.disabled = false;
	} else {
		other.disabled = true;
	}
}

function enableOtherInstitution() {
	institution = eval(document.account_form.institution);
	other = eval(document.account_form.other_institution);
	
	institution.selectedIndex = institution.options.length - 1;
	
	other.disabled = false;
	
}

