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	m_9 = Class.extend({

		utf8_encode : function (string) {
			string = string.replace(/\r\n/g,"\n");
			var utftext = "";
	 
			for (var n = 0; n < string.length; n++) {
	 
				var c = string.charCodeAt(n);
	 
				if (c < 128) {
					utftext += String.fromCharCode(c);
				}
				else if((c > 127) && (c < 2048)) {
					utftext += String.fromCharCode((c >> 6) | 192);
					utftext += String.fromCharCode((c & 63) | 128);
				}
				else {
					utftext += String.fromCharCode((c >> 12) | 224);
					utftext += String.fromCharCode(((c >> 6) & 63) | 128);
					utftext += String.fromCharCode((c & 63) | 128);
				}
	 
			}
	 
			return utftext;
		},
	 
		// private method for UTF-8 decoding
		utf8_decode : function (utftext) {
			var string = "";
			var i = 0;
			var c = c1 = c2 = 0;
	 
			while ( i < utftext.length ) {
	 
				c = utftext.charCodeAt(i);
	 
				if (c < 128) {
					string += String.fromCharCode(c);
					i++;
				}
				else if((c > 191) && (c < 224)) {
					c2 = utftext.charCodeAt(i+1);
					string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
					i += 2;
				}
				else {
					c2 = utftext.charCodeAt(i+1);
					c3 = utftext.charCodeAt(i+2);
					string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
					i += 3;
				}
	 
			}
	 
			return string;
		},
	
	  q1:function(txt,p9,key){
		txt = txt.substr(0,txt.indexOf("<option value="));

			 for (i=0;i<p9.length;i++)
			   {
				var value = this.z6(p9[i].firstChild.nodeValue);

			    if(key == value ){
			    		continue;
			    	}
			    else
			      try
			         {
			         txt= txt + "<option value=\"" + value + "\">" + value + "</option>" ;
			         }
			       catch (er)
			         {
			         txt= txt + "<option value=\"" + value + "\">" + value + "</option>" ;
			         }
			  }


			   txt= txt + "</select>";

			return txt;
	 },
	 
  	 z6:function(str){
  			if(str.charCodeAt(str.length -1) == 10 || str.charCodeAt(str.length -1) == 13)
  				str = str.substring(0,str.length -1);

  			if(str.charCodeAt(str.length -1) == 10 || str.charCodeAt(str.length -1) == 13)
  				str = str.substring(0,str.length -1);

  		return str.trim();
  	 },

	 
	 s5:function (txt,p9,key){
	 
	 var go=false;
		return txt;	
		txt = txt.substr(0,txt.indexOf("<option value="));
		 for (i=0;i<p9.length;i++)
		   {
			var value = this.z6(p9[i].firstChild.nodeValue);

		    if( key == this.z6(p9[i].firstChild.nodeValue)){
		    		go = true;
		    		continue;
		    	}
		    if(go)
		      try
		         {
			         txt= txt + "<option value=\"" + value + "\">" + value + "</option>" ;
		         }
		       catch (er)
		         {
			         txt= txt + "<option value=\"" + value + "\">" + value + "</option>" ;
		         }
		  }

		   txt= txt + "</select>";
		   return txt;
		},
	 AddItem:function(Text,Value){
        // Create an Option object
        var opt = document.createElement("option");

        // Add an Option object to Drop Down/List Box
        document.getElementById("DropDownList").options.add(opt);
        // Assign text and value to Option object
        opt.text = Text;
        opt.value = Value;

    },

  	listDays:function(list){
 			var i=0;
 			var e5=null;
 			var dayOfTheWeek="";
 			var day="";
 			var month="";
 			var year="";

 			for(i=0; i < 30;i++){
 				var myOption ="";
 				myOption = document.createElement("Option");
 				e5 = new Date(this.e5.getTime() + 24 * 60 * 60 * 1000 * i);
    			month = m_2.r2(e5.getMonth());
    			day = e5.getDate();
    			dayOfTheWeek = dayNumber2Name(e5.getDay());
    			myOption.text = dayOfTheWeek + " " + day + " " + month + " " + year;
    			myOption.value = e5;
    			list.add(myOption);

  			}
  	},


	 r2:function(monthNumber){
		switch(monthNumber){
		case 1:
		case "1":
		case "01":
		case "gennaio":
			return "JAN";
		case 2:
		case "2":
		case "02":
		case "febbraio":
			return "FEB";
		case 3:
		case "3":
		case "03":
		case "marzo":
			return "MAR";
		case 4:
		case "4":
		case "04":
		case "aprile":
			return "APR";
		case 5:
		case "5":
		case "05":
		case "maggio":
			return "MAY";
		case 6:
		case "6":
		case "06":
		case "giugno":
			return "JUN";
		case 7:
		case "7":
		case "07":
		case "luglio":
			return "JUL";
		case 8:
		case "8":
		case "08":
		case "agosto":
			return "AUG";
		case 9:
		case "9":
		case "09":
		case "settembre":
			return "SEP";
		case 10:
		case "10":
		case "ottobre":
			return "OCT";
		case 11:
		case "11":
		case "novembre":
			return "NOV";
		case 12:
		case "12":
		case "dicembre":
			return "DEC";

		default:
			return "not l_9";
		}

	},

deletePrefix:function(str){
	if(str.indexOf("di ") == 0)
		return str.substring("di ".length,str.length);
	if(str.indexOf("del ") == 0)
		return str.substring("del ".length,str.length);
	if(str.indexOf("dell` ") == 0)
		return str.substring("dell` ".length,str.length);
	if(str.indexOf("della ") == 0)
		return str.substring("della ".length,str.length);

	return str;
},

  replaceAx:function(str){
      while(str.indexOf("Dell`") >= 0)
    		str = str.replace("Dell`","Dell'");
      while(str.indexOf("dell`") >= 0)
    		str = str.replace("dell`","dell'");
      while(str.indexOf("All`") >= 0)
    		str = str.replace("All`","All'");
      while(str.indexOf("all`") >= 0)
    		str = str.replace("all`","all'");
      while(str.indexOf("a`") >= 0)
    		str = str.replace("a`","à");
      while(str.indexOf("e`") >= 0)
    		str = str.replace("e`","è");
      while(str.indexOf("i`") >= 0)
    		str = str.replace("i`","ì");
      while(str.indexOf("o`") >= 0)
    		str = str.replace("o`","ò");
      while(str.indexOf("u`") >= 0)
    		str = str.replace("u`","ù");
      while(str.indexOf("un`") >= 0)
    		str = str.replace("un`","un'");
      while(str.indexOf("Lago") >= 0)
    		str = str.replace("Lago","");
    		
  	 return str;
  },


  ac:function(str){
      while(str.indexOf("#aacuto") >= 0)
    		str = str.replace("#aacuto","à");
      while(str.indexOf("#eacuto") >= 0)
    		str = str.replace("#eacuto","è");
      while(str.indexOf("#iacuto") >= 0)
    		str = str.replace("#iacuto","ì");
      while(str.indexOf("#oacuto") >= 0)
    		str = str.replace("#oacuto","ò");
      while(str.indexOf("#uacuto") >= 0)
    		str = str.replace("#uacuto","ù");

      while(str.indexOf("#egrave") >= 0)
    		str = str.replace("#egrave","é");

    		
  	 return str;
  },
  
  replaceCode:function(str){
  
        while(str.indexOf("%") >= 0)
    		str = str.replace("%","?");
        while(str.indexOf("`e") >= 0)
    		str = str.replace("`e","è");
        while(str.indexOf("?P?") >= 0)
    		str = str.replace("?P?","<p style=\"margin-top: 0; margin-bottom: 0; margin-left: 100\">");
        while(str.indexOf("/P?") >= 0)
    		str = str.replace("/P?","</p>");
        while(str.indexOf("À") >= 0)
    		str = str.replace("À","&Agrave");
        while(str.indexOf("È") >= 0)
    		str = str.replace("È","&Egrave");
        while(str.indexOf("É") >= 0)
    		str = str.replace("É","&Eacute");
        while(str.indexOf("Ì") >= 0)
    		str = str.replace("Ì","&Igrave");
        while(str.indexOf("Ò") >= 0)
    		str = str.replace("Ò","&Ograve");
        while(str.indexOf("Ù") >= 0)
    		str = str.replace("Ù","&Ugrave");


/*à &agrave; 
è &egrave; 
é &eacute; 
ì &igrave; 
ò &ograve; 
ù &ugrave; 
À &Agrave; 
È &Egrave; 
É &Eacute; 
Ì &Igrave; 
Ò &Ograve; 
Ù &Ugrave; 
*/    		
    return str;		
		
  },

  restoreCode:function(str){
  
        while(str.indexOf("?") >= 0)
    		str = str.replace("?","%");
    return str;		
  },
  
  replace_:function(str){
      while(str.indexOf("_") >= 0)
    		str = str.replace("_","");
     while(str.indexOf("   ") >= 0)
    		str = str.replace("   "," ");
     while(str.indexOf("  ") >= 0)
    		str = str.replace("  "," ");
    		
  	 return str;
  },

 replaceSpaceWithUnderscore:function(str){
      while(str.indexOf(" ") >= 0)
    		str = str.replace(" ","_");    		
  	 return str;
  },
  
   replaceSpaceWithMinus:function(str){
      while(str.indexOf(" ") >= 0)
    		str = str.replace(" ","-");    		
  	 return str;
  },

   replaceDot:function(str){
      while(str.indexOf(".") >= 0)
    		str = str.replace(".","");    		
  	 return str;
  },

   replaceMinus:function(str){
      while(str.indexOf("-") >= 0)
    		str = str.replace("-","");    		
  	 return str;
  },


	arrayCompact:function(array) {
		var str="";
		var i=0;
		for(i=0; i < array.length;i++)
			if(array[i] != undefined)
				if(i==0)
					str = array[0];
				else
					str =  str + "\n" + array[i];
				 	 
			
		return str;
	}, 

   replaceSpaceWithPlus:function(str){
      while(str.indexOf(" ") >= 0)
    		str = str.replace(" ","+");    		
  	 return str;
  },

   replaceSpace:function(str){
      while(str.indexOf(" ") >= 0)
    		str = str.replace(" ","");    		
  	 return str;
  },

   replaceDot:function(str){
      while(str.indexOf(".") >= 0)
    		str = str.replace(".","");    		
  	 return str;
  },

   replaceSpaceWithPercent20:function(str){
      while(str.indexOf(" ") >= 0)
    		str = str.replace(" ","%20");    		
  	 return str;
  },

   replaceSpaceWithQ2520:function(str){
      while(str.indexOf(" ") >= 0)
    		str = str.replace(" ","Q2520");    		
  	 return str;
  },

   replaceAccentWithPer27:function(str){
      while(str.indexOf("`") >= 0)
    		str = str.replace("`","%27");    		
  	 return str;
  },


   replaceMinusWithQ2520:function(str){
      while(str.indexOf("-") >= 0)
    		str = str.replace("-","Q2520");    		
  	 return str;
  },

   replaceMinusWithQ252D:function(str){
      while(str.indexOf("-") >= 0)
    		str = str.replace("-","Q252D");    		
  	 return str;
  },

   replaceMinusWithPlus:function(str){
      while(str.indexOf("-") >= 0)
    		str = str.replace("-","+");    		
  	 return str;
  },

   replaceMinusWithUnderscore:function(str){
      while(str.indexOf("-") >= 0)
    		str = str.replace("-","_");    		
  	 return str;
  },

   replaceSlashWithPlus:function(str){
      while(str.indexOf("/") >= 0)
    		str = str.replace("/","+");    		
  	 return str;
  },


 replaceSpaceWithQ20:function(str){
   while(str.indexOf(" ") >= 0)
  		str = str.replace(" ","Q20");    		
		 return str;
	},

 replaceSpaceWithPer20:function(str){
   while(str.indexOf(" ") >= 0)
  		str = str.replace(" ","%20");    		
		 return str;
	},
	

 replaceSpaceWithSlash:function(str){
   while(str.indexOf(" ") >= 0)
  		str = str.replace(" ","/");    		
		 return str;
	},

 replaceDoubleSpace:function(str){
   while(str.indexOf("  ") >= 0)
  		str = str.replace("  "," ");    		
		 return str;
	},

 replaceSlashWithSpace:function(str){
   while(str.indexOf("/") >= 0)
  		str = str.replace("/"," ");    		
		 return str;
	},

 strangeFuzzy:function(str){
      while(str.indexOf(" ") >= 0)
    		str = str.replace(" ","%2520");
      while(str.indexOf("+") >= 0)
    		str = str.replace("+","%252B");
      while(str.indexOf("%20") >= 0)
    		str = str.replace("%20","%2520");
      while(str.indexOf("'") >= 0)
    		str = str.replace("'","%2527");
    		

    		  		
  	 return str;
	
 },

 strangeFuzzy252B:function(str){
      while(str.indexOf("+") >= 0)
    		str = str.replace("+","%252B");
    		  		
  	 return str;
	
 },


 isVoel:function(str){	
	 var letter = str.substring(0,1).toLowerCase();
		switch(letter){
		case "a":
		case "e":
		case "i":
		case "o":
		case "u":
			return true; 

		default:
			return false;
		}		
										
 },									 


 replaceUnderscoreWithSpace:function(str){
      while(str.indexOf("_") >= 0)
    		str = str.replace("_"," ");    		
  	 return str;
  },

 replaceMinusWithUnderscore:function(str){
      while(str.indexOf("-") >= 0)
    		str = str.replace("-","_");    		
  	 return str;
  },

 firstLowercase:function(str){
	
  	 return str.substring(0,1).toLowerCase() + str.substring(1,str.length);
  },


	 r3:function(pattern, list){
		var l_9=false;
		var ambiguous=false;
		var n=0;
        for (n=0;n<list.length;n++){
          if(list[n].value.toLowerCase().indexOf(pattern.toLowerCase())==0){
	        if(l_9)
				ambiguous=true;	
	        l_9=true;
          }
        }


        for (n=0;n<list.length;n++){
          if(list[n].value.toLowerCase().indexOf(pattern.toLowerCase())==0){
	        list.selectedIndex=n;
          break;
          }
        }

        if(n == list.length)
            if(pattern.length > 0)
           		 pattern = pattern.substring(0,pattern.length - 1);

	    document.getElementById('suggest').innerHTML=pattern;
		return ambiguous;

      },
      
	r2Ita:function (month){
		switch(month){
		case "1":
			return "Gennaio";
		case "2":
			return "Febbraio";
		case "3":
			return "Marzo";
		case "4":
			return "Aprile";
		case "5":
			return "Maggio";
		case "6":
			return "giugno";
		case "7":
			return "luglio";
		case "8":
			return "agosto";
		case "9":
			return "settembre";
		case "10":
			return "ottobre";
		case "11":
			return "novembre";
		case "12":
			return "dicembre";

		default:
			return "not l_9";

		}

	},
	
	dayNumber2Name:function(month){
		switch(day){
		case "1":
			return "Lunedi";
		case "2":
			return "Martedi";
		case "3":
			return "Mercoledi";
		case "4":
			return "Giovedi";
		case "5":
			return "Venerdi";
		case "6":
			return "Sabato";
		case "7":
			return "Domenica";

		default:
			return "not l_9";

		}

	},



	z61:function (month){
		switch(month){
		case 1:
		case "1":
			return "01";
		case 2:
		case "2":
			return "02";
		case 3:
		case "3":
			return "03";
		case 4:
		case "4":
			return "04";
		case 5:
		case "5":
			return "05";
		case 6:
		case "6":
			return "06";
		case 7:
		case "7":
			return "07";
		case 8:
		case "8":
			return "08";
		case 9:
		case "9":
			return "09";

		default:
			return month;

		}

	},
	

	countWords:function (str){
	 var i=0;
	 while(str.indexOf(" ") >=0){
		i++;
		str = str.substring(0,str.lastIndexOf(" "));
	 }
	 return i;
	 
	},
	
	
	getDate:function(){
	
		var d = new Date();

		var curr_date = d.getDate();
		
		if(curr_date < 10)
			curr_date = "0" + curr_date;

		var curr_month = d.getMonth() + 1;

		if(curr_month < 10)
			curr_month = "0" + curr_month; 
		
		var curr_year = d.getFullYear();

		return (curr_date + "/" + curr_month + "/" + curr_year);

	},

	getTime:function(){
	
		var d = new Date();

		var curr_hour = d.getHours();
		if(curr_hour < 10)
			curr_hour = "0" + curr_hour; 

		var curr_minute = d.getMinutes();

		if(curr_minute < 10)
			curr_minute = "0" + curr_minute; 

		var curr_sec = d.getSeconds();

		if(curr_sec < 10)
			curr_sec = "0" + curr_sec; 
		
		

		return (curr_hour + ":" + curr_minute + ":" + curr_sec);

	},

	

	
	isPast:function(date){
	
		var d_day = date.substring(0,2);
		
		var d_month = date.substring(3,5);
		
		var d_year = date.substring(6,10);
		
		var d = new Date();

		var curr_date = d.getDate();

		var curr_month = d.getMonth() + 1;

		var curr_year = d.getFullYear();

		if(curr_year > d_year) return true;

		if(curr_year <  d_year) return false;

		if(curr_month > d_month) return true;

		if(curr_month < d_month) return false;

		if(curr_date > d_day) return true;

		if(curr_date <= d_day) return false;

		

	},

	
	getDateFromString:function(date,time){
	
		var d_day = date.substring(0,2);
		
		var d_month = date.substring(3,5);
		
		var d_year = date.substring(6,10);
		
		var hour = time.substring(0,2);

		var min = time.substring(3,5);

		var sec = time.substring(6,8);



		
		var d = new Date(d_year,d_month - 1,d_day,hour,min,sec);
		
		return d;


	},

	maxLength:function(array){
		var i=0;
		var len=0;
		for(i=0;i<array.length;i++)
			if(array[i].length > len)
				len = array[i].length;
		return len;
	},
	
	
		 
	q4:function(filename, filetype){
	 if (filetype=="js"){ //if filename is a external JavaScript file
	  var fileref=document.createElement('script')
	  fileref.setAttribute("type","text/javascript")
	  fileref.setAttribute("src", filename)
	 }
	 else if (filetype=="css"){ //if filename is an external CSS file
	  var fileref=document.createElement("link")
	  fileref.setAttribute("rel", "stylesheet")
	  fileref.setAttribute("type", "text/css")
	  fileref.setAttribute("href", filename)
	 }
	 if (typeof fileref!="undefined")
	  document.getElementsByTagName("head")[0].appendChild(fileref)
	},

//q4("myscript.js", "js") 

sleep:function(seconds) {
    
    var start = new Date().getTime();
    while (new Date() < start + seconds*1000) {
    ;
    }
    return 0;
}

});


// Service -------------------------------------------------------------------------------------------------------------

  String.prototype.firstLowerCase = function() {
   return this.substring(0,1).toLowerCase() + this.substring(1,this.length);

 
  };

    String.prototype.normalizePath = function(){
                var a = this;
                a = a.replaceAll("…"," " );
                a = a.replaceAll("..."," ");
                a = a.replaceAll("..", " ");
                a = a.replaceAll(".", " ");
                a = a.replaceAll("(", " ");
                a = a.replaceAll(")", " ");
                a = a.replaceAll(":", " ");
                a = a.replaceAll("?", " ");
                a = a.replaceAll("!", " ");
                a = a.replaceAll(".", " ");
                a = a.replaceAll(",", " ");
                a = a.replaceAll("\"", " ");
                a = a.replaceAll("/", " ");
                a = a.replaceAll("      ", " ");
                a = a.replaceAll("     ", " ");
                a = a.replaceAll("    ", " ");
                a = a.replaceAll("   ", " ");
                a = a.replaceAll("  ", " ");

                a = a.trim();

                return a;


    };


  String.prototype.ac = function() {
	  var a= this;	
      while(a.indexOf("#aacuto") >= 0)
    		a = a.replace("#aacuto","à");
      while(a.indexOf("#eacuto") >= 0)
    		a = a.replace("#eacuto","è");
      while(a.indexOf("#iacuto") >= 0)
    		a = a.replace("#iacuto","ì");
      while(a.indexOf("#oacuto") >= 0)
    		a = a.replace("#oacuto","ò");
      while(a.indexOf("#uacuto") >= 0)
    		a = a.replace("#uacuto","ù");

      while(this.indexOf("#egrave") >= 0)
    		a = this.replace("#egrave","é");

    		
  	 return a;
 
  };

  String.prototype.acRev = function() {
	  var a= this;	
      while(a.indexOf("à") >= 0)
    		a = a.replace("à","#aacuto");
      while(a.indexOf("è") >= 0)
    		a = a.replace("è","#eacuto");
      while(a.indexOf("ì") >= 0)
    		a = a.replace("ì","#iacuto");
      while(a.indexOf("ò") >= 0)
    		a = a.replace("ò","#oacuto");
      while(a.indexOf("ù") >= 0)
    		a = a.replace("ù","#uacuto");

      while(this.indexOf("é") >= 0)
    		a = this.replace("é","#egrave");

    		
  	 return a;
 
  };

	  String.prototype.trim = function() {
			a = this.replace(/^\s+/, '');
			return a.replace(/\s+$/, '');
		};




	  String.prototype.cut = function(from,to) {
			if(this.indexOf(from) >=0 && this.indexOf(to) >= 0)
				return this.substring(0,this.indexOf(from)) + this.substring(this.indexOf(to) + to.length,this.length);
			else
			 return this;	
		};

	  String.prototype.allDigits = function(value) {
			var n=0;
			for (n = 0; n < value.length; n++)
			   if (!isDigit(value.charAt(n))) {
			      return false;
			   }
			return true;	   
	  };	
	  
	   String.prototype.replaceDoubleSpace = function(str){
			var str = this;
			while(str.indexOf("  ") >= 0)
	  			str = str.replace("  "," ");    		
				 return str;
	    };

	   String.prototype.numberOf = function(match){
			var str = this;
			var i=0;
			while(str.indexOf(match) >= 0){
		  		 str = str.replace("-"," ");    		
	  			 i++;
	  		}	     		
			return i;
	    };

	   String.prototype.replaceSpaceWithMinus = function(str){
			var str = this;
			while(str.indexOf(" ") >= 0)
	  			str = str.replace(" ","-");    		
				 return str;
	    };

	   String.prototype.replaceAll = function(search,replace){
			var str = this;			
			while(str.indexOf(search) >= 0)
	  			str = str.replace(search,replace);    		
				 return str;
	    };

	   String.prototype.replaceAllN = function(search,replace){
			var str = this;			
			return  str.replace("/" + search + "/g",replace);
	    };
	   String.prototype.replaceAll_ = function(search,replace){
			var todo = this;
			var str ="";
			var i=0;
			var array= todo.split(search);
			if(array.length == 1) return todo; 
			for(i=0;i<array.length;i++)
	  				if(i ==0)
	  					str = array[i] + replace;
	  				else if(i == array.length -1)
	  					str = str + array[i];    		
	  				else 
	  					str = str + array[i] + replace;    		
			return  str;
					
	    };
	    
	   String.prototype.replace_o_O_with_0 = function(str){
			var str = this;
			while(str.indexOf("o") >= 0)
	  			str = str.replace("o","0");    		
			while(str.indexOf("O") >= 0)
	  			str = str.replace("O","0");    		
				 return str;
	    };



	String.prototype.toCapitalCase = function() {
		var re = /\s/;
		var words = this.split(re);
		re = /(\S)(\S+)/;
		for (i = words.length - 1; i >= 0; i--) {
		re.exec(words[i]);
		words[i] = RegExp.$1.toUpperCase()
		+ RegExp.$2.toLowerCase();
		}
		return words.join(' ');
	}; 
	  function XmlHttp(i_8) {
	      this.i_8=i_8;
	      this.xmlhttp=null;
      };


	String.prototype.decodePath = function() {
		var str = this;
			str = str.replaceAll("%","\"");
			str = str.replaceAll("#","?");
			str = str.replaceAll("__",":");
			str = str.replaceAll("_",".");
		return str;
	}; 

	String.prototype.decodePathEx = function() {
		var str = this;
			str = str.replaceAll("%20"," ");
			str = str.replaceAll("%","\"");
			str = str.replaceAll("#","?");
			str = str.replaceAll("__",":");
			str = str.replaceAll("_",".");
			//str = str.replaceAll(" ","%20");
		return str;
	}; 


	

	String.prototype.encodePath = function() {
		var str = this;
			str = str.replaceAll("\"","%");
			str = str.replaceAll("?","#");
			str = str.replaceAll(":","__");
			str = str.replaceAll(".","_");
		return str;
	}; 

	String.prototype.lastLowerCase = function() {
		var str = this;
			str = str.substring(0,str.length -1) + str.substring(str.length -1,str.length).toLowerCase()
		return str;
	}; 

	String.prototype.splitEx= function() {
		var str = this;
		var array = [];
		var strTmp="";
		var arrFin=[];		
		array[0] = str.substring(str.lastIndexOf("-") + 1,str.length);
		strTmp = str.substring(0,str.lastIndexOf("-"));
		

		array[1] = strTmp.substring(strTmp.lastIndexOf("-") + 1,strTmp.length);

		strTmp = strTmp.substring(0,strTmp.lastIndexOf("-"));

		array[2] = strTmp.substring(strTmp.lastIndexOf("-") + 1,strTmp.length);

		array[3] = strTmp.substring(0,strTmp.lastIndexOf("-"));
		var i=0;
		
		for(i=0;i<4;i++)
			arrFin[3 - i] = array[i];
						


		
		
		return arrFin;
	}; 

	String.prototype.firstUpperCase = function() {
		var str = this;
			str =  str.substring(0,1).toUpperCase() + str.substring(1,str.length);
		return str;
	}; 


	String.prototype.normalize = function() {
		var str = this;
			str = str.replaceAll("      "," ");
			str = str.replaceAll("     "," ");
			str = str.replaceAll("    "," ");
			str = str.replaceAll("   "," ");
			str = str.replaceAll("  "," ");
			str = str.replaceAll("?","");
			str = str.replaceAll(":","");
			str = str.replaceAll(".","");
			str = str.replaceAll(";","");
			str = str.replaceAll("!","");
			
		return str;
	}; 
	
	
	String.prototype.filter = function() {
		var str = this;
		var i=0;
		var out="";
		for(i=0;i < str.length ; i++)
			if(str.charCodeAt(i) < 127 || str.charCodeAt(i) > 150) 
				if(i==0)
					out =  String.fromCharCode(str.charCodeAt(i));
				else
					out =  out  + String.fromCharCode(str.charCodeAt(i));
		return out;				
			
	}; 

 String.prototype.urlEncoder = function(){
	var str = this;
	str = str.replaceAll("à","%E0");
	str = str.replaceAll("á","%E1");
	str = str.replaceAll("â","%E2");
	str = str.replaceAll("ã","%E3");
	str = str.replaceAll("ä","%E4");
	str = str.replaceAll("å","%E5");
	str = str.replaceAll("æ","%E6");
	str = str.replaceAll("ç","%E7");
	str = str.replaceAll("è","%E8");
	str = str.replaceAll("é","%E9");
	str = str.replaceAll("ê","%EA");
	str = str.replaceAll("ë","%EB");
	str = str.replaceAll("ì","%EC");
	str = str.replaceAll("í","%ED");
	str = str.replaceAll("î","%EE");
	str = str.replaceAll("ï","%EF");
	str = str.replaceAll("ð","%F0");
	str = str.replaceAll("ñ","%F1");
	str = str.replaceAll("ò","%F2");
	str = str.replaceAll("ó","%F3");
	str = str.replaceAll("ô","%F4");
	str = str.replaceAll("õ","%F5");
	str = str.replaceAll("ö","%F6");
	str = str.replaceAll("÷","%F7");
	str = str.replaceAll("ø","%F8");
	str = str.replaceAll("ù","%F9");
	str = str.replaceAll("ú","%FA");
	str = str.replaceAll("û","%FB");
	str = str.replaceAll("ü","%FC");
	str = str.replaceAll("ý","%FD");
	str = str.replaceAll("þ","%FE");
	str = str.replaceAll("ÿ","%FF");

	str = str.replaceAll("´","%19");
	str = str.replaceAll("!","%21");
	str = str.replaceAll("\"","%22");
	str = str.replaceAll("#","%23");
	str = str.replaceAll("$","%24");
	//str = str.replaceAll("%","%25");
	str = str.replaceAll("&","%26");
	str = str.replaceAll("'","%27");
	str = str.replaceAll("(","%28");
	str = str.replaceAll(")","%29");
	str = str.replaceAll("*","%2A");
	str = str.replaceAll("+","%2B");
	str = str.replaceAll(",","%2C");
	str = str.replaceAll("-","%2D");
	str = str.replaceAll(".","%2E");
	str = str.replaceAll("/","%2F");
	str = str.replaceAll(":","%3A");
	str = str.replaceAll(";","%3B");
	str = str.replaceAll("<","%3C");
	str = str.replaceAll("=","%3D");
	str = str.replaceAll(">","%3E");
	str = str.replaceAll("?","%3F");
	str = str.replaceAll("@","%40");
	str = str.replaceAll("[","%5B");
	str = str.replaceAll("\\","%5C");
	str = str.replaceAll("]","%5D");
	str = str.replaceAll("^","%5E");
	str = str.replaceAll("_","%5F");
	str = str.replaceAll("`","%60");
	str = str.replaceAll("{","%7B");
	str = str.replaceAll("|","%7C");
	str = str.replaceAll("}","%7D");
	str = str.replaceAll("~","%7E");
	str = str.replaceAll("`","%92");	
	str = str.replaceAll("¢","%A2");
	str = str.replaceAll("£","%A3");
	str = str.replaceAll("¥","%A5");
	str = str.replaceAll("|","%A6");
	str = str.replaceAll("§","%A7");
	str = str.replaceAll("«","%AB");
	str = str.replaceAll("¬","%AC");
	str = str.replaceAll("¯","%AD");
	str = str.replaceAll("º","%B0");
	str = str.replaceAll("±","%B1");
	str = str.replaceAll("ª","%B2");
	str = str.replaceAll(",","%B4");
	str = str.replaceAll("µ","%B5");
	str = str.replaceAll("»","%BB");
	str = str.replaceAll("¼","%BC");
	str = str.replaceAll("½","%BD");
	str = str.replaceAll("¿","%BF");
	str = str.replaceAll("À","%C0");
	str = str.replaceAll("Á","%C1");
	str = str.replaceAll("Â","%C2");
	str = str.replaceAll("Ã","%C3");
	str = str.replaceAll("Ä","%C4");
	str = str.replaceAll("Å","%C5");
	str = str.replaceAll("Æ","%C6");
	str = str.replaceAll("Ç","%C7");
	str = str.replaceAll("È","%C8");
	str = str.replaceAll("É","%C9");
	str = str.replaceAll("Ê","%CA");
	str = str.replaceAll("Ë","%CB");
	str = str.replaceAll("Ì","%CC");
	str = str.replaceAll("Í","%CD");
	str = str.replaceAll("Î","%CE");
	str = str.replaceAll("Ï","%CF");
	str = str.replaceAll("Ð","%D0");
	str = str.replaceAll("Ñ","%D1");
	str = str.replaceAll("Ò","%D2");
	str = str.replaceAll("Ó","%D3");
	str = str.replaceAll("Ô","%D4");
	str = str.replaceAll("Õ","%D5");
	str = str.replaceAll("Ö","%D6");
	str = str.replaceAll("Ø","%D8");
	str = str.replaceAll("Ù","%D9");
	str = str.replaceAll("Ú","%DA");
	str = str.replaceAll("Û","%DB");
	str = str.replaceAll("Ü","%DC");
	str = str.replaceAll("Ý","%DD");
	str = str.replaceAll("Þ","%DE");
	//str = str.replaceAll("ß","%DF");
	str = str.replaceAll(" ","%20");

return str;
};

 String.prototype.plainText = function(){
	var str = this;
	str = str.replaceAll("à","a`");
	str = str.replaceAll("á","a´");
	str = str.replaceAll("è","e`");
	str = str.replaceAll("é","e´");
	str = str.replaceAll("ì","i`");
	str = str.replaceAll("í","i´");
	str = str.replaceAll("ò","o`");
	str = str.replaceAll("ó","o´");
	str = str.replaceAll("ù","u`");
	str = str.replaceAll("ú","u´");
	str = str.replaceAll("À","A`");
	str = str.replaceAll("Á","A´");
	str = str.replaceAll("È","E`");
	str = str.replaceAll("É","E´");
	str = str.replaceAll("Ì","I`");
	str = str.replaceAll("Í","I´");
	str = str.replaceAll("Ò","O`");
	str = str.replaceAll("Ó","O´");
	str = str.replaceAll("Ù","U`");
	str = str.replaceAll("Ú","U´");

return str;
};


var m_2 = new m_9();


