var MINUTE = 60000;
var HOUR = MINUTE * 60;
var DAY = HOUR * 24;
var MOUNTH = DAY*30;
var YEAR = MOUNTH * 12; 
var contextBuffer = "";
function Class() { }
       Class.prototype.construct = function() {};
        Class.__asMethod__ = function(func, superClass) {
            return function() {
                var currentSuperClass = this.$;
                this.$ = superClass;
                var ret = func.apply(this, arguments);
                this.$ = currentSuperClass;
                return ret;
            };
        };

        Class.extend = function(def) {
            var classDef = function() {
                if (arguments[0] !== Class) { this.construct.apply(this, arguments); }
            };

            var proto = new this(Class);
            var superClass = this.prototype;

            for (var n in def) {
                var item = def[n];

                if (item instanceof Function) {
                    item = Class.__asMethod__(item, superClass);
                }

                proto[n] = item;
            }

            proto.$ = superClass;
            classDef.prototype = proto;
            classDef.extend = this.extend;
            return classDef;
};

var ComboSelector = Class.extend({
	txt:"",
	autoSelect:true,

	setPrefaceText:function(str,isEndOfSentence){

		this.txt="<span style=\"font-family: Comic Sans MS;font-size:" + f_9.y2 + "pt\">";
		this.txt = this.txt + "<p align=\"justify\" charset=\"iso-8859-1\" style=\"margin-left: 100px; margin-right: 100px ;margin-top: 0; margin-bottom: 0\">";
		if(!isEndOfSentence || str.indexOf("%") > 0 || str.indexOf("?") > 0)
			this.txt = this.txt + "<br>" + m_2.replaceCode(unescape(str));
		else
			this.txt = this.txt + "<br>" + m_2.replaceCode(unescape(str)) + ".";
			
 },
  
  setChoiche:function(){
		  	  this.txt = this.txt + "<select name=\"categoria\" id = \"categoria_0\"  style=\"font-family: Comic Sans MS; font-size: " + f_9.y2 + "pt\" size=\"3\"ondblclick=\"javascript:g_2.r5('" + g_2.p7 + "',this.selectedIndex,this.value,'" + prcXml.nextAction + "','"  + prcXml.path +  "','"  + prcXml.returnPath + "','" + escape(prcXml.context) + "');\">";


              g_2.p9 = prcXml.lst;


			  g_2.h_4 = 0;
 			  var cookie = ""
 			  if(g_2.z5(prcXml.path) != null  && g_2.z5(prcXml.path) != undefined)
 			  	cookie = g_2.z5(prcXml.path).replace("_","").trim();
             
              for (i=0;i<g_2.p9.length;i++)
                {
   					var list_ = m_2.z6(g_2.p9[i].firstChild.nodeValue).trim();

					if( cookie == list_){
							g_2.h_4 = i;
					}


                    this.txt = this.txt + "<option value=\"" + list_ + "\">" + list_ + "</option>" ;

                }

              this.txt = this.txt + "</select>";



  
	return this.txt;



  },	
	finish:function(){  
           	if(g_2.l_5 > 1)
        		this.txt = this.txt  +"	<a href=\"javascript:g_2.r6();\"> <img border=\"0\" src=\"http://www.dimmicosavuoi.it/arrowblueleft.gif\" width=\"28\" height=\"25\"></a> Indietro";

        	this.txt= this.txt + "<div id=\"suggest\">";
        	this.txt= this.txt + "</div>";
			return this.txt;
	},

	display:function(isEndOfText){  
	
			var list = document.getElementById("categoria_0");

			if(list != undefined && list != null){
				if(g_2.h_4 < list.length)
					list.selectedIndex =  g_2.h_4;
				if(i==0)
					list.focus();
			}

	},
	

	m_6:function(){  
	 if (g_2.p9.length > 10)
	  	    document.getElementById('suggest').innerHTML="scrivi...";
		  else
	  	    document.getElementById('suggest').innerHTML="";
	  	    
		if(g_2.z1 != "" && !f_9.production)
				document.getElementById('suggest').innerHTML=g_2.z1;
	  	    
	
	},
	focus:function(){    	
		var textBox = document.getElementById("input");
		if(textBox != null)
			textBox.focus();
	}
	
});


var q_4 = ComboSelector.extend({
  choicheArray:[],
  aladinAutocomp:null,
  maxLength:0,
    common:new Array(
   "a",
   "ad",
   "ah",
   "ai",
   "al",
   "anche",
   "ancora",
   "che",
   "chi",
   "ci",
   "ciò",
   "codesta",
   "codesto",
   "come",
   "con_",
   "cosa",
   "così",
   "cui",
   "c'è",
   "da",
   "dagli",
   "dai",
   "dal",
   "dalla",
   "dalle",
   "degli",
   "dei",
   "del",
   "dell'",
   "della",
   "delle",
   "dello",
   "di",
   "e",
   "è",
   "ed",
   "egli",
   "eh",
   "ella",
   "era",
   "essa",
   "esse",
   "essi",
   "esso",
   "fa",
   "fra",
   "già",
   "giù",
   "gli",
   "hai",
   "ha",
   "ho",
   "i",
   "il",
   "in",
   "la",
   "le",
   "lei",
   "li",
   "lo",
   "loro",
   "lui",
   "là",
   "lì",
   "ma",
   "mai",
   "mi",
   "mia",
   "mie",
   "miei",
   "mio",
   "ne",
   "negli",
   "nei",
   "nel",
   "no",
   "noi",
   "non",
   "nostro",
   "nulla",
   "né",
   "o",
   "oh",
   "per",
   "perché",
   "più",
   "po’",
   "poi",
   "proprio",
   "qua",
   "quale",
   "quando",
   "quei",
   "quella",
   "questa",
   "questi",
   "questo",
   "qui",
   "se",
   "si",
   "su",
   "suo",
   "sé",
   "sì",
   "ti",
   "tra",
   "tua",
   "tue",
   "tuo",
   "tuoi",
   "un",
   "una",
   "uno",
   "vi",
   "voi",
   "vostro"
   ),
    commonEng:new Array(
"a",
"about",
"above",
"after",
"ah",
"all",
"also",
"among",
"an",
"and",
"are",
"as",
"at",
"be",
"been",
"between",
"but",
"by",
"call",
"can",
"can't",
"come",
"could",
"did",
"do",
"don't",
"down",
"each",
"eh",
"et",
"find",
"first",
"for",
"from",
"get",
"go",
"had",
"has",
"have",
"he",
"he's",
"her",
"here",
"him",
"his",
"how",
"I",
"I'm",
"I've",
"if",
"in",
"into",
"is",
"it",
"it's",
"its",
"just",
"like",
"litte",
"long",
"look",
"made",
"make",
"many",
"may",
"more",
"my",
"never",
"no",
"not",
"nothing",
"now",
"of",
"on",
"one",
"or",
"other",
"our",
"out",
"see",
"she",
"she's",
"so",
"some",
"still",
"than",
"that",
"the",
"their",
"them",
"then",
"there",
"there's",
"there're",
"these",
"they've",
"they're",
"they",
"this",
"those",
"time",
"to",
"two",
"up",
"us",
"use",
"was",
"we",
"we're",
"were",
"what",
"when",
"where",
"where's",
"which",
"who",
"why",
"will",
"with",
"would",
"write",
"yes",
"you",
"you've",
"you're",
"your",
"yours"),

  maxLength:0,
  listLoaded:false,
  wordLst:new Array(1024),
  digited:"",
 

  
 isCommon:function(word){
		
		var i=0;
		if(g_2.language == "ITA"){
			for(i=0; i < this.common.length; i++)
				if(this.common[i].toLowerCase() == word.toLowerCase())
					return true;
				
		}
		else
			for(i=0; i < this.commonEng.length; i++)
				if(this.commonEng[i].toLowerCase() == word.toLowerCase())
					return true;
		
				
		return false;		
	},
  setChoiche:function(isEnd){
	this.txt = this.txt  + "<input type=\"text\" name=\"input\" id=\"input\" ondblclick=\"render.selector.show();\" onkeyup=\"render.selector.valid(this);\" onclick=\"render.selector.show();\" >";
   	if(g_2.l_5 > 1)
   		this.txt = this.txt  +"	<a href=\"javascript:g_2.r6();\"> <img border=\"0\" src=\"http://www.dimmicosavuoi.it/arrowblueleft.gif\" width=\"28\" height=\"25\"></a> Indietro";
	if(g_2.advReady)
			this.txt	= this.txt + 	"<INPUT TYPE=button OnClick=\"f_9.loadAdv();\" VALUE=\"INSERISCI ANNUNCIO\" ID=LOADADV>";
	this.txt = this.txt  + "<div class=\"autocomplete_choices\" id=\"autocomplete_choices\"></div>";

	if(isEnd) return this.txt;
	
    g_2.p9 = prcXml.lst;

    g_2.h_4 = 0;
    var cookie = ""
	if(g_2.z5(prcXml.path) != null  && g_2.z5(prcXml.path) != undefined)
 		if(render.selector instanceof Selector) 
				cookie = g_2.z5(prcXml.path).replace("_","").trim();
       
        this.choicheArray=new Array(g_2.p9.length); /* @p Potenziale memory leak */ 
        this.maxLength=0;
        for (i=0;i<g_2.p9.length;i++){
   				var list_ = m_2.z6(g_2.p9[i].firstChild.nodeValue).trim();
					if(list_.length > this.maxLength)
						this.maxLength = list_.length; 
						
	 			if(render.selector instanceof Selector) 
					if( cookie == list_){
								g_2.h_4 = i;
					}

	               this.choicheArray[i] =  m_2.replaceCode(list_.ac());

				}

     
	},	
	finish:function(){  

	},
	display:function(isEndOfText){
		if(isEndOfText) return;
		var textBox = document.getElementById("input");
		textBox.style.width = (this.maxLength * f_9.y2) + "px";
		textBox.focus();
		this.aladinAutocomp = new aladinLocalAutocom("input","autocomplete_choices",this.choicheArray,g_2.q_7,null,this.notFoundCB,g_2.goBackCB,g_2.q_6,null,null,200,f_9.startSuggestionImmidiatly);
		if(g_2.l_5 == 1){ 
			this.aladinAutocomp.scriptaculus.spaceIsASelector = false;
			this.aladinAutocomp.setAutoSelect(false);
		}
		else{
			this.aladinAutocomp.setAutoSelect(this.autoSelect);
			this.aladinAutocomp.scriptaculus.spaceIsASelector = true;
		}
		/* devo vedere se appartiene a requireHints
		
		 se appartiene devo recuperare l'url e farmi dare una lista di suggerimenti */
		
		 
		
		
/*		var autocompDiv = document.getElementById("autocomplete_choices");
		var hintDiv = document.getElementById("hint");
		hintDiv.style.top = autocompDiv.style.top; 
		hintDiv.style.left = autocompDiv.style.pixelLeft + autocompDiv.style.pixelWidth + "px"; 
		var hinttxt = 						"<ul>Corso D Italia</ul><ul>Corso Del Rinascimento</ul><ul>Corso Di Francia</ul>"
		hintDiv.innerHTML = hinttxt;
		if(this.choicheArray.length > 3)
			hintDiv.style.display = "none";
*/		
		
		
	},	
	
	show:function(){  
		if(f_9.a6 != null && f_9.a6 != undefined){ 
			f_9.a6.r7ResultProcess();
			f_9.a6.r7InactivityTimers();
		}	
        g_2.lastActivityTime = new Date();

		this.aladinAutocomp.show();
		
		
		
	},  	

	
	m_6:function(){  
	
	},
	
	notFoundCB:function (keyCode) {

		
		if(this.textChangedCB == null){
			this.spaceIsASelector = false;
			this.options.completeListMode = true;
			render.selector.aladinAutocomp.setAutoSelect(false);

			this.registerTextChangedCB(render.selector.textChanged);	
			this.options.afterUpdateElement = render.selector.q_7;
		}
			
		
	},



	valid:function(obj){  

	}  	

  	


});

var q_4WSpace = q_4.extend({
  choicheArray:[],
  aladinAutocomp:null,
	  
	display:function(isEndOfText){
		if(isEndOfText) return;
		var textBox = document.getElementById("input");
		textBox.style.width = (this.maxLength * f_9.y2) + "px";
		textBox.focus();
		this.choicheArray = new Array(1);
		this.choicheArray[0] ="";
		this.aladinAutocomp = new aladinLocalAutocom("input","autocomplete_choices",this.choicheArray,this.q_7,null,this.notFoundCB,g_2.goBackCB,this.q_6,null,this.textChanged,200,f_9.startSuggestionImmidiatly);
		this.aladinAutocomp.scriptaculus.spaceIsASelector = false;
		this.aladinAutocomp.scriptaculus.options.completeListMode = false;
		this.aladinAutocomp.setAutoSelect(false);
		
		
	},	


	
	textChanged:function(txt){  

			var i=0;
			var j=0;
			
			if((txt.lastIndexOf(" ") + 1) != txt.length)
			 return;
			else
			  txt = txt.substring(0,txt.length -1);	 
			
			var words = txt.split(" "); 

			render.selector.digited = words[words.length - 1];
			

			if(txt.lenght < 2 || render.selector.digited.length < 2)
				return;
			
			if(render.selector.isCommon(render.selector.digited)) 
				 return;
			
	
			var rs = new Remoteh_1();

		
			var text = rs.getFile(f_9.basePath + "/app/wordspace/"  + render.selector.digited.toLowerCase() + "/sentspace.txt");


			if(text.indexOf("Warning") >=0) return;
			
			
			/* devo evitare di mettere parole doppie */ 
			

			var arrayFull = text.split("\n");
            var l_9 = false;
            var arrayTmp=[];  
			
			for(i=0; i < arrayFull.length; i++){
					    
				l_9 = false;
							
				for(j=0; j < render.selector.wordLst.length; j++)							
					if(render.selector.wordLst[j] == arrayFull[i]){
						l_9= true;
						break;					
					}		
						 			
				if(!l_9)
					arrayTmp[i] = arrayFull[i];
						 			
			}
			
			
			render.selector.wordLst[words.length - 1] = new Array(arrayTmp.length);
			
			
			
			for(i=0; i < arrayTmp.length; i++)			
				render.selector.wordLst[words.length - 1][i] = arrayTmp[i]; 
			
			 
			
				
			
			var array=[];
			var j=0;
			var t=0;
			for(i=0; i < words.length; i++)
				if(render.selector.wordLst[i] != undefined)
					for(j=0; j < render.selector.wordLst[i].length; j++)
							array[t++] = render.selector.wordLst[i][j];
			
			
			if(array == null) return;
			
			var textBox = document.getElementById("input");
			var maxLength = m_2.maxLength(array);
			
			textBox.style.width = (maxLength * f_9.y2) + "px";
	
			render.selector.aladinAutocomp.setAutoSelect(false);

			render.selector.aladinAutocomp.setArray(array);

	


	},
  		q_7:function(text,obj) {
   
		var index = -1;
		var value="";
		var finalUrl = location.href.replace("&7",m_2.replaceSpaceWithUnderscore(m_2.restoreCode(text.trim())) + "&7");
		var finalPath = m_2.replaceSpaceWithSlash(m_2.restoreCode(text.trim()));
 
		/* Qui è necessario verificare il contenuto del SentencesSpace: va verificato il contesto 
		 Contesti 
		 Aladino
		 Case Cerco in affitto/vendita
		 Auto vendita
		 Orari treni 
		    
		*/
 
		 if(f_9.p_6.modified){
				 f_9.p_4.saveIncremental(f_9.p_6);
		 }	 

		location.href = finalUrl; 
		window.location.reload(true);
		

	},




	q_6:function(item)
			{
			var str = item;
			var i=0;
			
 	},

	show:function(){  
		if(f_9.a6 != null && f_9.a6 != undefined){ 
			f_9.a6.r7ResultProcess();
			f_9.a6.r7InactivityTimers();
		}	
        g_2.lastActivityTime = new Date();

		this.aladinAutocomp.show();
		
		
		
	},  	
  
    notFoundCB:function (keyCode) {

			
			var txt =document.getElementById("input");
			
		
		},
	  	
  		q_7:function(text,obj) {
   
		var index = -1;
		var value="";
		var finalUrl = location.href.replace("&7",m_2.replaceSpaceWithUnderscore(m_2.restoreCode(text.trim())) + "&7");
		var finalPath = m_2.replaceSpaceWithSlash(m_2.restoreCode(text.trim()));
 

		 if(f_9.p_6.modified){
				 f_9.p_4.saveIncremental(f_9.p_6);
		 }	 

		location.href = finalUrl; 
		window.location.reload(true);
		

	}



});



var q_4SenSpace = q_4.extend({
  choicheArray:[],
  aladinAutocomp:null,
  sentence:"",
  keywords:[],
  keyHis:[],
  digited:"",
  selector:null,
  keySen:[],
  keySenHis:[],
  keywordsLastLoadedIndex:1,
  timeoutOnPressedCB:null,
  timeoutOnResults:null,
  timeaoutOnShow:null,
  lastKeyIsSpace:false,
  results:[],
  resSongPage:"resSongX0.htm",
  
 	construct:function(){
		this.selector = new q_4();
		this.keySen = [];
		this.keySenHis = [];
		this.keywords = [];
		this.keyHis = [];
			
		
	},
 
	setBackChoiche:function(){
		this.txt = this.txt  + "<input type=\"text\" name=\"input\" id=\"input\" ondblclick=\"render.selector.show();\" onkeyup=\"render.selector.valid(this);\" onclick=\"render.selector.show();\" >";
   		this.txt = this.txt  +"	<a href=\"javascript:g_2.r6();\"> <img border=\"0\" src=\"http://www.dimmicosavuoi.it/arrowblueleft.gif\" width=\"28\" height=\"25\"></a> Indietro";
		this.txt = this.txt  + "<div class=\"autocomplete_choices\" id=\"autocomplete_choices\"></div>";

		this.choicheArray[0] =  "";


     
	},	
		  
	display:function(isEndOfText){
		var textBox = document.getElementById("input");
		if(textBox != null && textBox != undefined){
			textBox.style.width = (40 * f_9.y2) + "px";
			textBox.focus();
		}
		this.choicheArray = new Array(1);
		this.choicheArray[0] ="";
		this.aladinAutocomp = new aladinLocalAutocom("input","autocomplete_choices",this.choicheArray,this.q_7,null,this.notFoundCB,this.goBackCB,this.q_6,null,this.textChangedInteractive,200,f_9.startSuggestionImmidiatly);
		this.aladinAutocomp.scriptaculus.spaceIsASelector = false;
		this.aladinAutocomp.scriptaculus.options.completeListMode = true;
		this.aladinAutocomp.scriptaculus.backMode = true;
		this.aladinAutocomp.setAutoSelect(false);
		
		
	},	


	


	show:function(){  
		if(f_9.a6 != null && f_9.a6 != undefined){ 
			f_9.a6.r7ResultProcess();
			f_9.a6.r7InactivityTimers();
		}	
        g_2.lastActivityTime = new Date();

		this.aladinAutocomp.show();
		
		
		
	},  

	textChangedInteractive:function(txt){  


			if(txt == undefined){ 
				txt = document.getElementById("input").value + " ";
			}			
			else{
				if(render.selector.timeoutOnPressedCB != null){	
					 clearTimeout(render.selector.timeoutOnPressedCB);
					 render.selector.timeoutOnPressedCB = null;
					 
					}		
					
				if(render.selector.timeoutOnResultsCB != null){	
					 clearTimeout(render.selector.timeoutOnResultsCB);
					 render.selector.timeoutOnResultsCB = null;
					 
					 
					}
				else			
 				render.selector.timeoutOnPressedCB = setTimeout('render.selector.timeoutOnPressed();',60000);
			}			
				
		    txt = txt.replaceAll("con ","con_ ");
		    txt = txt.replaceAll("CON ","CON_ ");
		    txt = txt.replaceAll("Con ","Con_ ");
		    txt = txt.replaceAll("COn ","COn_ ");
		    
		    
		    render.selector.digited = txt;
 		    render.selector.selector = document.getElementById("center_0").innerHTML;
		    	
			if(txt.length == 0){
			
				render.selector.keywords = null;
				render.selector.keySen = null;
				render.selector.keySenHis = null;
				render.selector.keyHis = null;
				render.selector.results = null;
				render.selector.keywords = new Array(0);
				render.selector.keySen = new Array(0);
				render.selector.keySenHis = new Array(0);
				render.selector.keyHis = new Array(0);
				render.selector.results = new Array(0);

			}
			txt = txt.normalize();
			
			if((txt.lastIndexOf(" ") + 1) != txt.length){
				 
				render.selector.lastKeyIsSpace = false;
				
				return;

			}

			
			/* Salvo i risultati solo quando c'è lo spazio */
  			  if(render.selector.keySen.length > 0)
				  render.selector.keySenHis[txt.substring(0,txt.length -1)] = render.selector.keySen;

			   if(render.selector.keywords.length > 0)
				  render.selector.keyHis[txt.substring(0,txt.length -1)] = render.selector.keywords;


			
			render.selector.lastKeyIsSpace = true;		

			var words = txt.split(" "); 
			
			
			var last = txt.substring(txt.indexOf(render.selector.sentence) + render.selector.sentence.length,txt.length).trim();
			
			if(last.length == 0)
				last = txt.trim();
				
			render.selector.sentence = txt;
					
			
			  	 

			if(!render.selector.isCommon(last)) 
			  render.selector.keywords[render.selector.keywords.length] = last;
			 

			
			var path = txt.trim().toLowerCase();
			
			
			path = path.replaceAll(" ","/");
			
			path = path.urlEncoder();
			
	
			var rs = new Remoteh_1();

		    var text="Warning";
		    
		    if(txt.length > 0){
		    
			    if(m_2.countWords(txt) == 1)			
					text = rs.getFile(f_9.baseSong  + g_2.senBasePath + (g_2.language== "ITA" ? "/" : "_eng/")   + path + "/songs.txt");
				else
					text = rs.getSentences(f_9.baseSong + g_2.senBasePath + (g_2.language== "ITA" ? "/" : "_eng/") + path);
				
			}	
			var arrayFull = [];
			var arrayTemp = null;
			
			if(text.length > 0)
				if( text.indexOf("<b>Warning</b>") < 0 || (text.indexOf("<b>Warning</b>") > 0 && text.indexOf("dirstoryboard.php") > 0)) 
					arrayFull = text.split("\n").sort();

/*			var j=0;
			if(arrayTemp != null){
				arrayFull[0] = arrayTemp[0].trim();
				for(j=0;j < arrayTemp.length;j++)
					if(arrayTemp[j].length > 0)
						if(j > 0 && (arrayTemp[j].trim() != arrayTemp[j - 1].trim()))
							arrayFull[arrayFull.length] = arrayTemp[j].trim();
									
			}
*/			
			if(render.selector.keywords.length == 1 && m_2.countWords(txt) == 1)
				for(j=0;j<arrayFull.length;j++)
						render.selector.keySen[render.selector.keySen.length] =	arrayFull[j];					
			

			/* ricerca parole */ 
			var i=0;
			var k=0;
			if(render.selector.keywords.length == 1 && m_2.countWords(txt) > 1) {
  				    
  				    var arrayTemp=[];
 					/* se render.selector.keySen.length è == 0 allora è la prima keyword dopo non keyword
 					 la devo caricare nel keySen */
				    if(render.selector.keySen.length == 0){ 
				    
					    text = rs.getFile(f_9.baseSong + g_2.senBasePath + (g_2.language== "ITA" ? "/" : "_eng/")  + render.selector.keywords[0].toLowerCase().urlEncoder() + "/songs.txt");
						if( text.indexOf("<b>Warning</b>") < 0 || (text.indexOf("<b>Warning</b>") > 0 && text.indexOf("dirstoryboard.php") > 0) && text.length > 0){ 
									
							render.selector.keySen = text.split("\n").sort();
							arrayFull = render.selector.keySen;						 
 						}
 					}
 					else /* altrimenti ricarico i risultati con la vecchia query */
							arrayFull = render.selector.keySen;						 
 						
 					
										

			}

			
			
			
			if(render.selector.keywords.length > 1){
			
			
//					    text = rs.getFile(f_9.basePath + "/spaces/searches_space/song_sen_space/"  + render.selector.keywords[render.selector.keywords.length -1].toLowerCase().urlEncoder() + "/songs.txt");
//						if(text.indexOf("Warning") < 0){ 
								
								
								/* filtro il nuovo arrivato: se non ha parole in comune non devo fare nulla */
/*								
								var arrayTmp = text.split("\n").sort();
							    var arrayKeys=[];
								for(j=0;j < arrayTmp.length;j++){
								    var l_9 = false;
									for(k=0;k < render.selector.keywords.length -1;k++){						
										// la keyword  deve essere cercata solo nel testo					
										if(arrayTmp[j].substring(0,arrayTmp[j].indexOf("-")).toLowerCase().indexOf(render.selector.keywords[k].toLowerCase()) >= 0){
											l_9 = true;
										}
										else{
											l_9 = false;
											break;
										}	
																				
									}
											
											if(l_9 && arrayTmp[j].length > 0){
											    // devo salvare le frasi 
											    arrayKeys[arrayKeys.length] = arrayTmp[j].trim();																					
												arrayFull[arrayFull.length] = arrayTmp[j].trim();
											}	
								}	
*/
								/* filtro le vecchie frasi con la nuova parola */

							    var arrayKeys=[];								
								for(j=0;j < render.selector.keySen.length;j++){
										/* la keyword non deve essere cercata solo nel testo */					
  										var	l_9 = false;
										if(render.selector.keySen[j].substring(0,render.selector.keySen[j].indexOf("-")).toLowerCase().indexOf(render.selector.keywords[render.selector.keywords.length -1].toLowerCase()) >=0){
											l_9 = true;
											
											if(l_9){
												arrayKeys[arrayKeys.length] = render.selector.keySen[j].trim();
												arrayFull[arrayFull.length] = render.selector.keySen[j].trim();
											}
										}	

								}	

								render.selector.keySen = arrayKeys;
								render.selector.keySenHis[txt] = render.selector.keySen;
								render.selector.keyHis[txt] = render.selector.keywords;
								


//						}

			}
			 
			
				
			if(arrayFull.length == 0) return;
			
			var textBox = document.getElementById("input");
			
			
					
			textBox.style.width = (screen.width - 100) + "px";
			
	
			render.selector.aladinAutocomp.setAutoSelect(false);
			
			arrayFull = arrayFull.sort()
			
			
			
			for(i=0;i< arrayFull.length;i++)
				arrayFull[i] = arrayFull[i].decodePath(); 		

			/* ciclo di ordinamento: metto per primi quelli che iniziano con le parole */
			
			
			var newArray=[];
			
			var j=1;
			if(arrayFull.length > 0)			
				newArray[0] = arrayFull[0];
			for(i=0;i< arrayFull.length;i++)
				if(arrayFull[i].numberOf("-") >= 3)
				   if(i > 0 && arrayFull[i].indexOf(arrayFull[i -1]) < 0)
							newArray[j++] = arrayFull[i];
																				
		      /* ordino */					

			  j=0;
			  var k = 0;	
			  var matchArray=[];
			  var notMatchArray=[];
			  for(i=0;i< newArray.length;i++){
				  
				  if(newArray[i].toLowerCase().indexOf(txt.toLowerCase()) == 0 || newArray[i].toLowerCase().indexOf(txt.substring(0,txt.lastIndexOf(" ") - 1).toLowerCase()) == 0)
					matchArray[j++] = newArray[i];
				  else
					notMatchArray[k++] = newArray[i];
			 }			

			  
			    var finalArray=[];
			    
			    k=0;
			    var totalLength = 	matchArray.length + notMatchArray.length;
			    if(totalLength == 0){ 
						finalArray[0] ="";
						render.selector.aladinAutocomp.setArray(finalArray);
						 return;
			    }
			    if(totalLength >= 80){			    
 					 for(i=0;i<= 80;i++) 				  
 						if(i < matchArray.length) 
 							finalArray[k++] = matchArray[i];
 						else
 							finalArray[k++] = notMatchArray[i - matchArray.length];
 					
 				    render.selector.results = null;
 				    render.selector.results = matchArray.concat(notMatchArray);
 						
 				}	
 				else{	
 				    finalArray = matchArray.concat(notMatchArray);
 				    render.selector.results = null;
 				    render.selector.results = finalArray;
		    		window.frames['I0'].location.href  = "blank.htm";
 				}    
				
							  	
				render.selector.aladinAutocomp.setArray(finalArray);
				render.selector.aladinAutocomp.hide();
			
 			    render.selector.timeaoutOnShow = setTimeout('render.selector.aladinAutocomp.show();',300);
				
				

	},

 timeoutOnResults:function() {
 
  if(render.selector.results.length > 0){
  
		var table = new p_9();
		
		if(render.selector.resSongPage == "resPoetryX0.htm")		
			table.h_7TableSenPoetry(render.selector.results);
		else
			table.h_7TableSenSon(render.selector.results);
		f_9.p_9 = table.code;
		f_9.p_9Buffer = f_9.p_9;
		window.frames['I0'].location.href  =  render.selector.resSongPage;
		render.selector.aladinAutocomp.hide();
	 
  }
 
 },


 timeoutOnPressed:function() {
	 if(render.selector.lastKeyIsSpace || render.selector.digited.length == 0) return;
	 render.selector.textChangedInteractive(render.selector.digited + " ");
	 render.selector.timeoutOnResults();
	
 
 },



 q_7:function(txt,obj) {
   

	     var preface= "<span style=\"font-family: Comic Sans MS;font-size:13pt\"><p align=\"justify\" charset=\"iso-8859-1\" style=\"margin-left: 100px; margin-right: 100px ;margin-top: 0; margin-bottom: 0\"><br>" + "Io>";
    	 preface = preface  + txt +    "	<a href=\"javascript:f_9.restartSongs(false);\"> <img border=\"0\" src=\"http://www.dimmicosavuoi.it/arrowblueleft.gif\" width=\"28\" height=\"25\"></a> Indietro";

         document.getElementById("center_0").innerHTML= preface;
   
		/* riordino i risultati */
		var i=0;
		for(i=0;i < render.selector.results.length;i++)
			if(render.selector.results[i] == txt)
				break;
				
		if(i == render.selector.results.length)
			render.selector.results[0] = txt;
		else{
		
			var save = render.selector.results[i];
			render.selector.results[i] = render.selector.results[0];
			render.selector.results[0] = txt; 
			
		}			
			
		
   	if(f_9.userExperiences  != null){
 		f_9.userExperiences.add("SELECTED_SONG",render.selector.digited.urlEncoder(),f_9.p_6);				
		f_9.p_4.saveIncremental(f_9.p_6);
		f_9.p_6 = new UserExperiences(g_2.z5("UNIQUE_ID"));
	 }	
		
		render.selector.timeoutOnResults();
		
		render.selector.clearTimeouts();
 
 


		

	},



 clearTimeouts:function() {


		if(render.selector.timeoutOnPressedCB != null){	
				 clearTimeout(render.selector.timeoutOnPressedCB);
				 render.selector.timeoutOnPressedCB = null;
					 
		}		

		
		if(render.selector.timeoutOnResultsCB != null){
 				clearTimeout(render.selector.timeoutOnResultsCB);
 				render.selector.timeoutOnResultsCB = null;
 	    }

		if(render.selector.timeoutOnShow != null){
 				clearTimeout(render.selector.timeoutOnShow);
 				render.selector.timeoutOnShow = null;
 	    }

},


 h_7SongLinks:function(i) {
   
		var index = -1;
		var value="";
		var rs = new Remoteh_1();
		
		var txt = render.selector.results[i];
		
		var original = txt;
 
		//g_2.setBackToRes(window["I0"].document.body.innerHTML);

		render.selector.backToRes();
		
		
	  
		f_9.contentArray =[];


		var array  =  txt.splitEx();	

		var senEbay    =  array[0].trim().replaceAll("%20"," ").encodePath();
		var authorEbay =  array[1].trim().replaceAll("%20"," ").encodePath();		
		var albumEbay  =  array[2].trim().replaceAll("%20"," ").encodePath();
		var songEbay   =  array[3].trim().replaceAll("%20"," ").encodePath(); 

					
		var sen    =  array[0].trim().replaceAll("%20"," ").encodePath();
		var author =  array[1].trim().replaceAll("%20"," ").replaceAll("&","%26");		
		var album  =  array[2].trim().replaceAll(",","").replaceAll("!","").replaceAll("(","").replaceAll(")","").replaceAll("/"," ").encodePath();
		var song   =  array[3].trim().replaceAll(",","").replaceAll("!","").replaceAll("(","").replaceAll(")","").replaceAll("/"," ").encodePath(); 

		author =  author.urlEncoder();		
		album  =  album.urlEncoder();
		song   =  song.urlEncoder(); 
		var path   =  author + "/" + album + "/" + song;
		

		
		
		var text = rs.getFile(f_9.baseSong + "/spaces/song_sen_space" + (g_2.language== "ITA" ? "/" : "_eng/")  + path.urlEncoder() + "/songs.txt");

		
		if(text.indexOf("Warning") >=0) return;
			
			
		author =  author.replaceAll("%20"," ");		
		album  =  album.replaceAll("%20"," ");
		song   =  song.replaceAll("%20"," "); 
			
		var array = text.split("\n");
		var content=null;
		var readContent = null;
		for (i=0;i < array.length; i++){
			content = new songContent();
			readContent = PHP_Unserialize(array[i]);	
			f_9.contentArray[i] = content.clone(readContent); 
		
		}	
		
		var youTubeUrl = "http://www.youtube.com/results?search_query=" + author.replaceAll(" ","+") + "+" + song.replaceAll(" ","+") + "&aq=0";
		
		
		var youTube = new songContent(1,authorEbay,albumEbay,songEbay,"Youtube",youTubeUrl,'Aladino',0,0);
		
		f_9.contentArray[f_9.contentArray.length] = youTube; 
		
		
		var table = new p_9();
		
		table.h_7TableSong(f_9.contentArray);
		f_9.p_9 = table.code;
		window.frames['I0'].location.href  =  "resX0.htm";

 


		

	},


 h_7PoetryLinks:function(i) {
   
		var index = -1;
		var value="";
		var rs = new Remoteh_1();
		
		var txt = render.selector.results[i];
		
		var original = txt;
 
		//g_2.setBackToRes(window["I0"].document.body.innerHTML);

		render.selector.backToRes();
		
		
	  
		f_9.contentArray =[];


		var array  =  txt.splitEx();	

		var senEbay    =  array[0].trim().replaceAll("%20"," ").encodePath();
		var authorEbay =  array[1].trim().replaceAll("%20"," ").encodePath();		
		var albumEbay  =  array[2].trim().replaceAll("%20"," ").encodePath();
		var songEbay   =  array[3].trim().replaceAll("%20"," ").encodePath(); 

					
		var sen    =  array[0].trim().replaceAll("%20"," ").encodePath();
		var author =  array[1].trim().replaceAll("%20"," ").replaceAll("&","%26");		
		var album  =  array[2].trim().replaceAll(",","").replaceAll("!","").replaceAll("(","").replaceAll(")","").replaceAll("/"," ").encodePath();
		var song   =  array[3].trim().replaceAll(",","").replaceAll("!","").replaceAll("(","").replaceAll(")","").replaceAll("/"," ").encodePath(); 

		author =  author.urlEncoder();		
		album  =  album.urlEncoder();
		song   =  song.urlEncoder(); 
		var path   =  author + "/" + album + "/" + song;
		

		
		
		var text = rs.getFile(f_9.baseSong + "/spaces/poetry_sen_space" + (g_2.language== "ITA" ? "/" : "_eng/")  + path.urlEncoder() + "/songs.txt");

		
		if(text.indexOf("Warning") >=0) return;
			
			
		author =  author.replaceAll("%20"," ");		
		album  =  album.replaceAll("%20"," ");
		song   =  song.replaceAll("%20"," "); 
			
		var array = text.split("\n");
		var content=null;
		var readContent = null;
		for (i=0;i < array.length; i++){
			content = new songContent();
			readContent = PHP_Unserialize(array[i]);	
			f_9.contentArray[i] = content.clone(readContent); 
		
		}	
		
		
		var table = new p_9();
		
		table.h_7TableSong(f_9.contentArray);
		f_9.p_9 = table.code;
		window.frames['I0'].location.href  =  "resX0.htm";

 


		

	},



 q5Song:function() {
 
		document.getElementById("back").style.height= "0px";	 	    
		document.getElementById("back").innerHTML="";
		f_9.p_9 = f_9.p_9Buffer;
		window.frames['I0'].location.href  =  render.selector.resSongPage;
		
 
 },

 backToRes:function() {
   

	     var preface= "<span style=\"font-family: Comic Sans MS;font-size:13pt\"><p align=\"justify\" charset=\"iso-8859-1\" style=\"margin-left: 100px; margin-right: 100px ;margin-top: 0; margin-bottom: 0\">";
    	 preface = preface  + "	<a href=\"javascript:render.selector.q5Song(false);\"> <img border=\"0\" src=\"http://www.dimmicosavuoi.it/arrowblueleft.gif\" width=\"28\" height=\"25\"></a> Indietro";


		document.getElementById("back").style.height= "50px";	 	    
		document.getElementById("back").innerHTML=preface;
	},


	goBackCB:function () {

	
	
	render.selector.clearTimeouts();
	
	
	/* Devo verificare a quale punto sono:  */
	  
	
	 if(render.selector.digited.length > 0)
		render.selector.digited = render.selector.digited.substring(0,render.selector.digited.length -1);
			
			
	 if(document.getElementById("center_0").innerHTML.indexOf("Indietro") >= 0){
	 	document.getElementById("center_0").innerHTML= render.selector.selector;
		render.selector.display(false);
	 }
	 
	 if(render.selector.keySenHis[render.selector.digited] != undefined)
		render.selector.keySen = render.selector.keySenHis[render.selector.digited];

	 if(render.selector.keyHis[render.selector.digited] != undefined)
		render.selector.keywords = render.selector.keyHis[render.selector.digited];
	 
	 render.selector.textChangedInteractive(render.selector.digited);
	 	
	
	},
	


	q_6:function(item){
			var str = item;
			var i=0;
			
 	},
	
	notFoundCB:function (keyCode) {

			
			var txt =document.getElementById("input");
			
		
	}
	  	
 


});



function prcXmlHis(){
			this.head="";
			this.scope="";
			this.context="";
			this.returnPath="";
			this.key="";
			this.tag="";
			this.nextAction="";
			this.robotSays="";
			this.y9="";
			this.path="";
			this.lst=null;
			this.tail="";
			this.z1="";
			this.link="";
			this.isStatement=true;

			

			prcXmlHis.prototype.clone=function(prcXml){

				this.head=prcXml.head;
				this.scope=prcXml.scope;
				this.context=prcXml.context;
				this.returnPath=prcXml.returnPath;
				this.key=prcXml.key;
				this.tag=prcXml.tag;
				this.nextAction=prcXml.nextAction;
				this.robotSays=prcXml.robotSays;
				this.y9=prcXml.y9;
				this.path=prcXml.path;
				this.tail=prcXml.tail;
				this.z1=prcXml.z1;
				this.link=prcXml.link;
				this.isStatement=prcXml.isStatement;

				return this;
			};
			

}

 

var	f_5 = Class.extend({
	  language:"ITA",
	  carClassDownloaded:false,
	  q_9:false,	
	  motoClassDownloaded:false,
	  z1:"",
	  l_5:0,
	  p6:"",
	  p7:"",
	  p8:"",
	  y5:"",
	  f_4:"",
	  status:"",
	  y8:"",
	  m4:[],
	  m5:[],
	  m6:[],
	  b_6:[],
	  h_3:"",
	  h_4:"",
	  h_5:0,
	  h_6:"",
	  refreshed:false,
	  finishRestoring:true,
	  DELIVERED:0,
	  ABORTED:-1,
	  resultsAreComing:false,
	  lastAtctivityTime:null,
	  haveValidRes:false,
	  lastActivityTime:false,
	  init:true,
	  queryPath:"",
	  o_9:"",
	  advReady:false,
	  queryPathHis:[],
	  o_8:false,
	  aliasPath:"",
	  prcXmlHistory:[],
	  dimmicosavuoiHasResults:false,
	  innerHtmlFrames:[],
	  innerHtmlFramesIdx:0,
	  songRes:null, 
	  senBasePath:"", 
	  h_7:function(prcXml){	
	
		if(this.h_3 ==="")
			this.h_3 = prcXml.nextAction;

		this.y5 = prcXml.nextAction;

		this.y8 = prcXml.path;

		this.p6 = prcXml.path;
		this.p8 = m_2.replace_(prcXml.context);
		this.p7   =  f_9.baseUrl + "/search.php";
		this.f_4 = prcXml.returnPath;
		
	  },
	  
	  
	h_8:function(){	
		 var m_0 = location.href; 
		 if(m_0.indexOf("#") >= 0){		 
			m_0 = m_0.substring(m_0.indexOf("#") + 1,m_0.length);		 

		 if(m_0.indexOf("&") >= 0)
			m_0 = m_0.substring(0,m_0.indexOf("&"));		 
		 		 
		   return m_0;
		 		   	 
		 }	
		 else
			return ""; 
		 
	},

	h_9:function(){	
		 var m_0 = location.href; 
		 var str="";
		 if(m_0.indexOf("#") >= 0){		 
			m_0 = m_0.substring(m_0.indexOf("#") + 1,m_0.length);		 

				if(m_0.indexOf("&") >= 0){		 
					m_0 = m_0.substring(m_0.indexOf("&") + 1,m_0.length);		 
					return m_0;	   	 
				}	
				else
					return null; 
		}		 
	},
	
	i_0:function(){
		location.href = "#" + m_2.replaceSpaceWithUnderscore(m_2.replace_(this.p8)) + "&" + g_2.initialStatusIndex;
	},

	i_0Lan:function(lan){
		location.href = "#" + m_2.replaceSpaceWithUnderscore(m_2.replace_(this.p8)) + "&" + g_2.initialStatusIndex + "&LAN=" + lan;
	},


	setVirtualPath:function(){
		var i_1="";
		var mirror="";
		location.href = "#" + m_2.replaceSpaceWithUnderscore(m_2.replace_(this.p8)) + "&" + g_2.initialStatusIndex;
		if(this.h_6.length > 0){ 
			var i_2  = m_2.replace_(this.p8);
			if (g_2.l_5 > 0)
			i_1 = g_2.m6[g_2.l_5 - 1];
			var diff =  i_2.substring(i_1.length,i_2.length);
			if(diff.indexOf(" ") == 0)
				diff = diff.substring(1,diff.length);
			
			this.h_6 = this.h_6 + "/" + diff;
			mirror= this.h_6;
			 
		}
		else {
		   this.h_6 = m_2.replace_(this.p8); 
		   this.h_6 = this.h_6.substring(0,this.h_6.length - 1);
		}
		return this.h_6;
		
	},


	 i_3:function(initialStatusIdx)
	   {

	   
	    this.initialStatusIndex = initialStatusIdx;
		if(f_9.a6 != null && f_9.a6 != undefined){ 
			f_9.a6.r7ResultProcess();
			f_9.a6.r7InactivityTimers();
		}	
  	    g_2.lastActivityTime = new Date();
		switch(initialStatusIdx){
			case 7:
				render.autoSelect = false;
			    render.selector = new q_4WSpace();
				break;
			case 9:
				render.autoSelect = false;
			    render.selector = new q_4SenSpace();
				document.getElementById("robot").style.height= "0px";	 	    
				document.getElementById("robot").innerHTML="";
				break;

			case 10:
				render.autoSelect = false;
			    render.selector = new q_4SenSpace();
				document.getElementById("robot").style.height= "0px";	 	    
				document.getElementById("robot").innerHTML="";
				break;
					
			default:
				render.autoSelect = true;
			    render.selector = new q_4();
				document.getElementById("robot").style.height= "0px";	 	    
				document.getElementById("robot").innerHTML="";
			
		}
		

 		f_9.a6=null;
 		this.l_5 = 0;
		f_9.l_4(f_9.y2);
 		this.h_3="";
 		prcXml.context = "";
 		this.h_6 ="";
		document.getElementById("tabs_0").innerHTML="";
		g_2.queryPath="";
		g_2.o_9 = "";
		g_2.advReady=false;
		window.frames['I0'].location.href  = "blank.htm";
		f_9.o_5="";
		g_8.o_6 = null;
		

		},





	  o_4:function(){
  		 return this.o_1("refresh","refreshed",5);

	    },

	  getRefreshCookie:function(){
  		 return this.z5("refresh");

	    },
	  
	  
	  q2:function(value){
  		return this.z4(g_2.y8,value,20);

	    },

	  i_4:function(value){
  		return this.z4("startUrl",value,20);

	    },


	  n_6:function(value){
		this.z51("resCookie");
  		return this.o_1("resCookie",value,5);
	    },
	    
	  n_7:function(engineName){
		
		var str = this.z5("resCookie");
		if(str == null)
			return f_9.o_2;	
		if(str.indexOf(engineName) >= 0){
			str = str.substring(str.indexOf(engineName + ",") + (engineName + ",").length, str.length);
			str = str.substring(0,str.indexOf(","))
			return str;		 	
		}
	    return f_9.o_2; 
	  
	   
	  },
	  
	  n_8:function(){
			var i=0;
			if(f_9.a6 == null) return;
			
			for(i=0;i < f_9.a6.b5s();i++)
					f_9.a6.a9(i).setRes(g_2.n_7(f_9.a6.d5(i))); 
		
	  
	  },


	  saveSongsResults:function(res){
			var i=0;
			if(res == null) return;
			
			for(i=0;i <res.length ;i++){
			}
	  
	  },

	  n_9:function(){

		var i=0;
		var str="";
			for(i=0;i < f_9.a6.b5s();i++){
				if(f_9.a6.displayMode(i) == f_9.n_4)
					if(i==0)
						str = f_9.a6.d5(i) + "," + f_9.a6.a9(i).getRes(); 
					else
						str =   str + "," + f_9.a6.d5(i) + "," + f_9.a6.a9(i).getRes(); 

			}	
		    
		    str =   str + ",";
			this.n_6(str);
			
/*			var prcXmlH = new prcXmlHis();
			prcXmlH = prcXmlH.clone(this.prcXmlHistory[0]);	
			var php  = new PHP_Serializer();
			str = php.serialize(prcXmlH);
			for(i=1; i < this.l_5; i++){
			    prcXmlH  = prcXmlH.clone(this.prcXmlHistory[i])
				str = str + "#" + php.serialize(prcXmlH);
				if(str.lenght > 1024)
					saveFileIncremental
					str = "";
			   
			}
*/			
					
	   },
	  o_1:function (name,value,min){
				if (min != null) {
					var date = new Date();
					date.setTime(date.getTime()+(min * 60000));
					var expires = "; expires="+date.toGMTString();
				}
				else var expires = "";
				document.cookie = name+"="+value+expires+"; path=/";
	},
	    
	 z4:function (name,value,years){
				if (years) {
					var date = new Date();
					date.setTime(date.getTime()+(years*24*60*60*1000*365));
					var expires = "; expires="+date.toGMTString();
				}
				else var expires = "";
				document.cookie = name+"="+value+expires+"; path=/";
	},

	z5:function(name){
				var nameEQ = name + "=";
				var ca = document.cookie.split(';');
				for(var i=0;i < ca.length;i++) {
					var c = ca[i];
					while (c.charAt(0)==' ') c = c.substring(1,c.length);
					if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
				}
				return null;
	},

	i_5:function(){
				var nameEQ = "startUrl" + "=";
				var ca = document.cookie.split(';');
				for(var i=0;i < ca.length;i++) {
					var c = ca[i];
					while (c.charAt(0)==' ') c = c.substring(1,c.length);
					if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
				}
				return null;
	},

	z51:function(name){
				return this.z4(name,"",-1);
	},
     
 
    q_6:function()
    {
 		if(f_9.a6 != null && f_9.a6 != undefined && !g_2.resultsAreComing){ 
			f_9.a6.r7ResultProcess();
			f_9.a6.r7InactivityTimers();
		}	

	    g_2.lastActivityTime = new Date();

	},
 
    r6:function()
    {

        g_2.lastActivityTime = new Date();
        
		if(prcXml.tag != "skip" && !(g_2.h_3 == "nextXml" && prcXml.y9 == 0)){

			if(prcXml.isStatement){
					g_2.queryPath = g_2.queryPath.substring(0,g_2.queryPath.lastIndexOf("/"));
					g_2.o_9 = f_9.basePath + f_9.appPath  + g_2.queryPath;
					if(g_8.o_6 != null)
						g_8.o_6.q_0(prcXml.tag,false);
					g_2.o_8 = false;
			}
			else
				g_2.o_8 = true;
		}
			



		if(f_9.a6 != null && f_9.a6 != undefined){ 
			f_9.a6.r7ResultProcess();
			f_9.a6.r7InactivityTimers();
		}	
		

        if(this.l_5 > 0 & this.l_5 != 1){
         this.l_5 = this.l_5 - 1;
	     this.p6 =	this.m5[this.l_5 - 1];
    	 this.p8 = this.m6[this.l_5 - 1];
    	 this.y5 = this.b_6[this.l_5 - 1];
  	  	 this.status="_continue_";
  	     h_0.loadXMLDoc(this.m4[this.l_5 - 1],f_9.s2Forward);
		}
		else if (this.l_5 == 1){
	     this.p6 =	this.m5[0];
    	 this.p8 = this.m6[0];
    	 this.y5 = this.b_6[0];
  	  	 this.status="_continue_";
  	     h_0.loadXMLDoc(this.m4[0],f_9.s2Forward);

		}

		else if (this.l_5 > 10000)
  		  this.l_5 = 0;

    },
    
    r5:function(url,index,value,nextAction,path,returnPath,context)
    {
		var finalUrl="";
		if(f_9.a6 != null && f_9.a6 != undefined){ 
			f_9.a6.r7ResultProcess();
			f_9.a6.r7InactivityTimers();
		}	
		h_0.setCallback(f_9.s2Forward);
		finalUrl = h_0.requestData(url,index,value,nextAction,path,returnPath,context);
		g_2.i_6(finalUrl,value,index);
	    g_2.resultsAreComing = false;  
		g_2.lastActivityTime = new Date();
		window.frames['I0'].location.href  =  "blank.htm";
		g_2.dimmicosavuoiHasResults = false;
		f_9.results = new Array(0);



		
	},


    onMouseOver:function(url,index,value,nextAction,path,returnPath,context)
    {
		var i=0;
		var str ="";
		var list=null;
		for(i=0;i < 1;i++){
			var str="";
            str = "categoria_" + i;

		list = document.getElementById(str);

		list.selectedIndex = index;    
	
		}	
	},
	 
	 i_6:function(finalUrl,value,index){
		this.m4[this.l_5] = finalUrl + "&scope=back";
    	this.m5[this.l_5] = this.p6;
    	this.m6[this.l_5] = this.p8;
    	this.b_6[this.l_5] = this.y5;
    	this.prcXmlHistory[this.l_5] = prcXml;
		this.l_5 = this.l_5 + 1;
  
   		if(render.selector instanceof Selector) 
  			if(index > 10){
					this.z51(this.y8);
					this.q2(value); 
			}
	
	  },

	 setBackToRes:function(innerHtmlFrame) {
	   

			 this.innerHtmlFrames[this.innerHtmlFramesIdx++] = innerHtmlFrame;	
		     var preface= "<span style=\"font-family: Comic Sans MS;font-size:13pt\"><p align=\"justify\" charset=\"iso-8859-1\" style=\"margin-left: 100px; margin-right: 100px ;margin-top: 0; margin-bottom: 0\">";
	    	 preface = preface  + "	<a href=\"javascript:g_2.backToIframe();\"> <img border=\"0\" src=\"http://www.dimmicosavuoi.it/arrowblueleft.gif\" width=\"28\" height=\"25\"></a> Indietro";


				document.getElementById("back").style.visibility = "visible";	 	    
			document.getElementById("back").style.height= "50px";	 	    
			document.getElementById("back").innerHTML=preface;
	
	},

	 backToIframe:function() {
	   
			g_2.innerHtmlFramesIdx = g_2.innerHtmlFramesIdx - 1;	
			if(g_2.innerHtmlFramesIdx == 0){
				document.getElementById("back").style.height= "0px";
				document.getElementById("back").style.visibility = "hidden";
			}		 	    
			  
			  window["I0"].document.body.innerHTML = g_2.innerHtmlFrames[g_2.innerHtmlFramesIdx];	
			  	
	},


	  
	q_7:function(text,obj) {
   
		var index = -1;
		var value="";
		for(var i=0; i < render.selector.choicheArray.length; i++){
			if(render.selector.choicheArray[i] == text){
				index = i;
				value = m_2.restoreCode(render.selector.choicheArray[i]).acRev();
				break;
			}	
		}
				
	  if(index != -1) 
			g_2.r5(g_2.p7,index,value,prcXml.nextAction,prcXml.path,prcXml.returnPath,escape(prcXml.context));				

	},

	valid:function(obj) {
		var status=0;
	},

	setToIta:function() {
		this.language="ITA";
		f_9.restartSongs(false);
		
		  
	},
	setToEng:function() {
		this.language="ENG";
		f_9.restartSongs(false);
		
		  
	},


	goBackCB:function () {


		g_2.r6();
	}
	  


});


var	Page = Class.extend({
	i_8:null,
	y1:2,
	y2:13,
	MAXENGINENUM:1,
	a6:null,
	p9:null,
	production:true,
	test:false,
	baseUrl:"",
	basePath:"",
	baseSong:"",
	i_7:[],
	m_0:null,
	i_9:"", 
	l_0:1,
	l_1:2, 	
	l_2:3,
	n_2:4,
	n_3:5, 
	n_4:6,
	l_0_EBAY:7,
	o_2:-1,
	o_3:-2,
	RESULT_MACHINE_IS_BANNED:-3,	
	TIMEOUT_ON_INACTIVITY:4000,
	startUrl:"",
	xttp:null,
	startSuggestionImmidiatly:true,
	p_4:null,
	user:null,
	userExperiences:null,
	p_6:null,
	advId:"10-1-1",
    advTitle:"",
    advText:"",
    o_5:"",
    advPlace:"",
    p_9Buffer:null,
    p_9:"",
	appPath:"",
	appUrl:"",
	mEmo:"",
	restoreFromh_1:true,
	rs:null,
	soundFile:"",
	contentArray:[],
	p_9Obj:null,
	construct:function(){
		var i=0;
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/auto/cerco&context=Cerco ";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/treni&context=Cerco%20un%20treno%20da%20";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/aerei&context=Vorrei%20un%20volo%20da ";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/case&context=Vorrei%20";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/moto/cerco&context=Cerco ";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/meteo&context=Vorrei%20sapere%20che%20tempo%20";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/varie&context=Cerco%20";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/users/Aladino&context=Io>%20";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/app/p_space&context=Io>%20";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/spaces/searches_space/song_sen_space&context=Io>%20";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/spaces/searches_space/poetry_sen_space&context=Io>%20";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/affinita/IlCibo&context=Io>%20Il cibo";
		this.i_7[i++] = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/camper/cerco&context=Cerco ";

		if(this.production){
		    this.baseUrl="http://www.dimmicosavuoi.it/php";
		    this.basePath="/web/htdocs/www.dimmicosavuoi.it/home/cgi-bin";
			this.appUrl = "http://www.dimmicosavuoi.it"
			this.baseSong= "/web/htdocs/www.dimmicosavuoi.it/home";
		}
		else{
			this.baseUrl="http://localhost/php";
			this.basePath="c:/aladinsearch";
			this.appUrl = "c:/aladinsearch";
			this.baseSong= this.basePath;
		}
		
		if(this.test){
		    this.baseUrl="http://www.dimmicosavuoi.it/cgi-bin/test";
		    this.basePath="/web/htdocs/www.dimmicosavuoi.it/home/cgi-bin/test";
			this.appUrl = "http://www.dimmicosavuoi.it/test"
			this.baseSong= this.basePath;
		}

		

/*	  if(navigator.appName == "Microsoft Internet Explorer")
		  document.body.scroll = "no";	
	  else
		  document.documentElement.style.overflow = 'hidden';	 
*/

	},

	
	
	reloadPage:function(){
		g_2.finishRestoring = false;
		
			
		this.m_0 = m_2.replaceUnderscoreWithSpace(g_2.h_8());
	
		if(this.m_0.length > 0)
			this.m_0 = unescape(this.m_0);
		
		if(location.href.indexOf("#") > 0){ 
			this.i_9 = g_2.h_9();
			if(this.i_9 == 7 || this.i_9 == 9){
				f_9.p_4 = new VirtualStorage();
				f_9.user = f_9.p_4.retrive("unregistered_users",g_2.z5("UNIQUE_ID"),new UnregisteredUser());
		   	    
		   	    if(f_9.user != null)	   
			   	  if(f_9.user.name != ""){	   
					 this.i_7[this.i_9] = this.i_7[this.i_9].replace("Io>",this.user.name + "> ");			
				     render.selector.autoSelect = false;	 
				  }		
			}
			
			

			f_9.p_6 = new UserExperiences(g_2.z5("UNIQUE_ID"));
			
			
			
			
			
			g_2.initialStatusIndex = this.i_9;

			g_2.i_6(this.i_7[this.i_9],"",1);

			switch(parseInt(this.i_9)){	
				case 0:
					f_9.startCar(f_9.i_7[0], this.l_6);				
					return;
				case 3:	
					f_9.startHome(f_9.i_7[3], this.l_6);				
					return;
				case 4:	
					f_9.startMoto(f_9.i_7[4], this.l_6);				
					return;
				case 9:	
					f_9.restoreSong();				
					return;

									
			}


/*			switch(this.i_9){	
				case "0":
					m_2.q4("classCarX0.js","js");					
					break;
				case "3":	
					m_2.q4("classHomeX0.js","js");
					break;
				case "4":	
					m_2.q4("classMotoX0.js","js");
					break;
					
			}
*/
			
			if(f_9.restoreFromh_1)			
				h_0.loadXMLDoc(this.i_7[this.i_9],this.l_6);
			else{
				var i=0;
			
			}		
			
			
		}
		
		else if(location.href.indexOf("?") > 0){ 
			var adv= location.href.substring(location.href.indexOf("?adv=") + "?adv=".length,location.href.length);
			
				window.frames['I0'].location.href  = f_9.appUrl + "/app/adv/" + adv + "/" + "index.html";
				setTimeout('f_9.Robot.says(\"Fatto!!! Ho inserito il tuo annuncio che vedi li sotto. Ciao ciao.\" ,null)',3000);
				setTimeout('javascript:location.href=\"http://www.dimmicosavuoi.it\"',13000);

		
		
		}
		
		else if(g_2.getRefreshCookie() == null){
			g_2.o_4();
			window.location.reload(true);			
		}
	
	},	

	l_3:function(startUrl, xmlhttp){
		
 	    g_2.status = "_continue_";
		g_2.i_6(startUrl,"",1);
		
		h_0.loadXMLDoc(startUrl,xmlhttp);
	
	
	},
	r_1:function(continueDialog){	
	   var str="";
	   g_2.status = "_continue_";
       g_2.i_3(7);
	   render.selector = new q_4WSpace();
       this.startSuggestionImmidiatly=false; 
	   	

	   	  if(f_9.user.name != "")	   
				this.i_7[g_2.initialStatusIndex] = this.i_7[g_2.initialStatusIndex].replace("Io>",this.user.name + "> ");			


	   	
	   
		f_9.l_3(this.i_7[g_2.initialStatusIndex],this.s2Forward);			
       

	},

	restoreSong:function(){	
	
	
	   		
	   var txt="";
	   if(location.href.indexOf("&LAN=") > 0)
			g_2.language = location.href.substring(location.href.lastIndexOf("&LAN=") + 5,location.href.length);
	   
	   g_2.status = "_continue_";
       g_2.i_3(9);
       g_2.p8 = "Io> ";
       g_2.i_0Lan(g_2.language);




       prcXml.lst = [];
	   f_9.restartSongs(false);
	   var rs = new Remoteh_1();
	   var txt = rs.getFile(f_9.basePath + "/app/user_data/" + g_2.z5("UNIQUE_ID") + "/song_res.txt");
	   if(txt.indexOf("Warning") < 0){
			 txt = txt.replaceAll("\\'","'");
			 render.selector.results =txt.split("\n");
		     render.selector.timeoutOnResults();

	   }
	   else {
			var txt = f_9.rs.getFile(f_9.baseSong + "/spaces/song_sen_space" + (g_2.language== "ITA" ? "/" : "_eng/") + "all.txt");
  			var table = new p_9();
			table.h_7TableAuthors(txt);
			f_9.p_9 = table.code;
			window.frames['I0'].location.href  =  "resX0.htm";

			
	   }
	      
	   	       
	    	 
       

	},


	startSongs:function(continueDialog){	
	   var txt="";
	   g_2.status = "_continue_";
       g_2.i_3(9);
       g_2.p8 =  "Io> ";
       

       
       
	   f_9.restartSongs(continueDialog);
	    	 
       

	},


	restartSongs:function(continueDialog){	
	   var txt="";
       g_2.i_0Lan(g_2.language);
	   if(render.selector != null){	
				render.selector.keywords = null;
				render.selector.keySen = null;
				render.selector.keySenHis = null;
				render.selector.keyHis = null;
				render.selector.results = null;
				render.selector.keywords = new Array(0);
				render.selector.keySen = new Array(0);
				render.selector.keySenHis = new Array(0);
				render.selector.keyHis = new Array(0);
				render.selector.results = new Array(0);
			    render.selector.clearTimeouts();
	   }	
       render.selector = null;
	   render.selector = new q_4SenSpace();
				render.selector.keywords = null;
				render.selector.keySen = null;
				render.selector.keySenHis = null;
				render.selector.keyHis = null;
				render.selector.results = null;
				render.selector.keywords = new Array(0);
				render.selector.keySen = new Array(0);
				render.selector.keySenHis = new Array(0);
				render.selector.keyHis = new Array(0);
				render.selector.results = new Array(0);
       this.startSuggestionImmidiatly=false; 
		g_2.senBasePath = "/spaces/searches_space/song_sen_space";
		render.selector.resSongPage="resSongX0.htm";
	   	


		if(g_2.language == "ITA")
			txt = render.m_3("<img onclick=\"g_2.setToEng();\" name=\"flag1\" src=\"" + "./image/" + "eng_flag_shadow.jpg" + "\"> <img onclick=\"g_2.setToIta();\" name=\"flag2\" src=\"" + "./image/" + "ita_flag.jpg" + "\"> Io>");
		else
			txt = render.m_3("<img onclick=\"g_2.setToEng();\" name=\"flag1\" src=\"" + "./image/" + "eng_flag.jpg" + "\"> <img onclick=\"g_2.setToIta();\" name=\"flag2\" src=\"" + "./image/" + "ita_flag_shadow.jpg" + "\"> Io>");
		
		var array=[];
		array[0]="";	
			
		render.m_4();

  	    render.m_5();

		render.selector.aladinAutocomp.setArray(array);
		
    	if(f_9.userExperiences  != null){
				if(f_9.userExperiences.hasNeverDoneThisOne("SUGGESTED_SLOW_DIGIT")){
					var txt = "scrivi lentamente sennò non capisco, grazie";
					f_9.userExperiences = new UserExperiences(g_2.z5("UNIQUE_ID"));
					f_9.userExperiences.add("SUGGESTED_SLOW_DIGIT",txt.urlEncoder(),f_9.p_6);
					//f_9.Robot.says(txt,null);
				}
	    }
	    
	    
		 txt = f_9.rs.getFile(f_9.baseSong + "/spaces/song_sen_space" + (g_2.language== "ITA" ? "/" : "_eng/") + "all.txt");
  	     var table = new p_9();
		 table.h_7TableAuthors(txt);
		 f_9.p_9 = table.code;
		 window.frames['I0'].location.href  =  "resX0.htm";
		
		
		 	
	

       

	},


	startPoetry:function(continueDialog){	
	   var txt="";
	   g_2.status = "_continue_";
       g_2.i_3(10);
       g_2.p8 =  "Io> ";
       

       
       
	   f_9.restartPoetry(continueDialog);
	    	 
       

	},


	restartPoetry:function(continueDialog){	
	   var txt="";
       g_2.i_0Lan(g_2.language);
	   if(render.selector != null){	
				render.selector.keywords = null;
				render.selector.keySen = null;
				render.selector.keySenHis = null;
				render.selector.keyHis = null;
				render.selector.results = null;
				render.selector.keywords = new Array(0);
				render.selector.keySen = new Array(0);
				render.selector.keySenHis = new Array(0);
				render.selector.keyHis = new Array(0);
				render.selector.results = new Array(0);
			    render.selector.clearTimeouts();
	   }	
       render.selector = null;
	   render.selector = new q_4SenSpace();
				render.selector.keywords = null;
				render.selector.keySen = null;
				render.selector.keySenHis = null;
				render.selector.keyHis = null;
				render.selector.results = null;
				render.selector.keywords = new Array(0);
				render.selector.keySen = new Array(0);
				render.selector.keySenHis = new Array(0);
				render.selector.keyHis = new Array(0);
				render.selector.results = new Array(0);
       this.startSuggestionImmidiatly=false; 
	   	
		g_2.senBasePath = "/spaces/searches_space/poetry_sen_space";
		render.selector.resSongPage="resPoetryX0.htm";

		var array=[];
		array[0]="";	

		if(g_2.language == "ITA")
			txt = render.m_3("<img onclick=\"g_2.setToEng();\" name=\"flag1\" src=\"" + "./image/" + "eng_flag_shadow.jpg" + "\"> <img onclick=\"g_2.setToIta();\" name=\"flag2\" src=\"" + "./image/" + "ita_flag.jpg" + "\"> Io>");
		else
			txt = render.m_3("<img onclick=\"g_2.setToEng();\" name=\"flag1\" src=\"" + "./image/" + "eng_flag.jpg" + "\"> <img onclick=\"g_2.setToIta();\" name=\"flag2\" src=\"" + "./image/" + "ita_flag_shadow.jpg" + "\"> Io>");
			
		render.m_4();

  	    render.m_5();

		render.selector.aladinAutocomp.setArray(array);
		
    	if(f_9.userExperiences  != null){
				if(f_9.userExperiences.hasNeverDoneThisOne("SUGGESTED_SLOW_POETRY")){
					var txt = "scrivi lentamente sennò non capisco, grazie";
					f_9.userExperiences = new UserExperiences(g_2.z5("UNIQUE_ID"));
					f_9.userExperiences.add("SUGGESTED_SLOW_DIGIT",txt.urlEncoder(),f_9.p_6);
					//f_9.Robot.says(txt,null);
				}
	    }
	    
	    
		 txt = f_9.rs.getFile(f_9.baseSong + "/spaces/poetry_sen_space" + (g_2.language== "ITA" ? "/" : "_eng/") + "all.txt");
  	     var table = new p_9();
		 table.h_7TableAuthorsPoetry(txt);
		 f_9.p_9 = table.code;
		 window.frames['I0'].location.href  =  "resX0.htm";
		
		
		 	
	

       

	},


	startCar:function(startUrl, xmlhttp){
	

		if(!g_2.carClassDownloaded){
		    m_2.q4("classCarX0.js","js");
			this.startUrl = startUrl;
			this.xhttp= xmlhttp;
			setTimeout('parent.f_9.startCarDialog()',1000);			
			return;		
		}		 
		else{		
		
			g_2.i_6(startUrl,"",1);		
			h_0.loadXMLDoc(startUrl,xmlhttp);
		}	
	
	},


	startCarDialog:function(){
	

	   g_2.status = "_continue_";
		if(!g_2.carClassDownloaded){
			setTimeout('parent.f_9.startCarDialog()',1000);			
			return;
		}		 
		else{		
		
			g_2.i_6(this.startUrl,"",1);		
			h_0.loadXMLDoc(this.startUrl,this.xhttp);
		}	
	
	
	},
	startMoto:function(startUrl, xmlhttp){
	

		if(!g_2.motoClassDownloaded){
		    m_2.q4("classMotoX0.js","js");
			this.startUrl = startUrl;
			this.xhttp= xmlhttp;
			setTimeout('parent.f_9.startMotoDialog()',1000);			
			return;		
		}		 
		else{		
		
			g_2.i_6(startUrl,"",1);		
			h_0.loadXMLDoc(startUrl,xmlhttp);
		}	
	
	},


	startMotoDialog:function(){
	

	   g_2.status = "_continue_";
		if(!g_2.motoClassDownloaded){
			setTimeout('parent.f_9.startMotoDialog()',1000);			
			return;
		}		 
		else{		
		
			g_2.i_6(this.startUrl,"",1);		
			h_0.loadXMLDoc(this.startUrl,this.xhttp);
		}	
	
	
	},


	startHome:function(startUrl, xmlhttp){
	
			g_8.o_6 = new o_7("case/Vorrei");
         		
		if(!g_2.q_9){
		    m_2.q4("classHomeX0.js","js");
			this.startUrl = startUrl;
			this.xhttp= xmlhttp;
			setTimeout('parent.f_9.startHomeDialog()',1000);			
			return;		
		}		 
		else{		
		
			g_2.i_6(startUrl,"",1);		
			h_0.loadXMLDoc(startUrl,xmlhttp);
		}	
	
	},


	startHomeDialog:function(){
	

	   g_2.status = "_continue_";
		if(!g_2.q_9){
			setTimeout('parent.f_9.startHomeDialog()',1000);			
			return;
		}		 
		else{	
			
		
			g_2.i_6(this.startUrl,"",1);		
			h_0.loadXMLDoc(this.startUrl,this.xhttp);
		}	
	
	
	},
    

    
	 l_4:function (font) {
		var center=null;
		center = document.getElementById('center_0');
		center.style.fontSize = font;
	  },
	  
	l_5Forward:function(s3){
		var show = false;
     	var txt  = "";

		prcXml.extractData(s3);
		
		if(prcXml.link != "noLink"){
			
			/*var finalUrl = location.href + "#" + prcXml.link.replace("AND","&");
			
			var idx = parseInt(prcXml.link.substring(prcXml.link.indexOf("D") + 1,prcXml.link.length));
			switch(idx){	
				case 0:
					f_9.startCar(f_9.i_7[0], f_9.s2Forward);				
					return;
				case 3:	
					f_9.startHome(f_9.i_7[3], f_9.s2Forward);				
					return;
				case 4:	
					f_9.startMoto(f_9.i_7[4], f_9.s2Forward);				
					return;
					
			}

			*/
			
			location.href = "#" + prcXml.link.replace("AND","&");
			
			
			
			window.location.reload(true);
			return;
		}



		g_2.h_7(prcXml);
			

		txt = render.m_3("");
			
		show = g_8.process(txt);
			
		g_2.i_0();
		
		g_2.setVirtualPath();	

		if (show)
			render.display(f_9);
				
				
		if (show)
			render.s1(f_9);		
			
			
		render.m_4();

		render.m_5();


		render.selector.focus();
				
		render.m_6();
		   
		g_2.status = prcXml.status;
		g_2.h_3 = prcXml.nextAction;

	  
	},

	loadAdv:function(){
		if(g_2.advReady){
		
		
			if(g_2.z5("ADV_ID") != null){
				f_9.advId = g_2.z5("ADV_ID");			
			
			}	
			else{
				f_9.advId = generateGuid();			
				g_2.o_1("ADV_ID",f_9.advId,60);
			}		   
			
			window.frames['I0'].location.href =  "new_X0.htm";
			g_2.advReady=false;
		  
		}
	
	},
	
	l_6:function(){
		var b_8=navigator.appName;
		var s3=null;

		
		if(h_0.xmlHttpHandler.xmlhttp.readyState!=4) return;
		if(h_0.xmlHttpHandler.xmlhttp.status!=200)
		  {
			  alert("Problem retrieving XML data");
			  return;
		  }

		if(b_8 == "Microsoft Internet Explorer"){

		    s3 = new ActiveXObject('Microsoft.XMLDOM');
			s3.loadXML(h_0.xmlHttpHandler.xmlhttp.responseText);

		}
		else
			s3 =  new DOMParser().parseFromString(h_0.xmlHttpHandler.xmlhttp.responseText, "text/xml");

		f_9.l_5Backward(s3);
		

			
	  
	},


	l_5Backward:function(s3){
     	var txt  = "";
		var finalUrl = "";
		var i=0;
		var m_0="";
		var	l_7 = false;
		var l_9 = false;

		
		
		prcXml.extractData(s3);

		
		
		g_2.h_7(prcXml);

		txt = render.m_3("");
			
		g_8.process(txt);
			
		g_2.i_0();
						
			
		render.m_4();
		   
		g_2.status = prcXml.status;

		g_2.h_3 = prcXml.nextAction;
		
		txt = m_2.replace_(prcXml.context);
		/* extract just processed: z6 context and tail */
		
		m_0 = f_9.m_0.substring(f_9.m_0.indexOf(txt) + txt.length,f_9.m_0.length);  

		/* look for head */
		
		txt = prcXml.head.trim();

		l_7 = false;
		
		if(txt != "noHead"){
			if(m_0.indexOf(txt) < 0){ /* skip */
				value = m_2.z6(g_2.p9[0].firstChild.nodeValue).trim()
				index = 0;
				l_7 = true;
			}
			else
				m_0 = m_0.substring(m_0.indexOf(txt) + txt.length,m_0.length);
		}
		l_9 = false;
		
		m_0 = m_0.trim();
				
        for(i=0;i<g_2.p9.length && !l_7 ;i++){

   				   txt = m_2.z6(g_2.p9[i].firstChild.nodeValue).trim();
				   if(txt == m_0.trim().substring(0,txt.length)){
							m_0 = f_9.m_0.substring(f_9.m_0.indexOf(txt) + txt.length + 1,f_9.m_0.length);
							value = txt;
							index = i;
							l_9 = true;
							break;
					}

          }

		if(!l_9){ /* skip */
				value = m_2.z6(g_2.p9[0].firstChild.nodeValue).trim()
				index = 0;
			}
		

		
		render.m_5();
		
		
		
		m_0 = m_0.trim();	

	    if(m_0.length > 0 || (m_0.length == 0 && l_9)){
			
				h_0.setCallback(f_9.l_6);
				finalUrl = h_0.requestData(g_2.p7,index,value,g_2.y5,g_2.p6,g_2.f_4,g_2.p8);			
				g_2.i_6(finalUrl,value,index);

				if(m_0.length == 0 || prcXml.tail == m_0)
					g_2.finishRestoring=true;

		}	
		else {
				render.m_6();
				g_2.n_8();
				render.s1(f_9);		
						
			
		}	

			
	  
	},

	l_5BackwardHis:function(prcXmlHis){
     	var txt  = "";
		var finalUrl = "";
		var i=0;
		var m_0="";
		var	l_7 = false;
		var l_9 = false;

		

		prcXml = prcXmlHis;
		
		g_2.h_7(prcXml);

		txt = render.m_3("");
			
		g_8.process(txt);
			
		g_2.i_0();
						
			
		render.m_4();
		   
		g_2.status = prcXml.status;

		g_2.h_3 = prcXml.nextAction;
		
		txt = m_2.replace_(prcXml.context);
		/* extract just processed: z6 context and tail */
		
		m_0 = f_9.m_0.substring(f_9.m_0.indexOf(txt) + txt.length,f_9.m_0.length);  

		/* look for head */
		
		txt = prcXml.head.trim();

		l_7 = false;
		
		if(txt != "noHead"){
			if(m_0.indexOf(txt) < 0){ /* skip */
				value = m_2.z6(g_2.p9[0].firstChild.nodeValue).trim()
				index = 0;
				l_7 = true;
			}
			else
				m_0 = m_0.substring(m_0.indexOf(txt) + txt.length,m_0.length);
		}
		l_9 = false;
		
		m_0 = m_0.trim();
				
				
        for(i=0;i<g_2.p9.length && !l_7 ;i++){

   				   txt = m_2.z6(g_2.p9[i].firstChild.nodeValue).trim();
				   if(txt == m_0.trim().substring(0,txt.length)){
							m_0 = f_9.m_0.substring(f_9.m_0.indexOf(txt) + txt.length + 1,f_9.m_0.length);
							value = txt;
							index = i;
							l_9 = true;
							break;
					}

          }

		if(!l_9){ /* skip */
				value = m_2.z6(g_2.p9[0].firstChild.nodeValue).trim()
				index = 0;
			}
		

		
		render.m_5();
		
		
		
		m_0 = m_0.trim();	

	    if(m_0.length > 0 || (m_0.length == 0 && l_9)){
			
				h_0.setCallback(f_9.l_6);
				finalUrl = h_0.createUrl(g_2.p7,index,value,g_2.y5,g_2.p6,g_2.f_4,g_2.p8);			
				g_2.i_6(finalUrl,value,index);

				if(m_0.length == 0 || prcXml.tail == m_0)
					g_2.finishRestoring=true;

		}	
		else {
				render.m_6();
				g_2.n_8();
				render.s1(f_9);		
						
			
		}	

			
	  
	},
	
    s2Forward:function()
    {
	var b_8=navigator.appName;
	var s3=null;
	

	if(h_0.xmlHttpHandler.xmlhttp.readyState!=4) return;
	if(h_0.xmlHttpHandler.xmlhttp.status!=200)
	  {
		  alert("Problem retrieving XML data");
		  return;
	  }

	if(b_8 == "Microsoft Internet Explorer"){

	    s3 = new ActiveXObject('Microsoft.XMLDOM');
		s3.loadXML(h_0.xmlHttpHandler.xmlhttp.responseText);

	}
	else
		s3 =  new DOMParser().parseFromString(h_0.xmlHttpHandler.xmlhttp.responseText, "text/xml");

	f_9.l_5Forward(s3);


	},

	h_7TableAuthor:function(author){
	
	
    	var txt = f_9.rs.getFile(f_9.baseSong + "/spaces/song_sen_space"  + (g_2.language== "ITA" ? "/" : "_eng/") + author + "/" + "all.txt");

		var array = txt.split("\n");
		array = array.sort();
 	     var table = new p_9();
 	     g_2.songRes = array;
		 table.h_7TableAuthor(array);
		 f_9.p_9 = table.code;
		 window.frames['I0'].location.href  =  "resX0.htm";
 		 g_2.setBackToRes(window["I0"].document.body.innerHTML);


		
		
	},

	h_7TableAuthorPoetry:function(author){
	
	
    	var txt = f_9.rs.getFile(f_9.baseSong + "/spaces/poetry_sen_space"  + (g_2.language== "ITA" ? "/" : "_eng/") + author + "/" + "all.txt");

		var array = txt.split("\n");
		array = array.sort();
 	     var table = new p_9();
 	     g_2.songRes = array;
		 table.h_7TableAuthorPoetry(array);
		 f_9.p_9 = table.code;
		 window.frames['I0'].location.href  =  "resX0.htm";
 		 g_2.setBackToRes(window["I0"].document.body.innerHTML);


		
		
	},


	h_7TableSong:function(i){
	
	
		var array  =  g_2.songRes[i].split(";");
		var author =  array[0].trim();		
		var name   =  array[1].trim(); 
		var album  =  array[2].trim();
		
    	var txt = f_9.rs.getSong(f_9.baseSong + "/spaces/song_sen_space"  + (g_2.language== "ITA" ? "" : "_eng"),author,album,name);
		//txt = txt.replaceAll("'","`");
		array = txt.split("\n");
		array = array.sort();
		var i=0;
		for(i=0;i < array.length;i++)
			array[i] = array[i].decodePathEx();
 	    var table = new p_9();
	    table.h_7TableSenSon(array);
		f_9.p_9 = table.code;
		f_9.p_9Buffer = f_9.p_9;
		render.selector.results = array;
		window.frames['I0'].location.href  =  "resSongX0.htm";
     	g_2.setBackToRes(window["I0"].document.body.innerHTML);

	
		
		
	},
	
	h_7TablePoetry:function(i){
	
	
		var array  =  g_2.songRes[i].split(";");
		var author =  array[0].trim();		
		var name   =  array[1].trim(); 
		var album  =  array[2].trim();
		
    	var txt = f_9.rs.getSong(f_9.baseSong + "/spaces/poetry_sen_space"  + (g_2.language== "ITA" ? "" : "_eng"),author,album,name);
		//txt = txt.replaceAll("'","`");
		array = txt.split("\n");
		array = array.sort();
		var i=0;
		for(i=0;i < array.length;i++)
			array[i] = array[i].decodePathEx();
 	    var table = new p_9();
	    table.h_7TableSenPoetry(array);
		f_9.p_9 = table.code;
		f_9.p_9Buffer = f_9.p_9;
		render.selector.results = array;
		window.frames['I0'].location.href  =  "resPoetryX0.htm";
     	g_2.setBackToRes(window["I0"].document.body.innerHTML);

	
		
		
	}
	



});

var	processXml = Class.extend({
	  head:"",
	  scope:"",
	  context:"",
	  returnPath:"",
	  key:"",
	  tag:"",
	  nextAction:"",
	  robotSays:"",
	  y9:"",
	  path:"",
	  lst:null,
	  tail:"",
	  z1:"",
	  link:"",
	  isStatement:true,
	  		  
	  extractData:function(s3){

		if(s3.getElementsByTagName("LINK")[0] != null)
			this.link = s3.getElementsByTagName("LINK")[0].firstChild.nodeValue;

		if(s3.getElementsByTagName("STATEMENT")[0] != null)
			this.isStatement = s3.getElementsByTagName("STATEMENT")[0].firstChild.nodeValue == "statement"? true : false;
			

	    this.key = s3.getElementsByTagName("KEY")[0].firstChild.nodeValue;

		this.tag = s3.getElementsByTagName("TAG")[0].firstChild.nodeValue;

		this.context   = unescape(s3.getElementsByTagName("CONTEXT")[0].firstChild.nodeValue);

		 
		this.nextAction =  s3.getElementsByTagName("NEXT")[0].firstChild.nodeValue;


		this.y9 = s3.getElementsByTagName("INDEX")[0].firstChild.nodeValue;

		this.head =  s3.getElementsByTagName("HEAD")[0].firstChild.nodeValue;

		this.scope = s3.getElementsByTagName("SCOPE")[0].firstChild.nodeValue;

		this.returnPath = s3.getElementsByTagName("RETURN")[0].firstChild.nodeValue;


		this.lst = s3.getElementsByTagName("LIST");
		

		this.path   = s3.getElementsByTagName("PATH")[0].firstChild.nodeValue;

		this.z1 = s3.getElementsByTagName("DEBUG")[0].firstChild.nodeValue;
		this.status = s3.getElementsByTagName("STATUS")[0].firstChild.nodeValue;
		
		this.tail = s3.getElementsByTagName("TAIL")[0].firstChild.nodeValue;
		if(s3.getElementsByTagName("ROBOT")[0] != null)
			this.robotSays = s3.getElementsByTagName("ROBOT")[0].firstChild.nodeValue;
		
		
		if(this.tail != "noTail")
			this.context = this.context + " " + this.tail + " ";
		
			  
	  
	}		



});



var	g_7 = Class.extend({
	selector:null,
	isEndOfText:false,
	
	construct:function(){
		this.selector = new q_4();
		
		
	},
	
	display:function (f_9){
				var i;
				var str="";
				for(i=0;i < f_9.a6.b5s();i++){
					switch(f_9.a6.displayMode(i)){
						case f_9.l_0 : 
							str = "I" + i;
               				parent.frames[i].location.href = f_9.a6.h1(i);
							break;
							
						case f_9.n_4_EBAY : 
               				f_9.a6.a9ByName("eBay").loadUrl();
							break;
					}
				}

	},
   	q8:function(idx){
   		  var i=0;
	      for(i=0;i < f_9.MAXENGINENUM;i++){
		    if( i== idx)
				document.getElementById("I" + i).style.height="518px";
			else
				document.getElementById("I" + i).style.height="0px";

		  }

	},

   	q8Ebay:function(idx){
	     	var str= "I" + idx;
			var i=0;
			window[str].document.body.innerHTML = f_9.a6.a9ByName("eBay").getPage();
	      for(i=0;i < f_9.MAXENGINENUM;i++){
		    if( i== idx)
				document.getElementById("I" + i).style.height="518px";
			else
				document.getElementById("I" + i).style.height="0px";

		  }

	},

   	wakeUpRobot:function(message){
		document.write("<div id=robotTalk style=\"WIDTH: 99%; HEIGHT: 0px\">");
		document.write("<p style=\"MARGIN-LEFT: 100px; TEXT-INDENT: 100px; MARGIN-RIGHT: 100px\""); 
		document.write("align=justify></P></DIV>");
		document.getElementById("robotTalk").style.height="150px";
		document.getElementById("center_0").style.height="0px";
		document.getElementById("robotTalk").innerHTML=message;
	},
	
   	asleepRobot:function(){
		document.getElementById("robotTalk").style.height="0px";
		document.getElementById("center_0").style.height="150px";
	},
	

   	setInnerPage:function(url){
   	      url = url.replace("baseUrl",f_9.baseUrl).replace("cgi-bin/","");
		  document.getElementById('I0').src = url; 
	  
	 

	},



	s1:function(f_9){
	      var tab="";
	      var str="";
	      tab = "<ul>";
	      var i=0;
 		  var results=[];

	      if(f_9.a6 == null) return;
          for(i=0;i < f_9.a6.b5s();i++){

                  	 if(f_9.a6.h4(i)){
							switch(f_9.a6.displayMode(i)){
							
								case f_9.l_0 : 
			                  		tab = tab + "<li><a href=\"javascript:parent.render.q8('" + i + "');\" title=\"" + f_9.a6.d5(i) + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "</span></a></li>";
									break;

								case f_9.l_0_EBAY : 
			                  		tab = tab + "<li><a href=\"javascript:parent.render.q8Ebay('" + i + "');\" title=\"" + f_9.a6.d5(i) + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "</span></a></li>";
									break;
	
								case f_9.l_1 : 							
			                  		tab = tab + "<li><a href=\"javascript:parent.f_9.a6.f_3('" + i + "');\" title=\"" + f_9.a6.d5(i) + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "</span></a></li>";
									break;

								case f_9.l_2 : 							
			                  		tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPage('" + i + "');\" title=\"" + f_9.a6.d5(i) + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "</span></a></li>";
									break;

								case f_9.n_2 : 							
				                  		
				                  		var numRes = f_9.a6.n_1Sync(i);	
				                  		if(numRes > 0)
				                  			tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPage('" + i + "');\" title=\"" + f_9.a6.d5(i) + "(" + numRes + ")" + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "(" + numRes + ")" + "</span></a></li>";
										
									break;
								case f_9.n_3 : 							
				                  		
				                  		
				                  		var numRes = f_9.a6.getRes(i);
				                  		
				                  		if(numRes == -1)
					                  		f_9.a6.n_1Async(i);
				                  			
				                  		if(numRes > 0)
				                  			tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPage('" + i + "');\" title=\"" + f_9.a6.d5(i) + "(" + numRes + ")" + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "(" + numRes + ")" + "</span></a></li>";
										else
					                  		tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPage('" + i + "');\" title=\"" + f_9.a6.d5(i) + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "</span></a></li>";
																					
									break;

								case f_9.n_4 : 							
				                  		
				                  		
				                  		var numRes = f_9.a6.getRes(i);
				                  		
	                				    if(numRes == f_9.RESULT_MACHINE_IS_BANNED)
				                  			tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPageTimed('" + i + "');\" title=\"" + f_9.a6.d5(i) + "(" + numRes + ")" + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "(?)" + "</span></a></li>";
									                  		
				                  		if(numRes == f_9.o_2){
				                  			if(f_9.a6.a9(i).n_4 == null){
					                  			f_9.a6.n_5(i,setTimeout('parent.f_9.a6.n_1Async(' + i + ')',parent.f_9.TIMEOUT_ON_INACTIVITY));
						                  		tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPageTimed('" + i + "');\" title=\"" + f_9.a6.d5(i) + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "</span></a></li>";
											}	
										}	    			

				                  		else if(numRes == f_9.o_3)
						                  		tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPageTimed('" + i + "');\" title=\"" + f_9.a6.d5(i) + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "</span></a></li>";
				                  			
				                  		else if(numRes > 0 || (numRes == 0 && f_9.a6.a9(i).reqStatus == g_2.DELIVERED)){
				                  				
				                  			tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPageTimed('" + i + "');\" title=\"" + f_9.a6.d5(i) + "(" + numRes + ")" + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "(" + numRes + ")" + "</span></a></li>";
											  if(!g_2.dimmicosavuoiHasResults && f_9.a6.a9(i).getName() != "Dimmicosavuoi"){
											   var resAdv = new p_5Adv(numRes,f_9.a6.a9(i).getName(),f_9.appUrl + "/image/" + f_9.a6.a9(i).getName() + ".gif",f_9.a6.a9(i).h1());
											   results[results.length] = resAdv;
    										   results.sort(function(a,b){return parseInt(b.numRes) - parseInt(a.numRes)});
 								   			   var table = new p_9();
											   table.h_7TableAdv(results,"");
											   f_9.p_9 = table.code;
											   window.frames['I0'].location.href  =  "resX0.htm";
											   
											   
											   
										 }
										} 											
					                  	else if(numRes == 0 && f_9.a6.a9(i).reqStatus == g_2.ABORT)
				                  			tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPageTimed('" + i + "');\" title=\"" + f_9.a6.d5(i) + "(" + numRes + ")" + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "(?)" + "</span></a></li>";
									
									break;
								
								case f_9.n_4_EBAY : 							
				                  		
				                  		
				                  		var numRes = f_9.a6.getRes(i);
				                  		
				                  		if(numRes == f_9.o_3)
										  ;				                  			
				                  		else if(numRes >= 0)
				                  			tab = tab + "<li><a href=\"javascript:parent.f_9.a6.jumpToPageTimed('" + i + "');\" title=\"" + f_9.a6.d5(i) + "(" + numRes + ")" + "\"><font size=\"" + f_9.y1 +  "\"><span>" + f_9.a6.d5(i) + "(" + numRes + ")" + "</span></a></li>";
																					
									break;


							}
                  	 

                  	 }
          }
          tab =  tab  + "</ul>";

  		document.getElementById("tabs_0").innerHTML=tab;
  		var tab = document.getElementById("tabs_0");
		
		if(render.selector instanceof q_4){ 
			
  			var textBox = document.getElementById("input");
			if(textBox != null)
				textBox.focus();
		}
		  
	},
	
	m_3:function(pref){
	var str="";
	var txt="";
	var y6="";

	str = m_2.replaceAx(m_2.replace_(prcXml.context.ac()));

 	if(prcXml.head != "noHead"){
		str =  str + " " + prcXml.head;
	}

	if((g_2.status.indexOf("_continue_") >= 0 || g_2.status.indexOf("_replace_") >= 0 || g_2.status.length == 0) && (prcXml.lst.length != null && prcXml.lst.length > 0))
		this.isEndOfText=false;
	else
		this.isEndOfText=true;
		
	if(pref.length > 0)
		str = pref;
			
	txt =render.selector.setPrefaceText(str,this.isEndOfText);

	
	
	if(prcXml.context == "")
		prcXml.context   = prcXml.context + " ";
 
  
	if((g_2.status.indexOf("_continue_") >= 0 || g_2.status.indexOf("_replace_") >= 0 || g_2.status.length == 0) && prcXml.lst.length > 0)
		return render.selector.setChoiche(false);
	else
		return render.selector.setChoiche(true);		

  },
  
	m_4:function(){	 
          	return this.selector.finish();
          	
	},
	
	m_5:function(){
			var txt = this.selector.txt;

            document.getElementById("center_0").innerHTML=txt

			this.selector.display(this.isEndOfText,f_9.startSuggestionImmidiatly);
			
			/* only first time */
			f_9.startSuggestionImmidiatly = true;
			

		
	},
	
	m_6:function(){

	 this.selector.m_6();


	
	}

	


});

var	f_8 = Class.extend({
	y4:"",
	construct:function(){
	this.y4="";
	},

	q9:function(oEvent) {
    	
		var list=null;
		var m_7=0;

        if (!oEvent) { /* puo essere che con Explorer non ci sia l'oggett oEvent, al suo posto viene utilizzato l'oggetto event della classe window */
            oEvent = window.event;
        }
		if(oEvent == undefined)
			return; 	
       g_2.lastActivityTime = new Date();

		f_9.a6.r7ResultProcess();
		f_9.a6.r7InactivityTimers();
   
        m_7 = oEvent.keyCode;
		for(i=0;i < 1;i++){
			var str="";
            str = "categoria_" + i;

			list = document.getElementById(str);





       switch(oEvent.keyCode) {
        case 38: /* up arrow */
            break;
        case 40: /* down arrow */
            break;
		case 32: /* space */

			if(g_2.y5.length > 0){
			if(list.selectedIndex < 0)
				index=1;
			else
				index = list.selectedIndex;

    		break;
    		}

	    }


       if (m_7 == 8 || m_7 == 46) {
            if(m_8.y4.length > 0)
           		 m_8.y4 = m_8.y4.substring(0,m_8.y4.length - 1);
           	else
          		g_2.r6();

	    document.getElementById('suggest').innerHTML=m_8.y4;

        } else if (m_7 < 32 || (m_7 >= 33 && m_7 <= 46) || (m_7 >= 112 && m_7 <= 123)) {
            /* ignore */
        } else {
	        m_8.y4 = m_8.y4 + String.fromCharCode(m_7);
            if(!m_2.r3(m_8.y4,list)){
				finalUrl = h_0.requestData(g_2.p7,list.selectedIndex,list[list.selectedIndex].value,g_2.y5,g_2.p6,prcXml.returnPath,g_2.p8);
				g_2.i_6(finalUrl,list[list.selectedIndex].value,list.selectedIndex);
			}	    
        }

	 } /* end for */


       if (m_7 == 32) {

		finalUrl = h_0.requestData(g_2.p7,index,list[index].value,g_2.y5,g_2.p6,prcXml.returnPath,g_2.p8);

		g_2.i_6(finalUrl,list[index].value,index);

		}
    }

 




});









var	g_9 = Class.extend({
	m_1:"",
	o_6:null,	

	h_7QueryPath:function(mode){
	
		
			
		if(prcXml.isStatement){
			var ctx = m_2.replace_(prcXml.context).trim();
		    value =  ctx.substring(g_2.queryPath.length, ctx.length).trim();
			if(g_2.queryPath.length > 0)
				g_2.queryPath = g_2.queryPath + "/" + value;
			else
				g_2.queryPath =  value;

			if(g_2.aliasPath.length > 0) 
					g_2.aliasPath = g_2.aliasPath + "/" + g_2.l_5 + "_" +  prcXml.y9;
			else
					g_2.aliasPath =  g_2.l_5 + "_" +  prcXml.y9;
					 
				
			g_2.queryPathHis[g_2.l_5 - 1] = g_2.queryPath;
			
			if(g_2.o_9.length == 0)
				g_2.o_9 = f_9.basePath + f_9.appPath + g_2.queryPath;									
			else
				g_2.o_9 = g_2.o_9 + "/" + value;
		}
		else
			g_2.queryPathHis[g_2.l_5 - 1] = g_2.queryPathHis[g_2.l_5 - 2];

			
		if(mode)
		   return value;	
		else			
			return g_2.l_5 + "_" +  prcXml.y9;	

	},
		
	process:function(txt){
	
	this.m_1 = txt;
	

	

	/******************************************************************************* ALADINO *****************************************************************************************/
		if(prcXml.path.indexOf("Aladino") > 0) {

       		if(f_9.Robot == null){
					f_9.Robot = new q_2();
					f_9.a6 == null;					

        		}

				if(prcXml.robotSays != "noMessage"){
				 
				 if(f_9.userExperiences == null)
				     f_9.userExperiences = f_9.p_4.retrive("user_experience",g_2.z5("UNIQUE_ID"),new UserExperiences());
				 if(f_9.userExperiences == null)
				     f_9.userExperiences = new UserExperiences(g_2.z5("UNIQUE_ID")); 
				   var ctx = m_2.replace_(prcXml.context)
				   var str = m_2.replaceCode(unescape(ctx.substring(ctx.indexOf(">") + 2,ctx.length)));
				   str = m_2.replace_(str);
				    
				    var repeat="";
				    var toBeSaid = prcXml.robotSays;
				    
				    if(prcXml.robotSays.indexOf(".mp3") > 0 || prcXml.robotSays.indexOf(".wav") > 0 ){
						f_9.soundFile = prcXml.robotSays;
						toBeSaid = "";
						window.frames['I0'].location.href  =  "sound.htm";
						
				     
					}
					else{
					
						switch(f_9.userExperiences.countPronunced("ANSWER",str)){
							case 0:							
								break;
							case 1:
								if(f_9.userExperiences.lastTimeYouDidIt("ANSWER",str) < MINUTE)
									toBeSaid = "Come ho appena detto " + prcXml.robotSays.firstLowerCase();
								else if(f_9.userExperiences.lastTimeYouDidIt("ANSWER",str) < DAY)
									if(str.indexOf("?") > 0) 
										toBeSaid = "Mi hai gi&agrave fatto questa domanda, comunque " + prcXml.robotSays.firstLowerCase();
									else
										toBeSaid = "Come ho detto " + prcXml.robotSays.firstLowerCase();
										
								else  
									if(str.indexOf("?") > 0) 							
										toBeSaid = "Mi sembra che hai gi&agrave fatto questa domanda, comunque " + prcXml.robotSays.firstLowerCase();
									else
										toBeSaid = "Mi sembra di averlo gi&agrave detto, comunque " + prcXml.robotSays.firstLowerCase();
									
								break;
							case 2:
								if(f_9.userExperiences.lastTimeYouDidIt("ANSWER",str) < MINUTE)
									if(str.indexOf("?") > 0) 							
										toBeSaid = "Me l'hai gi&agrave chiesto due volte nel giro di qualche minuto, comunque " + prcXml.robotSays.firstLowerCase();
									else
										toBeSaid = "Te l'ho appena detto, comunque " + prcXml.robotSays.firstLowerCase();
										
								else if(f_9.userExperiences.lastTimeYouDidIt("ANSWER",str) > DAY)
									if(str.indexOf("?") > 0) 							
										toBeSaid = "Mi hai gi&agrave fatto pi&ugrave volte questa domanda, comunque " + prcXml.robotSays.firstLowerCase();							
									else  
										toBeSaid = "Ribadisco che " + prcXml.robotSays.firstLowerCase();
								break;
							case 3:
									toBeSaid = "Mi stai prendendo per il mulo?";
								break;
							default:
								toBeSaid = "";
							
						} 

					}				 

					contextBuffer = str;
					if(toBeSaid != ""){
   						f_9.Robot.says(toBeSaid,
								function(){
									f_9.r_1(true);
								});

						
						 f_9.userExperiences.add("ANSWER",str,f_9.p_6);
						}
				 }
				

				
				

				if(prcXml.scope == "back"){

				}
			   	else {
             		switch(prcXml.tag){

            			case "userName":
							var usr = f_9.p_4.retrive("unregistered_users",g_2.z5("UNIQUE_ID"),new UnregisteredUser());
							
							
							usr.name = prcXml.key.toCapitalCase();
							var sex="";
							if(prcXml.y9 > 647)
								f_9.user.sex = "Male";
							else
								f_9.user.sex = "Female";	
							
							
							f_9.p_4.save(usr);
							f_9.user = usr;							
							           			
							
							f_9.Robot.says(prcXml.key.toCapitalCase() + ", che bel nome; sei un maschio o una femmina?",
							
							function(){
								f_9.Robot.makeQuestion("maschioOFemmina","");
							});
            				
            			break;	
            			case "age":
								var year = new Date().getFullYear();
								var how = 2035 - year
								f_9.Robot.says("Ho -" + how + " anni, cos&igrave dice quel fuori di testa del mio boss" ,null);
            			break;	

            			
            			case "userSex":
							switch(prcXml.key){
								case "una femmina":
									f_9.Robot.says("WOW! vado pazzo per le femmine",null);
								break;	
            				}
            			break;	
    

          		}

      		}


		}

/******************************************************************************* END TRENI*****************************************************************************************/





/******************************************************************************* TRENI*****************************************************************************************/
		if(prcXml.path.indexOf("treni") > 0) {

       		if(f_9.a6 == null){
	       			f_9.a6 = new c1(3);
        			f_9.a6.a7(new trenitaliaSearchUrl("http://orario.trenitalia.com/b2c/nppPriceTravelSolutions.do?car=0&stazin=e7X&stazout=f1X&datag=depDayX&datam=depMonthX&dataa=depYearX&&timsh=depTimeX&stazin_r=&stazout_r=&timsm=24&timsm_r=24&lang=it&nreq=5&channel=tcom&lang_r=it&nreq_r=5&npag=1&npag_r=1&channel_r=tcom","Trenitalia"));
        			f_9.a6.a7(new meteoSearchUrl("http://www.ilmeteo.it/meteo/f1X?g=1","Meteo"));
					f_9.a6.a7(new roadSharingSearchUrl("http://www.roadsharing.com/it/search?v=2&cittapartenza=e7CityX,%20Italia&cittaarrivo=e9X,%20Italia&acpartenza=4&acarrivo=4&lngpartenza=e7X&latpartenza=returnFromX&lngarrivo=f1X&latarrivo=returnToX","roadSharing"));

					f_9.a6.a8();
        		}

			if(prcXml.scope == "back"){
				/* Back */
				f_9.a6.back();
			}
       	else {
             		switch(prcXml.tag){
            			case "Arrivare":
            					f_9.a6.c2(prcXml.key);

          				break;

      				case "partoilgiorno":
           				if(prcXml.key.indexOf("back") < 0){
            					f_9.a6.c3(prcXml.key);
            					f_9.a6.c8();
            				}
						return true;
   
                      case "giorno partenza":
                          f_9.a6.z8(prcXml.key);
                          break;

                      case "mese partenza":
      		      		if(g_2.status.indexOf("_continue_") >= 0)
                           f_9.a6.z9(prcXml.key);
                        else
                           f_9.a6.a_1(prcXml.key);

 						return true;
                        break;

                      case "domani mattina":
                      case "domani pomeriggio":
                      case "domani sera":

      		      		if(g_2.status.indexOf("_continue_") >= 0){
      	      				f_9.a6.c7();
      	      				switch(prcXml.tag){
                                case "domani mattina":
                                	f_9.a6.c9();
                                	break;
                                case "domani pomeriggio":
      							f_9.a6.d1();
                                	break;
                                case "domani sera":
      							f_9.a6.d2();
                                	break;
      						}


      	      			}
      					else
      						f_9.a6.c5(prcXml.key.substring(0,2));

							return true;

                          break;


                    case "stamattina":
                    case "oggi pomeriggio":
                    case "stasera":
      		      		if(g_2.status.indexOf("_continue_") >= 0){
      	      				f_9.a6.c8();
      	      				switch(prcXml.tag){
                                case "stamattina":
                                	f_9.a6.c9();
                                	break;
                                case "oggi pomeriggio":
      							f_9.a6.d1();
                                	break;
                                case "stasera":
      							f_9.a6.d2();
                                	break;
      						}
                          }
      					else
      						f_9.a6.c5(prcXml.key.substring(0,2));
							return true;
                        break;


          		}

      		}


		}

/******************************************************************************* END TRENI*****************************************************************************************/







/******************************************************************************* AUTO *****************************************************************************************/


		if(prcXml.path.indexOf("auto") > 0 ){

				
				if(f_9.a6 == null){
								
    							f_9.a6 = new d4(13);
			        			f_9.a6.a7(new DimmicosavuoiCarSearchUrl("__","Dimmicosavuoi"));
        						f_9.a6.a7(new l8("http://www.autoscout24.it/List.aspx?vis=1&cy=I&state=A&maxresults=500&results=20&ustate=N&ustate=U&um=True&sort=price&pool=1","AutoScout24"));
        						//f_9.a6.a7(new l7("http://auto.secondamano.it/auto/annunci","Secondamano"));
        						f_9.a6.a7(new f_2("http://www.subito.it/annunci-abruzzo-italia/vendita/auto/?th=1","Subito"));
        						f_9.a6.a7(new KijijiCarEngine("http://www.kijiji.it/auto-e-moto/auto/","Kijiji"));
        						f_9.a6.a7(new ebayUrlCarEngine("http://desc.shop.ebay.it/items/","eBay"));
        						f_9.a6.a7(new AutoSupermarketCarEngine("http://www.autosupermarket.it/Autosupermarket_Search-Stype.","autosupermarket"));
        						f_9.a6.a7(new tuttoRuoteCarEngine("http://www.tuttoruote.it/risu_auto.asp?Submit=Invia","TuttoRuote"));
        						f_9.a6.a7(new donkizCarEngine("http://auto.donkiz.it/search?","Donkiz"));
        						f_9.a6.a7(new trovitCarEngine("http://auto.trovit.it/index.php/cod.search_cars","Trovit"));        						
        						f_9.a6.a7(new cliccaMotoriCarEngine("http://www.cliccamotori.it/search.php?","Cliccamotori"));        						
        						
        						f_9.a6.a7(new car4youCarEngine("http://car4you.quattroruote.it/AppPortal/Page/Public/VehicleResult.aspx?&NewSearch=1","Car4you"));        						
        						f_9.a6.a7(new e_5("http://www.i0100.com/it/","i0100"));
         						f_9.a6.a7(new CiaoCarEngine("http://www.ciao.it/sr/","Ciao"));
        						f_9.appPath = "/app/dbfs/auto/";
        						
        						
								if(this.o_6 == null)
										this.o_6 = new o_7("auto/Cerco");

	       						f_9.a6.a8();
        		}

			if(prcXml.scope == "back"){
				/* Back */
				f_9.a6.back();
				return true;
			}
			else if(g_2.h_3 == "nextXml" && prcXml.y9 == 0){
					f_9.a6.skip();
			}

			else {
 /*********************************************   p_1  *******************************************************************************/

						if(prcXml.tag != "skip"){
						    value = this.h_7QueryPath(true);
						}	

					

					/* Costruzione query: wildcard */ 

             		switch(prcXml.tag){
 		                case "priceTo":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								g_2.o_9 = g_2.o_9.replace(engine.priceFrom,"*");
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
 		                case "m_axYear":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
 		                case "kilometri":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								var km = prcXml.key.substring(0,prcXml.key.indexOf("km") - 1);
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
            			case "o_ptionals":
								g_2.o_9 = g_2.o_9.replace(",","*");
								g_2.o_9 = g_2.o_9.replace("dotato di ","*");

						break;	
 
					}

 /*********************************************   Costruzione DBFS   *******************************************************************************/


             		switch(prcXml.tag){

						case "skip":
						case "priceFrom":
						   break;
							
						/* Primary key */	
        				case "motorMaker":
								this.o_6.addElement(prcXml.tag,true,false,value);
								f_9.o_5 = this.o_6.q_1();
						break;

						default:
							this.o_6.addElement(prcXml.tag,false,true,value);
							f_9.o_5 = this.o_6.q_1();
						break;
						

	        		}


				if(!f_9.test && !f_9.production)
						document.getElementById('z1').innerHTML = f_9.o_5;


 /*********************************************   Costruzione ANNUNCIO, Attivazione pulsante   *******************************************************************************/

             		switch(prcXml.tag){
 

            			case "motorMaker":
            			case "motorModel":
            				f_9.advTitle = m_2.replaceSlashWithSpace(g_2.queryPath).replace("Cerco","Vendo");   
            				break;
            			case "researchType":
            			    break;



            			case "idZona":
							g_2.advReady=true;
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							f_9.advPlace =  prcXml.key + " (" + engine.p_3[engine.mainCity] + ")";
							f_9.advTitle = f_9.advTitle + " " + engine.mainCity + " zona " + prcXml.key; 
							f_9.advTitle = f_9.advTitle.replaceDoubleSpace();
							
						 break;
 
 
						case "mainCity":
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							var title = m_2.replaceSlashWithSpace(g_2.queryPath);
							f_9.advPlace =  prcXml.key;
							title = f_9.advTitle + (m_2.isVoel(prcXml.key) ? " ad " : " a ")  + f_9.advPlace; 
							f_9.advTitle = title.replaceDoubleSpace();
							g_2.advReady=true;
						           			            			
								 
						break;	
 
					}



					f_9.advText = m_2.replaceSlashWithSpace(g_2.queryPath).replace("Cerco","Vendo").replace("Vorrei affittare","Affitto").cut("con prezzo","euro");

 /*********************************************   ENGINE    *******************************************************************************/


        			switch(prcXml.tag){
        				case "motorMaker":
        				case "motorModel":
        				case "motorType":
        				case "fuelType":
        				case "mainCity":
        				case "areaId":
        				case "m_axYear":
		        		case "kilometri":
        				case "e_xternalColor":
        				case "o_ptionals":
            			case "sellerType":
            			case "version":
        					f_9.a6.b9(prcXml.tag,prcXml.key);
							return true;
	        				break;

        				case "priceFrom":
                            var go = false;
        				    f_9.a6.b3(prcXml.key);
							this.m_1 = m_2.s5(txt,g_2.p9,prcXml.key);
	        				break;

        				case "priceTo":
		        				f_9.a6.b4(prcXml.key);
								return true;
		        				break;

								return true;
		        			 	break;

		                case "priceMax":
							f_9.a6.b3("0");
							f_9.a6.b4(prcXml.key);
							return true;
							break;
						case "skip":
						case "notag":
		                	f_9.a6.skip();
						break;



        				default:

                        	break;

  	     			}
			}


		}



/******************************************************************************* END AUTO*****************************************************************************************/

/******************************************************************************* MOTO *****************************************************************************************/


		if(prcXml.path.indexOf("moto") > 0 ){


				if(f_9.a6 == null){
    						f_9.a6 = new d4(5);
			        		f_9.a6.a7(new DimmicosavuoiMotoSearchUrl("__","Dimmicosavuoi"));
        					//f_9.a6.a7(new e_7("http://auto.secondamano.it/moto/annunci","Secondamano"));
        					f_9.a6.a7(new SubitoMotoEngine("http://www.subito.it/annunci-abruzzo-italia/vendita/moto-e-scooter/?th=1","Subito"));
        					f_9.a6.a7(new ebayUrlMotoEngine("http://desc.shop.ebay.it/items/","eBay"));
        					f_9.a6.a7(new KijijiMotoEngine("http://www.kijiji.it/auto-e-moto/moto/","Kijiji"));
        					f_9.a6.a7(new tuttoRuoteMotoEngine("http://www.tuttoruote.it/risu_moto.asp?Submit=Invia","TuttoRuote"));
        					
       						f_9.appPath = "/app/dbfs/moto/";
        						
        						
							if(this.o_6 == null)
										this.o_6 = new o_7("moto/Cerco");
        					f_9.a6.a8();
        		}

			if(prcXml.scope == "back"){
				/* Back */
				f_9.a6.back();
				return true;
			}
			else if(g_2.h_3 == "nextXml" && prcXml.y9 == 0){
					f_9.a6.skip();
			}

			else {
 
 /*********************************************   p_1  *******************************************************************************/

						if(prcXml.tag != "skip"){
						
						   value = this.h_7QueryPath(true);

						}	

					

					/* Costruzione query: wildcard  */

             		switch(prcXml.tag){
 		                case "priceTo":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								g_2.o_9 = g_2.o_9.replace(engine.priceFrom,"*");
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
 		                case "m_axYear":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
 		                case "kilometri":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								var km = prcXml.key.substring(0,prcXml.key.indexOf("km") - 1);
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
            			case "o_ptionals":
								g_2.o_9 = g_2.o_9.replace(",","*");
								g_2.o_9 = g_2.o_9.replace("dotato di ","*");

						break;	
 
					}
							if(!f_9.test && !f_9.production)
								document.getElementById('z1').innerHTML = g_2.o_9;

 /*********************************************   Costruzione DBFS   *******************************************************************************/


             		switch(prcXml.tag){

						case "skip":
						case "priceFrom":
						   break;
							
						/* Primary key */	
        				case "motorMaker":
								this.o_6.addElement(prcXml.tag,true,false,value);
								f_9.o_5 = this.o_6.q_1();
						break;

						default:
							this.o_6.addElement(prcXml.tag,false,true,value);
							f_9.o_5 = this.o_6.q_1();
						break;
						

	        		}




 /*********************************************   Costruzione ANNUNCIO, Attivazione pulsante   *******************************************************************************/

             		switch(prcXml.tag){
 

            			case "motorMaker":
            			case "motorModel":
            				f_9.advTitle = m_2.replaceSlashWithSpace(g_2.queryPath).replace("Cerco","Vendo");   
            				break;
            			case "researchType":
            			    break;



            			case "idZona":
							g_2.advReady=true;
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							f_9.advPlace =  prcXml.key + " (" + engine.p_3[engine.mainCity] + ")";
							f_9.advTitle = f_9.advTitle + " " + engine.mainCity + " zona " + prcXml.key; 
							f_9.advTitle = f_9.advTitle.replaceDoubleSpace();
							
						 break;
 
 
						case "mainCity":
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							var title = m_2.replaceSlashWithSpace(g_2.queryPath);
							f_9.advPlace =  prcXml.key;
							title = f_9.advTitle + (m_2.isVoel(prcXml.key) ? " ad " : " a ")  + f_9.advPlace; 
							f_9.advTitle = title.replaceDoubleSpace();
							g_2.advReady=true;
						           			            			
								 
						break;	
 
					}



					f_9.advText = m_2.replaceSlashWithSpace(g_2.queryPath).replace("Cerco","Vendo").replace("Vorrei affittare","Affitto").cut("con prezzo","euro");

 /*********************************************   ENGINE    *******************************************************************************/
 
        			switch(prcXml.tag){
        				case "motorMaker":
        				case "motorModel":
        				case "motorType":
        				case "mainCity":
        				case "areaId":
        				case "m_axYear":
		        		case "kilometri":
            			case "sellerType":
        					f_9.a6.b9(prcXml.tag,prcXml.key);
							return true;
	        				break;

        				case "priceFrom":
                            var go = false;
        				    f_9.a6.b3(prcXml.key);
							this.m_1 = m_2.s5(txt,g_2.p9,prcXml.key);
	        				break;

        				case "priceTo":
		        				f_9.a6.b4(prcXml.key);
								return true;
		        				break;

								return true;
		        			 	break;

		                case "priceMax":
							f_9.a6.b3("0");
							f_9.a6.b4(prcXml.key);
							return true;
							break;
						case "skip":
						case "notag":
		                	f_9.a6.skip();
						break;

						case "version":
	        				f_9.a6.b2(prcXml.key);
							return true;
        				break;

						break;

        				default:

                        	break;

  	     			}
			}


		}

/******************************************************************************* END MOTO *****************************************************************************************/

/******************************************************************************* CAMPER *****************************************************************************************/


		if(prcXml.path.indexOf("camper") > 0 ){


				if(f_9.a6 == null){
    						f_9.a6 = new d4(4);
			        		f_9.a6.a7(new DimmicosavuoiCamperSearchUrl("__","Dimmicosavuoi"));
        					//f_9.a6.a7(new SMCamperEngine("http://www.secondamano.it/iad/car/caravan/result?","Secondamano"));
        					f_9.a6.a7(new SubitoCamperEngine("http://www.subito.it/annunci-abruzzo-italia/vendita/caravan-e-camper/?th=1","Subito"));
        					f_9.a6.a7(new ebayUrlCamperEngine("http://auto-usate.shop.ebay.it/i.html?_sacat=105646&_dmpt=Camper_e_Roulotte&_odkw=&_osacat=105646&bkBtn=&_trksid=p3286.m270.l1313","eBay"));
        					f_9.a6.a7(new KijijiCamperEngine("http://www.kijiji.it/auto-e-moto/caravan-e-camper/","Kijiji"));
        					
       						f_9.appPath = "/app/dbfs/camper/";
        						
        						
							if(this.o_6 == null)
										this.o_6 = new o_7("camper/Cerco");
        					f_9.a6.a8();
        		}

			if(prcXml.scope == "back"){
				/*  Back */
				f_9.a6.back();
				return true;
			}
			else if(g_2.h_3 == "nextXml" && prcXml.y9 == 0){
					f_9.a6.skip();
			}

			else {
 
 /*********************************************   p_1  *******************************************************************************/

						if(prcXml.tag != "skip"){
						
						   value = this.h_7QueryPath(true);

						}	

					

					/* Costruzione query: wildcard */ 

             		switch(prcXml.tag){
 		                case "priceTo":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								g_2.o_9 = g_2.o_9.replace(engine.priceFrom,"*");
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
 		                case "m_axYear":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
 		                case "kilometri":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								var km = prcXml.key.substring(0,prcXml.key.indexOf("km") - 1);
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
            			case "o_ptionals":
								g_2.o_9 = g_2.o_9.replace(",","*");
								g_2.o_9 = g_2.o_9.replace("dotato di ","*");

						break;	
 
					}
							if(!f_9.test && !f_9.production)
								document.getElementById('z1').innerHTML = g_2.o_9;

 /*********************************************   Costruzione DBFS   *******************************************************************************/


             		switch(prcXml.tag){

						case "skip":
						case "priceFrom":
						   break;
							
						/* Primary key	 */
        				case "motorMaker":
								this.o_6.addElement(prcXml.tag,true,false,value);
								f_9.o_5 = this.o_6.q_1();
						break;

						default:
							this.o_6.addElement(prcXml.tag,false,true,value);
							f_9.o_5 = this.o_6.q_1();
						break;
						

	        		}




 /*********************************************   Costruzione ANNUNCIO, Attivazione pulsante   *******************************************************************************/

             		switch(prcXml.tag){
 

            			case "motorMaker":
            			case "motorModel":
            				f_9.advTitle = m_2.replaceSlashWithSpace(g_2.queryPath).replace("Cerco","Vendo");   
            				break;
            			case "researchType":
            			    break;



            			case "idZona":
							g_2.advReady=true;
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							f_9.advPlace =  prcXml.key + " (" + engine.p_3[engine.mainCity] + ")";
							f_9.advTitle = f_9.advTitle + " " + engine.mainCity + " zona " + prcXml.key; 
							f_9.advTitle = f_9.advTitle.replaceDoubleSpace();
							
						 break;
 
 
						case "mainCity":
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							var title = m_2.replaceSlashWithSpace(g_2.queryPath);
							f_9.advPlace =  prcXml.key;
							title = f_9.advTitle + (m_2.isVoel(prcXml.key) ? " ad " : " a ")  + f_9.advPlace; 
							f_9.advTitle = title.replaceDoubleSpace();
							g_2.advReady=true;
						           			            			
								 
						break;	
 
					}



					f_9.advText = m_2.replaceSlashWithSpace(g_2.queryPath).replace("Cerco","Vendo").replace("Vorrei affittare","Affitto").cut("con prezzo","euro");

 /*********************************************   ENGINE    *******************************************************************************/
 
        			switch(prcXml.tag){
        				case "motorMaker":
        				case "motorModel":
        				case "motorType":
        				case "mainCity":
        				case "areaId":
        				case "m_axYear":
		        		case "kilometri":
            			case "sellerType":
        					f_9.a6.b9(prcXml.tag,prcXml.key);
							return true;
	        				break;

        				case "priceFrom":
                            var go = false;
        				    f_9.a6.b3(prcXml.key);
							this.m_1 = m_2.s5(txt,g_2.p9,prcXml.key);
	        				break;

        				case "priceTo":
		        				f_9.a6.b4(prcXml.key);
								return true;
		        				break;

								return true;
		        			 	break;

						case "skip":
						case "notag":
		                	f_9.a6.skip();
						break;

						case "version":
	        				f_9.a6.b2(prcXml.key);
							return true;
        				break;

						break;

        				default:

                        	break;

  	     			}
			}


		}

/******************************************************************************* END CAMPER *****************************************************************************************/


/******************************************************************************* AFFINITA *****************************************************************************************/


		if(prcXml.path.indexOf("affinita") > 0 ){


				if(f_9.a6 == null){
        					
       						f_9.appPath = "/app/dbfs/affinita/";
        						
        						
        		}

			if(prcXml.scope == "back"){
				/* Back */
				f_9.a6.back();
				return true;
			}
			else if(g_2.h_3 == "nextXml" && prcXml.y9 == 0){
					f_9.a6.skip();
			}

			else {
 
/*********************************************   p_1  *******************************************************************************/

						if(prcXml.tag != "skip"){
						
						   value = this.h_7QueryPath(false);

						}	

					

/*********************************************   Costruzione DBFS   *******************************************************************************/


             		switch(prcXml.tag){

						case "skip":
						   break;
		
						case "start":
							if(this.o_6 == null)
										this.o_6 = new o_7("affinita/" + prcXml.context.substring(prcXml.context.indexOf(">") + 1,prcXml.context.length).trim());
							this.o_6.addElement(prcXml.tag,true,false,value);
							break;							
						default:
							this.o_6.addElement(prcXml.tag,false,true,value);
						break;
						

	        		}
							f_9.o_5 = this.o_6.q_1();


				if(!f_9.test && !f_9.production)
						document.getElementById('z1').innerHTML = f_9.o_5;
				}

		}

/******************************************************************************* END AFFINITA *****************************************************************************************/




/******************************************************************************* METEO *****************************************************************************************/


		if(prcXml.path.indexOf("meteo") > 0 ){


				if(f_9.a6 == null){
    						f_9.a6 = new b7(1);
        					f_9.a6.a7(new ilMeteoForecastsearchEngine("http://www.ilmeteo.it/meteo/","il Meteo"));
        					
        					f_9.a6.a8();
        		}

			if(prcXml.scope == "back"){
				/* Back */
				f_9.a6.back();
				return true;
			}
			else if(g_2.h_3 == "nextXml" && prcXml.y9 == 0){
					f_9.a6.skip();
			}

			else {
        			switch(prcXml.tag){
        				case "areaId":
        				case "day":
        					f_9.a6.b9(prcXml.tag,prcXml.key);
							return true;
	        				break;


						case "skip":
						case "notag":
		                	f_9.a6.skip();
						break;



        				default:
                        	break;

  	     			}
			}


		}

/******************************************************************************* END METEO *****************************************************************************************/





/******************************************************************************* AEREI*****************************************************************************************/

		if(prcXml.path.indexOf("aerei") > 0) {

       		if(f_9.a6 == null){
	       			f_9.a6 = new c1(3);
	       			f_9.a6.a7(new d8("http://viaggi.kelkoo.it/ctl/do/checkFlight?from=shopbot&catPath=it%2FflightTickets&catId=172201&type=flyTypeX&departure=e7X&departureTEXT=e7CityX&arrival=f1X&arrivalTEXT=e9X&departureDate=depDayX%2FdepMonthX%2FdepYearX&departureTimeOutbounds=depTimeX&returnDate=retDayX%2FretMonthX%2FretYearX&departureTimeReturn=retTimeX&ticketclass=economy&first=no&level=2&in campagna=&nbadults=nAdultsX&nbchilds=nChildsX&nbbabies=g5X&x=17&y=10","kelkoo"));
					f_9.a6.a7(new EasyvolsFlySearch("http://www.easyvols.org/clients-noh-it/mev/results.jsp?clientId=1&type=1&departAller=e7CityX&arriveeAller=f1X&arriveeAllerIata=e9X&jourAller=depDayX&moisAller=depMonthX%2FdepYearX&jourRetour=retDayX&moisRetour=retMonthX%2FretYearX&paxAdultes=1&paxEnfants=0&paxBebes=0&classe=1","Easyvol"));
	       			f_9.a6.a7(new ilMeteoSearchUrl("http://www.ilmeteo.it/portale/meteo-mondo?citta=f1X","ilMeteo"));

					f_9.a6.a8();
        		}

			if(prcXml.scope == "back"){
				/* Back */
				f_9.a6.back();
			}
       	else {
             		switch(prcXml.tag){
             			case "skip":
             			case "first":
             			case "notag":
             				break;
           			case "Arrivare":
            					f_9.a6.c2(prcXml.key);
          				break;

      				case "partoilgiorno":
         					f_9.a6.c3(prcXml.key);
           					f_9.a6.c8();
           					return true;
                            break;

                      case "giorno":
                          if(prcXml.path.indexOf("con ritorno") < 0)
                         		 f_9.a6.z8(prcXml.key);
                          else
                          		f_9.a6.b9("f9",prcXml.key);
                          break;

                      case "mese":
                          if(prcXml.path.indexOf("con ritorno") < 0)
                                 f_9.a6.z9(prcXml.key);
						 else
                                 f_9.a6.b9("f8",prcXml.key);

                        break;

					  case "anno":
                          if(prcXml.path.indexOf("con ritorno") < 0)
						   	   f_9.a6.a_1(prcXml.key);
						  else
  	                           f_9.a6.b9("f7",prcXml.key);

        					return true;
					   	  break;

					  case "ore":
                          if(prcXml.path.indexOf("con ritorno") < 0)
 		   						f_9.a6.c5(prcXml.key.substring(0,2));
 		   				  else
 		   				  		f_9.a6.b9("returnsHour",prcXml.key.substring(0,2));
           					return true;
 						  break;

                      case "domani mattina":
                      case "domani pomeriggio":
                      case "domani sera":
                          if(prcXml.path.indexOf("con ritorno") < 0){
        	      				f_9.a6.c7();
        	      				switch(prcXml.tag){
                                  case "domani mattina":
                                  	f_9.a6.c9();
                                  	break;
                                  case "domani pomeriggio":
        							f_9.a6.d1();
                                  	break;
                                  case "domani sera":
        							f_9.a6.d2();
                                  	break;
        						}
						  }
						  else{
        	      				f_9.a6.b9("returnTomorrow","");
        	      				switch(prcXml.tag){
                                  case "domani mattina":
                                  	f_9.a6.b9("returnOnMorning","");
                                  	break;
                                  case "domani pomeriggio":
        							f_9.a6.b9("returnOnAfternoon","");
                                  	break;
                                  case "domani sera":
        							f_9.a6.b9("returnOnEvening","");
                                  	break;
        						}
						 }



           					return true;

                          break;


                    case "stamattina":
                    case "oggi pomeriggio":
                    case "stasera":
      		      		if(g_2.status.indexOf("_continue_") >= 0){
      	      				f_9.a6.c8();
      	      				switch(prcXml.tag){
                                case "stamattina":
                                	f_9.a6.c9();
                                	break;
                                case "oggi pomeriggio":
      							f_9.a6.d1();
                                	break;
                                case "stasera":
      							f_9.a6.d2();
                                	break;
      						}
                          }
      					else
      						f_9.a6.c5(prcXml.key.substring(0,2));

           					return true;
                        break;

					default:
						f_9.a6.b9(prcXml.tag,prcXml.key);
           				return true;
						break;

          		}

      		}

      		}
		/******************************************************************************* END AEREI*****************************************************************************************/
	/******************************************************************************* CASE *****************************************************************************************/

		if(prcXml.path.indexOf("case") > 0) {

       		if(f_9.a6 == null){
	       			f_9.a6 = new b7(13);
        			f_9.a6.a7(new DimmicosavuoiHomeSearchUrl("__","Dimmicosavuoi"));
        			//f_9.a6.a7(new p3("http://case.secondamano.it","Secondamano"));
        			f_9.a6.a7(new o7("http://www.subito.it/li?ca=13_s&th=1&w=3","Subito"));
        			f_9.a6.a7(new KijijiHomeSearchUrl("http://www.kijiji.it/case/","Kijiji"));
        			f_9.a6.a7(new eBayHomeSearchUrl("http://desc.shop.ebay.it/items/_Immobili__W0QQLHQ5fTitleDescZ1","eBay"));        			
        			f_9.a6.a7(new ImmobiliareHomeSearchUrl("http://www.immobiliare.it","Immobiliare"));
        			f_9.a6.a7(new CasaHomeSearchUrl("http://www.casa.it/risultato.aspx?PageSize=10&From=AdvancedSearch","CasaIT"));
        			f_9.a6.a7(new CercaCasaHomeSearchUrl("http://www.cercacasa.it/lista.php?codiceag=&categoria=&s=s&submit=cerca","Cercacasa"));        			
        			f_9.a6.a7(new CasaclickHomeSearchUrl("http://www.casaclick.it/","Casaclick"));        			
        			f_9.a6.a7(new TroviItHomeSearchUrl("http://case.trovit.it/index.php/cod.search_homes","Trovit"));
        			f_9.a6.a7(new VivastreetSearchUrl("http://search.vivastreet.virgilio.it/immobiliare-in-researchTypeXareaIdX?lb=new&search=1&start_field=1","Vivastreet"));        			
        			f_9.a6.a7(new BakecaHomeSearchUrl("","Bakeca"));
        			f_9.a6.a7(new _123casaHomeSearchUrl("http://www.123case.it/search?","123Case"));
        			f_9.a6.a7(new BakecaAnnunciHomeSearchUrl("http://www.bachecaannunci.it","Bachecaannunci"));      
        			  			
        			f_9.appPath = "/app/dbfs/case/";
        			
        			
					f_9.a6.a8();
					if(this.o_6 == null)
							this.o_6 = new o_7("case/Vorrei");


        		}

			if(prcXml.scope == "back"){
	
						
						f_9.a6.back();

			}
			else if(g_2.h_3 == "nextXml" && prcXml.y9 == 0){
   					g_2.queryPathHis[g_2.l_5] = g_2.queryPathHis[g_2.l_5 - 1];
					f_9.a6.skip();
       			}
       		else {
     				var value="";
 

					if(g_2.o_8)
						if(prcXml.tag != "skip"){
						
							if(prcXml.isStatement){
									g_2.queryPath = g_2.queryPath.substring(0,g_2.queryPath.lastIndexOf("/"));
   									g_2.o_9 = f_9.basePath + f_9.appPath + g_2.queryPath;
									if(this.o_6 != null)
										this.o_6.q_0(prcXml.tag,false);
									g_2.o_8 = false;
							}
							else
								g_2.o_8 = true;
						}	


						

/*********************************************   p_1 *******************************************************************************/

						if(prcXml.tag != "skip"){
						    value = this.h_7QueryPath(true);
						
						}	

					

					/* Costruzione query: wildcard */

             		switch(prcXml.tag){
 		                case "priceTo":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								g_2.o_9 = g_2.o_9.replace(engine.priceFrom,"*");
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
 		                case "homeSizeMax":
								var engine = f_9.a6.a9ByName("Dimmicosavuoi");
								g_2.o_9 = g_2.o_9.replace(engine.homeSizeMin,"*");
								g_2.o_9 = g_2.o_9.replace(prcXml.key,"*");
						break;	
            			case "options":
								g_2.o_9 = g_2.o_9.replace(",","*");
								g_2.o_9 = g_2.o_9.replace("dotato di ","*");

						break;	
 
					}
		
					if(!f_9.test && !f_9.production)
										document.getElementById('z1').innerHTML = g_2.o_9;

/*********************************************   Costruzione DBFS   *******************************************************************************/


             		switch(prcXml.tag){

						case "skip":
						case "priceFrom":
						case "homeSizeMin":
						   break;
							
						/* Primary key */	
            			case "homeType":
            			case "researchType":
            			case "mainCity":
            			case "holidayPlace":
            			case "bigCity":
            			case "bigCityNoZone":
            			case "homeCondition":
            			case "areaId":
						   if(g_2.o_9.indexOf("casa vacanze") >= 0 && prcXml.tag == "areaId"){
								this.o_6.addElement(prcXml.tag,false,true,value);
								f_9.o_5 = this.o_6.q_1();
						   } 
						   else{
								this.o_6.addElement(prcXml.tag,true,false,value);
								f_9.o_5 = this.o_6.q_1();
						   }		
						break;

						default:
							this.o_6.addElement(prcXml.tag,false,true,value);
							f_9.o_5 = this.o_6.q_1();
						break;
						

	        		}
	        		



/*********************************************   Costruzione ANNUNCIO, Attivazione pulsante   *******************************************************************************/

             		switch(prcXml.tag){
 

            			case "homeType":
            				f_9.advTitle = m_2.replaceSlashWithSpace(g_2.queryPath).replace("Vorrei acquistare","Vendo").replace("Vorrei affittare","Affitto").replace("una","").replace("un","");   
            				break;
            			case "researchType":
            			    break;

            			case "holidaySite":
							g_2.advReady=true;
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							f_9.advPlace =   engine.areaId + " " + prcXml.key;
							f_9.advTitle =  f_9.advTitle + " " + engine.areaId + " zona " + prcXml.key; 
							f_9.advTitle =  f_9.advTitle.replaceDoubleSpace();
							
						 break;


            			case "idZona":
							g_2.advReady=true;
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							f_9.advPlace =  prcXml.key + " (" + engine.p_3[engine.mainCity] + ")";
							f_9.advTitle = f_9.advTitle + " " + engine.mainCity + " zona " + prcXml.key; 
							f_9.advTitle = f_9.advTitle.replaceDoubleSpace();
							
						 break;
 
           				case "city":
							g_2.advReady=true;
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							var title = m_2.replaceSlashWithSpace(g_2.queryPath);
							f_9.advPlace =  prcXml.key + " (" + engine.p_3[engine.mainCity] + ")";
							title = f_9.advTitle + (m_2.isVoel(prcXml.key) ? " ad " : " a ")  + f_9.advPlace; 
							   
							f_9.advTitle = title.replaceDoubleSpace();
							
						 break;
 
						case "bigCityNoZone":
							var engine = f_9.a6.a9ByName("Dimmicosavuoi");
							var title = m_2.replaceSlashWithSpace(g_2.queryPath);
							f_9.advPlace =  prcXml.key;
							title = f_9.advTitle + (m_2.isVoel(prcXml.key) ? " ad " : " a ")  + f_9.advPlace; 
							f_9.advTitle = title.replaceDoubleSpace();
							g_2.advReady=true;
						           			            			
            			case "homeStructure":
            			case "options":
            			case "sellerType":
            			case "plotType":
            			case "holidayPlace":
 		                case "priceTo":
 						case "homeSizeMax":
								 
						break;	
 
					}



					f_9.advText = m_2.replaceSlashWithSpace(g_2.queryPath).replace("Vorrei acquistare","Vendo").replace("Vorrei affittare","Affitto").cut("con prezzo","euro");
				
				
/*********************************************   ENGINE    *******************************************************************************/
				
					 	
             		switch(prcXml.tag){
            			case "homeType":
            			case "researchType":
            			case "mainCity":
            			case "areaId":
            			case "homeStructure":
            			case "options":
            			case "sellerType":
            			case "plotType":
            			case "commercialType":
            			case "holidayPlace":
            			case "bigCity":
            			case "idZona":
           						f_9.a6.b9(prcXml.tag,prcXml.key.replace("vendere","acquistare"));
								return true;
		                        break;
            			case "city":
   							    f_9.a6.b9(prcXml.tag,prcXml.y9);
   							    f_9.a6.b9("cityName",prcXml.key);
								return true;
		                        break;
		                case "priceFrom":
							f_9.a6.b3(prcXml.key);
							this.m_1 = m_2.s5(txt,g_2.p9,prcXml.key);
							break;
		                case "priceTo":
							f_9.a6.b4(prcXml.key);
							return true;
							break;
		                case "priceMax":
							f_9.a6.b3("0");
							f_9.a6.b4(prcXml.key);
							return true;
							break;
						case "homeSizeMin":
           						f_9.a6.b9(prcXml.tag,prcXml.key);
								this.m_1 = m_2.s5(txt,g_2.p9,prcXml.key);
								break;
						case "homeSizeMax":
           						f_9.a6.b9(prcXml.tag,prcXml.key);
								return true;
								break;
						case "homeSizeAround":
           						f_9.a6.b9("homeSizeMin",prcXml.key);
           						f_9.a6.b9("homeSizeMax",parseInt(prcXml.key) + 10);
								return true;
								break;

		                case "skip":
		                	f_9.a6.skip();
		                	break;
						case "notag":
							break;
	       				default:
        					if(f_9.a6 != null){

            					if(prcXml.key.indexOf("skip") < 0 && prcXml.key.indexOf("first") < 0){
            						if(prcXml.status.indexOf("_replace_") >= 0)
										f_9.a6.back();


            						f_9.a6.b2(prcXml.key);
									return true;
    	                            }
    	                        	break;

    							}
              			 }
      			}

      	}
		/******************************************************************************* END CASE *****************************************************************************************/
	
/******************************************************************************* VARIE *****************************************************************************************/


		if(prcXml.path.indexOf("varie") > 0 ){


				if(f_9.a6 == null){
    						f_9.a6 = new b7(2);
        					f_9.a6.a7(new pagineGialleSearchUrl("http://www.paginegialle.it/pgol","Paginegialle"));
        					f_9.a6.a7(new googleSearchUrl("http://maps.google.it/maps?hl=it&source=hp&ie=UTF8","Google"));
        					
        					f_9.a6.a8();
        		}

			if(prcXml.scope == "back"){
				/* Back */
				f_9.a6.back();
				return true;
			}
			else if(g_2.h_3 == "nextXml" && prcXml.y9 == 0){
					f_9.a6.skip();
			}

			else {
        			switch(prcXml.tag){
        				case "shopType":
        				case "subShopType":
        				case "bigCity":
        				case "address":
         					f_9.a6.b9(prcXml.tag,prcXml.key);
							return true;
	        				break;


						case "skip":
						case "notag":
		                	f_9.a6.skip();
						break;



        				default:
                        	break;

  	     			}
			}


		}

/******************************************************************************* END VARIE *****************************************************************************************/


	
	
	return false;
}




});


var	h_1 = Class.extend({


  xmlHttpHandler:null,

   	  
  requestData:function(url,index,value,nextAction,path,returnPath,context){
		var finalUrl="";
		if(!(nextAction ==  "nextXml" && index == 0))
				if(prcXml.head != "noHead")
					context =  context + " " + prcXml.head;

 		finalUrl = url + "?action=" + nextAction  + "&index=" + index + "&value=" + value + "&dir=" + path + "&context=" + context +"&returnPath=" + returnPath;
		m_8.y4 = "";


		this.loadXMLDoc(finalUrl,null);
		return finalUrl;


  
  },
  createUrl:function(url,index,value,nextAction,path,returnPath,context){
		var finalUrl="";
		if(!(nextAction ==  "nextXml" && index == 0))
				if(prcXml.head != "noHead")
					context =  context + " " + prcXml.head;

 		finalUrl = url + "?action=" + nextAction  + "&index=" + index + "&value=" + value + "&dir=" + path + "&context=" + context +"&returnPath=" + returnPath;
		return finalUrl;


  
  },

  
  setCallback:function(callback){

	 this.xmlHttpHandler = new XmlHttp(callback);
	
  },
  
  
  
  getPage:function(url){
		var finalUrl= f_9.baseUrl + "/search.php?action=getPage&url=" + escape(url);
		var req =null;
		var res=null;
		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }

		if(req == null) return null;
		res = req.open("GET",finalUrl, false);    
		req.send(null);   
		if(req.status == 200)   
			return req.responseText;
		else 
			return null;
				  
	
  },


  getPageAsync:function(url,i){
		var finalUrl="";
		
		var req =null;
		var res=null;
		var p=0;
		if(f_9.a6.a9(i).name == "Subito")
			p++;
		
		if(f_9.a6.a9(i).name == "Dimmicosavuoi")
			finalUrl =  url;
		else if(f_9.a6.a9(i).name == "Vivastreet")
			finalUrl = f_9.baseUrl + "/search.php?action=getPage&url=" + url;
		else
			finalUrl = f_9.baseUrl + "/search.php?action=getPage&url=" + escape(url);
		

		if(f_9.a6.a9(i).name == "TuttoRuote")
			finalUrl = finalUrl.replace("%25252B","%252B");
		if(f_9.a6.a9(i).requestHttpRes != null) return;

		if (window.XMLHttpRequest)
		   {/* code for IE7, Firefox, Mozilla, etc. */
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {/* code for IE5, IE6 */
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		f_9.a6.r7InactivityTimer(i);
		f_9.a6.setTimeoutOnResponse(i,req);		
		f_9.a6.a9(i).setRes(f_9.o_3);
		req.onreadystatechange = function() {
			if(req.readyState != 4) 
				return;			
			if (req.readyState == 4) {
				if(req.status!=200)
				  {
					  return;
				 }
				g_2.resultsAreComing = true;  
				f_9.a6.a9(i).requestHttpRes = null;
				if(f_9.a6.a9(i).onWaitResultTimer != null){
					clearTimeout(f_9.a6.a9(i).onWaitResultTimer);
					f_9.a6.a9(i).onWaitResultTimer = null;
				}	
				var txt = req.responseText;
				if(txt != null){
					f_9.a6.setNumRes(i,txt); 
					if(f_9.a6.a9(i).getRes() > 0)
						setTimeout('parent.g_2.haveValidRes = true;',15000);
					render.s1(f_9);
					if(render.selector.aladinAutocomp != null){
						render.selector.aladinAutocomp.hide();						
					}		
				
				}			
			}
		}
		f_9.a6.a9(i).reqStatus=g_2.DELIVERED;   
		res = req.open("GET",finalUrl, true);
		req.send(null);   
		return 0;				  
	
  },
  
  h1Async:function(url,callback,obj){
		var finalUrl= url;
		var req =null;
		var res=null;


		if (window.XMLHttpRequest)
		   {/* code for IE7, Firefox, Mozilla, etc. */
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {/* code for IE5, IE6 */
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		req.onreadystatechange = function() {
			if(req.readyState != 4) 
				return;			
			if (req.readyState == 4) {
				if(req.status!=200)
				  {
					  return;
				 }
			
				var txt = req.responseText;
				
				if(txt != null){
					callback(obj,txt);
				}			
			}
		}

		res = req.open("GET",finalUrl, true);
		req.send(null);   
		return 0;				  
	
  },

  	
  refreshResults:function(){
		
  },

  
  loadXMLDoc:function(url,callback){
   
    if(url == undefined) return;
    
	 if(callback != null)	
		this.xmlHttpHandler = new XmlHttp(callback);

	 var b_8=navigator.appName;
		

		url = url.replace("baseUrl",f_9.baseUrl).replace("basePath",f_9.basePath);

   if (window.XMLHttpRequest)
      {/* code for IE7, Firefox, Mozilla, etc. */
      this.xmlHttpHandler.xmlhttp=new XMLHttpRequest();
      }
    else if (window.ActiveXObject)
      {/* code for IE5, IE6 */
      this.xmlHttpHandler.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }


	if (this.xmlHttpHandler.xmlhttp!=null)
      {
      this.xmlHttpHandler.xmlhttp.onreadystatechange=this.xmlHttpHandler.i_8;
      this.xmlHttpHandler.xmlhttp.open("GET",url,true);
      this.xmlHttpHandler.xmlhttp.send(null);
      }
    else
      {
      alert("Your browser does not support XMLHTTP.");
      }

    }
   

});



var m_8 = new f_8();
var f_9 = new Page();
var g_2 = new f_5();
var prcXml = new processXml();
var render = new g_7();
render.autoSelect = true;

var g_8 = new g_9();
var h_0 = new h_1();

	var	i9 = Class.extend({
		history:new Array(f_9.MAXENGINENUM),
        a4:new Array(f_9.MAXENGINENUM),
        a2:0,
		b6:new Array(f_9.MAXENGINENUM),
		h4Shot:new Array(f_9.MAXENGINENUM),
		a3:0,
		l_5:0,
		priceTo:"",
		priceFrom:"",
    	name:"",
    	baseUrl:"",
    	a1:"",
		idx:0,
    	h4s:true,
    	g9:[],
		h2:[],
		v5:[],
		h3:[],
		p2ISTAT:[],
		h5:[],
		p_3:[],
		p_2:[],
		o9:[],
   		mainCity:"",
   		city:"",
		p2:[],
		bigTown:[],
   		sellerType:"",
   		n3:[],
   		keywordsClear:false,
		a_4:-1,
		numRes:-1,
		n_4:null,
		requestHttpRes:null,
		onWaitResultTimer:null,
		p_3:[],
		reqStatus:g_2.DELIVERED,
		keywordsSeparator:[],
		price:[],


		construct: function(baseUrl,name){
			this.$.init.call(baseUrl,name);
		},

		init: function(baseUrl,name){
	    	  this.name = name;
    		  this.a1 = name;
    		  this.baseUrl = baseUrl;
    		  this.keywordsSeparator[this.a1] = " ";
			  this.price[this.a1]= new Array(50);
    		  this.a4[this.a1] = new Array(100);
			  this.g9[this.a1] = new Array(20);
			  this.g9[this.a1]["skip"] 				 	= this.skip;
			  this.g9[this.a1]["notag"] 				 	= this.doNothing;
			  this.g9[this.a1]["mainCity"] 				 = this.h9;
			  this.g9[this.a1]["city"] 					 = this.i4;
			  this.g9[this.a1]["cityName"]					 = this.i3;
			  this.g9[this.a1]["areaId"]					 = this.i1;
			  this.g9[this.a1]["sellerType"]					 = this.n9;
			  this.history[this.a1] 		=     new Array(100);
			  this.b6[this.a1] 		=     new Array(100);
			  this.o9[this.a1] = new Array(20);
			  this.bigTown[this.a1] = new Array(20);	
     	  	  this.n3[this.a1] = new Array(2);
			  this.h2[this.a1] = new Array(107);
			  this.h2[this.a1]["Agrigento"]  = "Sicilia";
			  this.h2[this.a1]["Alessandria"]  = "Piemonte";
			  this.h2[this.a1]["Ancona"]  = "Marche";
			  this.h2[this.a1]["Aosta"]  = "Valle-dAosta";
			  this.h2[this.a1]["Arezzo"]  = "Toscana";
			  this.h2[this.a1]["Ascoli Piceno"]  = "Marche";
			  this.h2[this.a1]["Asti"]  = "Piemonte";
			  this.h2[this.a1]["Avellino"]  = "Campania";
			  this.h2[this.a1]["Bari"]  = "Puglia";
			  this.h2[this.a1]["Belluno"]  = "Veneto";
			  this.h2[this.a1]["Benevento"]  = "Campania";
			  this.h2[this.a1]["Bergamo"]  = "Lombardia";
			  this.h2[this.a1]["Biella"]  = "Piemonte";
			  this.h2[this.a1]["Bologna"]  = "Emilia-Romagna";
			  this.h2[this.a1]["Bolzano"]  = "Trentino-Alto-Adige";
			  this.h2[this.a1]["Brescia"]  = "Lombardia";
			  this.h2[this.a1]["Brindisi"]  = "Puglia";
			  this.h2[this.a1]["Cagliari"]  = "Sardegna";
			  this.h2[this.a1]["Caltanissetta"]  = "Sicilia";
			  this.h2[this.a1]["Campobasso"]  = "Molise";
			  this.h2[this.a1]["Carbonia-Iglesias"] = "Sardegna";
			  this.h2[this.a1]["Caserta"]  = "Campania";
			  this.h2[this.a1]["Catania"]  = "Sicilia";
			  this.h2[this.a1]["Catanzaro"]  = "Calabria";
			  this.h2[this.a1]["Chieti"]  = "Abruzzo";
			  this.h2[this.a1]["Como"]  = "Lombardia";
			  this.h2[this.a1]["Cosenza"]  = "Calabria";
			  this.h2[this.a1]["Cremona"]  = "Lombardia";
			  this.h2[this.a1]["Crotone"]  = "Calabria";
			  this.h2[this.a1]["Cuneo"]  = "Piemonte";
			  this.h2[this.a1]["Enna"]  = "Sicilia";
			  this.h2[this.a1]["Ferrara"]  = "Emilia-Romagna";
			  this.h2[this.a1]["Fermo"]  = "Marche";
			  this.h2[this.a1]["Firenze"]  = "Toscana";
			  this.h2[this.a1]["Foggia"]  = "Puglia";
			  this.h2[this.a1]["Forli-Cesena"]  = "Emilia-Romagna";
			  this.h2[this.a1]["Frosinone"]  = "Lazio";
			  this.h2[this.a1]["Genova"]  = "Liguria";
			  this.h2[this.a1]["Gorizia"]  = "Friuli-Venezia-Giulia";
			  this.h2[this.a1]["Grosseto"]  = "Toscana";
			  this.h2[this.a1]["Imperia"]  = "Liguria";
			  this.h2[this.a1]["Isernia"]  = "Molise";
			  this.h2[this.a1]["La Spezia"]  = "Liguria";
			  this.h2[this.a1]["L`Aquila"]  = "Abruzzo";
			  this.h2[this.a1]["Latina"]  = "Lazio";
			  this.h2[this.a1]["Lecce"]  = "Puglia";
			  this.h2[this.a1]["Lecco"]  = "Lombardia";
			  this.h2[this.a1]["Livorno"]  = "Toscana";
			  this.h2[this.a1]["Lodi"]  = "Lombardia";
			  this.h2[this.a1]["Lucca"]  = "Toscana";
			  this.h2[this.a1]["Macerata"]  = "Marche";
			  this.h2[this.a1]["Mantova"]  = "Lombardia";
			  this.h2[this.a1]["Massa-Carrara"]  = "Toscana";
			  this.h2[this.a1]["Matera"]  = "Basilicata";
			  this.h2[this.a1]["Medio Campidano"]  = "Lazio";
			  this.h2[this.a1]["Messina"]  = "Sicilia";
			  this.h2[this.a1]["Milano"]  = "Lombardia";
			  this.h2[this.a1]["Modena"]  = "Emilia-Romagna";
			  this.h2[this.a1]["Napoli"]  = "Campania";
			  this.h2[this.a1]["Novara"]  = "Piemonte";
			  this.h2[this.a1]["Nuoro"]  = "Sardegna";
			  this.h2[this.a1]["Ogliastra"]  = "Sardegna";
			  this.h2[this.a1]["Olbia-Tempio"]  = "Sardegna";
			  this.h2[this.a1]["Oristano"]  = "Sardegna";
			  this.h2[this.a1]["Padova"]   =  "Veneto";
			  this.h2[this.a1]["Palermo"]  = "Sicilia";
			  this.h2[this.a1]["Parma"]  = "Emilia-Romagna";
			  this.h2[this.a1]["Pavia"]  = "Lombardia";
			  this.h2[this.a1]["Perugia"]  = "Umbria";
			  this.h2[this.a1]["Pesaro e Urbino"]  = "Marche";
			  this.h2[this.a1]["Pescara"]  = "Abruzzo";
			  this.h2[this.a1]["Piacenza"]  = "Emilia-Romagna";
			  this.h2[this.a1]["Pisa"]  = "Toscana";
			  this.h2[this.a1]["Pistoia"]  = "Toscana";
			  this.h2[this.a1]["Pordenone"]  = "Friuli-Venezia-Giulia";
			  this.h2[this.a1]["Potenza"]  = "Basilicata";
			  this.h2[this.a1]["Prato"]  = "Toscana";
			  this.h2[this.a1]["Ragusa"]  = "Sicilia";
			  this.h2[this.a1]["Ravenna"]  = "Emilia-Romagna";
			  this.h2[this.a1]["Reggio Calabria"]  = "Calabria";
			  this.h2[this.a1]["Reggio Emilia"]  = "Emilia-Romagna";
			  this.h2[this.a1]["Rieti"]  = "Lazio";
			  this.h2[this.a1]["Rimini"]  = "Emilia-Romagna";
			  this.h2[this.a1]["Roma"]  = "Lazio";
			  this.h2[this.a1]["Rovigo"]  = "Veneto";
			  this.h2[this.a1]["Salerno"]  = "Campania";
			  this.h2[this.a1]["Sassari"]  = "Sardegna";
			  this.h2[this.a1]["Savona"]  = "Liguria";
			  this.h2[this.a1]["Siena"]  = "Toscana";
			  this.h2[this.a1]["Siracusa"]  = "Sicilia";
			  this.h2[this.a1]["Sondrio"]  = "Lombardia";
			  this.h2[this.a1]["Taranto"]  = "Puglia";
			  this.h2[this.a1]["Teramo"]  = "Abruzzo";
			  this.h2[this.a1]["Terni"]  = "Umbria";
			  this.h2[this.a1]["Torino"]  = "Piemonte";
			  this.h2[this.a1]["Trapani"]  = "Sicilia";
			  this.h2[this.a1]["Trento"]  = "Trentino-Alto-Adige";
			  this.h2[this.a1]["Treviso"]  = "Veneto";
			  this.h2[this.a1]["Trieste"]  = "Friuli-Venezia-Giulia";
			  this.h2[this.a1]["Udine"]  = "Friuli-Venezia-Giulia";
			  this.h2[this.a1]["Varese"]  = "Lombardia";
			  this.h2[this.a1]["Venezia"]  = "Veneto";
			  this.h2[this.a1]["Verbano-Cusio-Ossola"] = "Piemonte";
			  this.h2[this.a1]["Vercelli"]  = "Piemonte";
			  this.h2[this.a1]["Verona"]  = "Veneto";
			  this.h2[this.a1]["Vibo Valentia"]  = "Calabria";
			  this.h2[this.a1]["Vicenza"]  = "Veneto";
			  this.h2[this.a1]["Viterbo"]  = "Lazio";
			  var i=0;
			  this.p_2[i++]="Agrigento";  
			  this.p_2[i++]="Alessandria";  
			  this.p_2[i++]="Ancona";  
			  this.p_2[i++]="Aosta";  
			  this.p_2[i++]="Arezzo";  
			  this.p_2[i++]="Ascoli Piceno";  
			  this.p_2[i++]="Asti";  
			  this.p_2[i++]="Avellino";  
			  this.p_2[i++]="Bari";  
			  this.p_2[i++]="Belluno";  
			  this.p_2[i++]="Benevento";  
			  this.p_2[i++]="Bergamo";  
			  this.p_2[i++]="Biella";  
			  this.p_2[i++]="Bologna";  
			  this.p_2[i++]="Bolzano";  
			  this.p_2[i++]="Brescia";  
			  this.p_2[i++]="Brindisi";  
			  this.p_2[i++]="Cagliari";  
			  this.p_2[i++]="Caltanissetta";  
			  this.p_2[i++]="Campobasso";  
			  this.p_2[i++]="Carbonia-Iglesias"; 
			  this.p_2[i++]="Caserta";  
			  this.p_2[i++]="Catania";  
			  this.p_2[i++]="Catanzaro";  
			  this.p_2[i++]="Chieti";  
			  this.p_2[i++]="Como";  
			  this.p_2[i++]="Cosenza";  
			  this.p_2[i++]="Cremona";  
			  this.p_2[i++]="Crotone";  
			  this.p_2[i++]="Cuneo";  
			  this.p_2[i++]="Enna";  
			  this.p_2[i++]="Ferrara";  
			  this.p_2[i++]="Fermo";  			  
			  this.p_2[i++]="Firenze";  
			  this.p_2[i++]="Foggia";  
			  this.p_2[i++]="Forli-Cesena";  
			  this.p_2[i++]="Frosinone";  
			  this.p_2[i++]="Genova";  
			  this.p_2[i++]="Gorizia";  
			  this.p_2[i++]="Grosseto";  
			  this.p_2[i++]="Imperia";  
			  this.p_2[i++]="Isernia";  
			  this.p_2[i++]="La Spezia";  
			  this.p_2[i++]="L`Aquila";  
			  this.p_2[i++]="Latina";  
			  this.p_2[i++]="Lecce";  
			  this.p_2[i++]="Lecco";  
			  this.p_2[i++]="Livorno";  
			  this.p_2[i++]="Lodi";  
			  this.p_2[i++]="Lucca";  
			  this.p_2[i++]="Macerata";  
			  this.p_2[i++]="Mantova";  
			  this.p_2[i++]="Massa-Carrara";  
			  this.p_2[i++]="Matera";  
			  this.p_2[i++]="Medio Campidano";  
			  this.p_2[i++]="Messina";  
			  this.p_2[i++]="Milano";  
			  this.p_2[i++]="Modena";  
			  this.p_2[i++]="Napoli";  
			  this.p_2[i++]="Novara";  
			  this.p_2[i++]="Nuoro";  
			  this.p_2[i++]="Ogliastra";  
			  this.p_2[i++]="Olbia-Tempio";  
			  this.p_2[i++]="Oristano";  
			  this.p_2[i++]="Padova";   
			  this.p_2[i++]="Palermo";  
			  this.p_2[i++]="Parma";  
			  this.p_2[i++]="Pavia";  
			  this.p_2[i++]="Perugia";  
			  this.p_2[i++]="Pesaro e Urbino";  
			  this.p_2[i++]="Pescara";  
			  this.p_2[i++]="Piacenza";  
			  this.p_2[i++]="Pisa";  
			  this.p_2[i++]="Pistoia";  
			  this.p_2[i++]="Pordenone";  
			  this.p_2[i++]="Potenza";  
			  this.p_2[i++]="Prato";  
			  this.p_2[i++]="Ragusa";  
			  this.p_2[i++]="Ravenna";  
			  this.p_2[i++]="Reggio Calabria";  
			  this.p_2[i++]="Reggio Emilia";  
			  this.p_2[i++]="Rieti";  
			  this.p_2[i++]="Rimini";  
			  this.p_2[i++]="Roma";  
			  this.p_2[i++]="Rovigo";  
			  this.p_2[i++]="Salerno";  
			  this.p_2[i++]="Sassari";  
			  this.p_2[i++]="Savona";  
			  this.p_2[i++]="Siena";  
			  this.p_2[i++]="Siracusa";  
			  this.p_2[i++]="Sondrio";  
			  this.p_2[i++]="Taranto";  
			  this.p_2[i++]="Teramo";  
			  this.p_2[i++]="Terni";  
			  this.p_2[i++]="Torino";  
			  this.p_2[i++]="Trapani";  
			  this.p_2[i++]="Trento";  
			  this.p_2[i++]="Treviso";  
			  this.p_2[i++]="Trieste";  
			  this.p_2[i++]="Udine";  
			  this.p_2[i++]="Varese";  
			  this.p_2[i++]="Venezia";  
			  this.p_2[i++]="Verbano-Cusio-Ossola"; 
			  this.p_2[i++]="Vercelli";  
			  this.p_2[i++]="Verona";  
			  this.p_2[i++]="Vibo Valentia";  
			  this.p_2[i++]="Vicenza";  
			  this.p_2[i++]="Viterbo";  
			  this.v5["Agrigento"]  = "Sicilia";
			  this.v5["Alessandria"]  = "Piemonte";
			  this.v5["Ancona"]  = "Marche";
			  this.v5["Aosta"]  = "Valle-dAosta";
			  this.v5["Arezzo"]  = "Toscana";
			  this.v5["Ascoli Piceno"]  = "Marche";
			  this.v5["Asti"]  = "Piemonte";
			  this.v5["Avellino"]  = "Campania";
			  this.v5["Bari"]  = "Puglia";
			  this.v5["Belluno"]  = "Veneto";
			  this.v5["Benevento"]  = "Campania";
			  this.v5["Bergamo"]  = "Lombardia";
			  this.v5["Biella"]  = "Piemonte";
			  this.v5["Bologna"]  = "Emilia-Romagna";
			  this.v5["Bolzano"]  = "Trentino-Alto-Adige";
			  this.v5["Brescia"]  = "Lombardia";
			  this.v5["Brindisi"]  = "Puglia";
			  this.v5["Cagliari"]  = "Sardegna";
			  this.v5["Caltanissetta"]  = "Sicilia";
			  this.v5["Campobasso"]  = "Molise";
			  this.v5["Carbonia-Iglesias"] = "Sardegna";
			  this.v5["Caserta"]  = "Campania";
			  this.v5["Catania"]  = "Sicilia";
			  this.v5["Catanzaro"]  = "Calabria";
			  this.v5["Chieti"]  = "Abruzzo";
			  this.v5["Como"]  = "Lombardia";
			  this.v5["Cosenza"]  = "Calabria";
			  this.v5["Cremona"]  = "Lombardia";
			  this.v5["Crotone"]  = "Calabria";
			  this.v5["Cuneo"]  = "Piemonte";
			  this.v5["Enna"]  = "Sicilia";
			  this.v5["Ferrara"]  = "Emilia-Romagna";
			  this.v5["Fermo"]  = "Marche";
			  this.v5["Firenze"]  = "Toscana";
			  this.v5["Foggia"]  = "Puglia";
			  this.v5["Forli-Cesena"]  = "Emilia-Romagna";
			  this.v5["Frosinone"]  = "Lazio";
			  this.v5["Genova"]  = "Liguria";
			  this.v5["Gorizia"]  = "Friuli-Venezia-Giulia";
			  this.v5["Grosseto"]  = "Toscana";
			  this.v5["Imperia"]  = "Liguria";
			  this.v5["Isernia"]  = "Molise";
			  this.v5["La Spezia"]  = "Liguria";
			  this.v5["L`Aquila"]  = "Abruzzo";
			  this.v5["Latina"]  = "Lazio";
			  this.v5["Lecce"]  = "Puglia";
			  this.v5["Lecco"]  = "Lombardia";
			  this.v5["Livorno"]  = "Toscana";
			  this.v5["Lodi"]  = "Lombardia";
			  this.v5["Lucca"]  = "Toscana";
			  this.v5["Macerata"]  = "Marche";
			  this.v5["Mantova"]  = "Lombardia";
			  this.v5["Massa-Carrara"]  = "Toscana";
			  this.v5["Matera"]  = "Basilicata";
			  this.v5["Medio Campidano"]  = "Lazio";
			  this.v5["Messina"]  = "Sicilia";
			  this.v5["Milano"]  = "Lombardia";
			  this.v5["Modena"]  = "Emilia-Romagna";
			  this.v5["Napoli"]  = "Campania";
			  this.v5["Novara"]  = "Piemonte";
			  this.v5["Nuoro"]  = "Sardegna";
			  this.v5["Ogliastra"]  = "Sardegna";
			  this.v5["Olbia-Tempio"]  = "Sardegna";
			  this.v5["Oristano"]  = "Sardegna";
			  this.v5["Padova"]   =  "Veneto";
			  this.v5["Palermo"]  = "Sicilia";
			  this.v5["Parma"]  = "Emilia-Romagna";
			  this.v5["Pavia"]  = "Lombardia";
			  this.v5["Perugia"]  = "Umbria";
			  this.v5["Pesaro e Urbino"]  = "Marche";
			  this.v5["Pescara"]  = "Abruzzo";
			  this.v5["Piacenza"]  = "Emilia-Romagna";
			  this.v5["Pisa"]  = "Toscana";
			  this.v5["Pistoia"]  = "Toscana";
			  this.v5["Pordenone"]  = "Friuli-Venezia-Giulia";
			  this.v5["Potenza"]  = "Basilicata";
			  this.v5["Prato"]  = "Toscana";
			  this.v5["Ragusa"]  = "Sicilia";
			  this.v5["Ravenna"]  = "Emilia-Romagna";
			  this.v5["Reggio Calabria"]  = "Calabria";
			  this.v5["Reggio Emilia"]  = "Emilia-Romagna";
			  this.v5["Rieti"]  = "Lazio";
			  this.v5["Rimini"]  = "Emilia-Romagna";
			  this.v5["Roma"]  = "Lazio";
			  this.v5["Rovigo"]  = "Veneto";
			  this.v5["Salerno"]  = "Campania";
			  this.v5["Sassari"]  = "Sardegna";
			  this.v5["Savona"]  = "Liguria";
			  this.v5["Siena"]  = "Toscana";
			  this.v5["Siracusa"]  = "Sicilia";
			  this.v5["Sondrio"]  = "Lombardia";
			  this.v5["Taranto"]  = "Puglia";
			  this.v5["Teramo"]  = "Abruzzo";
			  this.v5["Terni"]  = "Umbria";
			  this.v5["Torino"]  = "Piemonte";
			  this.v5["Trapani"]  = "Sicilia";
			  this.v5["Trento"]  = "Trentino-Alto-Adige";
			  this.v5["Treviso"]  = "Veneto";
			  this.v5["Trieste"]  = "Friuli-Venezia-Giulia";
			  this.v5["Udine"]  = "Friuli-Venezia-Giulia";
			  this.v5["Varese"]  = "Lombardia";
			  this.v5["Venezia"]  = "Veneto";
			  this.v5["Verbano-Cusio-Ossola"] = "Piemonte";
			  this.v5["Vercelli"]  = "Piemonte";
			  this.v5["Verona"]  = "Veneto";
			  this.v5["Vibo Valentia"]  = "Calabria";
			  this.v5["Vicenza"]  = "Veneto";
			  this.v5["Viterbo"]  = "Lazio";
				this.p_3["Agrigento"] = "AG";
				this.p_3["Alessandria"] = "AL";
				this.p_3["Ancona"] = "AN";
				this.p_3["Aosta"] = "AO";
				this.p_3["Arezzo"] = "AR";
				this.p_3["Ascoli Piceno"] = "AP";
				this.p_3["Asti"] = "AT";
				this.p_3["Avellino"] = "AV";
				this.p_3["Bari"] = "BA";
				this.p_3["Belluno"] = "BL";
				this.p_3["Benevento"] = "BN";
				this.p_3["Bergamo"] = "BG";
				this.p_3["Biella"] = "BI";
				this.p_3["Bologna"] = "BO";
				this.p_3["Bolzano"] = "BZ";
				this.p_3["Brescia"] = "BS";
				this.p_3["Brindisi"] = "BR";
				this.p_3["Cagliari"] = "CA";
				this.p_3["Caltanissetta"] = "CL";
				this.p_3["Campobasso"] = "CB";
				this.p_3["Carbonia-Iglesias"] = "CI";
				this.p_3["Caserta"] = "CE";
				this.p_3["Catania"] = "CT";
				this.p_3["Catanzaro"] = "CZ";
				this.p_3["Chieti"] = "CH";
				this.p_3["Como"] = "CO";
				this.p_3["Cosenza"] = "CS";
				this.p_3["Cremona"] = "CR";
				this.p_3["Crotone"] = "KR";
				this.p_3["Cuneo"] = "CN";
				this.p_3["Enna"] = "EN";
				this.p_3["Ferrara"] = "FE";
				this.p_3["Fermo"] = "FM";
				this.p_3["Firenze"] = "FI";
				this.p_3["Foggia"] = "FG";
				this.p_3["Forl?-Cesena"] = "FC";
				this.p_3["Frosinone"] = "FR";
				this.p_3["Genova"] = "GE";
				this.p_3["Gorizia"] = "GO";
				this.p_3["Grosseto"] = "GR";
				this.p_3["Imperia"] = "IM";
				this.p_3["Isernia"] = "IS";
				this.p_3["La Spezia"] = "SP";
				this.p_3["L`Aquila"] = "AQ";
				this.p_3["Latina"] = "LT";
				this.p_3["Lecce"] = "LE";
				this.p_3["Lecco"] = "LC";
				this.p_3["Livorno"] = "LI";
				this.p_3["Lodi"] = "LO";
				this.p_3["Lucca"] = "LU";
				this.p_3["Macerata"] = "MC";
				this.p_3["Mantova"] = "MN";
				this.p_3["Massa-Carrara"] = "MS";
				this.p_3["Matera"] = "MT";
				this.p_3["Medio Campidano"] = "VS";
				this.p_3["Messina"] = "ME";
				this.p_3["Milano"] = "MI";
				this.p_3["Modena"] = "MO";
				this.p_3["Napoli"] = "NA";
				this.p_3["Novara"] = "NO";
				this.p_3["Nuoro"] = "NU";
				this.p_3["Ogliastra"] = "OG";
				this.p_3["Olbia-Tempio"] = "OT";
				this.p_3["Oristano"] = "OR";
				this.p_3["Padova"] = "PD";
				this.p_3["Palermo"] = "PA";
				this.p_3["Parma"] = "PR";
				this.p_3["Pavia"] = "PV";
				this.p_3["Perugia"] = "PG";
				this.p_3["Pesaro e Urbino"] = "PU";
				this.p_3["Pescara"] = "PE";
				this.p_3["Piacenza"] = "PC";
				this.p_3["Pisa"] = "PI";
				this.p_3["Pistoia"] = "PT";
				this.p_3["Pordenone"] = "PN";
				this.p_3["Potenza"] = "PZ";
				this.p_3["Prato"] = "PO";
				this.p_3["Ragusa"] = "RG";
				this.p_3["Ravenna"] = "RA";
				this.p_3["Reggio di Calabria"] = "RC";
				this.p_3["Reggio Emilia"] = "RE";
				this.p_3["Rieti"] = "RI";
				this.p_3["Rimini"] = "RN";
				this.p_3["Roma"] = "RM";
				this.p_3["Rovigo"] = "RO";
				this.p_3["Salerno"] = "SA";
				this.p_3["Sassari"] = "SS";
				this.p_3["Savona"] = "SV";
				this.p_3["Siena"] = "SI";
				this.p_3["Siracusa"] = "SR";
				this.p_3["Sondrio"] = "SO";
				this.p_3["Taranto"] = "TA";
				this.p_3["Teramo"] = "TE";
				this.p_3["Terni"] = "TR";
				this.p_3["Torino"] = "TO";
				this.p_3["Trapani"] = "TP";
				this.p_3["Trento"] = "TN";
				this.p_3["Treviso"] = "TV";
				this.p_3["Trieste"] = "TS";
				this.p_3["Udine"] = "UD";
				this.p_3["Varese"] = "VA";
				this.p_3["Venezia"] = "VE";
				this.p_3["Verbano-Cusio-Ossola"] = "VB";
				this.p_3["Vercelli"] = "VC";
				this.p_3["Verona"] = "VR";
				this.p_3["Vibo Valentia"] = "VV";
				this.p_3["Vicenza"] = "VI";
				this.p_3["Viterbo"] = "VT";

				this.h3["Agrigento"]  = "084";
				this.h3["Alessandria"]  = "006";
				this.h3["Ancona"]  = "042";
				this.h3["Aosta"]  = "007";
				this.h3["Arezzo"]  = "051";
				this.h3["Ascoli Piceno"]  = "044";
				this.h3["Asti"]  = "005";
				this.h3["Avellino"]  = "064";
				this.h3["Bari"]  = "072";
				this.h3["Belluno"]  = "025";
				this.h3["Benevento"]  = "062";
				this.h3["Bergamo"]  = "016";
				this.h3["Biella"]  = "096";
				this.h3["Bologna"]  = "037";
				this.h3["Bolzano"]  = "021";
				this.h3["Brescia"]  = "017";
				this.h3["Brindisi"]  = "074";
				this.h3["Cagliari"]  = "092";
				this.h3["Caltanissetta"]  = "085";
				this.h3["Campobasso"]  = "070";
				this.h3["Carbonia-Iglesias"] = "107";
				this.h3["Caserta"]  = "061";
				this.h3["Catania"]  = "087";
				this.h3["Catanzaro"]  = "079";
				this.h3["Chieti"]  = "069";
				this.h3["Como"]  = "013";
				this.h3["Cosenza"]  = "078";
				this.h3["Cremona"]  = "019";
				this.h3["Crotone"]  = "101";
				this.h3["Cuneo"]  = "004";
				this.h3["Enna"]  = "086";
				this.h3["Ferrara"]  = "038";
				this.h3["Fermo"]  = "109";
				this.h3["Firenze"]  = "048";
				this.h3["Foggia"]  = "071";
				this.h3["Forli-Cesena"]  = "040";
				this.h3["Frosinone"]  = "060";
				this.h3["Genova"]  = "010";
				this.h3["Gorizia"]  = "031";
				this.h3["Grosseto"]  = "053";
				this.h3["Imperia"]  = "008";
				this.h3["Isernia"]  = "094";
				this.h3["La Spezia"]  = "066";
				this.h3["L`Aquila"]  = "011";
				this.h3["Latina"]  = "059";
				this.h3["Lecce"]  = "075";
				this.h3["Lecco"]  = "097";
				this.h3["Livorno"]  = "049";
				this.h3["Lodi"]  = "098";
				this.h3["Lucca"]  = "046";
				this.h3["Macerata"]  = "043";
				this.h3["Mantova"]  = "020";
				this.h3["Massa-Carrara"]  = "045";
				this.h3["Matera"]  = "077";
				this.h3["Medio Campidano"]  = "106";
				this.h3["Messina"]  = "083";
				this.h3["Milano"]  = "015";
				this.h3["Modena"]  = "036";
				this.h3["Napoli"]  = "063";
				this.h3["Novara"]  = "003";
				this.h3["Nuoro"]  = "091";
				this.h3["Ogliastra"]  = "105";
				this.h3["Olbia-Tempio"]  = "104";
				this.h3["Oristano"]  = "095";
				this.h3["Padova"]  = "028";
				this.h3["Palermo"]  = "082";
				this.h3["Parma"]  = "034";
				this.h3["Pavia"]  = "018";
				this.h3["Perugia"]  = "054";
				this.h3["Pesaro e Urbino"]  = "041";
				this.h3["Pescara"]  = "068";
				this.h3["Piacenza"]  = "033";
				this.h3["Pisa"]  = "050";
				this.h3["Pistoia"]  = "047";
				this.h3["Pordenone"]  = "093";
				this.h3["Potenza"]  = "076";
				this.h3["Prato"]  = "100";
				this.h3["Ragusa"]  = "088";
				this.h3["Ravenna"]  = "039";
				this.h3["Reggio Calabria"]  = "080";
				this.h3["Reggio Emilia"]  = "035";
				this.h3["Rieti"]  = "057";
				this.h3["Rimini"]  = "099";
				this.h3["Roma"]  = "058";
				this.h3["Rovigo"]  = "029";
				this.h3["Salerno"]  = "065";
				this.h3["Sassari"]  = "090";
				this.h3["Savona"]  = "009";
				this.h3["Siena"]  = "052";
				this.h3["Siracusa"]  = "089";
				this.h3["Sondrio"]  = "014";
				this.h3["Taranto"]  = "073";
				this.h3["Teramo"]  = "067";
				this.h3["Terni"]  = "055";
				this.h3["Torino"]  = "001";
				this.h3["Trapani"]  = "081";
				this.h3["Trento"]  = "022";
				this.h3["Treviso"]  = "026";
				this.h3["Trieste"]  = "032";
				this.h3["Udine"]  = "030";
				this.h3["Varese"]  = "012";
				this.h3["Venezia"]  = "027";
				this.h3["Verbano-Cusio-Ossola"] = "103";
				this.h3["Vercelli"]  = "002";
				this.h3["Verona"]  = "023";
				this.h3["Vibo Valentia"]  = "102";
				this.h3["Vicenza"]  = "024";
				this.h3["Viterbo"]  = "056";
				this.h5["Agrigento"] = "92100";
				this.h5["Alessandria"] = "15100";
				this.h5["Ancona"] = "60100";
				this.h5["Aosta"] = "11100";
				this.h5["Arezzo"] = "52100";
				this.h5["Ascoli Piceno"] = "63100";
				this.h5["Asti"] = "14100";
				this.h5["Avellino"] = "83100";
				this.h5["Bari"] = "70100";
				this.h5["Belluno"] = "32100";
				this.h5["Benevento"] = "82100";
				this.h5["Bergamo"] = "24100";
				this.h5["Biella"] = "13100";
				this.h5["Bologna"] = "40100";
				this.h5["Bolzano"] = "39100";
				this.h5["Brescia"] = "25100";
				this.h5["Brindisi"] = "72100";
				this.h5["Cagliari"] = "09100";
				this.h5["Caltanissetta"] = "93100";
				this.h5["Campobasso"] = "86100";
				this.h5["Caserta"] = "81100";
				this.h5["Catania"] = "95100";
				this.h5["Catanzaro"] = "88100";
				this.h5["Chieti"] = "66100";
				this.h5["Como"] = "22100";
				this.h5["Cosenza"] = "87100";
				this.h5["Cremona"] = "26100";
				this.h5["Crotone"] = "88900";
				this.h5["Cuneo"] = "12100";
				this.h5["Enna"] = "94100";
				this.h5["Ferrara"] = "44100";
				this.h5["Fermo"] = "63100";
				this.h5["Firenze"] = "50100";
				this.h5["Foggia"] = "71100";
				this.h5["Frosinone"] = "03100";
				this.h5["Genova"] = "16100";
				this.h5["Gorizia"] = "34100";
				this.h5["Grosseto"] = "58100";
				this.h5["Imperia"] = "18100";
				this.h5["Isernia"] = "86170";
				this.h5["La Spezia"]  = "19100";
				this.h5["Latina"] = "04100";
				this.h5["Lecce"] = "73100";
				this.h5["Lecco"] = "23100";
				this.h5["Livorno"] = "57100";
				this.h5["Lodi"] = "26100";
				this.h5["Lucca"] = "55100";
				this.h5["Macerata"] = "62100";
				this.h5["Mantova"] = "46100";
				this.h5["Matera"] = "75100";
				this.h5["Messina"] = "98100";
				this.h5["Milano"] = "20100";
				this.h5["Modena"] = "41100";
				this.h5["Napoli"] = "80100";
				this.h5["Novara"] = "28100";
				this.h5["Nuoro"] = "08100";
				this.h5["Oristano"] = "09100";
				this.h5["Padova"] = "35100";
				this.h5["Palermo"] = "90100";
				this.h5["Parma"] = "43100";
				this.h5["Pavia"] = "27100";
				this.h5["Perugia"] = "06100";
				this.h5["Pescara"] = "65100";
				this.h5["Piacenza"] = "29100";
				this.h5["Pisa"] = "56100";
				this.h5["Pistoia"] = "51100";
				this.h5["Pordenone"] = "33100";
				this.h5["Potenza"] = "85000";
				this.h5["Prato"] = "59100";
				this.h5["Ragusa"] = "97100";
				this.h5["Ravenna"] = "48100";
				this.h5["Reggio Calabria"]  =  "89100";
				this.h5["Reggio Emilia"] =  "42100";
				this.h5["Rieti"] = "02100";
				this.h5["Rimini"] = "47900";
				this.h5["Roma"] = "00100";
				this.h5["Rovigo"] = "45100";
				this.h5["Salerno"] = "84100";
				this.h5["Sassari"] = "07100";
				this.h5["Savona"] = "17100";
				this.h5["Siena"] = "53100";
				this.h5["Siracusa"] = "96100";
				this.h5["Sondrio"] = "23100";
				this.h5["Taranto"] = "74100";
				this.h5["Teramo"] = "64100";
				this.h5["Terni"] = "05100";
				this.h5["Torino"] = "10100";
				this.h5["Trapani"] = "91100";
				this.h5["Trento"] = "38100";
				this.h5["Treviso"] = "31100";
				this.h5["Trieste"] = "34100";
				this.h5["Udine"] = "33100";
				this.h5["Varese"] = "21100";
				this.h5["Venezia"] = "30100";
				this.h5["Vercelli"] = "13100";
				this.h5["Verona"] = "37100";
				this.h5["Vibo Valentia"] = "89100"
				this.h5["Vicenza"] = "36100";
				this.h5["Viterbo"] = "01100";
				this.p2ISTAT["Bologna"]	 = "037006"; 
				this.p2ISTAT["Bari"]	 = "072006";
				this.p2ISTAT["Cagliari"]	= "092009";
				this.p2ISTAT["Firenze"]	= "048017";
				this.p2ISTAT["Genova"]	= "010025";
				this.p2ISTAT["Milano"]	 = "015146"; 
				this.p2ISTAT["Napoli"]	 = "063049";
				this.p2ISTAT["Palermo"]	 = "082053";
				this.p2ISTAT["Reggio Calabria"]	 = "080063";
				this.p2ISTAT["Roma"]	 = "058091";
				this.p2ISTAT["Torino"]	 = "001272"; 
				
												

		},

		h4:function(){
			return this.h4s;
		},


		setActive:function(active){
			this.h4s =  active;
		},

		n_1:function(txt){
			return 0;
		
		},


		a8:function(a1){
			this.a4[this.a1][this.a3] = this.baseUrl;

		},

		setIdx:function(idx){
			this.idx = idx;

		},

		getIdx:function(){
			return this.idx;
		},

		setNumRes:function(res){
			this.numRes = res;
		},

		setRes:function(numRes){
			this.numRes = numRes;
		},

		getRes:function(){
			return this.numRes;
		},
		
		getIdx:function(){
			return this.idx;
		},

		setTimeoutOnResponse:function(req){
			this.requestHttpRes = req;
			
			doAbort = function(){
			   req.abort();
			   this.requestHttpRes = null;
			   this.reqStatus = g_2.ABORTED;
			}	
			this.onWaitResultTimer = setTimeout("doAbort()",30000);
			
			
		},

		b2:function(keyword){
				this.b6[this.a1][this.l_5++]		 =   m_2.deletePrefix(keyword);
				this.history[this.a1][this.a2++] =  "b6";

		},

		h6:function(keyword){
				this.history[this.a1][this.a2 - 1] =  "nullKeywords";
				this.b6[this.a1][this.l_5++]		 =  keyword;
				this.history[this.a1][this.a2++] =  "b6";


		},

		h7:function(keyword){
				this.b6[this.a1][this.l_5++]		 =   keyword;
				this.history[this.a1][this.a2++] =  "specialKeywords";

		},

		h8:function(keyword){
				this.b6[this.a1][this.l_5++]		 =   keyword ;
				this.history[this.a1][this.a2++] =   "b6";

		},

		b3:function(priceFrom){
			this.priceFrom = priceFrom;
			this.history[this.a1][this.a2++] =  "priceFrom";
		},

		b4:function(priceTo){
			this.priceTo = priceTo;
			this.history[this.a1][this.a2++] =  "priceTo";

		},

		h9:function(mainCity,obj){
  			  obj.history[obj.a1][obj.a2++] =  "mainCity";
  			  obj.a_2	= mainCity;
		},

		i1:function(areaId,obj){
  			  obj.history[obj.a1][obj.a2++] =  "areaId";
		},

		i3:function(city,obj){
			
  			  return;
		},
		i4:function(city,obj){
  			obj.history[obj.a1][obj.a2++] =  "city";
			return;
		},

		n9:function(sellerType,obj){
	  		obj.history[obj.a1][obj.a2++] =  "sellerType";
			if(obj.n3[obj.a1][sellerType] != undefined)
				obj.sellerType = obj.n3[obj.a1][sellerType];
		},
	

		h1:function() {
			var v6 = "";
			var i=0;
			var j=0;
			for(i=0;i<this.a2;i++){
			    if(this.b6[this.a1][j] != undefined && this.history[this.a1][i] == "b6"){
					if(v6 != "")
						v6 = v6 + this.keywordsSeparator[this.a1] +  this.b6[this.a1][j] ;
 					else
						v6 =  this.b6[this.a1][j];
				  j++;
				}
			   else if(this.history[this.a1][i] == "nullKeywords")
					j++;

			}
			if(this.keywordsClear)
				for(;v6.indexOf("\"") > 0;)
					v6 = v6.repalce("\"","");

			var res = this.a4[this.a1][this.a3].replace("keywordsX",v6).replace("price_fromX",this.priceFrom).replace("price_toX",this.priceTo).replace("areaIdX",((this.city == "")?this.mainCity:this.city));

			return res;
		},


		back:function() {

			switch(this.history[this.a1][this.a2 - 1]){
				case "b6":
				this.l_5--;
				if(this.history[this.a1][this.a2 - 2] == "nullKeywords")
					this.history[this.a1][this.a2 - 2] = "b6";
				break;
				case "priceFrom":
					this.priceFrom = "";
					break;
				case "priceTo":
					this.priceTo = "";
					this.a3--;
					break;

			}

			this.a2--;
			if(this.a2 > 0)
				this.history[this.a1][this.a2] = "";
			if(this.a3 > 0){
				this.a4[this.a1][this.a3] = this.a4[this.a1][this.a3 - 1];
				this.a3--;
			}


		},


		jumpToPage:function(){

		  location.href  = this.h1();

		},

		jumpToPageTimed:function(){
		  g_2.n_9();
		  
		    g_2.haveValidRes = false;
			if(f_9.userExperiences != null){
					if(f_9.userExperiences.hasNeverDoneThisOne("CLICKED_ON_RESULTS"))
							f_9.userExperiences.add("CLICKED_ON_RESULTS","-",f_9.p_6);
					
					f_9.userExperiences.add("URL",location.href.substring(location.href.indexOf("#") + 1,location.href.length),f_9.p_6);
					f_9.p_4.saveIncremental(f_9.p_6);
					f_9.p_6 = new UserExperiences(g_2.z5("UNIQUE_ID"));
			}			
	
		  location.href  = this.h1();

		},

		jumpToParentPageTimed:function(){
		  g_2.n_9();
		  
		    g_2.haveValidRes = false;
			if(f_9.userExperiences != null){
					if(f_9.userExperiences.hasNeverDoneThisOne("CLICKED_ON_RESULTS"))
							f_9.userExperiences.add("CLICKED_ON_RESULTS","-",f_9.p_6);
					
					f_9.userExperiences.add("URL",location.href.substring(location.href.indexOf("#") + 1,location.href.length),f_9.p_6);
					f_9.p_4.saveIncremental(f_9.p_6);
					f_9.p_6 = new UserExperiences(g_2.z5("UNIQUE_ID"));
			}			
	

		},


		displayMode:function(){
			return f_9.l_2;
			
		},



		popupPage:function(){

		 var e_2="";
		 e_2  = 'width='+ screen.width;
		 e_2 += ', height=' + screen.height - 800;
		 e_2 += ', top=470, left=0'
		 e_2 += ', directories=no';
		 e_2 += ', location=no';
		 e_2 += ', menubar=no';
		 e_2 += ', resizable=no';
		 e_2 += ', scrollbars=yes';
		 e_2 += ', g_2.status=no';		 e_2 += ', toolbar=no';

		if(false == this.a_4.closed )
		{
		   this.a_4.close();
		}

		 this.a_4 = window.open(this.h1(),this.name, e_2);

		},

		displayMode:function(){
			return f_9.l_2;
		},

		getName:function() {
		 	return this.name;

 		},

 		skip:function(){
			this.history[this.a1][this.a2++] =  "skip";
			if(this.a3 > 0){
				this.a3++;
				this.a4[this.a1][this.a3] = this.a4[this.a1][this.a3 - 1];
			}

 		},
 		doNothing:function(){
 			return;
 		},

		b9:function(action,key,obj){
    			this.g9[this.a1][action](key,obj);
    	},

    	onHttpResponse:function(){
    	 return;

    	}


	});

 var i5 = i9.extend({
    	milesMin:"",
    	milesMax:"",
    	motorMaker:"",
    	x1:"",
    	v9:"",
    	motorModel:"",
    	l2:[f_9.MAXENGINENUM],
    	l1:[f_9.MAXENGINENUM],
    	motorType:"",
    	l9:[f_9.MAXENGINENUM],
    	fuelType:"",
    	v8:[f_9.MAXENGINENUM],
    	v7:"",
    	v4:"",
    	u6:[f_9.MAXENGINENUM],
    	x2:"",
    	x2s:[f_9.MAXENGINENUM],
    	x4:"",
    	v3:[f_9.MAXENGINENUM],
    	version:"",
		construct:function(baseUrl,name){
  			this.$.init.call(this,baseUrl,name);
  			this.init(baseUrl,name);
  		},

		init:function(baseUrl,name){
	  	   this.$.init.call(this,baseUrl,name);
	  	    this.l9[this.a1] = new Array(10);
	  	    this.v8[this.a1] = new Array(10);
	  	    this.u6[this.a1] =  new Array(15);
	  	    this.x2s[this.a1] =  new Array(32);
	  	    this.v3[this.a1] =  new Array(33);
          	this.u6[this.a1]["Arancio"] = "Arancione"
          	this.u6[this.a1]["Argento"] = "Argento"
          	this.u6[this.a1]["Azzurro"] = "Azzurra"
          	this.u6[this.a1]["Beige"]   = "Beige"
          	this.u6[this.a1]["Bianco"]  = "Bianca"
          	this.u6[this.a1]["Blu"]     = "Blu"
          	this.u6[this.a1]["Bronzo"]  = "Bronzo"
          	this.u6[this.a1]["Giallo"]  = "Gialla"
          	this.u6[this.a1]["Grigio"]  = "Grigia"
          	this.u6[this.a1]["Marrone"] = "Marrone"
          	this.u6[this.a1]["Nero"]    = "Nero"
          	this.u6[this.a1]["Rosso"] = "Rossa"
          	this.u6[this.a1]["Verde"] = "Verde"
			this.x2s[this.a1]["2009"] = "2009";
			this.x2s[this.a1]["2008"] = "2008";
			this.x2s[this.a1]["2007"] = "2007";
			this.x2s[this.a1]["2006"] = "2006";
			this.x2s[this.a1]["2005"] = "2005";
			this.x2s[this.a1]["2004"] = "2004";
			this.x2s[this.a1]["2003"] = "2003";
			this.x2s[this.a1]["2002"] = "2002";
			this.x2s[this.a1]["2001"] = "2001";
			this.x2s[this.a1]["2000"] = "2000";
			this.x2s[this.a1]["1999"] = "1999";
			this.x2s[this.a1]["1998"] = "1998";
			this.x2s[this.a1]["1997"] = "1997";
			this.x2s[this.a1]["1996"] = "1996";
			this.x2s[this.a1]["1995"] = "1995";
			this.x2s[this.a1]["1994"] = "1994";
			this.x2s[this.a1]["1993"] = "1993";
			this.x2s[this.a1]["1992"] = "1992";
			this.x2s[this.a1]["1991"] = "1991";
			this.x2s[this.a1]["1990"] = "1990";
			this.x2s[this.a1]["1985"] = "1985";
			this.x2s[this.a1]["1980"] = "1980";
			this.x2s[this.a1]["1975"] = "1975";
			this.x2s[this.a1]["1970"] = "1970";
			this.x2s[this.a1]["1965"] = "1965";
			this.x2s[this.a1]["1960"] = "1960";
			this.x2s[this.a1]["1950"] = "1950";
			this.x2s[this.a1]["1940"] = "1940";
			this.x2s[this.a1]["1930"] = "1930";
			this.x2s[this.a1]["1920"] = "1920";
			this.x2s[this.a1]["1910"] = "1910";
			this.v3[this.a1]["Airbag"] =				"Airbag";
			this.v3[this.a1]["Airbag laterale"] =			"Airbag laterale";
			this.v3[this.a1]["Airbag passeggero"] =			"Airbag passeggero";
			this.v3[this.a1]["Alzacristalli elettrici"] =		"Alzacristalli elettrici";
			this.v3[this.a1]["Cerchi in lega"] =			"Cerchi in lega";
			this.v3[this.a1]["Chiusura centralizzata"] =		"Chiusura centralizzata";
			this.v3[this.a1]["Climatizzatore"] =			"Climatizzatore";
			this.v3[this.a1]["Controllo automatico clima"] =		"Controllo automatico clima";
			this.v3[this.a1]["Fari Xenon"] =				"Fari Xenon";
			this.v3[this.a1]["Interni in pelle"] =			"Interni in pelle";
			this.v3[this.a1]["Park distance control"] =		"Park distance control ";
			this.v3[this.a1]["Servosterzo"] =				"Servosterzo";
			this.v3[this.a1]["Sistema di navigazione"] =		"Sistema di navigazione";
			this.v3[this.a1]["Tettuccio apribile"] =			"Tettuccio apribile";
			this.v3[this.a1]["Trazione integrale"] =			"Trazione integrale";
			this.v3[this.a1]["ABS"] =					"ABS";
			this.v3[this.a1]["Adatta a portatori di handicap"] =	"Adatta a portatori di handicap";
			this.v3[this.a1]["Antifurto"] =				"Antifurto";
			this.v3[this.a1]["Autoradio"] =				"Autoradio";
			this.v3[this.a1]["Computer di bordo"] =			"Computer di bordo";
			this.v3[this.a1]["Controllo automatico trazione"] =	"Controllo automatico trazione";
			this.v3[this.a1]["Cruise Control"] =			"Cruise Control";
			this.v3[this.a1]["ESP"] =					"ESP";
			this.v3[this.a1]["Fendinebbia"] =				"Fendinebbia";
			this.v3[this.a1]["Gancio traino"] =			"Gancio traino";
			this.v3[this.a1]["Immobilizzatore elettronico"] =		"Immobilizzatore elettronico";
			this.v3[this.a1]["Lettore CD"] =				"Lettore CD";
			this.v3[this.a1]["Portapacchi"] =				"Portapacchi";
			this.v3[this.a1]["Regolazione elettrica sedili"] =		"Regolazione elettrica sedili";
			this.v3[this.a1]["Riscaldamento ausiliario"] =		"Riscaldamento ausiliario";
			this.v3[this.a1]["Sedili riscaldati"] =			"Sedili riscaldati";
			this.v3[this.a1]["Veicolo elaborato"] =			"Veicolo elaborato";


			this.g9[this.a1]["motorModel"]			= this.l4;
			this.g9[this.a1]["motorMaker"]			= this.l3;
			this.g9[this.a1]["motorType"]			= this.l5;
			this.g9[this.a1]["fuelType"]			= this.l6;
			this.g9[this.a1]["kilometri"]		= this.u9;
			this.g9[this.a1]["m_axYear"]				= this.u8;
			this.g9[this.a1]["e_xternalColor"]			= this.u7;
			this.g9[this.a1]["o_ptionals"]		= this.v1;
			this.g9[this.a1]["version"]		= this.setVersion;




		},

		l3:function(motorMaker,obj){
	  			obj.history[obj.a1][obj.a2++] =  "motorMaker";
				obj.x1 = motorMaker;
				if(obj.l2[obj.a1][motorMaker] != undefined && obj.l2[obj.a1][motorMaker] != ""){
					obj.motorMaker = obj.l2[obj.a1][motorMaker];
					obj.h4s = true;
				}
				else{
					obj.h4s = false;
				}
			},


		l4:function(motorModel,obj){
	  			obj.history[obj.a1][obj.a2++] =  "motorModel";
				if(obj.l1[obj.a1][obj.x1][motorModel] != undefined)
					obj.motorModel = obj.l1[obj.a1][obj.x1][motorModel];
			},

		l5:function(motorType,obj){
	  			obj.history[obj.a1][obj.a2++] =  "motorType";
				if(obj.l9[obj.a1][motorType] != undefined)
					obj.motorType = obj.l9[obj.a1][motorType];
			},

		l6:function(fuelType,obj){
	  			obj.history[obj.a1][obj.a2++] =  "fuelType";
				if(obj.v8[obj.a1][fuelType] != undefined)
					obj.fuelType = obj.v8[obj.a1][fuelType];
			},


		u7:function(v4,obj){
	  			obj.history[obj.a1][obj.a2++] =  "v4";
				if(obj.u6[obj.a1][v4] != undefined)
					obj.v4 = obj.u6[obj.a1][v4];
			},


		v1:function(x4,obj){
	  			obj.history[obj.a1][obj.a2++] =  "x4";
				if(obj.v3[obj.a1][x4] != undefined){
					obj.x4 = obj.v3[obj.a1][x4];
					return 0;
				}
				else
					return -1;  	
			},

		u8:function(x2,obj){
	  			obj.history[obj.a1][obj.a2++] =  "x2";
				if(obj.x2s[obj.a1][x2] != undefined)
					obj.x2 = obj.x2s[obj.a1][x2];
			},

		setVersion:function(version,obj){
	  			obj.history[obj.a1][obj.a2++] =  "version";
				obj.b2(version);
			},


		u9:function(v7,obj){
	  			obj.history[obj.a1][obj.a2++] =  "v7";
	  			switch(v7){
	  				case "kilometri zero":
	  					obj.v7 = "0";
	  					break;
	  				case "5000 km":
	  					obj.v7 = "5000";
	  					break;
	  				case "20000 km":
	  					obj.v7 = "20000";
	  					break;
	  				case "40000 km":
	  					obj.v7 = "40000";
	  					break;
	  				case "60000 km":
	  					obj.v7 = "60000";
	  					break;
	  				case "80000 km":
	  					obj.v7 = "80000";
	  					break;
	  				case "100000 km":
	  					obj.v7 = "100000";
	  					break;
	  				case "125000 km":
	  					obj.v7 = "125000";
	  					break;
	  				case "150000 km":
	  					obj.v7 = "150000";
	  					break;
	  				case "200000 km":
	  					obj.v7 = "200000";
	  					break;
	  				case "250000 km":
	  					obj.v7 = "250000";
	  					break;
	  				case "300000 km":
	  					obj.v7 = "300000";
	  					break;

	  			}
			},

 		h1:function(){

 				var url="";

				url = this.$.h1.call(this).replace("miles_fromX","0").replace("miles_toX",this.milesMax).replace("motorMakerX",this.motorMaker).replace("motorModelX",this.motorModel).replace("motorVersionX",this.version).replace("motorTypeX",this.motorType).replace("fuelTypeX",this.fuelType).replace("v7X",this.v7).replace("x2X",this.x2).replace("v4X",this.v4).replace("x4X",this.x4).replace("sellerTypeX",this.sellerType);
   				if(this.a1 == "Cliccamotori")
    				  g_2.z1=url;
				return url;
		},

		
		back:function() {
			switch(this.history[this.a1][this.a2  - 1]){
				case "milesMax":
					this.milesMax = "";
					break;

			}
			this.$.back.call(this)
		}

  });

 var q_3 = i9.extend({
    	shopType:"",
    	subShopType:"",
    	bigCity:"",
    	address:"",
		construct:function(baseUrl,name){
  			this.$.init.call(this,baseUrl,name);
  			this.init(baseUrl,name);
  		},

		init:function(baseUrl,name){
	  	   this.$.init.call(this,baseUrl,name);
			this.g9[this.a1]["shopType"]			= this.setShopType;
			this.g9[this.a1]["subShopType"]			= this.setSubShopType;
			this.g9[this.a1]["bigCity"]			= this.setBigCity;
			this.g9[this.a1]["addressType"]			= this.setAddressType;
			this.g9[this.a1]["address"]			= this.setAddress;

		},


		setShopType:function(shopType,obj){
				obj.shopType = shopType;
	  			obj.history[obj.a1][obj.a2++] =  "shopType";
			},

		setSubShopType:function(subShopType,obj){
				obj.subShopType = subShopType;
	  			obj.history[obj.a1][obj.a2++] =  "subShopType";
			},

		setBigCity:function(bigCity,obj){
				obj.bigCity = bigCity;
	  			obj.history[obj.a1][obj.a2++] =  "bigCity";
			},

		setAddressType:function(addressType,obj){
				obj.addressType = addressType;
	  			obj.history[obj.a1][obj.a2++] =  "addressType";
			},

		setAddress:function(address,obj){
				obj.address = address;
	  			obj.history[obj.a1][obj.a2++] =  "address";
			},


 		h1:function(){

 				var url="";
				url = this.$.h1.call(this).replace("shopTypeX",this.shopType).replace("subShopTypeX",this.subShopType).replace("bigCityX",this.bigCity).replace("addressX",this.address);
				return url;
		},

		
		back:function() {
			this.$.back.call(this);
		}

  });


 var pagineGialleSearchUrl = q_3.extend({
    	shopType:"",
		construct:function(baseUrl,name){
  			this.$.init.call(this,baseUrl,name);
  			this.init(baseUrl,name);
  		},

		init:function(baseUrl,name){
	  	   this.$.init.call(this,baseUrl,name);

		},


		displayMode:function(){
			return f_9.n_4;
			
		},


		n_1:function(txt){
		    var res="";
		    if(txt.indexOf("<h2>Nessun risultato. Perfeziona la tua ricerca.</h2></div>") >= 0)
				return 0;
		    var offset = txt.indexOf("</span> Risultati per");
			if(offset > -1) 
				res = txt.substring(0,offset);
			else{
			    var offset = txt.indexOf("</span> Risultato per");
					if(offset > -1)
						return 1;
					else
						return 0;	 
			}			
			
		    var offset = res.lastIndexOf(">");
			if(offset > -1) 
				res = res.substring(offset + 1,offset + 10);
			else
				return 0;
				

			return res;	
				
			 
		
		},

		setShopType:function(shopType,obj){
				obj.a3++;
				obj.a4[obj.a1][obj.a3] = obj.a4[obj.a1][obj.a3 - 1]  + "/4-shopTypeX"; 
				this.$.setShopType.call(this,shopType.replaceAll("un ","").replaceAll("una ",""),obj);
			},


		setSubShopType:function(subShopType,obj){
				obj.a3++;
				obj.a4[obj.a1][obj.a3] = obj.a4[obj.a1][obj.a3 - 1]  + "%20subShopTypeX"; 
				this.$.setSubShopType.call(this,subShopType,obj);
			},


		setBigCity:function(bigCity,obj){
				obj.a3++;
				obj.a4[obj.a1][obj.a3] = obj.a4[obj.a1][obj.a3 - 1]  + "/3-bigCityX"; 
				this.$.setBigCity.call(this,bigCity,obj);
			},

		setAddressType:function(addressType,obj){
				obj.a3++;
				obj.a4[obj.a1][obj.a3] = obj.a4[obj.a1][obj.a3 - 1]; 
				this.$.setAddressType.call(this,addressType,obj);
			},

		setAddress:function(address,obj){
				obj.a3++;
				obj.a4[obj.a1][obj.a3] = obj.a4[obj.a1][obj.a3 - 1]  + "?ind=addressX"; 
				this.$.setAddress.call(this,address,obj);
			}




  });

 var googleSearchUrl = q_3.extend({
    	shopType:"",
		construct:function(baseUrl,name){
  			this.$.init.call(this,baseUrl,name);
  			this.init(baseUrl,name);
  		},

		init:function(baseUrl,name){
	  	   this.$.init.call(this,baseUrl,name);

		},


		displayMode:function(){
			return f_9.n_4;
			
		},


		n_1:function(txt){
		    var res="";
		    if(txt.indexOf("<h2>Nessun risultato. Perfeziona la tua ricerca.</h2></div>") >= 0)
				return 0;
		    var offset = txt.indexOf("<span class=num_results style=padding-right:4em dir=ltr><b>");
			if(offset > -1) 
				res = txt.substring(offset + "<span class=num_results style=padding-right:4em dir=ltr><b>".length,offset + "<span class=num_results style=padding-right:4em dir=ltr><b>".length + 10);
			else
				return 0;

		    var offset = res.indexOf("<");
			if(offset > -1) 
				res = res.substring(0,offset);
			else
				return 0;
				
			
			
			return m_2.replaceDot(res);	
				
			 
		
		},

		setShopType:function(shopType,obj){
				obj.a3++;
				obj.a4[obj.a1][obj.a3] = obj.a4[obj.a1][obj.a3 - 1]  + "&q=shopTypeX"; 
				this.$.setShopType.call(this,shopType,obj);
			},


		setBigCity:function(bigCity,obj){
				obj.a3++;
				obj.a4[obj.a1][obj.a3] = obj.a4[obj.a1][obj.a3 - 1]  + "+bigCityX"; 
				this.$.setBigCity.call(this,bigCity,obj);
			},

		setAddressType:function(addressType,obj){
				obj.a3++;
				obj.a4[obj.a1][obj.a3] = obj.a4[obj.a1][obj.a3 - 1]; 
				this.$.setAddressType.call(this,addressType,obj);
			},

 		h1:function(){

 				var url="";
				url = this.$.h1.call(this).replace("shopTypeX",this.shopType).replace("bigCityX",this.bigCity).replace("addressX",this.address);
				return url + "&fb=1&split=1&gl=it&view=map&ei=OmStSoTrE86JsAbWosnaBw";
		},

		setAddress:function(address,obj){
				obj.a3++;
				obj.a4[obj.a1][obj.a3] = obj.a4[obj.a1][obj.a3 - 1]  + "+addressX"; 
				this.$.setAddress.call(this,address,obj);
			}




  });


var q_2 = Class.extend({
	txt:"",
	wordsSaid:"",
	numWordsSaid:0,
	buffer:"",
	windowHeight:0,
	waitReplay:null,
	
	construct:function(){
			setTimeout('f_9.Robot.robotLife(f_9.Robot)',200);
		
	
	},
	
	robotLife:function(robot){


		if(f_9.userExperiences != null)
			 if(f_9.p_6.modified){
				 f_9.p_4.saveIncremental(f_9.p_6);
 				 f_9.p_6 = new UserExperiences(g_2.z5("UNIQUE_ID"));
			 }	 

	
		if(g_2.z5("UNIQUE_ID") == null){
			/* register new anonimous */
			 var GUID = generateGuid();
			 unregUser = new UnregisteredUser(GUID);
  			 /* f_9.Robot.says("Ciao, mi chiamo Aladino e ti do il mio benvenuto su questo sito. Se hai bisogno di qualche cosa chiedimelo. Ciao Ciao" ,null);
			 f_9.Robot.says("Ciao, mi chiamo Aladino e ti do il mio benvenuto su questo sito. Ciao Ciao",
							function(){
								g_2.i_3(8);
								f_9.startSuggestionImmidiatly=true;
								f_9.l_3(f_9.i_7[8],f_9.s2Forward);
							});


			*/

			f_9.p_4.save(unregUser);
			g_2.z4("UNIQUE_ID",GUID,20);
			
		}
		else{
			 
			 
			 
			 
		if(f_9.user == null && g_2.init)			 
			 f_9.p_4.retriveAsync("unregistered_users",g_2.z5("UNIQUE_ID"),
			 function(obj){
					
					var usr=obj;	
					 if(usr == null){
						usr = new UnregisteredUser(g_2.z5("UNIQUE_ID"));
						var str = JSON.stringify(usr);
  						f_9.p_4.save(usr);
					}
						
					f_9.user = usr;
					if(g_2.h_8().length == 0){
						g_2.i_3(8);
						f_9.startSuggestionImmidiatly=true;
						f_9.l_3(f_9.i_7[8],f_9.s2Forward);
					}
						

			 },
			 new UnregisteredUser());
			
			
			
				


			if(f_9.userExperiences == null && g_2.init)			 
				 f_9.p_4.retriveAsync("user_experience",
				 g_2.z5("UNIQUE_ID"),
				 function(obj){
					f_9.userExperiences = obj;
					if(f_9.userExperiences == null && f_9.p_6 != null){
						 f_9.p_4.saveIncremental(f_9.p_6);
 						 f_9.p_6 = new UserExperiences(g_2.z5("UNIQUE_ID"));
	 					 g_2.init = false;
 				}	 
				 },
				 new UserExperiences());
			
			
			
			if(f_9.p_6 == null)
				f_9.p_6 = new UserExperiences(g_2.z5("UNIQUE_ID"));
				 

				if(new Date().getTime() > g_2.lastActivityTime.getTime() + 3600000){					
						if(g_2.h_8().indexOf("8") < 0){
							g_2.i_3(8);
							f_9.startSuggestionImmidiatly=true;
							f_9.l_3(f_9.i_7[8],f_9.s2Forward);
							document.getElementById("tabs_0").innerHTML="";

						}
				}
				
			

				if( (f_9.user  == null || f_9.userExperiences == null ? false : (f_9.user.name == ""  && f_9.userExperiences.count("URL") > 10 && (new Date().getTime() > g_2.lastActivityTime.getTime() + 6000)))){
						var questions= new Array("Ciao, mi chiamo Aladino e tu come ti chiami?","Ciao, io sono Aladino, e tu?","Mi dici come ti chiami? Io mi chiamo Aladino");
						 
						if(f_9.userExperiences == null){
							f_9.userExperiences = new UserExperiences(g_2.z5("UNIQUE_ID"));
							f_9.userExperiences.add("REQUESTED_NAME",questions[0],f_9.p_6);
							this.says(questions[0],
							function(){
								f_9.Robot.makeQuestion("comeTiChiami","Mi chiamo");
							});

						}
						else{
							if(f_9.userExperiences.lastRequestTimeIsPassed("REQUESTED_NAME")){ 			
							var question = f_9.userExperiences.getNewQuestion(questions);
							f_9.userExperiences.add("REQUESTED_NAME",question,f_9.p_6);

							this.says(question,
							function(){
								f_9.Robot.makeQuestion("comeTiChiami","Mi chiamo");
							});
											
									
						}
					  }
										
				}		



			
			if(g_2.haveValidRes  &&  ((f_9.userExperiences == null) ? true: f_9.userExperiences.hasNeverDoneThisOne("CLICKED_ON_RESULTS") && f_9.userExperiences.lastRequestTimeIsPassed("SUGGESTED_CLICK_RES"))){
				var questions= new Array("Ci sono dei risultati alla tua ricerca, se ci cliccki sopra li puoi vedere: dopo premi indietro nel tuo browser per tornare a questa pagina,ciao ciao","Hei hai visto che ho trovato della roba che cerchi? Se clicchi sopra i bottoni che hanno dei numeri li puoi vedere","Risultati in vistaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!!!!!!!!!!!!!!!!!");
						
						
				if(f_9.userExperiences  == null){
					
					f_9.userExperiences = new UserExperiences(g_2.z5("UNIQUE_ID"));
					f_9.userExperiences.add("SUGGESTED_CLICK_RES",questions[0],f_9.p_6);
					this.says(questions[0],null);

				}
				else{
					if(f_9.userExperiences.lastRequestTimeIsPassed("SUGGESTED_CLICK_RES")){ 			
					var question = f_9.userExperiences.getNewQuestion(questions);
					f_9.userExperiences.add("SUGGESTED_CLICK_RES",question,f_9.p_6);

					this.says(question,null);
											
									
				}
				}	
						
			}
			 

			

				
		   setTimeout('f_9.Robot.robotLife(f_9.Robot)',5000);
 				
			
		 }
		
	},
	
	makeQuestion:function(questionAddress,init){
	    var str = "baseUrl/search.php?action=startXml&nextAction=taleXml&dir=basePath/content/users/Aladino/questions/" + questionAddress +"&context=Io>" + init + "%20";
		if(f_9.user.name == "")
			f_9.l_3(str,f_9.s2Forward);			
		else
			f_9.l_3(str.replace("Io>",f_9.user.name + "> "),f_9.s2Forward);			
		
	
	},
	says:function(str,waitReplay){
		this.waitReplay = waitReplay;
		this.windowHeight = 150; 
		this.txt="<span style=\"font-family: Comic Sans MS;font-size:" + f_9.y2 + "pt\">";
		this.txt = this.txt + "<p align=\"justify\" style=\"text-indent: 100px; margin-left: 100px; margin-right: 100px\"><br> Aladino> ";
		this.buffer = str;	
		document.getElementById("robot").style.height="150px";
		document.getElementById("robot").style.visibility = "visible";		
		this.numWordsSaid =0;	
		setTimeout('this.setTimedText(f_9.Robot)',this.calcTimeout());
		
		setTimedText = function(robot){
			var toBeSaid="";
			if(robot.numWordsSaid == str.length){
				if(str.indexOf("%") < 0 && str.indexOf("?") < 0 && str.indexOf(".") < 0){
					 toBeSaid =  robot.txt + m_2.replaceCode(unescape(robot.wordsSaid)) + ".";
					 document.getElementById("robot").innerHTML = toBeSaid;
				}	 
				
				if(robot.waitReplay != null)
					robot.waitReplay();
				else
				  setTimeout('f_9.Robot.closeWindow(f_9.Robot)',3000);

				return;
			}		
			
			if(robot.numWordsSaid == 0)
					robot.wordsSaid = str.substring(0, 1);
				else				  
					robot.wordsSaid = robot.wordsSaid + str.substring(robot.numWordsSaid, robot.numWordsSaid + 1);
			  		
			
		     toBeSaid = robot.txt + m_2.replaceCode(unescape(robot.wordsSaid));
			
			
			document.getElementById("robot").innerHTML = toBeSaid;
			robot.numWordsSaid = robot.numWordsSaid + 1;
			setTimeout('this.setTimedText(f_9.Robot)',robot.calcTimeout());		
		
		}	
	 },

	

	showEyes:function(){


		setTimeout('this.openWindow(f_9.Robot)',5000);



		
	 },

	openWindow:function(robot){
			
			
			document.getElementById("robot").style.visibility = "visible";		
			document.getElementById("robot").style.height= robot.windowHeight + "px";
			if(robot.windowHeight < 151){
				setTimeout('this.openWindow(f_9.Robot)',20);
				robot.windowHeight++;
			}
			else{
			
				var txt = "<p><img border=\"0\" src=\"file:///C:/aladinSearch_/lab/Gif/aladin.gif\" width=\"64\" height=\"32\"></p>"
				document.getElementById("robot").innerHTML = txt;
				setTimeout('this.closeWindow(f_9.Robot)',12000);
			
					
			}
		
	},	

	closeWindow:function(robot){
			
			
			document.getElementById("robot").style.height= robot.windowHeight + "px";
			if(robot.windowHeight > 0){
				setTimeout('f_9.Robot.closeWindow(f_9.Robot)',20);
				robot.windowHeight--;
			}
			else{
			
			document.getElementById("robot").style.visibility = "hidden";		
			document.getElementById("robot").style.height= "0px";
			
					
			}
		
	},	

		
	calcTimeout:function(){
		var timeout =Math.floor(Math.random()*5);		
		if(timeout%2 == 1)
		 return 100 - timeout*22;
		else
		 return 100 + timeout*22;
		  
					
	}
	
	
});

var VirtualStorage = Class.extend({

  php:new PHP_Serializer(), 
  save:function(obj){
		var finalUrl= f_9.baseUrl + "/search.php?action=saveObj&bulk=" + escape(this.php.serialize(obj));
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {/* code for IE7, Firefox, Mozilla, etc. */
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {/* code for IE5, IE6 */
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		req.onreadystatechange = function() {
			if(req.readyState != 4) 
				return;			
			if (req.readyState == 4) {
				if(req.status!=200)
				  {
					  return;
				 }
				var txt = req.responseText;
				if(txt != null){
					return -1;
				}			
			}
		}
		res = req.open("GET",finalUrl, false);
		req.send(null);   
		obj.modified=false;
		return obj;				  
	
  },

  saveIncremental:function(obj){
		var php = new PHP_Serializer(); 
		var finalUrl= f_9.baseUrl + "/search.php?action=saveIncremental&bulk=" + escape(php.serialize(obj));
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {/* code for IE7, Firefox, Mozilla, etc. */
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {/* code for IE5, IE6 */
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		req.onreadystatechange = function() {
			if(req.readyState != 4) 
				return;			
			if (req.readyState == 4) {
				if(req.status!=200)
				  {
					  return;
				 }
				var txt = req.responseText;
				if(txt != null){
					return -1;
				}			
			}
		}
		res = req.open("GET",finalUrl, false);
		req.send(null);   
		obj.modified=false;
		return obj;				  
	
  },


  saveDirect:function(className,ID,obj){
		var finalUrl= f_9.baseUrl + "/search.php?action=saveDirect&className=" + className + "&ID=" + ID + "&bulk=" + escape(serialize(obj));
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		req.onreadystatechange = function() {
			if(req.readyState != 4) 
				return;			
			if (req.readyState == 4) {
				if(req.status!=200)
				  {
					  return;
				 }
				var txt = req.responseText;
				if(txt != null){
					return -1;
				}			
			}
		}
		res = req.open("GET",finalUrl, false);
		req.send(null);   
		obj.modified=false;
		return obj;				  
	
  },

 



  retrive:function(className,ID,container){
		var finalUrl= f_9.baseUrl + "/search.php?action=retriveObj&className=" + className + "&ID=" + ID + "&time=" + new Date().getTime();
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		res = req.open("GET",finalUrl, false);
		req.send(null); 
		var txt = req.responseText;
		if(txt != null){
			var cls = PHP_Unserialize(txt)
			if(cls == undefined)
			 return null;
			return container.clone(cls);
		}			
		  
		return null;				  
	
  },

  retriveAsync:function(className,ID,retrivedCB,container){
		var finalUrl= f_9.baseUrl + "/search.php?action=retriveObj&className=" + className + "&ID=" + ID + "&time=" + new Date().getTime();
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		req.onreadystatechange = function() {
			if(req.readyState != 4) 
				return;			
			if (req.readyState == 4) {
				if(req.status!=200)
				  {
					  return;
				 }
				var txt = req.responseText;
				if(txt != null){
					if(retrivedCB != null)
						var cls = PHP_Unserialize(txt);
						if (cls == undefined)
							retrivedCB(null);
						else
							retrivedCB(container.clone(cls));
					return 0;
				}			
			}
		}
		res = req.open("GET",finalUrl, true);
		req.send(null); 
		  
		return 0;				  
	
  }

});

var Remoteh_1 = Class.extend({


  saveSongRes:function(res){
  
		
		var url = f_9.baseUrl + "/songRes.php";
		var e_2 = "data=" + escape(res) + "&id=" + g_2.z5("UNIQUE_ID");

		var http =null;

		if (window.XMLHttpRequest)
		   {
		   http =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   http =new ActiveXObject("Microsoft.XMLHTTP");
		   }
		
		http.open("POST", url, false);

		/* Send the proper header information along with the request */
		http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		http.setRequestHeader("Content-length", e_2.length);
		http.setRequestHeader("Connection", "close");
		

		http.onreadystatechange = function() {/* Call a function when the state changes. */
			if(http.readyState == 4 && http.status == 200) {
			}
		}
		http.send(e_2);
  },




  b9:function(action,className,inputObject,outputObject){
		var finalUrl= f_9.baseUrl + "/search.php?action=" + action + "&className=" + className + "&obj=" + serialize(inputObject) + "&id=" + new Date().getTime();
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		res = req.open("GET",finalUrl, false);
		req.send(null); 
		var txt = req.responseText;
		if(txt != null){
		
			return outputObject.clone(PHP_Unserialize(txt));
		}			
		  
		return null;				  
	
  },
  
  sendMemoMail:function(captcha,email,from,id,link){
		var finalUrl= f_9.baseUrl + "/MEMoMail.php?captcha=" + captcha + "&email=" + email + "&from=" + from + "&id=" + id + "&link=" + escape(link);
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		res = req.open("GET",finalUrl, false);
		req.send(null); 
		var txt = req.responseText;
		if(txt != null){
		
			return txt;
		}			
		  
		return null;				  
	
  },

    getFile:function(filename){
		var finalUrl= f_9.baseUrl + "/search.php?action=getFile&filename=" + filename + "&id=" +  new Date().getTime();
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		res = req.open("GET",finalUrl, false);
		req.send(null); 
		var txt = req.responseText;
		if(txt != null){
		
			return txt.replaceAll("''","`");
		}			
		  
		return null;				  
	
  },

  
    getSong:function(path,author,album,song){
		var finalUrl= f_9.baseUrl + "/search.php?action=getSongsContentList&path=" + path + "&author=" + author.urlEncoder() + "&album=" + album.urlEncoder() + "&song=" + song.urlEncoder() +  "&id=" +  new Date().getTime();
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		res = req.open("GET",finalUrl, false);
		req.send(null); 
		var txt = req.responseText;
		if(txt != null){
		
			return txt.replaceAll("''","`");
		}			
		  
		return null;				  
	
  },

    dirExists:function(dir){
		var finalUrl= f_9.baseUrl + "/search.php?action=dirExists&dir=" + dir + "&id=" +  new Date().getTime();
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		res = req.open("GET",finalUrl, false);
		req.send(null); 
		var txt = req.responseText;
		if(txt != null){
		
			return txt;
		}			
		  
		return null;				  
	
  },

    getSentences:function(filename){
		var finalUrl= f_9.baseUrl + "/search.php?action=getFilesRes&path=" + filename + "&id=" +  new Date().getTime();
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		res = req.open("GET",finalUrl, false);
		req.send(null); 
		var txt = req.responseText;
		if(txt != null){
		
			return txt.replaceAll("''","`");
		}			
		  
		return null;				  
	
  },


    h_7mEmo:function(name,sen,foto){
		var out="";
		var arr = sen.split("<br>");
		
		
		var j=0;
		for(j=0; j <arr.length; j++){
		
				if(arr[j].length > 38){
					var i=0;
					var slit = 1;
					var sen1 = arr[j].split(" ");
					out=sen1[0] + " ";
					for(i=1; i <sen1.length; i++){
					   if((out + " " + sen1[i]).length - slit*(38 + (slit -1)*4) >=0){
							out = out + "<br>"; 
	 					    out = out + " " + sen1[i];
							slit++;
							
					   }
					   else
	   					   out = out + " " + sen1[i];
	    
					}		
					out = out + "<br>";	  
					 
				
				}	
				else
					out = arr[j] + "<br>";
				
		arr[j] = out + "<br>";
		 		
		
		}
		
		sen = arr.join("");
		/*out= arr[0] + "<br>" ;
		
		for(j=1; i <arr.length; j++)
			out = out + arr[j];
		*/
				
		sen  = sen.replaceAll("<br> ","<br>");
		sen  = sen.replaceAll("  "," ");
		sen  = sen.replaceAll("   "," ");
		
		
		sen  = sen.replaceAll("<br>  <br>","<br>");
		sen  = sen.replaceAll("<br> <br>","<br>");
		sen  = sen.replaceAll("<br><br>","<br>");
    
    
		var finalUrl= f_9.baseUrl +  "/mEmo.php?name=" + name + "&txt=" + sen + "&foto=" + foto + "&id=" +  new Date().getTime() + "&lan=" + g_2.language;
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		res = req.open("GET",finalUrl, false);
		req.send(null); 
		var txt = req.responseText;
		if(txt != null && txt.indexOf("Warning") < 0){
//			window.frames['I0'].location.href = name + ".jpg";
		   	f_9.rs.saveSongRes(parent.m_2.arrayCompact(render.selector.results)); 
			f_9.mEmo = f_9.appUrl + (g_2.language== "ITA" ? "/" : "/eng/") + "mEmo/" + txt + ".jpg"; 
		    window.frames['I0'].location.href =  "mEmoX0.htm";
			return txt;
		}			
		  
		return null;				  
	
  },

   getResults:function(path,results){
		var finalUrl= f_9.baseUrl + "/search.php?action=getResults&path=" + path + "&id=" +  new Date().getTime();
		var req =null;
		var res=null;

		if (window.XMLHttpRequest)
		   {
		   req =new XMLHttpRequest();
		   }
		 else if (window.ActiveXObject)
		   {
		   req =new ActiveXObject("Microsoft.XMLHTTP");
		   }
			
		if(req == null) return 0;
		res = req.open("GET",finalUrl, false);
		req.send(null); 
		var txt = req.responseText;
		if(txt != null){
		
			return results.clone(PHP_Unserialize(txt));
		}			
		  
		return null;				  
	
  }



});



function SignaledItem(name,address,phone,email,vote,lastDateSignaled){

            this.name  = name;
            this.address = address;
            this.phone = phone;
            this.email = email;
            this.vote = vote;
            this.dateSignaled = dateSignaled;
            
            
			this.className ="signaledItem";
			SignaledItem.prototype.getID=function(){
				return this.name; 
			};

			SignaledItem.prototype.clone=function(user){
				this.name = user.name;
				this.address = user.address;
				this.phone = user.phone;
				this.email = user.email;
	            this.vote = vote;
				this.className =user.className;
				return this;
			};
	
	
}

function SignaledByUserItem(name,dateSignaled,document){

            this.name  = name;
            this.address = address;
            this.phone = phone;
            this.email = email;
            this.vEx = voteExcellent;
            this.vG = voteGood;
            this.vM = voteMedium;
            this.vB = voteBad;
            this.userId = userId;
            this.dateSignaled = dateSignaled;
			this.modified=true;
            
            
			this.className ="signaledItem";
			SignaledItem.prototype.getID=function(){
				return this.name; 
			};

			SignaledItem.prototype.clone=function(user){
				this.name = user.name;
				this.address = user.address;
				this.phone = user.phone;
				this.email = user.email;
				this.className =user.className;
				this.modified=user.modified;
				return this;
			};
	
	
}




function User(nickName,password,name,surname,sex,address,phone,email){
            this.nickName = nickName;
            this.password = password;
            this.name  = name;
            this.surname = surname;
            this.address = address;
            this.phone = phone;
            this.email = email;
            this.sex = sex;
			this.modified=true;
			this.className ="users";
			User.prototype.getID=function(){
				return this.nickName; 
			};

			User.prototype.clone=function(user){
				this.nickName = user.nickName;
				this.password = user.password;
				this.name  = user.name;
				this.surname = user.surname;
				this.address = user.address;
				this.phone = user.phone;
				this.email = user.email;
				this.className =user.className;
				this.sex=user.sex;
				this.modified=user.modified;
				return this;
			};
	
	
}


function UnregisteredUser(id){
            this.id = id;
            this.name  = "";
            this.surname = "";
            this.address = "";
            this.phone = "";
            this.email = "";
			this.modified=false;
			this.sex="";
			this.className ="unregistered_users";
			UnregisteredUser.prototype.getID=function(){
				return this.id; 
			};

			UnregisteredUser.prototype.clone=function(user){
				this.id = user.id;
				this.name  = user.name;
				this.surname = user.surname;
				this.address = user.address;
				this.phone = user.phone;
				this.email = user.email;
				this.className =user.className;
				this.sex=user.sex;
				this.modified=user.modified;
				return this;
			};
	
	
}


function generateGuid()
{
	var result, i, j;
	result = '';
	for(j=0; j<32; j++)
	{
	if( j == 8 || j == 12|| j == 16|| j == 20)
	result = result + '-';
	i = Math.floor(Math.random()*16).toString(16).toUpperCase();
	result = result + i;
	}
	return result
} 






function LoginSession(user){
				this.nickName = user.nickName;
				this.password = user.password;
				this.loginNumber  = "";
				this.sessionID = "";
				this.lastTimeLogin  = "";
				this.startTime = "";
				this.modified=false;
				this.expiresTime = "";
			

			
			
			LoginSession.prototype.getID=function(){
				return this.nickName; 
			};

			LoginSession.prototype.clone=function(login){
				this.nickName = login.nickName;
				this.password = login.password;
				this.loginNumber  = login.loginNumber;
				this.sessionID = login.sessionID;
				this.lastTimeLogin  = login.lastTimeLogin;
				this.startTime = login.startTime;
				this.expiresTime = login.expiresTime;
				this.modified=login.modified;
				
				return this;
			};
	
	
}








function UserExperiences(userID){
            this.ID = userID;
			this.className ="user_experience";
			this.experiences= [];
			this.date=[];
			this.time=[];
			this.pronunced=[];
			this.modified=true;
			UserExperiences.prototype.getID=function(){
				return this.ID; 
			};

			UserExperiences.prototype.clone=function(userExperiences){
				this.ID = userExperiences.ID;
				this.className =userExperiences.className;
				var i=0;
				for(val in userExperiences.experiences){
					if(userExperiences.experiences[i] == undefined) break;
					this.experiences[i] =userExperiences.experiences[i];
					i++;
					
				}
				i=0;
				for(val in userExperiences.date){
					if(userExperiences.date[i] == undefined) break;
					this.date[i] =userExperiences.date[i];
					i++;
				}

				i=0;
				for(val in userExperiences.time){
					if(userExperiences.time[i] == undefined) break;
					this.time[i] =userExperiences.time[i];
					i++;
				}

				i=0;
				for(val in userExperiences.pronunced){
					if(userExperiences.pronunced[i] == undefined) break;
					this.pronunced[i] =userExperiences.pronunced[i];
					i++;
				}
				this.modified = userExperiences.modified;

				return this;
			};

			UserExperiences.prototype.add=function(exp,pronunced,usrExp){

				this.experiences[this.experiences.length] = exp; 
				this.date[this.date.length] = m_2.getDate();
				this.time[this.time.length] = m_2.getTime();
				this.pronunced[this.pronunced.length] = pronunced;
				this.modified=true;

				usrExp.experiences[usrExp.experiences.length] = exp; 
				usrExp.date[usrExp.date.length] = m_2.getDate();
				usrExp.time[usrExp.time.length] = m_2.getTime();
				usrExp.pronunced[usrExp.pronunced.length] = pronunced;
				usrExp.modified=true;
				
			};

	
			UserExperiences.prototype.getNewQuestion=function(questions){
				var i=0,j=0;	
				for(j=0; j < questions.length;j++){
					for(i=0;i<this.pronunced.length;i++)
						if( questions[j] == this.pronunced[i])
							break;
					if(i == this.pronunced.length)
						return questions[j];		
				}
				return questions[0];
			};

			UserExperiences.prototype.lastRequestTimeIsPassed=function(experience){
				var j=0;	
				for(j=0; j < this.date.length;j++){
					if(this.experiences[j] == experience)
						if(!m_2.isPast(this.date[j]))
							return false;		
				}
				return true;
			};

			UserExperiences.prototype.hasNeverDoneThisOne=function(experience){
				var j=0;	
				for(j=0; j < this.date.length;j++){
					if(this.experiences[j] == experience)
							return false;		
				}
				return true;
			};

			UserExperiences.prototype.hasDoneThisOne=function(experience){
				var j=0;	
				for(j=0; j < this.date.length;j++){
					if(this.experiences[j] == experience)
							return true;		
				}
				return false;
			};


			UserExperiences.prototype.count=function(experience){
				var j=0;
				var i=0;	
				for(j=0; j < this.date.length;j++){
					if(this.experiences[j] == experience)
							i++;		
				}
				return i;
			};

			UserExperiences.prototype.countPronunced=function(experience,pronunced){
				var j=0;
				var i=0;	
				for(j=0; j < this.date.length;j++){
					if(this.experiences[j] == experience)
						if(this.pronunced[j] == pronunced)
							i++;		
				}
				return i;
			};

			UserExperiences.prototype.lastTimeYouDidIt=function(experience,pronunced){
				var j=0;
				var i=0;
				var time=0;	
				for(j=0; j < this.date.length;j++){
					if(this.experiences[j] == experience)
						if(this.pronunced[j] == pronunced)
							if(time == 0)
								time = new Date().getTime() - m_2.getDateFromString(this.date[j],this.time[j]).getTime();
							else if(time < (new Date().getTime() - m_2.getDateFromString(this.date[j],this.time[j]).getTime()))
								time = new Date().getTime() - m_2.getDateFromString(this.date[j],this.time[j]).getTime();
								
				}				
				return time;
			};

	
}






function PlacesVisited(userID){
            this.ID = userID;
			this.className ="placesVisited";
			this.placesVisited = [];
			this.history=[];
			this.modified=true;
						
			Login.prototype.getID=function(){
				return this.ID; 
			};

			PlacesVisited.prototype.clone=function(placesVisited){
				this.ID = placesVisited.ID;
				this.className =placesVisited.className;
				var i=0;
				for(val in placesVisited.placesVisited){
					this.placesVisited[i] =placesVisited.placesVisited[i];
					i++;
				}
				var i=0;
				for(val in placesVisited.history){
					this.history[i] =placesVisited.history[i];
					i++;
				}
 
				this.modified = placesVisited.modified;
				return this;
			};

			PlacesVisited.prototype.add=function(place){

				this.placesVisited[this.placesVisited.length] = place; 
				
				
			};
	

			PlacesVisited.prototype.addHistory=function(history){

				this.history[this.history.length] = history; 
				
				
			};

			PlacesVisited.prototype.getPlace=function(i){

				return this.placesVisited[i]; 
				
				
			};
	
}


/*function Content(ID,engine,url){
            this.ID = ID;
			this.className ="content";
			this.url = url;
			this.engine = engine;
			this.modified=true;
						
			Content.prototype.getID=function(){
				return this.ID; 
			};

			Content.prototype.clone=function(content){
				this.ID = content.ID;
				this.className =content.className;
				this.url = content.url;
				this.modified = content.modified;
				return this;
			};

	
}


function Content(){
			this.className ="content";
						
			Content.prototype.getID=function(){
				return this.ID; 
			};

			Content.prototype.clone=function(content){
				this.ID = content.ID;
				this.className =content.className;
				this.url = content.url;
				this.modified = content.modified;
				return this;
			};

	
}
*/

function Content(ID,engine,url,user,score,visited){
            this.ID = ID;
			this.className ="content";
			this.url = url;
			this.engine = engine;
			this.user=user;
			this.score=score;
			this.visited=visited;
			this.modified=true;
						
			Content.prototype.getID=function(){
				return this.ID; 
			};

			Content.prototype.clone=function(content){
				this.ID = content.ID;
				this.className =content.className;
				this.url = content.url;
				this.modified = content.modified;
				this.user=content.user;
				this.score=content.score;
				this.visited=content.visited;
				return this;
			};

	
}


function songContent(ID,author,album,name,engine,url,user,score,visited){
            this.ID = ID;
			this.className ="songContent";
			this.author=author;
			this.album=album;
			this.name=name;
			this.url = url;
			this.engine = engine;
			this.user=user;
			this.score=score;
			this.visited=visited;
			this.modified=true;
						
			songContent.prototype.getID=function(){
				return this.ID; 
			};

			songContent.prototype.clone=function(content){
				this.ID = content.ID;
				this.className =content.className;
				this.author=content.author;
				this.album=content.album;
				this.name=content.name;
				this.url = content.url;
				this.engine = content.engine;
				this.modified = content.modified;
				this.user=content.user;
				this.score=content.score;
				this.visited=content.visited;
				return this;
			};

	
}
/*
var p_4 = new VirtualStorage();



var ret = p_4.retrive("songContent","1",new songContent());

ret.pippe();
*/

/*var content = new songContent(1,"Vasco Rossi","Bollicine","il mondo che vorrei","youtube","http://www.youtube.it?search=Vasco Rossi il mondo che vorrei","aladino",0,0);

var p_4 = new VirtualStorage();

p_4.save(content);
*/



/*var user = new User("pMariner","aladin","","","","","","");

var p_4 = new VirtualStorage();


p_4.save(user);

var ret = p_4.retrive("users","pMariner",new User())
var id  = ret.getID();
var login = new LoginSession(user);

p_4.save(login);


ret = p_4.retrive("loginSession","pMariner",new LoginSession(new User()));
id  = ret.getID();

var user = new User("pMariner","aladin","","","","","","");

var remoteSrv = new Remoteh_1();

var login = remoteSrv.b9("login","loginSession",user,new LoginSession(user));

login.sessionID;

*/




var o_7 = Class.extend({

	name:"",
	address:"",
	columnElementsById:[],
	queryPath:[],
	currentPath:"",
	lastPrimaryKey:0,
	construct:function(name){
		this.address =  name;
		this.name = name;
		this.currentPath = this.address;	
		this.columnElementsById = new Array();	
	},
	
	addElement:function(name,isPrimaryKey,isNull,value){
	   this.columnElementsById[this.columnElementsById.length] = new p_8(name,isPrimaryKey,isNull,this.columnElementsById.length,value);
	  	

	},
	
	commit_old:function(){
	   var i = 0;
	   var j = 0;
	   var z = 0;
	   var currentPath=this.address;
	   var queryPath =[]
	   for(i=0; i < this.columnElementsById.length;i++) 
	     if(this.columnElementsById[i].isPrimaryKey){
				 queryPath[queryPath.length] = currentPath + "/" + this.columnElementsById[i].value;
				 currentPath = currentPath + "/" + this.columnElementsById[i].value;
				 
	     }
	     else{ /* Devo andare all'indietro fino alla prima chiave primaria */


			       
		  /* Devo aggiungere il path all'ultima chiave primaria e a tutte le chiavi non primarie: in questo semplice modello si assume che le chiavi primarie 
		   siano in testa alla tabella 
		   1  Vorrei\acquistare\un appartamento\in provincia di Milano
		   2  Vorrei\acquistare\un appartamento\in provincia di Milano\nel comune di Rozzano
		   3a Vorrei\acquistare\un appartamento\in provincia di Milano\con superfice compresa tra 40 e 80 mq	
		   3b Vorrei\acquistare\un appartamento\in provincia di Milano\nel comune di Rozzano\con superfice compresa tra 40 e 80 mq
		   4a Vorrei\acquistare\un appartamento\in provincia di Milano\con prezzo compreso tra 40000 e 70000 euro
		   4b Vorrei\acquistare\un appartamento\in provincia di Milano\nel comune di Rozzano\con prezzo compreso tra 40000 e 70000 euro
		   4c Vorrei\acquistare\un appartamento\in provincia di Milano\nel comune di Rozzano\con superfice compresa tra 40 e 80 mq\con prezzo compreso tra 40000 e 70000 euro
		  */


		  
		  /* Devo ciclare dalla chiave j alla fine attuale del vettore i-1 è la primary key */
		    var k=0;
		    var n=0;
		    var len = queryPath.length;
			 /* Ciclo sugli elementi: ad ogni elemento a partire dalla primary key devo aggiungere tutte le combinazioni degli elementi		*/	   
			  for(k= i - 1; k < len ;k++)
			 /* Ciclo sulle colonne: devo aggiungere solo alla root della primary */
				  for(z=i; z < this.columnElementsById.length ;z++){					
						var l_9=false;
						for(n=0; n < queryPath[queryPath.length] ;n++){
							if(queryPath[n] == queryPath[k] + "/" + this.columnElementsById[z].value)
							  l_9 = true;
							  break;
						}	  
						if(!l_9)		  							
							queryPath[queryPath.length] = queryPath[k] + "/" + this.columnElementsById[z].value;
				 }
	           
			
	     
			
	     
	     }
	       
	  	return queryPath;

	},
	
	commit:function(){
	   var j = 0;
	   var z = 0;
	   

	   if(this.columnElementsById[this.columnElementsById.length - 1].isPrimaryKey){
				 this.queryPath[this.queryPath.length] = this.currentPath + "/" + this.columnElementsById[this.columnElementsById.length - 1].value;
				 this.currentPath = this.queryPath[this.queryPath.length -1];
				 this.lastPrimaryKey = this.queryPath.length - 1;
	   }
	   else{ /* Devo andare all'indietro fino alla prima chiave primaria */


			       
		  /* Devo aggiungere il path all'ultima chiave primaria e a tutte le chiavi non primarie: in questo semplice modello si assume che le chiavi primarie 
		   siano in testa alla tabella 
		   1  Vorrei\acquistare\un appartamento\in provincia di Milano
		   2  Vorrei\acquistare\un appartamento\in provincia di Milano\nel comune di Rozzano
		   3a Vorrei\acquistare\un appartamento\in provincia di Milano\con superfice compresa tra 40 e 80 mq	
		   3b Vorrei\acquistare\un appartamento\in provincia di Milano\nel comune di Rozzano\con superfice compresa tra 40 e 80 mq
		   4a Vorrei\acquistare\un appartamento\in provincia di Milano\con prezzo compreso tra 40000 e 70000 euro
		   4b Vorrei\acquistare\un appartamento\in provincia di Milano\nel comune di Rozzano\con prezzo compreso tra 40000 e 70000 euro
		   4c Vorrei\acquistare\un appartamento\in provincia di Milano\nel comune di Rozzano\con superfice compresa tra 40 e 80 mq\con prezzo compreso tra 40000 e 70000 euro
		  */



		  
		  /* Devo ciclare dalla chiave j alla fine attuale del vettore i-1 è la primary key */
		    var k=0;
		    var n=0;
		    var len = this.queryPath.length;
			 /* Ciclo sugli elementi: ad ogni elemento a partire dalla primary key: devo aggiungere tutte le combinazioni degli elementi	*/
			 /* Devo */ 		   
				  for(z=this.lastPrimaryKey; z < len ;z++){					
							this.queryPath[this.queryPath.length] = this.queryPath[z] + "/" + this.columnElementsById[this.columnElementsById.length - 1].value;
				 }
	           
			
	     
			
	     
	     }
	       
	  	return this.queryPath;

	},
	
	q_0:function(tag,direct){
	   
	   
	   var colIdx=0;
	   if(direct)
			colIdx = this.columnElementsById.length -2;
		else
			colIdx = this.columnElementsById.length -1;
			
	   for(; colIdx >= 0;colIdx--){
	   		 
			if(this.columnElementsById[colIdx].name == tag){
				if(direct)
					this.columnElementsById.splice(colIdx + 1,this.columnElementsById.length -1 -colIdx);
				else
					this.columnElementsById.splice(colIdx,this.columnElementsById.length  -colIdx);
				
				return;				
			}
	    }   

	},
	
	q_1:function(){
	   var colIdx = 0;
	   var z = 0;
	   this.currentPath = this.address;
 	   this.queryPath = new Array();
 	   this.lastPrimaryKey=0;
	   for(colIdx=0; colIdx < this.columnElementsById.length;colIdx++){
	   		 
			if(this.columnElementsById[colIdx].isPrimaryKey){
						 this.queryPath[this.queryPath.length] = this.currentPath + "/" + this.columnElementsById[colIdx].value;
						 this.currentPath = this.queryPath[this.queryPath.length -1];
						 this.lastPrimaryKey = this.queryPath.length - 1;
			}
			else{ /* Devo andare all'indietro fino alla prima chiave primaria */



				  
				  /* Devo ciclare dalla chiave j alla fine attuale del vettore i-1 è la primary key */
				    var k=0;
				    var n=0;
				    var len = this.queryPath.length;
					 /* Ciclo sugli elementi: ad ogni elemento a partire dalla primary key: devo aggiungere tutte le combinazioni degli elementi	*/
						  for(z=this.lastPrimaryKey; z < len ;z++){					
								/*var l_9=false;
								for(n=0; n < this.queryPath[this.queryPath.length] ;n++){
									if(this.queryPath[n] == this.queryPath[k] + "/" + this.columnElementsById[z].value)
									  l_9 = true;
									  break;
								}	  
								if(!l_9) */		  							
									this.queryPath[this.queryPath.length] = this.queryPath[z] + "/" + this.columnElementsById[colIdx].value;
						 }
			        
					
			  
					
			  
			  }
	    }

		var txt="";
		var i=0;
		var array=[];
		var res = this.queryPath;
		for (i=0; i < res.length;i++) 
			array[i] = res[i] + ";";
		 array = array.sort(function(a,b){return a.split("/").length - b.split("/").length});
		 array = array.sort(function(a,b){return a.length - b.length});

		for (i=0; i < res.length;i++) 
			txt = txt  + array[i];
	    
	       
	  	return txt;

	}
	
	
	
	



});

var p_8 = Class.extend({

	name:"",
	isPrimaryKey:false,
	isNull:false,
	idx:0,
	value:"",
	construct:function(name,isPrimaryKey,isNull,idx,value){
		this.name = name;
		this.isPrimaryKey = isPrimaryKey;
		this.isNull = isNull;
		this.id=idx;
		this.value = value;	  
	}

});



var p_9 = Class.extend({
	code:"",
	h_7Table:function(res,category){
		this.code = "<table id=\"res_table\">";			
		this.code = this.code + "<tbody>";
		var i=0;

			this.code = this.code + "<tr>";
  			this.code = this.code + "<th>Foto</th>";
		    this.code = this.code + "<th>Categoria</th>";
		    this.code = this.code + "<th>Prezzo</th>";
		    this.code = this.code + "<th>Dove</th>";
		    this.code = this.code + "<th>Titolo</th>";
		    this.code = this.code +  "</tr>";

		for(i=0;i<res.length;i++){
			this.code = this.code + "<tr onclick=\"javascript:startAdvDimmicosavuoiUrl('" + res[i].url + "');\">";
  			this.code = this.code + "<td><img src=\"" + res[i].photoPath + "\"></td>";
		    this.code = this.code + "<td>" + category + "</td>";
		    this.code = this.code + "<td>" + res[i].price + " euro </td>";
		    this.code = this.code + "<td>" + res[i].place + "</td>";
		    this.code = this.code + "<td>" + res[i].title + "</td>";
		    this.code = this.code +  "</tr>";
			

		}
			this.code = this.code + "</tbody>";
			this.code = this.code + "</table>";
		return this.code;
	},
	
	h_7TableAdv:function(res,category){
		this.code = "<table id=\"res_table\">";			
		this.code = this.code + "<tbody>";
		var i=0;

			this.code = this.code + "<tr>";
  			this.code = this.code + "<th>Risultati</th>";
		    this.code = this.code + "<th>Foto</th>";
		    this.code = this.code + "<th>WEB</th>";
		    this.code = this.code +  "</tr>";

		for(i=0;i<res.length;i++){

			this.code = this.code + "<tr onclick=\"javascript:startAdvUrl('" + res[i].url + "','" + i + "');\">";  			
		    this.code = this.code + "<td>" + res[i].numRes + "</td>";
  			this.code = this.code + "<td><img src=\"" + res[i].photoPath + "\"></td>";
		    this.code = this.code + "<td>" + res[i].title + "</td>";
		    this.code = this.code +  "</tr>";
			

		}
			this.code = this.code + "</tbody>";
			this.code = this.code + "</table>";
		return this.code;
	},

	/* icon;site;name;album;author;visited;score; */
	h_7TableSong:function(res){
		this.code = "<table id=\"res_table\">";			
		this.code = this.code + "<tbody>";
		var i=0;

			this.code = this.code + "<tr>";
  			this.code = this.code + "<th>Icona</th>";
		    this.code = this.code + "<th>Web</th>";
		    this.code = this.code + "<th>Canzone</th>";
		    this.code = this.code + "<th>Album</th>";
		    this.code = this.code + "<th>Autore</th>";
		    this.code = this.code + "<th>Visite</th>";
		    this.code = this.code + "<th>Punteggio</th>";
		    this.code = this.code +  "</tr>";

		for(i=0;i<res.length;i++){
		
			if(res[i] == undefined) continue;  
			this.code = this.code + "<tr onclick=\"javascript:startSonp7('" + res[i].url + "','" + i + "');\">";  			
  			this.code = this.code + "<td><img src=\"" + "./image/" + res[i].engine + ".jpg" + "\"></td>";
		    this.code = this.code + "<td>" + res[i].engine + "</td>";
		    this.code = this.code + "<td>" + res[i].name.replaceAll_("\\'","'") + "</td>";
		    this.code = this.code + "<td>" + res[i].album.replaceAll_("\\'","'"); + "</td>";
		    this.code = this.code + "<td>" + res[i].author.replaceAll_("\\'","'"); + "</td>";
		    this.code = this.code + "<td>" + res[i].visited + "</td>";
		    this.code = this.code + "<td>" + res[i].score + "</td>";
		    this.code = this.code +  "</tr>";
			

		}
			this.code = this.code + "</tbody>";
			this.code = this.code + "</table>";
		return this.code;
	},


	h_7TableSenSon:function(res){
		this.code = "<table id=\"res_table\">";			
		this.code = this.code + "<tbody>";
		var i=0;


			this.code = this.code + "<tr>";
  			this.code = this.code + "<th>foto</th>";
		    this.code = this.code + "<th>Strofa</th>";
		    this.code = this.code + "<th>Canzone</th>";
		    this.code = this.code + "<th>Album</th>";
		    this.code = this.code + "<th>Autore</th>";
		    this.code = this.code + "<th>Visite</th>";
		    this.code = this.code + "<th>Punteggio</th>";
		    this.code = this.code +  "</tr>";

		for(i=0;i<res.length;i++){
			if(res[i] == undefined || res[i].trim().length == 0) continue;
			var array  =  res[i].splitEx();
			if(array.length < 4) continue;			
			var sen    =  array[0].trim();
			var author =  array[1].trim().replaceAll("%20"," ");		
			var album  =  array[2].trim();
			var name   =  array[3].trim(); 
			var path = author + "/" + album + "/" + name + "/" + sen 



			this.code = this.code + "<tr onclick=\"javascript:parent.render.selector.h_7SongLinks('" + i + "');\">";  			
  			this.code = this.code +  "<td onMouseover=\"javascript:showhint('" + i + "',this, event, '700px');\">" + "<img src=\"" + "./image/" + author.urlEncoder() + ".jpg" + "\"></td>";
// 			this.code = this.code +  "<td onMouseover=\"javascript:showhint('" + i + "',this, event, '700px');\">" + sen + "</td>";
 			this.code = this.code +  "<td>" + sen + "</td>";
		    this.code = this.code + "<td>" + name + "</td>";
		    this.code = this.code + "<td>" + album + "</td>";
		    this.code = this.code + "<td>" + author + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code +  "</tr>";
			

		}
			this.code = this.code + "</tbody>";
			this.code = this.code + "</table>";
		return this.code;
	},

	h_7TableSenPoetry:function(res){
		this.code = "<table id=\"res_table\">";			
		this.code = this.code + "<tbody>";
		var i=0;


			this.code = this.code + "<tr>";
  			this.code = this.code + "<th>foto</th>";
		    this.code = this.code + "<th>Verso</th>";
		    this.code = this.code + "<th>Poesia</th>";
		    this.code = this.code + "<th>Opera</th>";
		    this.code = this.code + "<th>Autore</th>";
		    this.code = this.code + "<th>Visite</th>";
		    this.code = this.code + "<th>Punteggio</th>";
		    this.code = this.code +  "</tr>";

		for(i=0;i<res.length;i++){
			if(res[i] == undefined || res[i].trim().length == 0) continue;
			var array  =  res[i].splitEx();
			if(array.length < 4) continue;			
			var sen    =  array[0].trim();
			var author =  array[1].trim().replaceAll("%20"," ");		
			var album  =  array[2].trim();
			var name   =  array[3].trim(); 
			var path = author + "/" + album + "/" + name + "/" + sen 



			this.code = this.code + "<tr onclick=\"javascript:parent.render.selector.h_7PoetryLinks('" + i + "');\">";  			
  			this.code = this.code +  "<td onMouseover=\"javascript:showhint('" + i + "',this, event, '700px');\">" + "<img src=\"" + "./image/" + author.urlEncoder() + ".jpg" + "\"></td>";
// 			this.code = this.code +  "<td onMouseover=\"javascript:showhint('" + i + "',this, event, '700px');\">" + sen + "</td>";
 			this.code = this.code +  "<td>" + sen + "</td>";
		    this.code = this.code + "<td>" + name + "</td>";
		    this.code = this.code + "<td>" + album + "</td>";
		    this.code = this.code + "<td>" + author + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code +  "</tr>";
			

		}
			this.code = this.code + "</tbody>";
			this.code = this.code + "</table>";
		return this.code;
	},



	h_7TableAuthors:function(authors){
		this.code = "<table id=\"res_table\">";			
		this.code = this.code + "<tbody>";
		var i=0;


		this.code = this.code + "<tr>";
  		this.code = this.code + "<th>foto</th>";
		this.code = this.code + "<th>Autore</th>";
		this.code = this.code + "<th>Numero Album</th>";
		this.code = this.code + "<th>Numero Canzoni</th>";
		this.code = this.code + "<th>Visite</th>";
		this.code = this.code + "<th>Punteggio</th>";
		this.code = this.code +  "</tr>";
		var res = authors.split("\n");
		res = res.sort();
		
		for(i=0;i<res.length;i++){
			if(res[i] == undefined || res[i].trim().length == 0) continue;
			var array  =  res[i].split(";");
			var author =  array[0].trim();		
			var album  =  array[1].trim();
			var name   =  array[2].trim(); 




			this.code = this.code + "<tr onclick=\"javascript:parent.f_9.h_7TableAuthor('" + author + "');\">";  			
  			this.code = this.code +  "<td>" + "<img src=\"" + "./image/" + author.urlEncoder() + ".jpg" + "\"></td>";
		    this.code = this.code + "<td>" + author + "</td>";
		    this.code = this.code + "<td>" + album + "</td>";
		    this.code = this.code + "<td>" + name + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code +  "</tr>";
			

		}
			this.code = this.code + "</tbody>";
			this.code = this.code + "</table>";
		return this.code;
	},


	h_7TableAuthorsPoetry:function(authors){
		this.code = "<table id=\"res_table\">";			
		this.code = this.code + "<tbody>";
		var i=0;


		this.code = this.code + "<tr>";
  		this.code = this.code + "<th>foto</th>";
		this.code = this.code + "<th>Autore</th>";
		this.code = this.code + "<th>Numero Opere</th>";
		this.code = this.code + "<th>Numero Poesie</th>";
		this.code = this.code + "<th>Visite</th>";
		this.code = this.code + "<th>Punteggio</th>";
		this.code = this.code +  "</tr>";
		var res = authors.split("\n");
		res = res.sort();
		
		for(i=0;i<res.length;i++){
			if(res[i] == undefined || res[i].trim().length == 0) continue;
			var array  =  res[i].split(";");
			var author =  array[0].trim();		
			var album  =  array[1].trim();
			var name   =  array[2].trim(); 




			this.code = this.code + "<tr onclick=\"javascript:parent.f_9.h_7TableAuthorPoetry('" + author + "');\">";  			
  			this.code = this.code +  "<td>" + "<img src=\"" + "./image/" + author.urlEncoder() + ".jpg" + "\"></td>";
		    this.code = this.code + "<td>" + author + "</td>";
		    this.code = this.code + "<td>" + album + "</td>";
		    this.code = this.code + "<td>" + name + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code +  "</tr>";
			

		}
			this.code = this.code + "</tbody>";
			this.code = this.code + "</table>";
		return this.code;
	},

	h_7TableAuthor:function(res){
	
		
		
		this.code = "<table id=\"res_table\">";			
		this.code = this.code + "<tbody>";
		var i=0;


		this.code = this.code + "<tr>";
  		this.code = this.code + "<th>foto</th>";
		this.code = this.code + "<th>Autore</th>";
		this.code = this.code + "<th>Canzone</th>";
		this.code = this.code + "<th>Album</th>";
		this.code = this.code + "<th>Visite</th>";
		this.code = this.code + "<th>Punteggio</th>";
		this.code = this.code +  "</tr>";
		
		for(i=0;i<res.length;i++){
			if(res[i] == undefined || res[i].trim().length == 0) continue;
			var array  =  res[i].split(";");
			var author =  array[0].trim();		
			var name  =   array[1].trim();
			var album   =  array[2].trim(); 




			this.code = this.code + "<tr onclick=\"javascript:parent.f_9.h_7TableSong(" + i + ");\">";  			
  			this.code = this.code +  "<td>" + "<img src=\"" + "./image/" + author.urlEncoder() + ".jpg" + "\"></td>";
		    this.code = this.code + "<td>" + author + "</td>";
		    this.code = this.code + "<td>" + name + "</td>";
		    this.code = this.code + "<td>" + album + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code +  "</tr>";
			

		}
			this.code = this.code + "</tbody>";
			this.code = this.code + "</table>";
		return this.code;
	},



	h_7TableAuthorPoetry:function(res){
	
		
		
		this.code = "<table id=\"res_table\">";			
		this.code = this.code + "<tbody>";
		var i=0;


		this.code = this.code + "<tr>";
  		this.code = this.code + "<th>foto</th>";
		this.code = this.code + "<th>Autore</th>";
		this.code = this.code + "<th>Poesia</th>";
		this.code = this.code + "<th>Opera</th>";
		this.code = this.code + "<th>Visite</th>";
		this.code = this.code + "<th>Punteggio</th>";
		this.code = this.code +  "</tr>";
		
		for(i=0;i<res.length;i++){
			if(res[i] == undefined || res[i].trim().length == 0) continue;
			var array  =  res[i].split(";");
			var author =  array[0].trim();		
			var name  =   array[1].trim();
			var album   =  array[2].trim(); 




			this.code = this.code + "<tr onclick=\"javascript:parent.f_9.h_7TablePoetry(" + i + ");\">";  			
  			this.code = this.code +  "<td>" + "<img src=\"" + "./image/" + author.urlEncoder() + ".jpg" + "\"></td>";
		    this.code = this.code + "<td>" + author + "</td>";
		    this.code = this.code + "<td>" + name + "</td>";
		    this.code = this.code + "<td>" + album + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code + "<td>" + "0" + "</td>";
		    this.code = this.code +  "</tr>";
			

		}
			this.code = this.code + "</tbody>";
			this.code = this.code + "</table>";
		return this.code;
	}


});


function Advertise(id,title,text,price,startDate,photoPath,place,url){
            this.id = id;
            this.title  = title;
            this.text = text;
            this.price = price;
            this.startDate = startDate;
 			this.photoPath=photoPath;
			this.place=place;
			this.url=url;
			this.className ="advertise";
			this.modified=false;
			UnregisteredUser.prototype.getID=function(){
				return this.id; 
			};

			UnregisteredUser.prototype.clone=function(adv){
				this.id = adv.id;
				this.title  = adv.title;
				this.text = adv.text;
				this.price = adv.price;
				this.startDate = adv.startDate;
				this.photoPath=adv.photoPath;
				this.place =adv.place;
				this.url =adv.url;
				this.modified=adv.modified;
				return this;
			};
	
	
}

function p_5(){
            this.id;
            this.title;
            this.text;
            this.price;
            this.startDate;
			this.photoPath;
            this.place;
            this.url;
            this.absUrl;
			this.className ="advertise";
			this.modified=false;
			p_5.prototype.getID=function(){
				return this.id; 
			};

			p_5.prototype.clone=function(adv){
				this.id = adv.id;
				this.title  = adv.title;
				this.text = adv.text;
				this.price = adv.price;
				this.startDate = adv.startDate;
				this.photoPath=adv.photoPath;
				this.place =adv.place;
				this.url =adv.url;
				this.absUrl = adv.absUrl;
				this.modified=adv.modified;
				return this;
			};

			p_5.prototype.toArray=function(){
				var array=[];
				array[array.length]=  this.photoPath;
				array[array.length] = this.place;
				array[array.length]  = this.price;
				array[array.length] = this.title;
				array[array.length] = this.startDate;
				return array;
			};
	
	
}

function p_5Adv(numRes,title,photoPath,url){
            this.numRes=numRes; 
            this.title=title;
			this.photoPath=photoPath;
            this.url=url;
			this.className ="p_5Adv";
			this.modified=false;
			p_5.prototype.getID=function(){
				return this.id; 
			};


			p_5.prototype.toArray=function(){
				var array=[];
				array[array.length]=  this.numRes
				array[array.length] = this.photoPath;
				array[array.length]  = this.title;
				array[array.length] = this.url;
				return array;
			};
	
	
}


function ResultList(dirPath){
			this.className=dirPath;
			this.res= [];
			this.modified=false;
			
			ResultList.prototype.getID=function(){
				return this.className; 
			};

			ResultList.prototype.clone=function(resList){
				this.className = resList.className;
				var i=0;
				for(val in resList.res){
					if(resList.res[i] == undefined) break;
					this.res[i] = resList.res[i];
					i++;
					
				}

				this.modified = resList.modified;

				return this;
			};
			

}



/* function Advertise(id,name,desc,text,price,startDate,endDate,photoPath){

var adv = new Advertise("10-1-1","Vendo appartamento in provincia di Milano","Splendido appartamento.....","vendo in provincia di milano meraviglioso appartamento dotato di tutti i comfort ","150000","01/02/2010","01/02/2010","C:/aladinSearch/app/advertise/80.jpg");

var p_4 = new VirtualStorage();


p_4.save(adv);

var remoteSrv = new Remoteh_1();

var res = remoteSrv.getResults("C:/aladinSearch/app/dbfs/case/Vorrei/acquistare/un appartamento",new ResultList("C:/aladinSearch/app/dbfs/case/Vorrei/acquistare/un appartamento"));
*/



