// JavaScript Document
window.onload = function() {
	var m = document.getElementById("divDestDireito");
	var e = document.getElementById("divConteudo");
	if(m && e) {
		var h = m.clientHeight;
		var h2 = e.clientHeight;
		if(h > h2) {
			e.style.height=h+'px';	
		}
	}
}


function aplicaFlashComId(id,swf, width, height,FlashVars, wmode, cache){
	var noCache = "";
	if (cache == undefined || cache == '') {var noCache = "?" + new Date();}
	if (wmode != "opaque" && wmode != "transparent") {wmode = "transparent";}
	var monta_swf = "";
	monta_swf += "<object id='"+ id +"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='"+ width +"' height='"+ height +"' title=''>";
	monta_swf += "<param name='movie' value='"+ swf + noCache +"'>";
	monta_swf += "<param name='quality' value='high'>";
	monta_swf += "<param name='menu' value='0'>";
	monta_swf += "<param name='wmode' value='"+ wmode +"'>";
	monta_swf += "<param name='FlashVars' value='"+ FlashVars +"'>";
	monta_swf += "<embed name='"+ id +"' src='"+ swf + noCache +"' quality='high' FlashVars='"+FlashVars+"' wmode='"+ wmode +"' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ width +"' height='"+ height +"'></embed>";
	monta_swf += "</object>";
	document.write(monta_swf);
}

function getMyApp(appName) {
    var retorno;
    if (navigator.appName.indexOf ("Microsoft") !=-1 || navigator.appName == "Microsoft Internet Explorer") {
        retorno = window[appName];
    } else {
        retorno = document[appName];
    }

    return (retorno==undefined)? document.getElementById(appName) : retorno ;
}



function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}



function maxlengthCampo(campo,maxlength,ControleTextoRestante)
{ 
	total = campo.value.length; 
	CRestantes = 0
	if (total >= maxlength )
	{   
		campo.value = campo.value.substring(0,maxlength);
		CRestantes = 0;
	} 
	else
	{ 
		CRestantes = maxlength - total;
	} 
	if(ControleTextoRestante!=null)
		ControleTextoRestante.innerHTML = CRestantes + " caracteres restantes.";
}

