	var tgs = new Array('div');
	var szs = new Array('xx-small','x-small','small','medium','large','x-large','xx-large');
	var startSz = 2;
	var janela = null;
	var xmlhttpc = new Array();
	var dreclames = new Array();
	var dgaleria = new Array();

	function openChat(theURL,winName,features) {
		window.open(theURL,winName,features);
	}

	function doContagem(obj,painel)
	{
		var a = document.getElementById(obj);
		var b = document.getElementById(painel);
		var c = 300;
		c = c-a.value.length;
		if (c<=0)
		{
			b.innerHTML = 'Seu texto <b>N&Atilde;O</b> pode ultrapassar 300 caracteres!';
			a.value = a.value.substring(0,300);
		}
		else if (c>1)
			b.innerHTML = 'Seu texto ainda pode conter <b>'+c+'</b> caracteres.';
		else
			b.innerHTML = 'Seu texto ainda pode conter <b>'+c+'</b> caractere.';
	}
	
	function lerCookie(name)
	{
		var cookieValue = null;
		var search = name + "=";

		if (document.cookie.length > 0)
		{
			offset = document.cookie.indexOf(search);
			if (offset != -1)
			{ 
				offset += search.length;
				end = document.cookie.indexOf(";", offset);
				if (end == -1) end = document.cookie.length;
				cookieValue = unescape(document.cookie.substring(offset, end))
			}
		}
		return cookieValue;
	}
	
	function salvaCookie(name, value, hours)
	{
		var expire = "";
		if (hours != null)
		{
			expire = new Date((new Date()).getTime() + hours * 3600000);
			expire = "; expires=" + expire.toGMTString();
		}
		document.cookie = name + "=" + escape(value) + expire;
	}	
	
	function doTamanhoLetra(trgt,inc)
	{
		var d = document,cEl = null,sz = startSz,i,j,cTags;
		if (inc==0)
		{
			var tmpTamanho = lerCookie("tamanho_"+trgt);
			if ((tmpTamanho!="undefined")&&(tmpTamanho!=null))
			{
				sz = parseInt(tmpTamanho);
				startSz = sz;
			}
		}
		else
		sz += inc;
		if ( sz < 0 ) sz = 0;
		if ( sz > 6 ) sz = 6;
		startSz = sz;
		if ( !( cEl = d.getElementById(trgt) ) ) cEl = d.getElementsByTagName(trgt)[0];
		if (cEl != null)
		{
			cEl.style.fontSize = szs[ sz ];	

			for ( i = 0; i < tgs.length; i++ )
			{
				cTags = cEl.getElementsByTagName(tgs[i]);
				for (j=0; j<cTags.length; j++)
					cTags[j].style.fontSize = szs[sz];
			}
			
			salvaCookie("tamanho_"+trgt, sz, 300);
		}
	}

	function showBanner(show)
	{
		theLI = document.getElementById("bannerexpansivel");
		if(show)
		{
			theLI.style.visibility = "visible";
			theLI.style.display = "";
		}
		else
		{
			theLI.style.visibility = "hidden";
			theLI.style.display = "none";				
		}
		return false;
	}
	
	function mudarFundo(cor)
	{
		document.bgColor=cor;
		salvaCookie("corFundo", cor, 300);
	}
	
	function doShow(obj)
	{
		o = document.getElementById(obj);
		o.style.visibility = "visible";
		o.style.display = "inline";		
	}
	
	function doHide(obj)
	{
		o = document.getElementById(obj);
		o.style.visibility = "hidden";
		o.style.display = "none";		
	}	

	function doFotoAjuste()
	{		
		var objFoto = document.getElementById('tmpFoto');

		doShow('foto');
		doHide('carregaFoto');


	}

	function doFoto(caminho)
	{
		doShow('carregaFoto');
		document.getElementById("foto").innerHTML = "<a href='javascript:window.close();' alt='Clique para fechar'><img id='tmpFoto' src='"+caminho+"' onload='doFotoAjuste();' border='0' ></a>";
		doHide('foto');		
	}
	function doVideo(caminho)
	{
		document.getElementById("foto").innerHTML = "<OBJECT  ID='mediaPlayer'  CLASSID='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'  CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'  STANDBY='Carregando...' height='360' width='420'><PARAM NAME='fileName'   VALUE='"+caminho+"'><PARAM NAME='animationatStart' VALUE='true'><PARAM NAME='transparentatStart' VALUE='true'><PARAM NAME='autoStart' VALUE='true'><PARAM NAME='showControls' VALUE='true'><PARAM NAME='showStatusBar' value='true'><embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/' src='"+caminho+"' autostart='true' showcontrols='true' showstatusbar='true' showdisplay='False' autorewind='true' height='360' width='420'></embed></OBJECT>";
	}

	var delayLoadRegistry=[];
	var delayLoadCompleted=[];

	function delayLoad(id,img,src)
	{
		delayLoadRegistry[delayLoadRegistry.length]=[id,img,src];
		delayLoadCompleted[id]=false;
	}

	function performDelayLoad(id)
	{
		if(!delayLoadCompleted[id])
		{
			delayLoadCompleted[id]=true;
			for(var i=0;i<delayLoadRegistry.length;i++)
			{
				if(delayLoadRegistry[i][0]==id)
				{
					delayLoadRegistry[i][1].onload="";
					delayLoadRegistry[i][1].src=delayLoadRegistry[i][2];
				}
			}
		}
	}

	try	{ xmlhttp = new XMLHttpRequest(); }	catch(ee) {
		try	{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e)	{
			try	{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(E) { xmlhttp = false; } } }
	
	function doUpdateFlash()
	{
		theObjects = document.getElementsByTagName("object");
		for (var i = 0; i < theObjects.length; i++) {
			if (theObjects[i].id != "mediaPlayer")
			theObjects[i].outerHTML = theObjects[i].outerHTML;
		}
	}