var flagabrirchat = 'N';
var flagchatativo = 'S';
var flagleftmenuativo = 'N';
var originaltitle;
originaltitle = document.title;

var Drag = {
obj : null,
dropTargets : [],
destinos : [],

init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper){
 o.onmousedown	= Drag.start;
 o.hmode	= bSwapHorzRef ? false : true ;
 o.vmode	= bSwapVertRef ? false : true ;
 o.root = oRoot && oRoot != null ? oRoot : o ;
 if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = "0px";
 if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = "0px";
 if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";
 if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
 o.minX = typeof minX != 'undefined' ? minX : null;
 o.minY	= typeof minY != 'undefined' ? minY : null;
 o.maxX	= typeof maxX != 'undefined' ? maxX : null;
 o.maxY	= typeof maxY != 'undefined' ? maxY : null;
 o.xMapper = fXMapper ? fXMapper : null;
 o.yMapper = fYMapper ? fYMapper : null;
 o.root.onDragStart	= new Function();
 o.root.onDragEnd	= new Function();
 o.root.onDrag		= new Function();
},
start : function(e){
  var o = Drag.obj = this;
  e = Drag.fixE(e);
  var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
  var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
  o.root.onDragStart(x, y);
  o.lastMouseX	= e.clientX;
  o.lastMouseY	= e.clientY;
  if (o.hmode) {
   if (o.minX != null){ o.minMouseX = e.clientX - x + o.minX; }
   if (o.maxX != null){ o.maxMouseX = o.minMouseX + o.maxX - o.minX; }
  } else {   
   if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
   if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
  }
  if (o.vmode) { 
   if (o.minY != null){ o.minMouseY = e.clientY - y + o.minY; }
   if (o.maxY != null){ o.maxMouseY = o.minMouseY + o.maxY - o.minY; }
  } else {
   if (o.minY != null){ o.maxMouseY = -o.minY + e.clientY + y; }
   if (o.maxY != null){ o.minMouseY = -o.maxY + e.clientY + y; }
  }
  document.onmousemove = Drag.drag;
  document.onmouseup   = Drag.detecta;
  return false;
},
drag : function(e){
 origemid = Drag.obj.id;
 e = Drag.fixE(e);
 var o = Drag.obj;
 var ey	= e.clientY;
 var ex	= e.clientX;
 var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
 var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
 var nx, ny;
 if (o.minX != null){ ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX); }
 if (o.maxX != null){ ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX); }
 if (o.minY != null){ ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY); }
 if (o.maxY != null){ ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY); }
 nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
 ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
 if (o.xMapper){ nx = o.xMapper(y); }
 else if (o.yMapper){ ny = o.yMapper(x); }
 if( origemid != "..trashca." &&
     origemid != "..npage."   &&
     origemid != "..ppage." ){
      Drag.obj.root.style.zIndex = 0;
 }
 Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
 Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
 Drag.obj.lastMouseX = ex;
 Drag.obj.lastMouseY = ey;
 Drag.obj.root.onDrag(nx, ny);
 //INI - Auto-scroll//
 var scrollvalue = 10;
 var pageheight = window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:null;
 var scrolldelta = pageheight - scrollvalue;
 if( e.clientY < scrollvalue && e.pageY > 30 ){
  window.scrollBy(0,-scrollvalue); 
  Drag.obj.lastMouseY = ey + scrollvalue;
 }//if
 if( e.clientY > scrolldelta ){ 
  window.scrollBy(0,scrollvalue);
  Drag.obj.lastMouseY = ey - scrollvalue;
 }//if
 //END - Auto-scroll//
 return false;
},
detecta : function(e){
 document.onmousemove = null;
 var ex = 0;
 var ey = 0;
 var left = 0;
 var top  = 0;
 var targPosx = 0;
 var targPosy = 0;
 var twidth  = 0;
 var theight = 0;
 var texto = "";
 var parametro = "";
 var flagmsie = "N";
 var scrollleft = 0;
 var scrolltop = 0;
 var clientLeft = 0;
 var clientTop = 0;
 origem = Drag.obj.name;
 origemid = Drag.obj.id;
 e = Drag.fixE(e);
 if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    scrolltop  = document.body.scrollTop;
    scrollleft = document.body.scrollLeft;
 } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    scrolltop  = document.documentElement.scrollTop;
    scrollleft = document.documentElement.scrollLeft;
 }
 if( document.body && ( document.body.clientLeft || document.body.clientTop ) ) {
    clientTop  = document.body.clientTop;
    clientLeft = document.body.clientLeft;
 } else if( document.documentElement && ( document.documentElement.clientLeft || document.documentElement.clientTop ) ) {
    clientTop  = document.documentElement.clientTop;
    clientLeft = document.documentElement.clientLeft;
 }
 if( scrollleft == "" || scrollleft == "undefined" ){ scrollleft = 0; }
 if( scrolltop == "" || scrolltop == "undefined" ){ scrolltop = 0; }
 if( clientLeft == "" || clientLeft == "undefined" ){ clientLeft = 0; }
 if( clientTop == "" || clientTop == "undefined" ){ clientTop = 0; }
 if(e.pageX || e.pageY){
    ex = e.pageX;
    ey = e.pageY;
    flagmsie = "N";
 } else {
    ex = e.clientX + scrollleft - clientLeft;
    ey = e.clientY + scrolltop  - clientTop;
    flagmsie = "S";
 }//if-else
 var flag_achou = "n";
 for(var i=0; i < Drag.dropTargets.length; i++){
    var curTarget  = Drag.dropTargets[i];
    var destino    = Drag.destinos[i];
    left = 0;
    top = 0;
    twidth = 0;
    theight = 0;
//  INI - Target Position  //
    while (curTarget.offsetParent){
     left += curTarget.offsetLeft;
     top  += curTarget.offsetTop;
     twidth = curTarget.offsetWidth;
     theight = curTarget.offsetHeight;
     curTarget = curTarget.offsetParent;
    }//while
    left += curTarget.offsetLeft;
    top  += curTarget.offsetTop;
    targPosx = left;
    targPosy = top;
//  FIM - Target Position  //
    var targWidth  = twidth;
    var targHeight = theight;
	
//  INI - Verificar se pode realmente mover //
    var flagpodemover = "N";
    if( document.getElementById('pop').style.display != 'block' &&
		document.getElementById('chatty').style.display != 'block' &&
		document.getElementById('notte').style.display != 'block' &&
		document.getElementById('digitado').style.display != 'block' &&
		document.getElementById('spansearch').style.display != 'block' ){
	 flagpodemover = "S";
	}//if
	
	if( flagleftmenuativo == 'S' ){
	 flagpodemover = "N";
	}//if
	
//  FIM - Verificar se pode realmente mover //

    if ( origemid == "..notepad." ||
         origem   == "..notepad." ||
         destino  == "..notepad." ||
         origemid == "chatty" ||
         origem   == "chatty" ||
         destino  == "chatty" ||
		 Drag.obj.style.display == "none" ||
		 flagpodemover == "N" ){

//       Objetos que não devem interagir com Drag&Drop
         document.onmouseup = Drag.end;
         return false;//exit;//sai da funcao toda

    }else if ( (ex > targPosx) && (ex < (targPosx + targWidth)) &&
         (ey > targPosy) && (ey < (targPosy + targHeight)) &&
         (origem != destino) &&
         (origemid != "..trashca.") &&
         (destino != "..trashca.") &&
         (origemid != "..npage.") &&
         (destino != "..npage.") &&
         (origemid != "..ppage.") &&
         (destino != "..ppage.") ){
        var mensagemmove = "Move?";
        var answermove = confirm(mensagemmove); 
        if(answermove){		 
         flag_achou = "s";
         parametro = origem + "|" + destino + "|" + "" + "|" + "";
         Drag.ajax(parametro);
         document.onmouseup = Drag.end;
         setTimeout("window.document.location.reload()",900);		 
		}else{
         Drag.obj.root.style.zIndex = "1";
         Drag.obj.root.style.top = "0px";
         Drag.obj.root.style.left = "0px";		
		 document.onmouseup = Drag.end;
		}//if-else answermove
        return false;//exit;//sai da funcao toda
    }else if ( (ex > targPosx) && (ex < (targPosx + targWidth)) &&
         (ey > targPosy) && (ey < (targPosy + targHeight)) &&
         (origem != destino) &&
         (origemid != "..trashca.") &&
         (destino == "..trashca.") &&
         (origemid != "..npage.") &&
         (destino != "..npage.") &&
         (origemid != "..ppage.") &&
         (destino != "..ppage.") ){
//////////Colocou na Lixeira//////////
         var mensagem = "Delete?";
         var answer = confirm(mensagem); 
         if(answer){
          flag_achou = "s";
          parametro = origem + "|" + destino + "|" + "" + "|" + "";
          Drag.ajaxdel(parametro);
          Drag.obj.root.style.visibility = "hidden";
          Drag.obj.root.style.zIndex = "0";
          Drag.obj.root.style.top = "0px";
          Drag.obj.root.style.left = "0px";
         } else {
          Drag.obj.root.style.zIndex = "1";
          Drag.obj.root.style.top = "0px";
          Drag.obj.root.style.left = "0px";
         }
         document.onmouseup = Drag.end;
         return false;//exit;//sai da funcao toda          
    }else if ( (ex > targPosx) && (ex < (targPosx + targWidth)) &&
         (ey > targPosy) && (ey < (targPosy + targHeight)) &&
         (origem != destino) &&
         (origemid != "..trashca.") &&
         (destino != "..trashca.") &&
         (origemid != "..npage.") &&
         (destino == "..npage.") &&
         (origemid != "..ppage.") &&
         (destino != "..ppage.") ){
//////////Colocou na Next Page//////////
          parametro = origem + "|" + destino + "|" + "" + "|" + "";
          Drag.ajaxnext(parametro);
          Drag.obj.root.style.visibility = "hidden";
          Drag.obj.root.style.zIndex = "0";
          Drag.obj.root.style.top = "0px";
          Drag.obj.root.style.left = "0px";
          document.onmouseup = Drag.end;
          return false;//exit;//sai da funcao toda          
    }else if ( (ex > targPosx) && (ex < (targPosx + targWidth)) &&
         (ey > targPosy) && (ey < (targPosy + targHeight)) &&
         (origem != destino ) &&
         (origemid != "..trashca.") &&
         (destino != "..trashca.") &&
         (origemid != "..npage.") &&
         (destino != "..npage.") &&
         (origemid != "..ppage.") &&
         (destino == "..ppage.") ){
//////////Colocou na Previous Page//////////
          parametro = origem + "|" + destino + "|" + "" + "|" + "";
          Drag.ajaxprev(parametro);
          Drag.obj.root.style.visibility = "hidden";
          Drag.obj.root.style.zIndex = "0";
          Drag.obj.root.style.top = "0px";
          Drag.obj.root.style.left = "0px";
          document.onmouseup = Drag.end;
          return false;//exit;//sai da funcao toda          
    }else if ( (ex > targPosx) && (ex < (targPosx + targWidth)) &&
         (ey > targPosy) && (ey < (targPosy + targHeight)) &&
         (origem != destino) &&
         (origemid == "..trashca.") &&
         (destino == "..trashca.") &&
         (origemid != "..npage.") &&
         (destino != "..npage.") &&
         (origemid != "..ppage.") &&
         (destino != "..ppage.") ){
//////////Reposicionou a Lixeira//////////
         document.onmouseup = Drag.end;
         return false;//exit;//sai da funcao toda          
    }else if ( (ex > targPosx) && (ex < (targPosx + targWidth)) &&
         (ey > targPosy) && (ey < (targPosy + targHeight)) &&
         (origem != destino ) &&
         (origemid != "..trashca.") &&
         (destino != "..trashca.") &&
         (origemid == "..npage.") &&
         (destino == "..npage.") &&
         (origemid != "..ppage.") &&
         (destino != "..ppage.") ){
//////////Reposicionou a Next Page//////////
         document.onmouseup = Drag.end;
         return false;//exit;//sai da funcao toda          
    }else if ( (ex > targPosx) && (ex < (targPosx + targWidth)) &&
         (ey > targPosy) && (ey < (targPosy + targHeight)) &&
         (origem != destino ) &&
         (origemid != "..trashca.") &&
         (destino != "..trashca.") &&
         (origemid != "..npage.") &&
         (destino != "..npage.") &&
         (origemid == "..ppage.") &&
         (destino == "..ppage.") ){
//////////Reposicionou a Previous Page//////////
         document.onmouseup = Drag.end;
         return false;//exit;//sai da funcao toda
    } else {
////   Outros
    }//if-else
  }//for
},
ajax : function(p){
     var xmlHttp=null;
     var parameters;
     var porigem = p.split("|")[0];
     var pdestino = p.split("|")[1];
     var pleft = p.split("|")[2];
     var ptop = p.split("|")[3];
     var purl = "linkchange.php";
     try {
       xmlHttp=new XMLHttpRequest();
     } catch (e) {
       try {
       xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
       }
     }//try-catch
     var url=purl;
//// origem | destino | left | top
     var o = porigem;
     var d = pdestino;
     var l = pleft;
     var t = ptop;
     parameters = "o=" + escape(o) + "&d=" + escape(d) + "&l=" + l + "&t=" + t + "&sid=" + Math.random();
     xmlHttp.open("POST", url, true);
     xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp.setRequestHeader("Content-length", parameters.length);
     xmlHttp.setRequestHeader("Connection", "close");
     xmlHttp.send(parameters);
},
ajaxdel : function(p){
     var xmlHttp=null;
     var parameters;
     var porigem = p.split("|")[0];
     var pdestino = p.split("|")[1];
     var pleft = p.split("|")[2];
     var ptop = p.split("|")[3];
     var purl = "linkdel.php";
     try {
       xmlHttp=new XMLHttpRequest();
     } catch (e) {
       try {
       xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
       }
     }//try-catch
     var url=purl;
//// origem | destino | left | top
     var s = porigem;
     parameters = "s=" + escape(s) + "&sid=" + Math.random();
     xmlHttp.open("POST", url, true);
     xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp.setRequestHeader("Content-length", parameters.length);
     xmlHttp.setRequestHeader("Connection", "close");
     xmlHttp.send(parameters);
},
ajaxnext : function(p){
     var xmlHttp=null;
     var parameters;
     var porigem = p.split("|")[0];
     var pdestino = p.split("|")[1];
     var pleft = p.split("|")[2];
     var ptop = p.split("|")[3];
     var purl = "linknext.php";
     try {
       xmlHttp=new XMLHttpRequest();
     } catch (e) {
       try {
       xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
       }
     }//try-catch
     var url=purl;
//// origem | destino | left | top
     var s = porigem;
     parameters = "s=" + escape(s) + "&sid=" + Math.random();
     xmlHttp.open("POST", url, true);
     xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp.setRequestHeader("Content-length", parameters.length);
     xmlHttp.setRequestHeader("Connection", "close");
     xmlHttp.send(parameters);
},
ajaxprev : function(p){
     var xmlHttp=null;
     var parameters;
     var porigem = p.split("|")[0];
     var pdestino = p.split("|")[1];
     var pleft = p.split("|")[2];
     var ptop = p.split("|")[3];
     var purl = "linkprev.php";
     try {
       xmlHttp=new XMLHttpRequest();
     } catch (e) {
       try {
       xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
       }
     }//try-catch
     var url=purl;
//// origem | destino | left | top
     var s = porigem;
     parameters = "s=" + escape(s) + "&sid=" + Math.random();
     xmlHttp.open("POST", url, true);
     xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     xmlHttp.setRequestHeader("Content-length", parameters.length);
     xmlHttp.setRequestHeader("Connection", "close");
     xmlHttp.send(parameters);
},
addDropTarget : function(t){
 Drag.dropTargets.push(t);
},
addDestino : function(d){
 Drag.destinos.push(d);
},
end : function(){
 document.onmousemove = null;
 document.onmouseup   = null;
 Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), 
                          parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
 Drag.obj = null;
},
fixE : function(e){
 if (typeof e == 'undefined'){ e = window.event; }
 if (typeof e.layerX == 'undefined'){ e.layerX = e.offsetX; }
 if (typeof e.layerY == 'undefined'){ e.layerY = e.offsetY; }
 return e;
}
};
////////////////////////////////////////////////////////////////////////////////////////////
function esconder(nomeobj,pagina,nomecoded){
 var xmlHttp=null;
 var parameters;
 var pcategoria = nomecoded;
 var ppagina    = pagina;
 var obj = document.getElementById(nomeobj);
 var purl = "categshow.php";

 if(obj.style.display=='block'){
   obj.style.display='none';
// Chamar AJAX para categhide
    purl = "categhide.php";
 }else{
   obj.style.display='block';
// Chamar AJAX para categshow
   purl = "categshow.php";
 }//if-else
///////////////AJAX///////////////////
 try {
//  Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
 } catch (e) {
//  Internet Explorer
    try {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
 }//try-catch

  var url=purl;
//categoria | pagina
  var c = pcategoria;
  var p = ppagina;
  parameters = "c=" + c + "&p=" + p + "&sid=" + Math.random();
  xmlHttp.open("POST", url, true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", parameters.length);
  xmlHttp.setRequestHeader("Connection", "close");
  xmlHttp.send(parameters);
}//esconder

////////////////////////////////////////////////////////////////////////////////////////////
function janelasecundaria (url){ 
   window.open(url,"janela1","width=350,height=200,scrollbars=NO");
}//janelaSecundaria

function janelasecundaria2 (url){ 
   window.open(url,"janela2","width=320,height=320,scrollbars=NO");
}//janelaSecundaria

function janelanotas (url){ 
   window.open(url,"janelanotas","width=500,height=350,scrollbars=NO");
}//janelanotas

//////////////////////////////////////////////////////////////////////////////////////
function fechachat(){
 var xmlHttp=null;
 var parameters;
 var url = "sair.php";
 try {
  xmlHttp=new XMLHttpRequest();
 } catch (e) {
 try {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
 }
 }//try-catch
 
 parameters = "sid=" + Math.random();
 xmlHttp.open("GET", url, false);
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
 xmlHttp.setRequestHeader("Content-length", parameters.length);
 xmlHttp.setRequestHeader("Connection", "close");
 xmlHttp.send(parameters);
 
 if(document.getElementById('gifchatmin')){ document.getElementById('gifchatmin').style.display = 'none'; }
 if(document.getElementById('iframechatty')){ document.getElementById('iframechatty').src = 'chatty/sair.php'; }
 if(document.getElementById('chatty')){ document.getElementById('chatty').style.display = 'none'; }
 flagchatativo = 'N';
 flagabrirchat = 'N';

}//fechachat
//////////////////////////////////////////////////////////////////////////////////////////
function abrirchat(){

 if(document.getElementById('iframechatty')){ document.getElementById('iframechatty').src = 'chatty/chat.php'; }
 if(document.getElementById('chatty')){ document.getElementById('chatty').style.display = 'block'; }
 flagabrirchat = 'N';
 flagchatativo = 'N';

}//abrirchat
//////////////////////////////////////////////////////////////////////////////////////////
function reabrechat(blink){

 if(document.getElementById('iframechatty')){ document.getElementById('iframechatty').src = 'chatty/chat.php'; }
 if(document.getElementById('chatty')){ document.getElementById('chatty').style.display = 'block'; }
 document.getElementById('gifchatmin').style.display = 'none';
 flagabrirchat = 'N';
 flagchatativo = 'N';

 if(blink){
  blinkingtitle(5,'>>>> Chat! <<<<',true);
 }//if

}//reabrechat
//////////////////////////////////////////////////////////////////////////////////////////
function verificachatty(){
 var ajaxRequest;
 try{
  ajaxRequest = new XMLHttpRequest();
 } catch (e){
  try{
   ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try{
    ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (e){
    // Something went wrong
    return false;
   }
  }
 }//try-catch
 //The function that will receive data
 ajaxRequest.onreadystatechange = function(){
  if(ajaxRequest.readyState == 4){
   flagabrirchat = ajaxRequest.responseText;
  }//if
 }//onready
 ajaxRequest.open("GET","chatty/verificachatty.php",true);
 ajaxRequest.send(null);

 //Verificar se eh pra abrir chat
 if( flagchatativo == 'S' && flagabrirchat == 'S' ){
  reabrechat(true);
 }else if( flagchatativo == 'S' ){
  setTimeout('verificachatty()',12000);
 }//if

}//function verificachatty
/////////////////////////////////////////////////////////////////////////////////////////////
function minimizachat(){

 if(document.getElementById('iframechatty')){ document.getElementById('iframechatty').src = 'chatty/pause.php'; }
 if(document.getElementById('chatty')){ document.getElementById('chatty').style.display = 'none'; }
 if(document.getElementById('gifchatmin')){ document.getElementById('gifchatmin').style.display = 'block'; }
 flagabrirchat = 'N';
 flagchatativo = 'S';
 verificachatty();

}//minimizachat
//////////////////////////////////////////////////////////////////////////////////////////
function blinkingtitle(count,message,blink){
    if(blink){
        document.title = message;
    } else {
        document.title = originaltitle;
        count--;
    }//if-else blink

    if (count > 0) {
        blinkTimer = setTimeout("blinkingtitle("+count+", '"+message+"', "+!blink+")", 800);
    }//if count
}//blinkingtitle
//////////////////////////////////////////////////////////////////////////////////////////
function popupchatty(){
 var url;

 if(document.getElementById('gifchatmin')){ document.getElementById('gifchatmin').style.display = 'none'; }
 if(document.getElementById('iframechatty')){ document.getElementById('iframechatty').src = 'chatty/pause.php'; }
 if(document.getElementById('chatty')){ document.getElementById('chatty').style.display = 'none'; }
 flagchatativo = 'N';
 flagabrirchat = 'N';

 url = 'chatty/chat.php?popu=S';
 window.open(url,"janelachatty","width=364,height=400,scrollbars=NO");

}//function popupchatty
/////////////////////////////////////////////////////////////////////////////////////////
function abrenotte(ppkto){

 if(document.getElementById('iframenotte')){
  document.getElementById('iframenotte').src = 'mensagem.php?topk=' + ppkto;
 }
 if(document.getElementById('notte')){ 
  document.getElementById('notte').style.display = 'block'; 
 }

}//function abrenotte
/////////////////////////////////////////////////////////////////////////////////////////
function fechanotte(){

 if(document.getElementById('iframenotte')){ document.getElementById('iframenotte').src = 'nada.php'; }
 if(document.getElementById('notte')){ document.getElementById('notte').style.display = 'none'; }
 if(document.getElementById('gifnotemin')){ document.getElementById('gifnotemin').style.display = 'block'; }
 

}//function fechanotte
////////////////////////////////////////////////////////////////////////////////////////
function abrenottes(){

 if(document.getElementById('iframenotte')){ document.getElementById('iframenotte').src = 'nottes.php'; }
 if(document.getElementById('notte')){ document.getElementById('notte').style.display = 'block'; }
 if(document.getElementById('gifnotemin')){document.getElementById('gifnotemin').style.display = 'none'; }

}//function reabrenottes
///////////////////////////////////////////////////////////////////////////////////////
function ulmouseover(){
 flagleftmenuativo = "S";
}//function ulmouseon
///////////////////////////////////////////////////////////////////////////////////////
function ulmouseout(){
 flagleftmenuativo = "N";
}//function onmouseout
//////////////////////////////////////////////////////////////////////////////////////
