// -----------------------------------------------------------------------
//	NEW WINDOW FUNCTIONS
// -----------------------------------------------------------------------
	
// NEW WINDOW
	function openWindow(myURL, sTitle, pWidth, pHeight) {
		newWin = window.open(myURL, sTitle, 'width='+pWidth+', height='+pHeight+',toolbar=no,menubar=no,menu=no,scrollbars=no,resizable=yes,location=no,directories=no,status=no');
		newWin.focus();
	}	// END: function openWindow
	
// -----------------------------------------------------------------------
//	POPUP WINDOW RESIZED
// -----------------------------------------------------------------------
	
	// VIEW PIC
	function viewPic(img) { 	
		picfile = new Image(); 
	    picfile.src = (img); 
		fileCheck(img); 
	}	// END: function viewPic

// -----------------------------------------------------------------------	
	
	// CHECK FILE
	function fileCheck(img) { 	
	    if((picfile.width !=0 ) && (picfile.height !=0 )) { 
	        buildWindow(img); 
	    } else {
	        funzione = "fileCheck('"+img+"')"; 
	        intervallo = setTimeout(funzione,50); 
	    }
	}	// END: function fileCheck

// -----------------------------------------------------------------------
	
	// MAKE POPUP WINDOW
	function buildWindow(img) { 
	  	
	    ht = picfile.height + 20;
	    wd = picfile.width + 20; 
	
	    var args = "height=" + ht + ",innerHeight=" + ht;
	    args += ",width=" + wd + ",innerWidth=" + wd;
	    
	    if(window.screen) { 
	    	
	        var avht = screen.availHeight; 
	        var avwd = screen.availWidth;
	        
	        var xcen = (avwd - wd) / 2; 
	        var ycen = (avht - ht) / 2;
	        
			args += ",left=" + xcen + ",screenX=" + xcen;
	        args += ",top=" + ycen + ",screenY=" + ycen + ""; 
			
			args += ",toolbar=no,menubar=no,menu=no,scrollbars=no,resizable=yes,location=no,directories=no,status=no";	
	    }
	    return window.open(img, '', args); 
	    
	}	// END: function buildWindow
	
	
// -----------------------------------------------------------------------


// ========================================================================
//  DROPDOWN MENU
// ========================================================================

	sfHover = function() {
		var sfEls = document.getElementById("menu").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);
	
// -----------------------------------------------------------------------
