// ### CHIUDI FINESTRA GENERICA
function	closeWindow(){
                                                
		window.close();
}     


// ### APRI FINESTRA GENERICA 
function 	openWindow(strIndirizzo,strPopupName,iWidth,iHeight) {

		var strFeatures = 'width='+iWidth+',height='+iHeight+',toolbar=none,menubar=none,location=none,status=none,scrollbars=yes';
		window.open(strIndirizzo,strPopupName,strFeatures);  
}




// ### APRI IMMAGINE PERSONALE MEMBRO DEL GRUPPO
function	openMemberImages(strPage,strWinName){
                                                
		iWidth=600;
		iHeight=600;
		
		openWindow(strPage,strWinName,iWidth,iHeight);
}


// ### APRI NEWSLETTER
function	openNewsLetterWindow(strPage,strWinName){

		iWidth=300;
		iHeight=300;
		
		openWindow(strPage,strWinName,iWidth,iHeight);

}         

// ### APRI ANTEPRIMA HTML 
function	openHtmlPreview(strPage,strWinName){

		iWidth=600;
		iHeight=600;
		
		openWindow(strPage,strWinName,iWidth,iHeight);

}

// ### APRI PAGINA CHAT
function	openChat(strPage,strWinName){

		iWidth=800;
		iHeight=650;
		
		openWindow(strPage,strWinName,iWidth,iHeight);

}
                                    
// ### RIDIMENSIONA LE IMMAGINI TROPPO GRANDI
function	resizeImg(idElement,iMaxWidth,iMaxHeight){

		var imgFoto=document.getElementById(idElement);
		    
		if	(imgFoto){

			var blnChange=false;
		        			
			var iNewWidth = imgFoto.width;
			var iNewHeight=imgFoto.height; 
		        			 
			if	( iNewWidth > iMaxWidth ){
				iNewHeight = (iMaxWidth / iNewWidth) * iNewHeight;
				iNewWidth = iMaxWidth;
				blnChange=true; 
			}
				
			if	( iNewHeight > iMaxHeight ){
				iNewWidth = (iMaxHeight / iNewHeight) * iNewWidth;
				iNewHeight = iMaxHeight; 
				blnChange=true;
			}        
						
			if	(blnChange==true){
							
				imgFoto.width = iNewWidth ;
				imgFoto.height= iNewHeight;
			}       
			
		}

}
