﻿function abreJanela(url, nome, width, height, extras) {
    tope = (screen.height - height) / 2;
    lefte = (screen.width - width) / 2;
    window.open(url, nome, "width=" + width + ", height=" + height + ",top=" + tope + ",left=" + lefte + extras);
}

function EscreveFlash(caminho, width, height) {
    document.write('<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 + '">');
    document.write('<param name="movie" value="' + caminho + '">');
    document.write('<param name="quality" value="high">');
    document.write('<param name="wmode" value="transparent">');
    document.write('<embed src="' + caminho + '" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
}

function EscreveFlashYouTube(caminho, width, height) {
    document.write('<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 + '">');
    document.write('<param name="movie" value="http://www.youtube.com/v/' + caminho + '&hl=en">');
    document.write('<param name="quality" value="high">');
    document.write('<param name="wmode" value="transparent">');
    document.write('<embed src="http://www.youtube.com/v/' + caminho + '&hl=en" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
}

function EscreveFlashFlv(pasta, caminho, width, height) {
    document.write('<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="' + width + '" height="' + height + '" align="middle">');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name="allowFullScreen" value="false" />');
    document.write('<param name="wmode" value="transparent">');
    document.write('<param name="movie" value="/Images/abreFlv.swf?video=/Video/' + pasta + '/' + caminho + '" />');
    document.write('<param name="quality" value="high" />');
    document.write('<embed src="/Images/abreFlv.swf?video=/Video/' + pasta + '/' + caminho + '" quality="high" width="' + width + '" height="' + height + '" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
    //    document.write('<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 + '">');
    //    document.write('<param name="movie" value="/Web/Images/abreFlv.swf?video=/Web/Video/' + pasta + "/" + caminho + '">');
    //    document.write('<param name="quality" value="high">');
    //    document.write('<param name="wmode" value="transparent">');
    //    document.write('<embed src="Images/abreFlv.swf?video=/Web/Video/' + pasta + "/" + caminho + '" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    //    document.write('</object>');
}

function EscreveFlashFlvAdmin(pasta, caminho, width, height) {
    document.write('<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="' + width + '" height="' + height + '" align="middle">');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name="allowFullScreen" value="false" />');
    document.write('<param name="movie" value="/Images/abreFlv2.swf?video=/Video/' + pasta + '/' + caminho + '" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent">');
    document.write('<embed src="/Images/abreFlv2.swf?video=/Video/' + pasta + '/' + caminho + '" quality="high" width="' + width + '" height="' + height + '" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
    //    document.write('<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 + '">');
    //    document.write('<param name="movie" value="/Web/Images/abreFlv.swf?video=/Web/Video/' + pasta + "/" + caminho + '">');
    //    document.write('<param name="quality" value="high">');
    //    document.write('<param name="wmode" value="transparent">');
    //    document.write('<embed src="Images/abreFlv.swf?video=/Web/Video/' + pasta + "/" + caminho + '" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    //    document.write('</object>');
}

function abreGaleria(id) {
    if (id == 'geral') {
        id = "todos";
    }
    abreJanela('popGaleria.aspx?galeria=' + id, 'galeria' + id, '751', '580', '');
}

function abreVideos() {
    abreJanela('Videos.aspx', 'videos', '718', '464', '');
}

function AbreIframe() {
    parent.document.getElementById("conteudo").style.height = document.getElementById("content").offsetHeight;
}

function getFlashMovieObject(movieName)
{
    if (window.document[movieName]) 
    {
        return window.document[movieName];
    }
    if (navigator.appName.indexOf("Microsoft Internet")==-1)
    {
        if (document.embeds && document.embeds[movieName])
            return document.embeds[movieName]; 
    }
    else
    {
        return document.getElementById(movieName);
    }
}
