// JavaScript Document

function showQR(theurl)
{
	var win = new Window({
		className: "alphacube", 
		title: "", 
		//top:70, 
		//left:30, 
		width:230, 
		height:270,
		zIndex: 100,
		maximize: false,
		minimize: false,
		destroyOnClose: true,
		scrollbars: false, 
		url: theurl, 
		showEffectOptions: {
			duration:1.5
		}
	}); 
	//win.show(); 
	win.showCenter();
}

function showNews(theurl)
{
	var win = new Window({
		className: "alphacube", 
		title: "News", 
		//top:70, 
		//left:30, 
		width:240, 
		height:130,
		zIndex: 100,
		maximize: false,
		minimize: false,
		destroyOnClose: true,
		scrollbars: false, 
		url: theurl, 
		showEffectOptions: {
			duration:1.5
		}
	}); 
	//win.show(); 
	win.showCenter();
}

function showPopupHP(theurl)
{
	var win = new Window({
		className: "alphacube", 
		title: "", 
		//top:70, 
		//left:30, 
		width:500, 
		height:404,
		zIndex: 100,
		maximize: false,
		minimize: false,
		destroyOnClose: true,
		scrollbars: false, 
		url: theurl, 
		showEffectOptions: {
			duration:1.5
		}
	}); 
	//win.show(); 
	win.showCenter();
}	

var ajax = new Array();
function getModelliList(sel)
{
	var opzioneselezionata = sel.options[sel.selectedIndex].value;
	document.getElementById('modello').options.length = 0;	// Empty city select box
	if(opzioneselezionata.length>0){
		var index = ajax.length;
		ajax[index] = new sack();
		
		ajax[index].requestFile = 'getDati.php?type=modelli&idobj='+opzioneselezionata;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createModelli(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}
function createModelli(index)
{
	var obj = document.getElementById('modello');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
}
function ClearOptions(OptionList) {

   // Always clear an option list from the last entry to the first
   for (x = OptionList.length; x >= 0; x = x - 1) {
      OptionList[x] = null;
   }
}
function AddToOptionList(OptionList, OptionValue, OptionText) {
   // Add option to the bottom of the list
   //alert(OptionText+"*"+OptionValue);
   OptionList[OptionList.length] = new Option(OptionText, OptionValue);
}


//setTimeout("showAutoSett('auto_della_settimana.php')",2500);
