/* abrir popup Janela */
function openPopup(u,n,w,h,o,c){
    var l=t=18;
    if(c){
        l=(screen.availWidth-w)/2;
        t=(screen.availHeight-h)/2;
    }
    p=window.open(u,'pop_'+n,'left='+l+',top='+t+',width='+w+',height='+h+''+((o)?','+o:''));
}

function popChat(u) {
	openPopup(u,'ChatOnline',630,540,'scrollbars=1',true);
}

function popMural(u) {
	openPopup(u,'Mural',329,187,'scrollbars=0',true);
}
/* fim de pop Window */


/* abrir popup layer */
// parte que abre a janela
var arrKeys = new Array("#","#");
var arrURLs = new Array("#","#");
if( arrKeys.length != arrURLs.length )
alert("Especifique a letra da Url.");
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function keyNav(e)
{
    var strFromCode;
    var strFromArr;
    if (document.layers)
    strFromCode = String.fromCharCode(e.which);
    else if (document.all)
    strFromCode = String.fromCharCode(event.keyCode);
    strFromCode = strFromCode.toLowerCase()
    for(i = 0; i < arrKeys.length; i++)
    {
        strFromArr = arrKeys[i].toLowerCase();
        if(strFromArr == strFromCode)
        {
            window.location=arrURLs[i];
            return(true);
        }
    }
    return(true);
}
document.onkeypress=keyNav;
var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var bouncelimit=0
var direction="up"
function initbox()
{
    if (!dom&&!ie&&!ns4)
    return
    crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
    scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
    crossobj.top=scroll_top-250
    crossobj.visibility=(dom||ie)? "visible" : "show"
    dropstart=setInterval("dropin()",50)
}
function dropin()
{
    scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
    if (parseInt(crossobj.top)<250+scroll_top) // ALTURA DA PÁGINA EM RELAÇÃO AO TOPO
    crossobj.top=parseInt(crossobj.top)+40
    else
    {
        clearInterval(dropstart)
        bouncestart=setInterval("bouncein()",50)
    }
}
function bouncein()
{
    crossobj.top=parseInt(crossobj.top)-bouncelimit
    if (bouncelimit<0)
    bouncelimit+=8
    bouncelimit=bouncelimit*-1
    if (bouncelimit==0)
    {
        clearInterval(bouncestart)
    }
}
function dismissbox()
{
    if (window.bouncestart) clearInterval(bouncestart)
    crossobj.visibility="hidden"
}
function get_cookie(Name)
{
    var search = Name + "="
    var returnvalue = ""
    if (document.cookie.length > 0)
    {
        offset = document.cookie.indexOf(search)
        if (offset != -1)
        {
            offset += search.length
            end = document.cookie.indexOf(";", offset)
            if (end == -1)
            end = document.cookie.length;
            returnvalue=unescape(document.cookie.substring(offset, end))
        }
    }
    return returnvalue;
}
function dropornot()
{
    if (get_cookie("droppedin")=="")
    {
        document.cookie="droppedin=yes"
    }
}
dropornot()
function redo()
{
    bouncelimit=32
    direction="up"
    initbox()
}
//window.onload = redo;

/*fim popup */