// JavaScript Document
function popup( pageToLoad, name, width, height, sb, stat, resiz) { //v2.0
    	xposition=0; yposition=0;
    	if (parseInt(navigator.appVersion) >= 4){
        	xposition = (screen.width - width + 10) / 2;
        	yposition = (screen.height - height + 65) / 2;
	    }
    	args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=" + resiz + ",scrollbars= " + sb + "," + "status=" + stat + ",titlebar=0," + "toolbar=0," + "hotkeys=0," + "screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition;           
	    name=window.open( pageToLoad,name,args );
		name.focus();
}

function new_win(url){
	nuova_finestra=window.open(url,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=522,height=300")
}

function shlayer(livello, stato) {
	if (document.layers) {
	  if (stato==1) {
		document[livello].visibility='show';
	  }else {
	    document[livello].visibility='hide';
	  }
	} else { 
	  if (stato==1) {
	    document.all[livello].style.visibility='visible';  
	  }else{
	    document.all[livello].style.visibility='hidden';
	  }
	}
}

function populateSWF(filmato,w,h,contenitore){	// perchè I.E. deve rompere le palle con FLAH??????????
	var shtml = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"";
	shtml += " codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\"";
	shtml += "  width=\""+w+"\" height=\""+h+"\" id=\"home\" align=\"\">";
	shtml += " <param name=movie value=\""+filmato+"\">";
	shtml += " <param name=quality value=best>";
	shtml += " <param name=menu value=false>";
	shtml += " <param name=wmode value=transparent>";
	shtml += " <embed src=\""+filmato+"\" quality=best menu=false wmode=\"transparent\" width=\""+w+"\" height=\""+h+"\" name=\"home\" align=\"\"";
	shtml += "  type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>";
	shtml += "     </object>"

	var md = document;
	var d = md.getElementById(contenitore);
	d.innerHTML = shtml;
}
