﻿// Autor: Julio Cesar Silveira
// Portifólio: www.artproweb.com.br
// Script para todo tipo de pop_up. Exemplos de uso:
// HTML
// href="javascript:abre_pop('http://link',[largura],[altura]);"
// Caso não queira colocar largura ou altura no pop ele abrira por padrão em 450 de largura e 340 de altura
// Action script 2
// getURL("javascript:abre_pop('http://link',[largura],[altura]);");
// ou via livraria do flash
// import flash.external.*;
// ExternalInterface.call("abre_pop('http://link',[largura],[altura])");

function abre_pop(link, width, height)
{
    if (width == undefined && height == undefined)
    {
        width = 450;
        height = 340;
    }
    var top = (screen.height / 2) - (height / 2);
    var left = (screen.width / 2) - (width / 2);
    window.open(link, 'atendimento', 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ',resizable=no,scrollbars=no');
}
