function urldecode(text) {
	text = unescape(text.replace(/\+/g,  " "));
	return text;
}
function muestraAyuda(elemento){
	$(".help_info").show();	
	txt = $("#txtHelp").html($(elemento).attr("title"));
	$(elemento).attr("title","");
	posicion = $(elemento).offset();
	$(".help_info").css("top",posicion.top - $(".help_info").height() -10);
	$(".help_info").css("left",posicion.left - $(".help_info").width () + 10);
}

function ocultaAyuda(elemento){
	txt = $("#txtHelp").html();
	$(elemento).attr("title",txt);
	$(".help_info").hide();
}
			
(function(){
	/*Use Object Detection to detect IE6*/
	var m = document.uniqueID /*IE*/
		&& document.compatMode /*>=IE6*/
		&& !window.XMLHttpRequest /*<=IE6*/
		&& document.execCommand ;
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */
		}
	}catch(oh){};
})();

function validarEmail(str){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str)){
		return true;
	}else{
		return false;
	}
}

function puntos (cadena){
	if(cadena == "" || typeof cadena == "undefined") return cadena;
	cadena = cadena+"";
	var l=cadena.length;
	for (x=0; x < l; x++)
			cadena=cadena.replace('.','');
			
	var regexp = new RegExp('(-?[0-9]+)([0-9]{3})');
	while(regexp.test(cadena))	{
		cadena = cadena.replace(regexp, '$1.$2');
	}
	return cadena;
}


function ucfirst( str ) {
    var f = str.charAt(0).toUpperCase();
    return f + str.substr(1, str.length-1);
}

function deshabilitarBoton (volver) {
	if (volver  == false) { 
		// $("#enviarTop").attr("disabled","disabled");	
		// document.frmEnviosolInfoTop.enviarTop.disabled = true;
		
		$("#btnContactar2").removeClass("boton_S");
		$("#btnContactar2").html( '<img src="/recursos/imgs/loading.gif" style=" border:0px;"/>');
		
		$("#btnContactar").removeClass("boton_S");
		$("#btnContactar").css("float", "right");
		$("#btnContactar").html( '<img src="/recursos/imgs/loading.gif" style=" border:0px;"/>');	
		
		document.frmEnviosolInfoTop.submit();
	} else { 
		// document.frmEnviosolInfoTop.enviarTop.disabled = false;
	}
}

function cargaFooter(){
/*	$.ajax({
		   type: "GET",
		   dataType: "html",
		   url: "/includes/footer.main.php",  
		   success: function(data) {
				$("#footer").replaceWith(data);
		   }			   
	});		*/
}