﻿
function enableDisable0()
{
   if(document.myform.select_tutor.selectedIndex==0)
	{
		document.myform.newtutor_fieldset.style.display = 'inline';
	}else{
		document.myform.newtutor_fieldset.style.display = 'none';
	}
}

function enableDisable1()
{
   if(document.myform.newvalue.selectedIndex==0)
	{
	   document.myform.newtutor_fieldset.style.display = 'inline';
	}else{
		document.myform.newtutor_fieldset.style.display = 'none';
	}
}

function enableDisable2()
{
   if(document.myform.is_history.checked)
	{
		document.myform.aplicants_history.style.display = 'block';
		document.myform.label1.style.display = 'inline';
	}else{
		document.myform.aplicants_history.style.display = 'none';
		document.myform.label1.style.display = 'none';
	}
}


function enableDisable3()
{
   if(document.myform.org_jo.selectedIndex==0)
	{
		document.myform.newjo_fieldset.style.display = 'inline';
	}else{
		document.myform.newjo_fieldset.style.display = 'none';
	}
}
function enableDisable4()
{
   if(document.myform.innyR.checked==true)
	{
		document.myform.other.style.display = 'inline';
	}else{
		document.myform.other.style.display = 'none';
	}
}
function enableDisable5()
{
   if(document.myform.niedotyczy.checked==true)
	{
		document.myform.bioethics_reason.style.display = 'inline';
	}else{
		document.myform.bioethics_reason.style.display = 'none';
	}
}
function enableDisable6(divID)
{
	var item = document.getElementById(divID);
  	if (item) {
   		 item.className=(item.className=='hiddeneventlist_description')?'unhiddeneventlist_description':'hiddeneventlist_description';
	}
}
function enableDisable7()
{
   if(document.myform.nonsubmiterfirstauthor.checked==true)
	{
		document.myform.publication_other_first_author.style.display = 'inline';
	}else{
		document.myform.publication_other_first_author.style.display = 'none';
	}
}
function enableDisable8newLecturePrize()
{
   if(document.myform.publication_isinternational.selectedIndex!=2)
	{
		document.getElementById('prizediv1').style.display = 'inline';
		document.getElementById('prizediv2').style.display = 'inline';
	}else{
		document.getElementById('prizediv1').style.display = 'none';
		document.getElementById('prizediv2').style.display = 'none';
	}
}
function enableDisable9newReviewer()
{
   if(document.myform.publication_isinternational.selectedIndex!=2)
	{
		document.getElementById('prizediv1').style.display = 'inline';
		document.getElementById('prizediv2').style.display = 'inline';
	}else{
		document.getElementById('prizediv1').style.display = 'none';
		document.getElementById('prizediv2').style.display = 'none';
	}
}
/*arrayOfFieldsetNamesAndIndexes must be 3 dimensional*/
function enableDisableFieldsetBySelection(arrayOfFieldsetNamesAndIndexes)
{
	for( x in arrayOfFieldsetNamesAndIndexes )
	{
		var pFieldsetName = arrayOfFieldsetNamesAndIndexes[x][0];
		var pSelectionName = arrayOfFieldsetNamesAndIndexes[x][1];
		var pSelectionIndex = arrayOfFieldsetNamesAndIndexes[x][2];
		for (var i = 0; i < document.myform[pSelectionName].options.length; i++)
		{ 
			
			if(i!=pSelectionIndex)
				continue;
			if(document.myform[pSelectionName].options[i].selected)
			{
				document.myform[pFieldsetName].style.display = 'inline';
			}else{
				document.myform[pFieldsetName].style.display = 'none';
			}
		}
	}
}
function countSelection(selection)
{

}

