var mse_Url = function(u){

    this.character = [
                      {'decoded': '$',
                       'encoded': '%24'},
                      {'decoded': '&',
                       'encoded': ' and '},                       
                      {'decoded': '+',
                       'encoded': '%2B'},
                      {'decoded': ',',
                       'encoded': '%2C'},
                      {'decoded': '/',
                       'encoded': '%2F'},
                      {'decoded': ':',
                       'encoded': '%3A'},                       
                      {'decoded': ';',
                       'encoded': '%3B'},
                      {'decoded': '=',
                       'encoded': '%3D'},
                      {'decoded': '?',
                       'encoded': '%3F'},
                      {'decoded': '@',
                       'encoded': '%40'},

                      {'decoded': ' ',
                       'encoded': '%20'},
                      {'decoded': '"',
                       'encoded': '%22'},                       
                      {'decoded': '<',
                       'encoded': '%3C'},
                      {'decoded': '>',
                       'encoded': '%3E'},
                      {'decoded': '#',
                       'encoded': '%23'},
                      {'decoded': '%',
                       'encoded': '%25'},                       
                      {'decoded': '{',
                       'encoded': '%7B'},
                      {'decoded': '}',
                       'encoded': '%7D'},
                      {'decoded': '|',
                       'encoded': '%7C'},
                      {'decoded': '\\',
                       'encoded': '%5C'},
                      {'decoded': '^',
                       'encoded': '%5E'},
                      {'decoded': '~',
                       'encoded': '%7E'},
                      
                      {'decoded': '[',
                       'encoded': '%5B'},
                      {'decoded': ']',
                       'encoded': '%5D'},
                      {'decoded': '`',
                       'encoded': '%60'}
    ];






    this.url=u;
  
    
  
  this.encode= function(){
  
  this.str="";
  

  
    for(var i=0;i<this.url.length;i++)
    {

      this.sub="";
    
      for(var j=0;j<this.character.length;j++)
      {
      
        if(this.url.substring(i,(i+1))==this.character[j].decoded)
        {
        
          this.sub = this.character[j].encoded;
        }

      
      }
    
      if(this.sub=="")
      {
      
        this.str+=this.url.substring(i,(i+1))
      
      }else
      {
      
        this.str+=this.sub;
      
      }
    
    
    }
  
 // alert(this.str);
  
    return this.str;
  
  
  }

  
  this.decode= function(){
  
  this.str="";
  

  
    for(var i=0;i<this.url.length;i++)
    {

      this.sub="";
    
      for(var j=0;j<this.character.length;j++)
      {
  

      
        if(this.url.substring(i,(i+3))==this.character[j].encoded)
        {
        

        
          this.sub = this.character[j].decoded;
        }
      
      
      }
    
      if(this.sub=="")
      {
      
        this.str+=this.url.substring(i,(i+1))
      
      }else
      {
      
        this.str+=this.sub;
      i=i+2;
      }
    
    
    }
  
    return this.str;
  
  
  }


}
