// Aumentar, Normal e Diminuir Texto
cont = 14;
function AumentarTexto(ValorA)
    {
	ValorA = document.getElementById(ValorA);
	cont++;
	ValorA.style.fontSize = cont;
	}
function DiminuirTexto(ValorB)
    {
	ValorB = document.getElementById(ValorB);
	cont--;
	ValorB.style.fontSize = cont;
	}
function TextoNormal(ValorC)
    {
	ValorC = document.getElementById(ValorC);
	cont = 14
	ValorC.style.fontSize = cont;
	}

// Editor HTML - Painel de Controle
_editor_url = "../";
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>'); 
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

/****************************************************************************
* Flash Tag Write Object v1.8 - by Lucas Fererira - www.lucasferreira.com   *
* Info and Usage: www.lucasferreira.com/flashtag                            *
* bugs/reports: contato@lucasferreira.com                                   *
****************************************************************************/

if(Browser == undefined)
{
	var Browser = {
		isIE: function(){ return (window.ActiveXObject && document.all && navigator.userAgent.toLowerCase().indexOf("msie") > -1  && navigator.userAgent.toLowerCase().indexOf("opera") == -1) ? true : false; }
	};
}

var Flash = function(movie, id, width, height, initParams)
{
	this.html = "";
	
	this.variables = new Array();
	
	this.flashversion = (typeof initParams != "undefined" && typeof initParams.flashversion != "undefined") ? initParams.flashversion : "7,0,0,0";
	
	this.attributes = {
		"classid": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
		"codebase": "http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=" + this.flashversion,
		"type": "application/x-shockwave-flash"
	};
	
	this.params = { "pluginurl": "http://www.macromedia.com/go/getflashplayer" };
	
	if(movie)
	{
		this.addAttribute("data", movie);
		this.addParameter("movie", movie);
	}
	
	if(id && id != null && (this.id = id)) 
	{
		this.addAttribute("id", this.id);
		this.addAttribute("name", this.id);
	}
	else
	{
		this.id = null;
	}
	
	if(width) this.addAttribute("width", width);
	if(height) this.addAttribute("height", height);
	
	if(initParams != undefined)
	{
		for(var i in initParams) this.addParameter(i.toString(), initParams[i]);
	}
};
Flash.version = "v1.8";

Flash.prototype.getObject = function()
{
	if(this.id == null) return null;
	try
	{
		if(window.document[this.id])
		{
			return window.document[this.id];
		}
		else
		{
			return document.getElementById(window.document[this.id]);
		}
	}
	catch(e) { return null; }
};

Flash.getObjectByExceptions = function(obj, excep)
{
	var tempObj = {};
	for(var i in obj)
	{
		var EOF = false;
		for(var j=0; j<excep.length; j++) if(excep[j] == i.toString()) { EOF = true; break; };
		if(!EOF) tempObj[i] = obj[i];
	}
	return tempObj;
};

Flash.prototype.addAttribute = function(prop, val){ this.attributes[prop] = val; };
Flash.prototype.addParameter = function(prop, val){ this.params[prop] = val; };
Flash.prototype.addVariable = function(prop, val){ this.variables.push([prop, val]); };

Flash.prototype.getFlashVars = function()
{
	for(var i=0, tempString = new Array(); i<this.variables.length; i++) tempString.push(this.variables[i].join("="));
	return tempString.join("&");
};
Flash.prototype.toString = function()
{
	this.params.flashVars = this.getFlashVars();
	if(Browser.isIE())
	{
		//IE
		this.html = "<ob" + "ject";
		var attr = Flash.getObjectByExceptions(this.attributes, ["type", "data"]);
		for(var i in attr) if(i.toString() != "extend") this.html += " " + i.toString() + " = \"" + attr[i] + "\"";
		this.html += "> ";
		var params = Flash.getObjectByExceptions(this.params, ["pluginurl", "extend"]);
		for(var i in params) if(i.toString() != "extend") this.html += "<param name=\"" + i.toString() + "\" value=\"" + params[i] + "\" /> ";
		this.html += " </obj" + "ect>";
	}
	else
	{
		//non-IE
		this.html = "<!--[if !IE]> <--> <obj" + "ect";
		var attr = Flash.getObjectByExceptions(this.attributes, ["classid", "codebase"]);
		for(var i in attr) if(i.toString() != "extend") this.html += " " + i.toString() + " = \"" + attr[i] + "\"";
		this.html += "> ";
		var params = Flash.getObjectByExceptions(this.params, ["extend"]);
		for(var i in params) if(i.toString() != "extend") this.html += "<param name=\"" + i.toString() + "\" value=\"" + params[i] + "\" /> ";
		this.html += " </obj" + "ect> <!--> <![endif]-->";
	}
	return this.html;
};
Flash.prototype.write = Flash.prototype.writeIn = function(w)
{
	if(typeof w == "string" && (w = document.getElementById(w)));
	if( w != null ) { w.innerHTML = this.toString(); }
	else if( w == undefined ) { document.write( this.toString() ); }
    	else { return false; }
};

//automatization functions...
Flash.correctAll = function()
{
	if(!/msie/.test(navigator.userAgent.toLowerCase()) || !document.getElementsByTagName) return false;
	for (var i = 0, objects = document.getElementsByTagName("OBJECT"); i < objects.length;
		(objects[i].outerHTML ? (objects[i].outerHTML = objects[i].outerHTML, objects[i].style.visibility = "visible") : null), i++);
};
Flash.automatic = function(r)
{
	if(r && window.attachEvent)
	{	
		for (var i = 0, objects = document.getElementsByTagName("OBJECT"); i < objects.length; (objects[i].style.visibility = "hidden"), i++);
		window.attachEvent("onload", Flash.correctAll);
		window.attachEvent("onunload", function(){ window.detachEvent("onload", Flash.correctAll); });
	}
	else
	{
		Flash.correctAll();
	}
};

// Mostrar / Ocultar DIVs
function MostrarDiv(nomediv, divclick){
var seldiv = document.getElementById(nomediv);
var seldiv1 = document.getElementById(divclick);
if (seldiv.style.display == 'none'){seldiv.style.display = 'block'; seldiv1.innerHTML = 'Ocultar Anúncio';} else{seldiv.style.display = 'none'; seldiv1.innerHTML = 'Mostrar Anúncio';}
}
// chamar função:  onclick="MostrarDiv(this.id);"

// Mostrar DIVs
function MostrarDiv1(nomediv){
var seldiv = document.getElementById(nomediv);
seldiv.style.display = 'block';
}
// chamar função:  onclick="MostrarDiv(this.id);"

// Ocultar DIVs
function OcultarDiv(nomediv){
var seldiv = document.getElementById(nomediv);
seldiv.style.display = 'none';
}
// chamar função:  onclick="MostrarDiv(this.id);"

// Adicionar aos Favoritos
function AdicionarFavoritos(){
    var url      = "http://www.superconectado.com.br";
    var title    = "SuperConectado.com.br - Informação, Negócios e Entretenimento";
    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);}
}

function Formatar(src, mask)
{
	var i = src.value.length;
	var saida = mask.substring(0,1);
	var texto = mask.substring(i)
	if (texto.substring(0,1) != saida) {
		src.value += texto.substring(0,1); }
}

function IncluiHttp(src)
{
	if (src.value.indexOf("http") == -1 && src.value != "" ) {
		src.value = "http://" + src.value; }
}

function ValidaEmail(src)
{
	if (src.value != "" && src.value.indexOf("@") == -1 && src.value.indexOf(".") == -1) {
		alert("E-mail inválido!");
		src.focus(); }
}

function ValidaData(src)
{
erro=0;
hoje = new Date();
anoAtual = hoje.getFullYear();
barras = src.value.split("/");
	if (barras.length == 3){
		dia = barras[0];
		mes = barras[1];
		ano = barras[2];
		resultado = (!isNaN(dia) && (dia > 0) && (dia < 32)) && (!isNaN(mes) && (mes > 0) && (mes < 13)) && (!isNaN(ano) && (ano.length == 4) && (ano <= anoAtual-16 && ano >= 1900));
	if (!resultado)	{
		alert("Data inválida!");
		src.focus();
		return false; }	}
}

function EnviaEmail(urlpage, nomepage, emorig, empara, tipoemail, idsite)
{
	window.open('http://www.superconectado.com.br/recomendar/home.asp?URLPag=http:[[www.superconectado.com.br' + urlpage + '&NMPag=' + nomepage + '&EMOrig=' + emorig + '&EMDest=' + empara + '&IDTip=' + tipoemail + '&IDSit=' + idsite + '','Recomendar','width=400,height=450,top=50,left=50');
}

function AcessaSite(url)
{
	window.open(url,'_blank');
}

function Imprimir(idcont)
{
	window.open('http://www.superconectado.com.br/imprimir/home.asp?IDCont=' + idcont + '','Imprimir','width=700,height=500,top=50,left=50,scrollbars=yes');
}

function Maiuscula(obj){
    obj.value = obj.value.toUpperCase();
}
function Minuscula(obj){
    obj.value = obj.value.toLowerCase();
}
function MinimoCaracteres(src,qtd){
	if (src.value.length < qtd)
		{
		alert('Necessário ' + qtd + ' caracteres ou mais!');
		src.focus();
		return false;
		}
}