//Current 3/8/2004
//=======================================================================
//Created by Michael Alperovich
//The function displays/hides a field based on the parameters passed
//fieldName is a TAG ID
//blnstate is 0/1  (hide/show)
function toggle(blnState, fieldName)
{
	//get an array of fields with the fieldName that is given
	var objFields = document.getElementsByName(fieldName);
    //alert("Hello " + fieldName);

	//loop through the field and show or hide them
  	for(i=0;i<objFields.length;i++)
  	{
   		if (blnState == 0)
   		{
    			// hide the field
    			objFields[i].style.display = 'none';
   		}
   		else
   		{
   			// show the field
    			objFields[i].style.display = '';
   		}
  	}

 }

//=======================================================================
//Created by Michael Alperovich
//The function switchs fields based on the parameters passed
//Doc1, Doc2 are TAG NAMEs
//show one or another information
 function Switch(show, doc1, doc2){
 	if (show==1){
 		toggle(1, doc1);
 		toggle(0, doc2);
	}

 }


//=======================================================================
//Created by Dimitrios Papapostolu
//The function is called with the parameters 
//for the elements to be switched
//before that happens, a disclaimer is shown to the user
//dFile= relative path to the file of the disclaimer
//figures = ID of a TAG that is hidden
//disclaimer = ID of a TAG that is visible
function question2user(dFile, figures, disclaimer)
{
	//Temporaliy flag, for switching all the Partner-Fonds elements with one click
	var switchAll=1;
	var ShowInfo=showModalDialog(dFile ,"","dialogWidth:30 em;dialogHeight:27 em;scrolling: auto; status: no; resizable: no; help: no;");
	//alert (ShowInfo);
	//switch function is called here with the given parameters
	
 	if (switchAll==1){
		//Switching all the hidden Partner-Fonds elements - manual parameters
		Switch(ShowInfo, "STP_figures", "STP_disclaimer");		
		Switch(ShowInfo, "GEAR_figures", "GEAR_disclaimer");		
	} else {
		Switch(ShowInfo, figures, disclaimer);
	}
}


//=======================================================================
//Created by Michael Alperovich
//The function redirects the URL
function DisplayPage(show, showURL){
 	if (show==1){
		top.location.replace(showURL);
	}
}

//=======================================================================
//Created by Michael Alperovich
//displayes an alert
function DisplayAlert(text){
	alert(text);
}
