<!--

//**********************************************************
//************** POPUP NUOVO SITO (2003/2004) **************
//**********************************************************

//************** POPUP S&P **************
//apre la popup per l'italiano
function OpenSP()
{
	window.open("http://www.borsaitalia.it/fwa-popup/popup-sp/sp.html",'BIT_SP','width=490,height=205');	
}

//apre la popup per l'inglese
function OpenSP_en()
{
	window.open("http://www.borsaitalia.it/fwa-popup/en/popup-sp/sp.html",'BIT_SP','width=490,height=205');	
}

//************** POPUP MIB30 **************
//apre la popup per l'italiano
function OpenMib()
{
	window.open("http://www.borsaitalia.it/fwa-popup/popup-mib/mib30.html",'BIT_MIB30','width=490,height=205');	
}

//apre la popup per l'inglese
function OpenMib_en()
{
	window.open("http://www.borsaitalia.it/fwa-popup/en/popup-mib/mib30.html",'BIT_MIB30','width=490,height=205');	
}

//************** POPUP STAR *****************
//apre la popup STAR per l'italiano
function OpenStar()
{
	window.open("http://www.borsaitalia.it/fwa-popup/popup-star/st.html",'STAR','width=490,height=205');	
}
//apre la popup STAR per l'inglese
function OpenStar_en()
{
	window.open("http://www.borsaitalia.it/fwa-popup/en/popup-star/st.html",'STAR','width=490,height=205');	
}

//************** POPUP techSTAR *****************
//apre la popup techSTAR per l'italiano
function OpenTS()
{
	window.open("http://www.borsaitalia.it/fwa-popup/popup-ts/ts.html",'techSTAR','width=490,height=205');	
}
//apre la popup techSTAR per l'inglese
function OpenTS_en()
{
	window.open("http://www.borsaitalia.it/fwa-popup/en/popup-ts/ts.html",'techSTAR','width=490,height=205');	
}

//************** POPUP NUMTEL *****************
//apre la popup NUMTEL per l'italiano
function OpenNumtel()
{
	window.open("http://www.borsaitalia.it/fwa-popup/popup-numtel/nm.html",'NUMTEL','width=490,height=205');	
}
//apre la popup NUMTEL per l'inglese
function OpenNumtel_en()
{
	window.open("http://www.borsaitalia.it/fwa-popup/en/popup-numtel/nm.html",'NUMTEL','width=490,height=205');	
}


//************** POPUP SOLE 24 ORE *****************
//apre le popup del sole 24 ore in home page
function openPop(URL)
{
	window.open(URL,'new','scrollbars=no,resizable=no,top=100,left=120,width=730,height=300,status=no,location=no,toolbar=no')
}

//************** CONTROLLO NEW RICERCA A TENDINA IT (07/09/2004) *****************
function check_search()
{

document.formSearchAll.action="";

if (document.formSearchAll.searchType.selectedIndex == "")
	{
		alert("Selezionare i parametri della ricerca");
		return false;
	}
if (document.formSearchAll.searchType.selectedIndex == 1)
	{
		var valuetext = document.formSearchAll.searchText.value;
		if (document.formSearchAll.searchText.value == "")
		{
			alert("Non ? stato specificato alcun argomento per la ricerca");
			return false;
		}
		else
		{
			document.formSearchAll.action = "http://www.borsaitalia.it/fwa-cgi-bin/ItTextSearch.csh?qs="+valuetext+"&searchType=searchArg&key=BitInd&fc=BitInd";
		}
	}
	else if (document.formSearchAll.searchType.selectedIndex == 2)
	{
		var valuetext = document.formSearchAll.searchText.value;
		if (document.formSearchAll.searchText.value == "")
		{
			alert("Non ? stato specificato alcun argomento per la ricerca");
			return false;
		}
		else
		{
			document.formSearchAll.action = "http://www.borsaitalia.it/servlet/HomeController?param_isindesc="+valuetext+"&target=SearchQuotes";
		}
	}
	else if (document.formSearchAll.searchType.selectedIndex == 3)
	{
		var valuetext = document.formSearchAll.searchText.value;
		if (document.formSearchAll.searchText.value == "")
		{
			alert("Non ? stato specificato alcun argomento per la ricerca");
			return false;
		}
		else
		{
			document.formSearchAll.action = "http://www.borsaitalia.it/servlet/SocQuotateResult?nome="+valuetext;
		}
	}
}
 
//************** CONTROLLO NEW RICERCA A TENDINA EN (07/09/2004) *****************
function check_search_en()
{

document.formSearchAll.action="";

if (document.formSearchAll.searchType.selectedIndex == "")
	{
		alert("Select search criteria from combo");
		return false;
	}
if (document.formSearchAll.searchType.selectedIndex == 1)
	{
		var valuetext = document.formSearchAll.searchText.value;
		if (document.formSearchAll.searchText.value == "")
		{
			alert("Insert search parameter!");
			return false;
		}
		else
		{
			document.formSearchAll.action = "http://www.borsaitalia.it/fwa-cgi-bin/EnTextSearch.csh?qs="+valuetext+"&searchType=searchArg&key=BitIndEn&fc=BitIndEn";
		}
	}
	else if (document.formSearchAll.searchType.selectedIndex == 2)
	{
		var valuetext = document.formSearchAll.searchText.value;
		if (document.formSearchAll.searchText.value == "")
		{
			alert("Insert search parameter!");
			return false;
		}
		else
		{
			document.formSearchAll.action = "http://www.borsaitalia.it/servlet/HomeController?param_isindesc="+valuetext+"&target=SearchQuotes&lang=en";
		}
	}
	else if (document.formSearchAll.searchType.selectedIndex == 3)
	{
		var valuetext = document.formSearchAll.searchText.value;
		if (document.formSearchAll.searchText.value == "")
		{
			alert("Insert search parameter!");
			return false;
		}
		else
		{
			document.formSearchAll.action = "http://www.borsaitalia.it/servlet/SocQuotateResult?nome="+valuetext+"&lang=en";
		}
	}
}
 

//************** CONTROLLI RICERCHE *****************
//controllo ricerca quotazione per l'italiano
function check_ric_arg(){
	if (document.formSearch.qs.value=="")
	{
		alert ("Non e' stato specificato alcun argomento per la ricerca");
		return false;
	}
}
//controllo ricerca quotazione per l'inglese
function check_ric_arg_en(){
	if (document.formSearch.qs.value=="")
	{
		alert ("Insert search parameter!");
		return false;
	}
}
//controllo ricerca argomento per l'italiano
function validate(){
if (document.formGetPrice.param_isindesc.value =='') 
	{
		alert ("Non e' stato specificato alcun argomento per la ricerca");
		return false;
	}
}
//controllo ricerca argomento per l'inglese
function validate_en(){
if (document.formGetPrice.param_isindesc.value =='') 
	{
		alert ("Insert search parameter!");
		return false;
	}
}

//cambia il submit in in lunk nel form UserServiceProxy
function submit_link(){
}


//************** POPUP VARIE e GENERICHE *****************
//funzione apertura finestra SENZA DIMENSIONE
function OpenWin(URL,TITLE)
{
	window.open(URL,TITLE);
}

//apre i disclaimer non c'e' distinzione linguistica perche' parametrizzato
function Disclaimer(URL,TITLE)
{
	window.open(URL,TITLE,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizeable=no,copyhistory=no,width=350,height=450,marginwidth=0,marginheight=0');
}
  
//apre i credits: la pagina e' la medesima per l'italiano e l'inglese
function credits_opener()
{
    myfile="http://www.borsaitalia.it/credits/credits.html";
    params = "width=350,height=200,resizable=0,status=0,scrollbars=0,toolbar=0,location=0,directories=0,menubar=0";
    mywindow = window.open( myfile , "credits_opener", params);
}


//************** STAR CONSENSUS *****************
//apre info della sezione star/consensus
function StarConsInfo(URL,TITLE)
{
	window.open(URL,TITLE,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizeable=no,copyhistory=no,width=600,height=550,marginwidth=0,marginheight=0');
}

//apre legenda della sezione star/consensus
function StarConsLegenda(URL,TITLE)
{
	window.open(URL,TITLE,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizeable=no,copyhistory=no,width=800,height=550,marginwidth=0,marginheight=0');
}  
  

//************** DISPLAY *****************
//apre le legende dei display non c'e' distinzione linguistica perche' parametrizzato
function Legenda(URL,TITLE)
{
	window.open(URL,TITLE,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizeable=no,copyhistory=no,width=350,height=450,marginwidth=0,marginheight=0');
}

//apre le legende dei display di secondo livello
function popLeg(URL,TITLE)
{
	window.open(URL,TITLE,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizeable=no,copyhistory=no,width=550,height=580,marginwidth=0,marginheight=0');
}

//apre le legende dei display Fondi di secondo livello
function popLegFondi(URL,TITLE)
{
	window.open(URL,TITLE,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizeable=no,copyhistory=no,width=620,height=550,marginwidth=0,marginheight=0');
}
  
// funzione per PopUp Indici nei display
function openPopUpWindow(title, target, w, h) {
	var url		= target + '&title='+title;
	var param	= 'toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,scrollbars=yes,resizable=yes,width='+w+',height='+h;
	// Apro la finestra
	top.consoleRef = window.open(url, 'popup', param);
}
function openLinkPopup(title, target) {
	openPopUpWindow(title, target, 682, 400);	
}


// funzione per PopUp per i Servizi NIS
function openPopUpNis(url, w, h) {
	var param	= 'toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,scrollbars=yes,resizable=yes,width='+w+',height='+h;
	// Apro la finestra
	top.consoleRef = window.open(url, 'popup', param);
}

//************** GRAFICI *****************
//apre i GRAFICI nelle home page  
function openWindowGraph(location)
{
	var baseURL = "http://grafici.borsaitalia.it/scripts/cligipsw.dll?";
	var k = "";	
	window.open(baseURL+location+k,'640x480','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=455,height=583');
}



function openGraphtechStar(URL,TITLE)
{
	window.open(URL,TITLE,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,copyhistory=no,width=462,height=468,marginwidth=0,marginheight=0');
}


//************** CONTROLLO DIMENSIONI LOGHI SOCIETARI *********************
//1? metodo : 2 funzioni compatte che regolano sia altezza che larghezza
function getSizesImgArray(filepath)
{
	var maxWidth = 200; //Larghezza Max
	var maxHeight = 110; //Altezza Max
	var strWidth = "";
	var strHeight = "";	
	var img = new Image();
	img.src = filepath;	
		
	//alert("img.height: "+ img.height);	
	//alert("img.width: "+ img.width);
	
	var sizesImg = new Array();
  sizesImg['width'] = '';
  sizesImg['height'] = '';
		
	if(img.width > maxWidth && img.height > maxHeight)
	{
		if(img.width  > img.height)
			sizesImg['width'] = " width='"+maxWidth +"' ";
		else
			sizesImg['height'] = " height='"+ maxHeight +"' ";		
	}
	else if(img.width > maxWidth)
		sizesImg['width'] = " width='"+maxWidth +"' ";
	
	else if(img.height > maxHeight) 
		sizesImg['height'] = " height='"+ maxHeight +"' ";	
		
	//alert("sizesImg: "+ sizesImg);
		
	return sizesImg;	
}


//************** CONTROLLO DIMENSIONI LOGHI SOCIETARI *********************
//1? metodo : 2 funzioni compatte che regolano sia altezza che larghezza
function getSizesImgArray2(img)
{
	var maxWidth = 350; //Larghezza Max
	var maxHeight = 110; //Altezza Max
			
	//alert("img.height-->: "+ img.height);	
	//alert("img.width -->: "+ img.width);
	
	var sizesImg = new Array();
  sizesImg['width'] = 0;
  sizesImg['height'] = 0;
		
	if(img.width > maxWidth && img.height > maxHeight)
	{
		if(img.width  > img.height)
			sizesImg['width'] = maxWidth;
		else
			sizesImg['height'] = maxHeight;		
	}
	else if(img.width > maxWidth)
		sizesImg['width'] = maxWidth;
	
	else if(img.height > maxHeight) 
		sizesImg['height'] = maxHeight;	
		
	
	//alert("width2: "+sizesImg['width']);
	//alert("heigh2: "+sizesImg['height']);
	
	img.style.position = 'relative';
	img.style.visibility = 'visible';
	
	if(sizesImg['width'] != 0)
		img.width 	=	sizesImg['width'];
	
	if(sizesImg['height'] != 0)
		img.height 	= sizesImg['height'];
		
	
}

function getImageDimension(filepath)
{
	document.write("<IMG style='visibility:hidden; position:absolute; ' onload='resizesImg(this)' src='"+filepath+ "'>");
}

function resizesImg(imgp)
{
	var maxWidth = 350; //Larghezza Max
	var maxHeight = 150; //Altezza Max
 
 	var img = new Image(); 
	img.src = imgp.src;
	
	if(img.width > img.height){
		if(img.width > maxWidth)
			imgp.width = maxWidth;
	}
	else if(img.height > img.width){
		if(img.height > maxHeight) 
			imgp.height = maxHeight;
	}
	else{
		if(img.height > maxHeight) 
			imgp.height = maxHeight;
	}
		
	imgp.style.position = 'relative';
	imgp.style.visibility = 'visible';
	
}

// 2? metodo : funzioni separate
function getImageMaxWidth(filepath)
{
	var sizesImg = getSizesImgArray(filepath);
	
	return sizesImg['width'];
}

function getImageMaxHeight(filepath)
{
	var sizesImg = getSizesImgArray(filepath);

	return sizesImg['height'];
}
//************** END CONTROLLO DIMENSIONI LOGHI SOCIETARI *********************


//************** CREA Select/Options dall'anno corrente al parametro anno *********************

function createOptSelect(formName, fieldName, paramYear) 

{

	var thisDate = new Date();

	var thisYear = thisDate.getFullYear();

	var z;

	var startYear = paramYear;

		

		for(i=thisYear, z=1; i>=startYear; i--, z++)

		{

			document[formName].elements[fieldName].options[z] = new Option(i, i);

		}

}
//************** END CREA Select/Options  *********************




//**********************************************************
//************** POPUP SITO OLD (2002) ***************
//**********************************************************
//apre la popup per l'italiano
function OpenMib30()
{
	//window.open("/fwa-popup/mib30.html",'BIT_MIB30','width=400,height=120');
	window.open("http://www.borsaitalia.it/fwa-popup/popup_banner.html",'BIT_MIB30','width=490,height=205');	
}
//apre la popup per l'inglese
function OpenMib30_en()
{
	//window.open("/fwa-popup/en/mib30.html",'BIT_MIB30','width=400,height=120');
	window.open("http://www.borsaitalia.it/fwa-popup/en/popup_banner.html",'BIT_MIB30','width=490,height=205');	
}
//apre la popup per il nis italiano
function OpenMib30_nis()
{
	//window.open("/fwa-popup/mib30.html",'BIT_MIB30','width=400,height=120');
	window.open("http://www.borsaitalia.it/fwa-popup/popup_banner.html",'BIT_MIB30','width=490,height=205');	
}
//apre la popup per il nis inglese
function OpenMib30_nis_en()
{
	//window.open("/fwa-popup/en/mib30.html",'BIT_MIB30','width=400,height=120');
	window.open("http://www.borsaitalia.it/fwa-popup/en/popup_banner.html",'BIT_MIB30','width=490,height=205');
}
//************** END POPUP MIB30 SITO OLD *********************

//-->