// JavaScript Document
//Função responsável pela exibição de arquivos swf sem bordas

function exibe_flash(swf,width,height) {
	var flash = "";
	flash += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'" id="menu">';
	flash += '<param name="movie" value="'+swf+'" />';
	flash += '<param name="wmode" value="transparent" />';
	flash += '<param name="quality" value="high" />';
	flash += '<embed src="'+swf+'" swliveconnect="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>';
	flash += '</object>';
	document.write(flash);
}

function exibe_flash_propaganda(swf,width,height, propagandaID,carregaXML,path,tipoIE) {
	var flash = "";
	var concat = "";
	var param = "";
	if(tipoIE){
        concat = "";
        param = "<PARAM NAME=\"FlashVars\" VALUE=\"carregaXML="+carregaXML+"&path="+path+"\" />";
    }else{
        concat = "?carregaXML="+carregaXML+"&path="+path;
        param = ""
    }
	
	flash += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'" id="menu">';
	flash += '<param name="movie" value="'+swf+concat+'" />';
	flash += '<param name="wmode" value="transparent" />';
	flash += '<param name="quality" value="high" />';
    flash += param;
	flash += '<embed src="'+swf+'" swliveconnect="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>';
	flash += '</object>';
	document.write(flash);
}


function openURLEx(url)
{
  var path = new String();
  path = url;
  if (path.substr(0,4) != 'http')
  {
    path = 'http://'+url;
  }
  window.open(path);
}

function openPopup(url)
{
  window.open(url,"Arquivo" , "scrollbars = 1, status=0, menubar=0, location=0, toolbar=0, width=250, height=250, resizable=1");
}

function GetCharCount(e, destino, max)
{
    
    if (parseInt(e.value.length) > max)
    {
        e.value = e.value.substr(0, max);
    }
    
    //Recuperando o texto do TextBox
    varTheText = e.value;
    
       
    //Retorna o nome do controle e o número de caracteres do texto
    if(document.all)//IE
    {
        document.getElementById(destino.id).innerText = parseInt(varTheText.length) + "/" + max;
    }
    else
    {
        document.getElementById(destino.id).textContent = parseInt(varTheText.length) + "/" + max;
    }       
}