﻿// JScript File
function SWFViewer($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="wmode" value="transparent">');
    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('        <embed id="globalnav-embed" src="' + $arquivo + '" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" 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>');
}
function AlturaDivs()
{
    if(document.getElementById("Centro")!= null)
    {
        centro = document.getElementById("CentroConteudo");
        esquerda = document.getElementById("EsquerdaConteudo");
        direita = document.getElementById("DireitaConteudo");
        
        altura = new Array(3);
            
            altura[0] = direita.offsetHeight;
            altura[1] = esquerda.offsetHeight;
            altura[2] = centro.offsetHeight;
            
            altura.sort(comparar);
            if(altura[2]<500){altura[2]=500;}else{altura[2]+=40;}
        
         
        direita.style.height=altura[2]+"px";
        esquerda.style.height=(altura[2]-36)+"px";
        centro.style.height=altura[2]+"px";  
    }        
}
function comparar(a, b){
     return a - b;
 }


 function Confirma() {
     if (confirm("Do you really want to delete this item?")) {
         return true;
     }
     else {
         return false;
     }
 }
 function Confirma(msg) {
     if (msg == null) { msg = "Do you really want to delete this item?"; }
     if (confirm(msg)) {
         return true;
     }
     else {
         return false;
     }
 }

 function abreShowModal(path, altura, largura) {
     try {
         feautures = "dialogHeight: " + altura + "px; dialogWidth: " + largura + "px;  center: Yes; scroll:No; help: No; resizable: Yes; status: No;"
         retorno = window.showModalDialog(path, window, feautures);
         if (retorno == "reload") {
             window.history.go(0);
         }
     }
     catch (e) {
         window.alert("Popup window blocked " + e.number);
     }
 }
 function abreJanela(path, nome, altura, largura) {
     try {
         esquerda = (screen.width / 2) - (largura / 2);
         emcima = (screen.height / 2) - (altura / 2);
         window.open(path, nome, 'width=' + largura + ',height=' + altura + ',left=' + esquerda + ', top=' + emcima + ', toolbar=no, location=no, directories=no, status=1, menubar=no, scrollbars=0, resizable=yes, titlebar=no');
     }
     catch (e) {
         window.alert("Popup window blocked " + e.number);
     }
 }
 function abreJanelaScroll(path, nome, altura, largura) {
     try {
         esquerda = (screen.width / 2) - (largura / 2);
         emcima = (screen.height / 2) - (altura / 2);
         window.open(path, nome, 'width=' + largura + ',height=' + altura + ',left=' + esquerda + ', top=' + emcima + ', toolbar=no, location=no, directories=no, status=1, menubar=no, scrollbars=1, resizable=yes, titlebar=no');
     }
     catch (e) {
         window.alert("Popup window blocked " + e.number);
     }
 }