/* ******************************************************** */
/* ************* Inizializzazione funzioni **************** */
/* ******************************************************** */
function initFunctions() { preloadImages(); }

/* **************************************************** */
/* FUNZIONE per aprire una finestra di PopUp centrata   */
/* **************************************************** */
function openPopUp(url,w,h,scrl) {
  l = (screen.width-w)/2;
  t = (screen.height-h)/2;
  newWin = window.open(url,"nuovafinestra", "width="+w+", height="+h+", left="+l+", top="+t+", scrollbars="+scrl+", resizable=no") 
  }

/* ****************************************************** */
/* FUNZIONE per togliere cornice ai filmati flash in IE   */
/* ****************************************************** */
function loadswf(swf,w,h){
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"");
	document.write("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\"");
	document.write("width=\""+w+"\" height=\""+h+"\">");
	document.write("<param name='movie' value='"+swf+"' />\n");
	document.write("<param name='menu' value='false' />\n");
	document.write("<param name='quality' value='high' /><param name='wmode' value='transparent' />\n");
	document.write("<embed src=\""+swf+"\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+w+"\" height=\""+h+"\"></embed>");
	document.write("</object>\n");
}


/* ********************************************* */
/* *** Countdown caratteri nelle textarea ****** */
/* ********************************************* */
function countChars(d)
{
if (navigator.appName.indexOf("Netscape")>=0 &&
   parseInt(navigator.appVersion) >=4) { var nn4 = true }
document.griglia.descrizione.onkeydown = countChars;
if (nn4) document.captureEvents(Event.KEYDOWN);

var oldString = "";

 if (document.griglia.descrizione.value.length> 255) {
    document.griglia.descrizione.value = oldString;
    }
 
else {
    document.griglia.rimasti1.value = 255 - document.griglia.descrizione.value.length;
    oldString = document.griglia.descrizione.value.substring(0,255);
    }
    
  }
