tag2script = function( texto ){
	var ini = 0;

	while ( ini!=-1 ){
		ini = texto.indexOf( '<script', ini );

		if ( ini >=0 ){

			ini = texto.indexOf( '>', ini ) + 1;
			var fim = texto.indexOf( '<\/script>', ini );
			codigo = texto.substring( ini, fim );

			eval( codigo );
		}
	}
}
var ajaxBox = function(){
	
	this.DisparaFormulario = function( elementJson )
	{
		
		elementJson      = eval( elementJson );	
		this.elementJson = elementJson;
		
		/* Definindo variaveis */
		this.a = eval('document.'+elementJson.NomeForm);
		this.b = elementJson.methodoForm;
		this.c = elementJson.urlRequest;
		this.e = elementJson.divCarregando;
		this.f = elementJson.msgCarregando;
		this.g = elementJson.divResposta;
		this.h = elementJson.Elementos;
		this.i = elementJson.classeRequerido;
		this.j = elementJson.classeNormal;
		this.y = elementJson.classeMsgRequerido;
		this.k = elementJson.Debug;
		this.l = elementJson.functionExecutaDepois;
		/*
			04.03.2009
			adicionado method de caracteres para sanar erro 403, acesso negado;
			fixChar
			
			this.fixChar
		*/
		/*
			22.08.2008
			adicionada função para, caso for enviar TODOS campos, não precisa definir um a um
			basta não definir nenhum
			'Elementos':[]
		*/
		if( this.h.length == 0 )
		{
			var populaValor;
			for( GetAllElements = 0; GetAllElements < this.a.elements.length; GetAllElements++ )
			{
				/*
					31.01.2009
					Verificando se o campo do tipo CHECKBOX foi marcado, para ser enviado em LOTE
				*/
				if( typeof( this.a.elements[ GetAllElements ].type) != 'undefined' && this.a.elements[ GetAllElements ].type == 'checkbox' )
				{	
					if( this.a.elements[ GetAllElements ].checked)
					{
						populaValor =  this.a.elements[ GetAllElements ].id + '='+ escape( this.a.elements[ GetAllElements ].value ) +'&'+ populaValor;
					}
						else
					{
						populaValor =  this.a.elements[ GetAllElements ].id + '=&'+ populaValor;	
					}
				} else {					
					populaValor = this.a.elements[ GetAllElements ].id + '='+ escape( this.a.elements[ GetAllElements ].value) +'&'+ populaValor;
				}
			}
			this.aa = populaValor;
			this.ajaxSend( this.b[1]);			
			
			return false;
		}
		
		/* Validando campos */
		for ( o = 0; o < this.h.length; o++){

			if( typeof( this.a.elements[ this.h[o].id] ) != 'undefined' )
			{
				
				if( this.a.elements[ this.h[o].id].id == this.h[o].id )
				{
					
					this.cleanElement( this.h[o].id);
					
					/* Validação de campo Requerido - CHECKBOX */
					if( this.h[o]['Requerido'] && !this.a.elements[ this.h[o].id].checked && this.a.elements[ this.h[o].id].type == 'checkbox' ) return this.valida( this.h[o], 'Requerido');
					
					/* Validação de campo Requerido - RADIO */
					if( this.h[o]['Requerido'] && !this.a.elements[ this.h[o].id].checked && this.a.elements[ this.h[o].id].type == 'radio' ) return this.valida( this.h[o], 'Requerido');
					
					/* Validação de campo Requerido - TEXT, TEXTAREA, PASSWORD, HIDDEN, SELECT-ONE, SELECT-MULTIPLE */
					if( !this.h[o]['tinyMCE'])
					{
						if( this.h[o]['Requerido'] && this.a.elements[ this.h[o].id].value == '' ) return this.valida( this.h[o], 'Requerido'); 
					}
					else{
						
						if( this.h[o]['Requerido'] && tinyMCE.getInstanceById( this.h[o].id).value == '' ) return this.valida( this.h[o], 'Requerido');
					}
					/* Validação do tamanho do campo e tipo[ texto, numero ]*/
					if( this.a.elements[this.h[o].id].type == 'text'       || 
						this.a.elements[this.h[o].id].type == 'textarea'   || 
						this.a.elements[this.h[o].id].type == 'password'   || 
						this.a.elements[this.h[o].id].type == 'hidden'
						){
					
						/* Validação quantidade minima de caracteres */
						if ( this.h[o]['Minimo']) if( parseInt( this.a.elements[ this.h[o].id].value.length ) < parseInt( this.h[o]['Minimo'][0] ) ) return this.valida( this.h[o], 'Minimo'); 
						
						/* Validação quantidade máxima de caracteres */
						if ( this.h[o]['Maximo']) if( parseInt( this.a.elements[ this.h[o].id].value.length ) > parseInt( this.h[o]['Maximo'][0] ) ) return this.valida( this.h[o], 'Maximo');
										
						/* Validação somente letras */
						if( this.h[o]['Somente'] == 'Letra'  && !(/^[a-zA-z]+$/.test( this.a.elements[ this.h[o].id].value )) ) return this.valida( this.h[o], 'Letra');
		
						/* Validação somente número */
						if( this.h[o]['Somente'] == 'Numero' && !(/^[0-9]+$/.test( this.a.elements[ this.h[o].id].value )) ) return this.valida( this.h[o], 'Numero');
					}
				}
			}
		}
		
		this.setValueRequest();
		
		// Debug;
		if ( typeof( this.k) != 'undefined') if( this.k[0] ) this.pre( this.h );
				
		return false;
	}
	
	this.criaElemento = function( base, elementBase, id, mensagen ){ 
	
		switch( base ){
		
			case 'Antes':
				if ( typeof( $( id)) != 'undefined') Element.remove( id);
				
					new Insertion.Before( this.a.elements[elementBase], '<div id="'+ id +'">'+ mensagen +'<\/div>' );
				
				$( elementBase).addClassName( this.i); 
				return false;
			break;
			
			case 'Depois':				
				if ( typeof( $( id)) != 'undefined') Element.remove( id);

					new Insertion.After( this.a.elements[elementBase], '<div id="'+ id +'">'+ mensagen +'<\/div>' ); 
				

				$( elementBase).addClassName( this.i);

				if ( typeof( this.y ) != 'undefined') $( id).addClassName( this.y);
				return false;
			break;	
		
		}		
		return false
	}
	this.cleanElement = function( e ){

		if ( typeof( $( 'R_'+e)) != 'undefined') Element.remove( 'R_'+e);  Element.removeClassName( $( e), this.i); 

	}
	this.fixChar = function( str )
	{
		var histogram = {}, tmp_arr = [];
		var ret = str.toString();
	 
		var replacer = function(search, replace, str) 
		{
			var tmp_arr = [];
			tmp_arr = str.split(search);
			return tmp_arr.join(replace);
		};
	 
		histogram['(']   = '(';
		histogram[')']   = ')';
		histogram['*']   = '~'; 
		histogram['~']   = '%7E';
		histogram['!']   = '!';
		histogram['\u20AC'] = '&#8364;';
		histogram['\u0081'] = '&#129;';
		histogram['\u201A'] = '&#8218;';
		histogram['\u0192'] = '&#402;';
		histogram['\u201E'] = '&#8222;';
		histogram['\u2013'] = '&shy;';
		histogram['\u2026'] = '&#8230;';
		histogram['\u2020'] = '&#8224;';
		histogram['\u2021'] = '&#8225;';
		histogram['\u02C6'] = '&#710;';
		histogram['\u2030'] = '&#8240;';
		histogram['\u0160'] = '&#352;';
		histogram['\u2039'] = '&#8249;';
		histogram['\u0152'] = '&#338;';
		histogram['\u008D'] = '&#141;';
		histogram['\u017D'] = '&#381;';
		histogram['\u008F'] = '&#143;';
		histogram['\u0090'] = '&#144;';
		histogram['\u2018'] = '&#8216;';
		histogram['\u2019'] = '&#8217;';
		histogram['\u201C'] = '&#8220;';
		histogram['\u201D'] = '&#8221;';
		histogram['\u2022'] = '&#8226;';
		histogram['\u2013'] = '&#8211;';
		histogram['\u2014'] = '&#8212;';
		histogram['\u02DC'] = '&#732;';
		histogram['\u2122'] = '&#8482;';
		histogram['\u0161'] = '&#353;';
		histogram['\u203A'] = '&#8250;';
		histogram['\u0153'] = '&#339;';
		histogram['\u009D'] = '&#157;';
		histogram['\u017E'] = '&#382;';
		histogram['\u0178'] = '&#376;';

		// Begin with encodeURIComponent, which most resembles PHP's encoding functions
		//ret = encodeURIComponent(ret);
	 
		// Restore spaces, converted by encodeURIComponent which is not rawurlencode compatible
		ret = replacer('%20', ' ', ret); // Custom replace. No regexing
	 
		for (search in histogram)
		{
			replace = histogram[search];
			ret = replacer(search, replace, ret) // Custom replace. No regexing
		}
	 
		// Uppercase for full PHP compatibility
		return ret.replace(/(\%([a-z0-9]{2}))/g, function(full, m1, m2)
		{
			return "%"+m2.toUpperCase();
		});

		return ret;
	}	
	this.setValueRequest = function(){
	
		var populaValor = 'Rand='+ this.r();
		var e = this.h;

		for ( i = 0; i < e.length; i++){
			if( typeof( $( e[ i].id).value ) == 'undefined' )
			{
				FixedValue  = this.fixChar( $( e[ i].id).innerHTML );
				populaValor = e[ i].id + '='+ escape( FixedValue ) +'&'+ populaValor;
			} else {				
				if( typeof($( e[ i].id).type) != 'undefined' && $( e[ i].id).type == 'checkbox' )
				{	
					if($( e[ i].id).checked)
					{
						FixedValue  = this.fixChar( $( e[ i].id).value  );
						populaValor = $( e[ i].id).id + '='+ escape( FixedValue ) +'&'+ populaValor;
					}
				} else if ( typeof( this.a.elements[ e[ i].id].type) == 'undefined')
				{
					
					for ( R = 0; R < this.a.elements[ e[ i].id].length; R++)
					{						
						if( this.a.elements[ e[ i].id][ R].checked)
						{
							FixedValue  = this.fixChar( this.a.elements[ e[ i].id][ R].value );
							populaValor = this.a.elements[ e[ i].id][ R].id + '='+ escape( FixedValue ) +'&'+ populaValor;	
						}
					}
				}
				
				else{
					if( !this.h[i]['tinyMCE'])
					{
						FixedValue  = this.fixChar( this.a.elements[ e[ i].id].value   );
						populaValor = e[ i].id + '='+ escape( FixedValue ) +'&'+ populaValor;
					}
					else{
						
						//var this_valor = tinyMCE.getInstanceById( e[ i].id); // this_valor.getHTML()
						var content = tinyMCE.getInstanceById(e[ i].id).getBody().innerHTML;
						var content = content.replace('<br mce_bogus="1">','');
						var content = this.fixChar( content,'HTML_SPECIALCHARS' );
						populaValor = e[ i].id + '='+ escape( content) +'&'+ populaValor;
					}
				}
			}	
		}
		this.aa = populaValor;

		this.ajaxSend( this.b[1]);
		
	}
	
	this.valida = function( e, tipo ){
		var e;
	
		switch( tipo){
		
			case 'Requerido':
				
				/* =============================================================================== */
				switch( e['MensagemResposta'][0] ){
				
					case 'Antes':
						if( e['MensagemResposta'][1] == 'Escreve' ){

						
							this.criaElemento( 'Antes', e.id, 'R_'+e.id, e['MensagemResposta'][2]);
						}
						else{
							alert( e['MensagemResposta'][2]);
							$( e.id).addClassName( this.i);
						}
						return false;
					break;	
					case 'Depois':

						if( e['MensagemResposta'][1] == 'Escreve' ){
						
							this.criaElemento( 'Depois', e.id, 'R_'+e.id, e['MensagemResposta'][2]);
						}
						else{
							alert( e['MensagemResposta'][2]);
							$( e.id).addClassName( this.i);
						}
						return false;
					break;
				}
				/* =============================================================================== */
			
			break;
				
			case 'Minimo':
			
				switch( e['Minimo'][1] ){
				
					case 'Antes':
						if( e['Minimo'][2] == 'Escreve' ){
						
							this.criaElemento( 'Antes', e.id, 'R_'+e.id, e['Minimo'][3]);
						}
						else{
							alert( e['Minimo'][3]);
							$( e.id).addClassName( this.i);
						}
						return false;
					break;	
					case 'Depois':
						if( e['Minimo'][2] == 'Escreve' ){
						
							this.criaElemento( 'Depois', e.id, 'R_'+e.id, e['Minimo'][3]);
						}
						else{
							alert( e['Minimo'][3]);
							$( e.id).addClassName( this.i);
						}
						return false;
					break;
				}
				
			break;

			case 'Maximo':
			
				switch( e['Maximo'][1] ){
				
					case 'Antes':
						if( e['Maximo'][2] == 'Escreve' ){
						
							this.criaElemento( 'Antes', e.id, 'R_'+e.id, e['Maximo'][3]);
						}
						else{
							alert( e['Maximo'][3]);
							$( e.id).addClassName( this.i);
						}
						return false;
					break;	
					case 'Depois':
						if( e['Maximo'][2] == 'Escreve' ){
						
							this.criaElemento( 'Depois', e.id, 'R_'+e.id, e['Maximo'][3]);
						}
						else{
							alert( e['Maximo'][3]);
							$( e.id).addClassName( this.i);
						}
						return false;
					break;
				}
						
			break;
			
			case 'Letra':

				switch( e['MensagemResposta'][0] ){
				
					case 'Antes':
					
						if (!(/^[a-zA-z]+$/.test( $( e.id ).value ))){
							
							if( e['MensagemResposta'][1] == 'Escreve' ){
							
								this.criaElemento( 'Depois', e.id, 'R_'+e.id, e['MensagemResposta'][2] );
							}
							else{
								alert( e['MensagemResposta'][2]);
								$( e.id).addClassName( this.i);
							}
							return false;				
						}
						
					break;	
					case 'Depois':

						if (!(/^[a-zA-z]+$/.test( $( e.id ).value ))){
							
							if( e['MensagemResposta'][1] == 'Escreve' ){
							
								this.criaElemento( 'Depois', e.id, 'R_'+e.id, e['MensagemResposta'][2] );
							}
							else{
								alert( e['MensagemResposta'][2]);
								$( e.id).addClassName( this.i);
							}
							return false;				
						}
						
						
					break;
				}
			
			break;
			
			case 'Numero':

				switch( e['MensagemResposta'][0] ){
				
					case 'Antes':
					
						if (!(/^[0-9]+$/.test( $( e.id ).value ))){
							
							if( e['MensagemResposta'][1] == 'Escreve' ){
							
								this.criaElemento( 'Depois', e.id, 'R_'+e.id, e['MensagemResposta'][2] );
							}
							else{
								alert( e['MensagemResposta'][2]);
								$( e.id).addClassName( this.i);
							}
							return false;				
						}

						
					break;	
					case 'Depois':

						if (!(/^[0-9]+$/.test( $( e.id ).value ))){
							
							if( e['MensagemResposta'][1] == 'Escreve' ){
							
								this.criaElemento( 'Depois', e.id, 'R_'+e.id, e['MensagemResposta'][2] );
							}
							else{
								alert( e['MensagemResposta'][2]);
								$( e.id).addClassName( this.i);
							}
							return false;				
						}
						
						
					break;
				}
			
			break;
		}
	}
	
	this.pre = function( e ){
		
		var populaValor = 'Rand - '+ this.r();
		var e;
		
		for ( i = 0; i < e.length; i++){
			if( typeof( $( e[ i].id).value ) == 'undefined' ){
			
				populaValor = e[ i].id + ' - '+ 
					
					$( e[ i].id).innerHTML +'<br />'+ populaValor;
			}
			else{
			
				populaValor = e[ i].id + ' - '+ 
					
					$( e[ i].id).value     +'<br />'+ populaValor;
			}	
		}
		
		$( this.k[ 1] ).innerHTML = populaValor;
		
	}
	
	this.r = function(){
	
		return Math.floor( Math.random() * 10 );
	}
	/*
		Criada por Felipe Olivaes ttr_validacao
		Valeu cara!
	*/
	this.ttrGetTop = function()
	{
		var ScrollTop = document.body.scrollTop;
		if (ScrollTop == 0){
			if (window.pageYOffset)
				ScrollTop = window.pageYOffset;
			else
				ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
		}
		return parseInt(ScrollTop);
	}
	
	this.ShowLoad = function()
	{	
		if( typeof( this.elementJson.divCarregando ) != 'undefined'  ){
		
			this.e = this.elementJson.divCarregando;
			
			if ( typeof( $( this.e[0] ) ) != 'undefined' ){
				
				$( this.e[0] ).style.top 	 = ( this.ttrGetTop() + 5 )+'px';
				$( this.e[0] ).style.display == '' || $( this.e[0] ).style.display == 'none' ? $( this.e[0] ).style.display = 'block' : $( this.e[0] ).style.display = 'none';	
				
				$( this.e[0] ).innerHTML = this.e[2];
			}
		}
	}

	/* Criando a estância de request */	
	this.callAjax = function(){
		try{
			y = new XMLHttpRequest();
		}catch(ee){
			try{
				y = new ActiveXObject("Msxml2.XMLHTTP");
			}catch(e){
				try{
					this.x = new ActiveXObject("Microsoft.XMLHTTP");
				}catch(E){
					y = false;
				}
			}
		}
	}	
	
	this.ajaxSend = function( RequestType ){

		switch ( RequestType ){

			case 'post':
			
			/* Mostramos Div de 'Carregando' e inserimos um texto de pré carregamento */
			this.ShowLoad();
			if ( typeof( this.f) != 'undefined') this.g[0].innerHTML = this.f;
			/* Mostramos Div de 'Carregando' e inserimos um texto de pré carregamento */
			
			this.callAjax();
			
			y.abort()

			y.open('POST', this.c, true);
			
			y.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; iso-8859-1");
			y.setRequestHeader("CharSet", "iso-8859-1")
			y.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
			y.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
			y.setRequestHeader("Pragma", "no-cache");

			y.send( this.aa );

			var arrayResposta 	= this.g;				
			y.onreadystatechange = function(){
				
				if ( y.readyState == 4){
	
					var Retorno   =y.responseText;

						tag2script( Retorno );
						
						for ( i = 0; i < arrayResposta.length; i++){

							$( arrayResposta[ i]).innerHTML =  Retorno;
							
						}					
						ajaxBox.ShowLoad();
				}
				
			}
			if ( typeof( this.l) != 'undefined') this.l();
			
			break;

			case 'get':
			
			/* Mostramos Div de 'Carregando' e inserimos um texto de pré carregamento */
			this.ShowLoad();
			if ( typeof( this.f) != 'undefined') this.g[0].innerHTML = this.f;
			/* Mostramos Div de 'Carregando' e inserimos um texto de pré carregamento */
										
			this.callAjax();
			y.abort()

			y.open('GET', this.c+"?"+this.aa,true);
			
			y.setRequestHeader("Content-Type", "text/html; charset=iso-8859-1");
			
			var arrayResposta = this.g;
			
			y.onreadystatechange = function(){
				
				if ( y.readyState == 4){
	
					var Retorno   = y.responseText;

						tag2script( Retorno );
						
						for ( i = 0; i < arrayResposta.length; i++){

							$( arrayResposta[ i]).innerHTML =  Retorno;
							
						}					
						ajaxBox.ShowLoad();
				}
				
			}
			y.send( null )
												
			break;
		}		
	
	}
		
	this.get = function( elementJson ){
		
		elementJson      = eval( elementJson );
		this.elementJson = elementJson;
		
		this.a 	 = elementJson.parametros;
		this.c 	 = elementJson.url;
		this.g 	 = elementJson.Resposta;
		this.d 	 = elementJson.methodo;
		this.f 	 = elementJson.query2ajax;
		this.e   = elementJson.divCarregando;
		this.aux = elementJson.auxiliar;
		
		this.o = elementJson.Confirmar;
		/*		
		Passar opção adicional &query=valor
		'auxiliar':['campo_id','query']
		*/
		if ( typeof( this.aux) != 'undefined')
		{
			elemento = eval('$("'+this.aux[0]+'")');
			this.a   = this.a+'&'+this.aux[1]+'='+elemento.value;
		}
		if ( typeof( this.o) != 'undefined')
		{	
			if ( this.o[0]){
				if ( confirm(this.o[1])){
		
					if (this.f) if ( this.f[0]) window.location.href = this.f[2]+'#'+this.f[1]+'&'+this.a;
					
					this.aa = encodeURI( this.a );
					
					this.ajaxSend( this.d);
				}
			}
			
		}
		else{
				if (this.f) if ( this.f[0]) window.location.href = this.f[2]+'#'+this.f[1]+'&'+this.a;
				
				this.aa = encodeURI( this.a );
				this.ajaxSend( this.d);				
			
		}		
	}
	this.url = function( Url, Resposta,Get)
	{
		this.callAjax();		
		y.abort()
		y.open('POST',  Url, true);		
		y.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; iso-8859-1");
		y.setRequestHeader("CharSet", "iso-8859-1")
		y.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
		y.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
		y.setRequestHeader("Pragma", "no-cache");		
		y.send( Get );
				
		y.onreadystatechange = function()
		{	
			if ( y.readyState == 4)
			{
				$(Resposta).innerHTML = y.responseText;
			}				
		}
	}
	
	this.getUrlFromAjax = function( elementJson ){
	
		elementJson      = eval( elementJson );
		this.elementJson = elementJson;
		
		this.url = window.location.href;
		
		this.g = elementJson.Resposta;
		this.c = elementJson.url;
		this.n = elementJson.Condicional;
		this.d = elementJson.methodo;
		
		if ( this.url.match('#') != null ){

			this.query       = this.url.split('#');
			this.Condicional = this.query[1].split('&');
			
			this.aa = encodeURI( this.Condicional[1] );
			if ( this.n == this.Condicional[0]) this.ajaxSend( this.d);
		}
	}
	
	this.onfly = function( elemento, options ){
		this.a = elemento;
		
		this.options = Object.extend(
									 	 {
											'methodo':'post',
											'botaoCancelar':['Cancelar!', ''],
											'botaoEnviar':  [ 'Enviar!', ''],
											'Resposta':[elemento]
										 }
									 , options || {}
									 );
		var pp = this.options.parametros;
		var uu = this.options.url;
		var mm = this.options.methodo;
		var aa = this.options.botaoCancelar;
		var bb = this.options.botaoEnviar;
		var rr = this.options.Resposta;
		
		var a = this.options.classMouseOver;
		var b = this.options.classEditando;
		var c = this.options.classDepois;
		this.$ = (
					{
						'over':function(){

									if( typeof( originalClass) == 'undefined' )originalClass = $( elemento).classNames()

									
									Element.show( elemento );
									$( elemento).addClassName( a);
									
						}
					,
						'out':function(){
								Element.removeClassName( $( elemento), a);
								Element.removeClassName( $( elemento), b);
								Element.removeClassName( $( elemento), c);
								$( elemento).addClassName( originalClass);
								
						}
					,
						'click':function(){
								this.cancelarOnfly = function(){

									Element.removeClassName( $( elemento), a);
									Element.removeClassName( $( elemento), b);
									Element.removeClassName( $( elemento), c);
									$( elemento).addClassName( originalClass);
									
									Element.remove( elemento+'_c_onfly');
									Element.remove( elemento+'_e_onfly');
									
									if ( typeof(X) != 'undefined')$( elemento).innerHTML = X;
									
									Element.show(elemento)
									Element.hide(elemento +'_onfly');
								}
								this.enviarOnfly = function(){
									var Retorno = function(R) {

										$( rr+'_onfly').value = $( elemento+'_onfly').value;
										X = R.responseText;
										
										Element.removeClassName( $( elemento), a);
										Element.removeClassName( $( elemento), b);
										Element.removeClassName( $( elemento), c);
										$( elemento).addClassName( originalClass);
										
										Element.remove( elemento+'_c_onfly');
										Element.remove( elemento+'_e_onfly');
										
										if ( typeof(X) != 'undefined')$( elemento).innerHTML = $( elemento+'_onfly').value;
										
										Element.show(elemento)
										Element.remove(elemento +'_onfly');									
									}
									
									if ( pp.length > 1 ) {

										ParamentroPassado = pp[0]+'='+$( elemento+'_onfly').value+'&'+pp[1];

									}
									
									new Ajax.Request( uu, { method:mm, parameters:encodeURI( ParamentroPassado ),onSuccess:Retorno } );
									
								}
								Element.hide(elemento);
								
								new Insertion.After( elemento, 
														'<textarea id="'+ elemento +'_onfly' +'">'+ $( elemento).innerHTML +'<\/textarea>' 
													);
								new Insertion.After( elemento+'_onfly', 
														'<input id="'+elemento+'_c_onfly'+'" type="button" class="'+aa[1]+'" value="'+aa[0]+'">' 
												    );
									Event.observe( elemento+'_c_onfly', 
												  	'click', this.cancelarOnfly 
												  );
									
								new Insertion.After( elemento+'_onfly', 
														'<input id="'+elemento+'_e_onfly'+'" type="button" class="'+bb[1]+'" value="'+bb[0]+'">' 
												    );
									Event.observe( elemento+'_e_onfly', 
												  	'click', this.enviarOnfly 
												  );
									
								$( elemento +'_onfly' ).addClassName( b);
								$( elemento +'_onfly' ).focus();
									
						}
					}
					
				  );

		Event.observe( this.a, 'click',     this.$.click);
		Event.observe( this.a, 'mouseout',  this.$.out);
		Event.observe( this.a, 'mouseover', this.$.over);
	
	}
}
var ajaxBox = new ajaxBox();
ajaxBox.me = function( e){

	$( e).style.display == ''      || 
	$( e).style.display == 'none'  ? 
	$( e).style.display =  'block' : 
	$( e).style.display =  'none';

}
ajaxBox.favorito = function( URL, TITLE)
{
    if (window.sidebar) window.sidebar.addPanel(TITLE, URL,"");
    else if(window.opera && window.print)
	{
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',URL);
        mbm.setAttribute('title',TITLE);
        mbm.click();
    }
    else if(document.all)
	{
		window.external.AddFavorite(URL, TITLE);
	}
}


