function campoValue(obj, Event, Default){
	if(Event == 'blur'){
		if(/^\s{0,}$/.test(obj.value)){
			obj.value = Default;
		}
	}else if(Event == 'click'){
		if(obj.value == Default){
			obj.value = '';
		}
	}
}
/*
function comercial() {	
	if(document.getElementById('comercial')){
		var items = [], allItems = document.getElementById('comercial').getElementsByTagName("li");
		for (var i = 0; i < allItems.length; i++) {				
			allItems[i].onclick = function() {	
				for (var item = this.parentNode.firstChild; item; item = item.nextSibling) {		
					item.className = 'normal';
					
				}
				
				document.getElementById('comercial-1').style.display = "none";
				document.getElementById('comercial-2').style.display = "none";				
				document.getElementById('comercial-4').style.display = "none";
				document.getElementById('comercial-5').style.display = "none";
				document.getElementById('comercial-6').style.display = "none";
				document.getElementById('1').style.background ='#fff';
				document.getElementById('2').style.background ='#fff';
				document.getElementById('4').style.background ='#fff';
				document.getElementById('5').style.background ='#fff';
				document.getElementById('6').style.background ='#fff';
				
				eu = this.id;
				document.getElementById('comercial-'+eu).style.display = "block";
				this.style.background = "#cccccc";
				this.className = 'clicado';
			}
			document.getElementById('comercial-1').style.display = "block";
			document.getElementById('comercial-2').style.display = "none";
			document.getElementById('comercial-4').style.display = "none";
			document.getElementById('comercial-5').style.display = "none";
			document.getElementById('comercial-6').style.display = "none";
		}	
	}
}
*/
function tratadores() {
	if(!document.getElementById('desce-form')) {
		return;
	}
	document.getElementById('desce-form').onclick = function() {
		descer();
	}
	document.getElementById('fechar').onclick = function() {
		subir();
	}
}
//Função que faz descer a janela de orçamento
function descer() {
	t1 = new Tween(document.getElementById('manda-amigo').style,'top',Tween.backEaseInOut,-440,250,1.5,'px');
	t1.start();
}
//Função que faz subir a janela de orçamento
function subir() {
	t1 = new Tween(document.getElementById('manda-amigo').style,'top',Tween.backEaseInOut,250,-440,2.5,'px');
	t1.start();
}

/*function mistura(){
	replaceAnchorLinks();//função do scroll
	tratadores();//função do manda amigo
	comercial();//função das abas do comercial
}*/

function manda(enq) {
resultado=window.open('',enq,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,copyhistory=no,width=200,height=200");
}

function enquete(enq) {
resultado=window.open('',enq,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,copyhistory=no,width=200,height=400");

}

function inserir_swf($arquivo,$altura,$largura,$id){
    document.writeln('    <object id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + $largura + '" height="' + $altura + '" id="' + $id + '" name="' + $id + '">');
    document.writeln('        <param name="movie" value="' + $arquivo + '" />');
    document.writeln('        <param name="FlashVars" value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />');
    document.writeln('        <param name="bgcolor" value="#ffffff" />');
    document.writeln('        <param name="menu" value="false" />');
    document.writeln('        <param name="quality" value="high" />');
    document.writeln('        <param name="salign" value="tl" />');
    document.writeln('        <param name="scale" value="noscale" />');
    document.writeln('        <param name="wmode" value="transparent" />');
    document.writeln('        <embed id="globalnav-embed" src="' + $arquivo + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#ffffff" menu="false" quality="high" salign="tl" scale="noscale" id="' + $id + '" width="' + $largura + '" height="' + $altura + '"></embed>');
    document.writeln('    </object>');
}

/*
if (window.attachEvent){
	window.attachEvent("onload", mistura);
}else{
	window.onload = mistura;
}*/

function abrir_pagina(page,largura,altura) {
	window.open(page, "", "top=40, left=40, width="+largura+", height="+altura+",scrollbars=yes" );	
}