//Abre Home iG Comercial por letra
/*var inicialLetra = url.substring(7,8);
for (i=65;i<=90;i++) { 
if(inicialLetra == String.fromCharCode(i).toLowerCase()){*/
	
	//Liberado pra todo mundo 
		//var popunder = window.open("http://www.ig.com.br/v7/comercial","homeig",'top=0,left=100,toolbar=no,location=no,status=no,menubar=no,directories=no,scrollbars=yes,resizable=no,width=785,height=770');
		//popunder.blur();
		
	/*}
} //Abre Home iG Comercial*/

document.domain = "ig.com.br"; 

function comentarMensagem(id_post)
{
   window.open('http://blig.ig.com.br/comentarios.php?id_post=' + id_post ,"fazercomentarios", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=425,height=350,top=50,left=100");

}/*comentarMensagem*/


function verComentarios(id_post)
{
   window.open('comentarios/' + id_post + '.html',"vercomentarios", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=425,height=350,top=50,left=100");
}/*verComentarios*/

function abreComentarios(id_post, caminho)
{
   window.open('http://' + caminho + '.blig.ig.com.br/comentarios/' + id_post + '.html',"vercomentarios", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=425,height=350,top=50,left=100");

}/*verComentarios*/


function abrePerfil()
{
   window.open('perfil.html' ,"perfil", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=550,height=450,top=50,left=100");
}/*abrePrefil*/

function abreBoletim(id_blog)
{
   janela = window.open("http://blig.ig.com.br/aviso_newsletter_criacao.php?id_blog="+id_blog,"popBoletim","width=236,height=257");
}/*abreBoletim*/

function abreAvisoDiario(id_blog)
{
   janela = window.open("http://blig.ig.com.br/aviso_criacao.php?id_blog="+id_blog,"popAvisoDiario","width=236,height=257");
}/*abreAvisoDiario*/

function abreEnvioAmigo(id_post,id_blog)
{
   url = location.href;
   if(url.lastIndexOf('#')>=0)
   	url = url.substr(0, - 1);
   janela = window.open("http://blig.ig.com.br/envia_amigo.php?url="+url+"&id_post="+id_post,"popEnvioAmigo","width=300,height=360");
}/*abreEnvioAmigo*/

function abreEnvioAmigoNew(id_post, perma)
{
   url = location.href;
   if(url.lastIndexOf('#')>=0)
   	url = url.substr(0, - 1);
   janela = window.open("http://blig.ig.com.br/envia_amigo.php?url="+url+"&id_post="+id_post+"&permalink="+ perma,"popEnvioAmigo","width=300,height=360");
}/*abreEnvioAmigo*/


function seloCrieSeuBlig(){
	document.write('<div align="center"><a href="http://blig.ig.com.br/" target="_blank"><img src="http://image.ig.com.br/bligzone/images/selo_blig_crieseublog.gif" width="90" height="36" border="0"></a></div>');
}/*selo_crieBlog*/

function abrePerfilPersonalizado(nome_arquivo,largura,altura)
{
   window.open(nome_arquivo,"perfil", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width="+largura+",height="+altura+",top=50,left=100");
}/*abrePrefilPersonalizado*/
//document.write("<base href='" + document.URL.substring(0, document.URL.lastIndexOf('/')) + "\/' \/>");
//alert(document.URL.substring(0, document.URL.lastIndexOf('/')));

x=document.URL;
ind=x.lastIndexOf('/');
nomeBlig=x.substring(1,ind);
nomeBlig=nomeBlig.substring(nomeBlig.lastIndexOf('/')+1);
//alert(nomeBlig);


///Anderson - 2006-06-28 - funcoes de contador/cookie

function getCookie(NameOfCookie) {
  if (document.cookie.length > 0) {
   begin = document.cookie.indexOf(NameOfCookie+"=");

   if (begin != -1) {
      begin += NameOfCookie.length+1;
      end = document.cookie.indexOf(";", begin);

      if (end == -1) end = document.cookie.length;
      return unescape(document.cookie.substring(begin, end));
      }
   }
  return null;
}


function setFrameXY() {
   fCounterX = getCookie('CounterW');
   fCounterY = getCookie('CounterH');

   document.getElementById('counter').width = fCounterX;
   document.getElementById('counter').height = fCounterY;
}