	//GlobalVar
	screenW = '';
	screenH = '';
	colorDepth = '';
	pixelDepth = '';
	browser = '';
	Platform = '';
	CodeName = '';
	MinorVersion = '';
	ApplicationName = '';
	ApplicationVersion = '';
	CookieEnabled = '';
	Cpu = ''; 
	UserAgente = '';
	browserLanguage = '';
	systemLanguage = '';
	userLanguage='';
	AltezzaDisponibile = '';
	LarghezzaDisponibile = '';
	
	OverLayLocked = false;
	
	SysConfigString = '';
	
	azienda = 'QMI';
	denominazione = 'Io vado al cinema!';



	function _InitFRAMEWORK()
	{
		
		BrandLabel = denominazione;
		window.status = BrandLabel
		document.title = BrandLabel;
		
		fmk$detectScreen();
		fmk$detectBrowserDetails();
		fmk$controlloPiattaforma();	
		fmk$controlloBrowserCritici();	
	}


	function fmk$controlloBrowserCritici()
	{
		if(ApplicationVersion.indexOf(" MSIE 6.0;")>=0)
		//if(ApplicationVersion.indexOf("MSIE")>0)
		{
			if(fmk$getCookie("unsupported")!="y"){
				setTimeout("showCredits()",2500);
				fmk$setCookie("unsupported","y",1);
			}
		}
		
	}

	function fmk$applicaClasse(elemento,classe)
	{
		if(fmk$checkObject(elemento))
			document.getElementById(elemento).className = classe;
	}
	
	function fmk$resizeEvents()
	{
		fmk$detectScreen();_AdaptAltezza();_InitDIGITAL;
	}

	function fmk$controlloPiattaforma()
	{
		switch(Platform)
		{	
			case "BlackBerry":
				document.location.href='/mobile/';
				break;
		}
	}	


	function fmk$detectBrowserDetails()
	{
		screenW = screen.width;
		screenH = screen.height;
		colorDepth = screen.colorDepth;
		pixelDepth = screen.pixelDepth;
	
		if(window.navigator.userAgent.indexOf("MSIE") > 0){browser='ie'}else{browser="ff";}	
		x = navigator;
		CodeName = x.appCodeName;
		MinorVersion = x.appMinorVersion;
		ApplicationName = x.appName;
		ApplicationVersion = x.appVersion;
		CookieEnabled = x.cookieEnabled;
		Cpu = x.cpuClass;
		Platform = x.platform;
		UserAgente = x.userAgent;
		browserLanguage = x.browserLanguage;
		systemLanguage = x.systemLanguage;
		userLanguage = x.userLanguage;
		
		AltezzaDisponibile = document.body.clientHeight;
		LarghezzaDisponibile = document.body.clientWidth;		
	}

	function fmk$storeSysInfo()
	{
		valore = "";
		valore+= "<b>screenW:</b> " + screenW +"<br />";
		valore+= "<b>screenH:</b> " + screenH +"<br />";
		valore+= "<b>colorDepth:</b> " + colorDepth +"<br />";
		valore+= "<b>pixelDepth:</b> " + pixelDepth +"<br />";
								
		valore+= "<b>Browser:</b> " + browser+"<br />";
		valore+= "<b>CodName:</b> " + CodeName +"<br />";
		valore+= "<b>MinorVersion:</b> " + MinorVersion+"<br />";
		valore+= "<b>ApplicationName:</b> " + ApplicationName+"<br />";
		valore+= "<b>ApplicationVersion:</b> " + ApplicationVersion +"<br />";
		valore+= "<b>CookieEnabled:</b> " + CookieEnabled+"<br />";
		valore+= "<b>Cpu:</b> " + Cpu+"<br />";
		valore+= "<b>Platform:</b> " + Platform+"<br />";
		valore+= "<b>UserAgente:</b> " + UserAgente+"<br />";
		valore+= "<b>browserLanguage:</b> " + browserLanguage+"<br />";
		valore+= "<b>systemLanguage:</b> " + systemLanguage +"<br />";
		valore+= "<b>userLanguage:</b> " + userLanguage +"<br />";
		SysConfigString = valore;
	}
		

	function fmk$printSysInfo()
	{
		level = document.getElementById("sysInfoContent");
		valore = "";
		valore+= "<b>screenW:</b> " + screenW +"<br />";
		valore+= "<b>screenH:</b> " + screenH +"<br />";
		valore+= "<b>colorDepth:</b> " + colorDepth +"<br />";
		valore+= "<b>pixelDepth:</b> " + pixelDepth +"<br />";						
		valore+= "<b>Browser:</b> " + browser+"<br />";
		valore+= "<b>CodName:</b> " + CodeName +"<br />";
		valore+= "<b>MinorVersion:</b> " + MinorVersion+"<br />";
		valore+= "<b>ApplicationName:</b> " + ApplicationName+"<br />";
		valore+= "<b>ApplicationVersion:</b> " + ApplicationVersion +"<br />";
		valore+= "<b>CookieEnabled:</b> " + CookieEnabled+"<br />";
		valore+= "<b>Cpu:</b> " + Cpu+"<br />";
		valore+= "<b>Platform:</b> " + Platform+"<br />";
		valore+= "<b>UserAgente:</b> " + UserAgente+"<br />";
		valore+= "<b>browserLanguage:</b> " + browserLanguage+"<br />";
		valore+= "<b>systemLanguage:</b> " + systemLanguage +"<br />";
		valore+= "<b>userLanguage:</b> " + userLanguage +"<br />";
		level.innerHTML += valore;


	}

	//Detect SCREEN SIZE
	var myWidth = 0, myHeight = 0;
	function fmk$detectScreen(){
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
			} else if( 
				document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
			{
			//IE 4 
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
	}
	
	
	function fmk$debug(stringa)
	{
		oggetto = document.getElementById("debuggerContentDBG");
		oldObj = oggetto.innerHTML
		oggetto.innerHTML = stringa+"<br>"+oldObj;
	}
	




	function fmk$setCookie(cookieName,cookieValue,nDays) 
	{
		var today = new Date();
		var expire = new Date();
		if (nDays==null || nDays==0) nDays=1;
		expire.setTime(today.getTime() + 3600000*24*nDays);
		document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString();
	}

	function fmk$manageCookie()
	{
		if(!CookieEnabled){
			if(fmk$checkObject("informer"))
			{
				fmk$prendicontenuto('/objects/noCookie.html');
				elemento = prendiElementoDaId("informer");
				elemento.innerHTML += alertNoCookie.replace(/#denominazione#/g,denominazione);
				fmk$ombreggiante("informer");
			}else{
				return;
			}
		}
	}

	function fmk$getCookie(Name) {
	   var search = Name + "="
	   if (document.cookie.length > 0) { // se ci sono cookie
	      offset = document.cookie.indexOf(search) 
	      if (offset != -1) { // se il cookie esiste
	         offset += search.length 
	         end = document.cookie.indexOf(";", offset) 
	
	         if (end == -1) 
	            end = document.cookie.length
	         return unescape(document.cookie.substring(offset, end))
	      } 
	   }
	}

	function fmk$checkObject(Id)
	{
	  var o = document.getElementById(Id);
	  if (o)
	  {
	      return o;
	  }
	  return null;
	}


	function fmk$opacizza(livello)
	{
		document.getElementById(livello).className = 'opaco';
	}
	
	function fmk$nitido(livello)
	{
		document.getElementById(livello).className = 'nitido';
	}
	
	function fmk$prendicontenuto(pURL)
	{
		var
			ajax = assegnaXMLHttpRequest();
		
		if(ajax) {
			ajax.open("get", pURL, false);
			ajax.setRequestHeader("connection", "close");
			ajax.send(null);
			return ajax.responseText;
		} 
			else {
				return false;
		}
	}
	
	
	function fmk$ombreggiante(livello)
	{
		pURL = "/objects/ombreggiante.htm"
		if (window.XMLHttpRequest) { // per Mozilla, Safari, etc 
			xmlhttp=new XMLHttpRequest();
			xmlhttp.onreadystatechange=function fmk$ombreggianteKernel(){
				if (xmlhttp.readyState==4) { 
					if (xmlhttp.status==200) { 
						modelloOmbra = xmlhttp.responseText;
						strutturaLivello = document.getElementById(livello).innerHTML;
						modelloOmbra = modelloOmbra.replace("#ombreggiantecontent#",strutturaLivello);
						document.getElementById(livello).innerHTML = modelloOmbra;
					}
				}
			};
			xmlhttp.open("GET", pURL, true);
			xmlhttp.send(null);
		} else if (window.ActiveXObject) { //IE 
			xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); 
			if (xmlhttp) {
				xmlhttp.onreadystatechange=function fmk$ombreggianteKernel(){
					if (xmlhttp.readyState==4) { 
						if (xmlhttp.status==200) { 
							modelloOmbra = xmlhttp.responseText;
							strutturaLivello = document.getElementById(livello).innerHTML;
							modelloOmbra = modelloOmbra.replace("#ombreggiantecontent#",strutturaLivello);
							document.getElementById(livello).innerHTML = modelloOmbra;
						}
					}
				};
				xmlhttp.open('GET', pURL, false);
				xmlhttp.send();
			}
		}		
	}

	function fmk$overLayerd()
	{
		
		if(OverLayLocked){
			document.getElementById("overLayerMask").setAttribute("zone", "");
		}else{
			document.getElementById("overLayerMask").setAttribute("zone", "mask");
		}

		elemento = prendiElementoDaId("overLayerMask");		
		if(elemento.className==''){
			elemento.style.width=eval(LarghezzaDisponibile);
			elemento.style.height=eval(AltezzaDisponibile);
			fmk$applicaClasse("overLayerMask","overLayered");
		}else{
			fmk$applicaClasse("overLayerMask","");
			fmk$clean("overLayerObject");
			fmk$clean("overLayerMask");
			elemento.style.width=0;
			elemento.style.height=0;
		}
		
	}
	
	function fmk$clean(livello){
		if(fmk$checkObject(livello))
			document.getElementById(livello).innerHTML = '';
		
	}
	
	function fmk$nascondi(livello){
		document.getElementById(livello).style.visibility = 'hidden';
		document.getElementById(livello).style.position = 'absolute';		
	}	
	
	function fmk$mostra(livello){
		document.getElementById(livello).style.visibility = 'visible';
		document.getElementById(livello).style.position = '';
	}

	function fmk$vaiA(redirto){
		document.location.href=redirto;
	}
	
	function fmk$sortNumber(a, b)
	{
		return a - b;
	}
	

	function fmk$IsNumeric(sText)
	{
		var ValidChars = "0123456789.";
		var IsNumber=true;
		var Char;
		
	
		for (i = 0; i < sText.length && IsNumber == true; i++) 
		{ 
			Char = sText.charAt(i); 
			if (ValidChars.indexOf(Char) == -1) 
			{
				IsNumber = false;
			}
		}
		return IsNumber;
	
	}
	
	function fmk$blink(ogg)
	{
		if(!ogg)
			return;
		elemento = prendiElementoDaId(ogg);
		if(elemento.className=='opaco'){
			elemento.className='nitido';
		}else{
			elemento.className='opaco';
		}
		setTimeout("fmk$blink('"+ogg+"')",300);
	}
	
	
	function fmk$PostCall(url,parString,callBack,content){
		elemento = document.getElementById(content);	
		if(elemento){
			elemento.innerHTML = "salvataggio in corso...";
		}else{
			cancellaRichiesta();
		}
		
		var req = assegnaXMLHttpRequest();
		req.abort();
		req.onreadystatechange = function()
		{ 
			if(req.readyState == 4)
			{
				if(req.status == 200)
				{
					if(callBack){
						ely = document.getElementById(content);		
						if(ely){
							ely.innerHTML = '';	
							ely.innerHTML = req.responseText;
							req.abort();
						}
					}
				}else{
					//window.status = req.status + " " + req.statusText;
					//alert(req.status + " " + req.statusText);
				}	
			} 
		}; 
		req.open("POST", url, true); 
		ric1 = req;		
		req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		req.setRequestHeader("Content-length", parString.length);
		req.setRequestHeader("Connection", "close");
		req.send(parString);
	}






function window_open(filename, x, y, target)
{
    windowops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=" + x + ",height=" + y + "'");
    newwindow=window.open(filename, target, windowops);
    return;
}

function openPopup(filename, x, y)
{
    windowops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=" + x + ",height=" + y + "'");
    newwindow=window.open(filename, "target", windowops);
    return;
}

function window_open_resize(filename, x, y, target)
{
windowops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=" + x + ",height=" + y + "'");
newwindow=window.open(filename, target, windowops);
return;
}

function window_open_bar(filename, x, y, target)
{
windowops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=" + x + ",height=" + y + "'");
newwindow=window.open(filename, target, windowops);
return;
}

function window_full(filename, target)
{
windowops = eval("'fullscreen=yes,titlebar=0,menubar=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,channelmode=no,status=no;'");
newwindow=window.open(filename, target, windowops);
return;
}

function window_full_bar(filename, target)
{
windowops = eval("'fullscreen=yes,titlebar=0,menubar=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,copyhistory=no,channelmode=no,status=no;'");
newwindow=window.open(filename, target, windowops);
return;
}

function window_open_resizescroll(filename, x, y, target)
{
windowops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + x + ",height=" + y + "'");
newwindow=window.open(filename, target, windowops);
return;
}