window.defaultStatus = "";

function janParam( param, param1 , w, h, nome )
{
   //var nomearq = param + (param1); 
//   var nomearq = param + encodeURI(param1);   
   var nomearq = param + escape(param1);
   alert("g "+nomearq)
   var windowvar = window.open(nomearq,nome,"scrollbars=yes,location=no,directories=no,status=no,menubar=no,resizable=yes,maxbutton=no,toolbar=no,top=0,left=0,width="+ w + ",height=" +h );
   windowvar.focus();
}


function jan (param,w,h,nome)
{
   var nomearq = param;
   var windowvar = window.open(nomearq,nome,"scrollbars=yes,location=no,directories=no,status=no,menubar=no,resizable=yes,maxbutton=no,toolbar=no,top=200,left=310,width="+ w + ",height=" +h );
   windowvar.focus();
}
var yy=screen.height;
var xx=screen.width;

function janwin(param)
{
   var nomearq = param;
   var tp = (yy-550)/2;
   var lf = (xx-720)/2;
   
   var windowvar = window.open(nomearq,"Noticia","scrollbars=yes,location=no,directories=no,status=no,menubar=no,resizable=yes,maxbutton=no,toolbar=no,top="+tp+",left="+lf+",width=720,height=550");
   windowvar.focus();
}
function jana (param,w,h,nome)
{

   var nomearq = param;
   var windowvar = window.open(nomearq,nome,"scrollbars=yes,location=no,directories=no,status=no,menubar=no,resizable=yes,maxbutton=no,toolbar=no,top=200,left=310,width="+ w + ",height=" +h );
   windowvar.focus();
}

function BordaV (Obj)
{
   Obj.style.border = "solid 1px #CC0000";
}

function BordaC (Obj)
{
   Obj.style.border = "solid 1px #BEC2CA";
}

function HomeFoto()
{
   if ( document.images["foto"].width < document.images["foto"].height ) {
      document.images["Seta"].width = 10;
      document.images["Seta"].height = 9;
      document.images["Seta"].src = "/midia/img/seta.gif";
   } else {
      document.images["Seta"].width = 9;
      document.images["Seta"].height = 10;
      document.images["Seta"].src = "/midia/img/seta2.gif";
   }
}

function in_array(arr, itm)
{
   for ( var i = 0; i < arr.length; i++ ) {
      var dia = parseInt(arr[i], 10);
      if ( dia == itm ) return true;
   }
   return false;
}

function getToday(sep)
{
   if (!sep) sep = "-";
   var now = new Date();
   var dia = now.getDate();
   if (dia < 10) dia = "0"+dia;
   var mes = now.getMonth() + 1;
   if (mes < 10) mes = "0"+mes;
   var ano = now.getYear();
   if (ano < 1900) ano += 1900;
   return "" + dia + sep + mes + sep + ano;
}

function oct(w)
{
   var op = parent.document.getElementById('ot');
   var fc = parent.document.getElementById('ct');
   var oo = parent.document.getElementById(w);
   var tf = parent.document.getElementById('Indiceaa');
   fc.style.display = "none";
   if (w == 'ot') {
      op.style.display = "block";
      oo.style.display = "block";
      a = y - 110;
  } else {
      op.style.display = "none";
      oo.style.display = "none";
      a = y - 25;
   }
     //alert("g oct "+a)
   tf.height = a;
}

function octi(w,tab1, tab2)
{
   var op = document.getElementById('ot');
   var fc = document.getElementById('ct');
   var oo = document.getElementById(w);
   var tf = document.getElementById('Indiceaa');
   
   var form;
   if ( tf.contentDocument ) { // DOM
      form = tf.contentDocument.getElementById('Indicefr');
   } else if ( tf.contentWindow ) { // IE win
      form = tf.contentWindow.document.getElementById('Indicefr');
   }

   op.style.display = "none";
   fc.style.display = "none";
   oo.style.display = "block";

   if (w == "ot")
   {
      a = y-320;
      form.style.height = y-350;
      trocaTabLidas( tab1, tab2);
   } else {
      form.style.height = y-180;
      a = y-140;
   }
    tf.height = a;
    
  }
