<!-- -------------------------------- SELEÇÃO PARA BROWSERS --------------------------------------//>
var xmlhttp = bunda();
function bunda(){
if(window.XMLHttpRequest){
return new XMLHttpRequest();
}else if(window.ActiveXObject)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
<!-- ------------------------------------ ALTERA URL ---------------------------------------------//>
function alteraURL(url, olugar){
	document.getElementById("carregando").style.display="";
    xmlhttp.open("GET", url, true);
    xmlhttp.onreadystatechange = function(){
      if(xmlhttp.readyState==4){
				if (xmlhttp.status == 200) {
					// Pega o conteúdo - HTML - da página requisitada: formulario.php?ajax=true e coloca dentra da div definida na variável recipiente
					document.getElementById(olugar).innerHTML = xmlhttp.responseText;
					document.getElementById("carregando").style.display="none";	
				} // if-status->200
			} // if->readyState->4
 }
   xmlhttp.send(null);
}
<!-- --------------------------------- ALTERA DESTAQUE -------------------------------------------//>
function alteraDestaque(url){
    xmlhttp.open("GET", url, true);
    xmlhttp.onreadystatechange = function(){
      if(xmlhttp.readyState==4){
	  document.getElementById("destaque").innerHTML = xmlhttp.responseText;
  }
 }
   xmlhttp.send(null);
}
<!-- --------------------------------- ALTERA VARIADOS ---------------------------------------------//>
function alteraVariados(url){
    xmlhttp.open("GET", url, true);
    xmlhttp.onreadystatechange = function(){
      if(xmlhttp.readyState==4){
	  document.getElementById("variados").innerHTML = xmlhttp.responseText;
  }
 }
   xmlhttp.send(null);
}
<!-- --------------------------- FAZ TROCAR DESTAQUE e VARIADOS------------------------------------//>
function AlteraAuto(){
window.setTimeout("alteraDestaque('site_destaque.php?ajax=ajax')", 8000);
window.setTimeout("alteraVariados('site_ofertas_variadas.php?ajax=ajax')", 12000); 
setTimeout("AlteraAuto()", 10000)}

<!-- --------------------------------- ----------------- -------------------------------------------//>
function limpar(objeto, msg) {
    if (objeto.value == msg)objeto.value = '';
}

function mostrar(objeto, msg) {
    if (objeto.value == '')objeto.value = msg;
}
<!-- --------------------------- Quantidade máxima de caracteres ----------------------------------//>
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else 
countfield.value = maxlimit - field.value.length;
}

<!-- --------------------------- Submeter Form com Javascript ----------------------------------//>

function submitform(NomeForm)
{
    document.forms[NomeForm].submit();
}

function ConfirmarEnvio(form)
{
enviar = window.confirm('Tem certeza que deseja excluir? Esta ação não tem volta!');
if(enviar){ document.forms[form].submit();
} else {
return false;
}
}

function AtivaDiv(ativa, desativa){
document.getElementById(ativa).style.display    ='block';
document.getElementById(desativa).style.display ='none';
}

function EnviaForm(NomeForm)
{
   NomeForm.submit();
}

//<![CDATA[
addEvent = function(o, e, f, s){
	var r = o[r = "_" + (e = "on" + e)] = o[r] || (o[e] ? [[o[e], o]] : []), a, c, d;
	r[r.length] = [f, s || o], o[e] = function(e){
		try{
			(e = e || event).preventDefault || (e.preventDefault = function(){e.returnValue = false;});
			e.stopPropagation || (e.stopPropagation = function(){e.cancelBubble = true;});
			e.target || (e.target = e.srcElement || null);
			e.key = (e.which + 1 || e.keyCode + 1) - 1 || 0;
		}catch(f){}
		for(d = 1, f = r.length; f; r[--f] && (a = r[f][0], o = r[f][1], a.call ? c = a.call(o, e) : (o._ = a, c = o._(e), o._ = null), d &= c !== false));
		return e = null, !!d;
    }
};

removeEvent = function(o, e, f, s){
	for(var i = (e = o["_on" + e] || []).length; i;)
		if(e[--i] && e[i][0] == f && (s || o) == e[i][1])
			return delete e[i];
	return false;
};

function formataMoeda(o, n, dig, dec){
	o.c = !isNaN(n) ? Math.abs(n) : 2;
	o.dec = typeof dec != "string" ? "," : dec, o.dig = typeof dig != "string" ? "." : dig;
	addEvent(o, "keypress", function(e){
		if(e.key > 47 && e.key < 58){
			var o, s, l = (s = ((o = this).value.replace(/^0+/g, "") + String.fromCharCode(e.key)).replace(/\D/g, "")).length, n;
			if(o.maxLength + 1 && l >= o.maxLength) return false;
			l <= (n = o.c) && (s = new Array(n - l + 2).join("0") + s);
			for(var i = (l = (s = s.split("")).length) - n; (i -= 3) > 0; s[i - 1] += o.dig);
			n && n < l && (s[l - ++n] += o.dec);
			o.value = s.join("");
		}
		e.key > 30 && e.preventDefault();
	});
}
//]]>