//Window.status = "Para rir a sério!";


function OpenWin(URL,nome,w,h) {
msg=open(URL,"nome","width="+w+",height="+h+",toolbar=no,scrollbars=no,resizable=yes,status=no,directories=no,menubar=no,location=no");
}

function OpenWinChatFAQ(URL,nome,w,h) {
msg=open(URL,"nome","width="+w+",height="+h+",toolbar=no,scrollbars=yes,resizable=no,status=no,directories=no,menubar=no,location=no");
}

//function SugereItem(coditem,titulo){
	function SugereItem(coditem){
  //     TecWindow=window.open(nome,"displayWindow","toolbar=no,width=535,height=450,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no")
                                
var newStr, urlStr, re, SugereItem;

//alert ("Estamos em testes. Pedimos desculpa pelo incómodo.");
	re = / /gi;
//alert ("Tente enviar este item mais tarde, obrigado.");
	
	//newStr = "/hm/pags/sendpage.php?artigoID=" + ID + "&tipo=" + tip + "&titulo=" + tit;
	//newStr = "/hm/pags/sendpage.php?c=" + coditem + "&tit=" + titulo;
	newStr = "/hm/pags/sendpage.php?c=" + coditem;
  urlStr = newStr.replace(re,"%20");
	
	TecWindow=window.open(urlStr,'SugereItem','toolbar=no,scrollbars=no,resizable=no,status=no,directories=no,menubar=no,location=no,width=480,height=530');
	//return false;
                                
}

function PrintItem(coditem){
  //                              TecWindow=window.open(nome,"displayWindow","toolbar=no,width=535,height=450,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no")
                                
var newStr, urlStr, re, SugereItem;

//alert (titulo);
//alert ("Estamos em testes. Pedimos desculpa pelo incómodo.");
	re = / /gi;
	//newStr = titulo;
//alert ("Tente enviar este item mais tarde, obrigado.");
	//alert (tit);
	
	
	//newStr = "/hm/pags/sendpage.php?artigoID=" + ID + "&tipo=" + tip + "&titulo=" + tit;
	newStr = "/hm/pags/print.php?c=" + coditem;
	
	//urlStr = newStr.replace(re,"%20");
//alert (urlStr);
	
	//alert (newStr);
	
	TecWindow=window.open(newStr,'PrintItem','toolbar=no,scrollbars=yes,resizable=yes,status=no,directories=no,menubar=no,location=no,width=560,height=520');
	//return false;
                                
}


function empacotar(coleccao,dir,nome_file,width,height){
                               
 var newStr, urlStr, re, mostra_coleccao;

	re = / /gi;

	newStr = "/hm/coleccoes_de_anedotas/files/item_colection.php?col=" + coleccao + "&dir_imgs=" + dir + "&file=" + nome_file + "&width=" + width + "&height=" + height;
	urlStr = newStr.replace(re,"%20");

	TecWindow=window.open(urlStr,'mostra_coleccao','toolbar=no,scrollbars=no,resizable=yes,status=no,directories=no,menubar=no,location=no,width=400,height=300');
	
                                
}

function postal(nome_file,width,height){
                               
 var newStr, urlStr, re, mostra_postal;

	re = / /gi;

	newStr = "/hm/cartoes/cartoes_preview.php?file=" + nome_file + "&width=" + width + "&height=" + height;
	urlStr = newStr.replace(re,"%20");

	//TecWindow=window.open(urlStr,'mostra_postal','toolbar=no,scrollbars=no,resizable=yes,status=no,directories=no,menubar=no,location=no,width=400,height=300');
	TecWindow=window.open(urlStr,'mostra_postal','toolbar=no,scrollbars=no,resizable=yes,status=no,directories=no,menubar=no,location=no,width=600,height=300');
                                
}



function Window400(nome){
                                TecWindow=window.open(nome,"displayWindow","toolbar=no,width=400,height=440,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no")
                              }
                              
function Window468(nome){
                                TecWindow=window.open(nome,"Votaritem","width=468,height=470,toolbar=no,directories=no,status=no,scrollbars=no,resizable=yes,menubar=no,location=no")
                        }

function Window535(nome){
                                TecWindow=window.open(nome,"displayWindow","toolbar=no,width=535,height=440,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no")
                        }
function Window550(nome){
                                TecWindow=window.open(nome,"displayWindow","toolbar=no,width=550,height=440,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no")
                        }
function Window_dossier(nome){
                                TecWindow=window.open(nome,"displayWindow","toolbar=yes,width=550,height=440,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no")
                        }

function Window750(nome){
                                TecWindow=window.open(nome,"displayWindow","toolbar=no,width=750,height=440,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=yes")
                        }
function cards_v(nome){
        TecWindow=window.open(nome,"displayWindow","toolbar=no,width=380,height=500,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
        }

function cards_h(nome){
        TecWindow=window.open(nome,"displayWindow","toolbar=no,width=490,height=370,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
        }
                        
function fit(nome){
        TecWindow=window.open(nome,"displayWindow","toolbar=no, width=400,height=300,directories=no,status=no,scrollbars=no,resizable=yes,menubar=no")
}


function fit_scroll(nome){
        TecWindow=window.open(nome,"displayWindow","toolbar=no, width=400,height=300,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
        }
                        
// Funcoes de Scrool Over        

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//------------------------------------------------------------------
//PopUnder Power
//Credit notice must stay intact for use.
//Paste this entire javascript between the
//<head> & </head> tags of your page, 
//Visit http://www.mikenew.net for more scripts. 
//by Mike New, with special thanks to Jeff Phillips 
//of classadrivers.com
//Downloaded from Java-scripts.net
//More scripts at http://www.java-scripts.net 

//Begin. Specify URLs to randomly select from
//and pop-under. Edit & add freely.
var popunder=new Array()
//popunder[0]="/hm/dinamicos/ParPerfeito.html"
popunder[0]="/hm/dinamicos/Toques2005T2.html"
//popunder[0]="/hm/dinamicos/Toques2005T1.html"
//popunder[0]="/hm/dinamicos/NatalToques.html"
//popunder[1]="/hm/pags/anedotas.html"

//Specify the width and height of new popunder window (in pixels).
// Dimensoes para os Toques
var width = '725'; 
var height = '529';

// Dimensoes ParPerfeito
//var width = '300'; 
//var height = '300';

//these are obvious variables. set "yes" or "no".
var p = 'scrollbars=no, resizable=no, toolbar=no,' + 'menubar=no, status=no, location=no, left=0, top=0, height=' + height + ',width=' + width;

// Load new PopUnder only once per browser session? (0=no, 1=yes)
// Putting 0 will cause the Popunder to load every time page is loaded
// Specifying 1 will cause it to load only once per session
var one_time=1

// That's it! Don't edit the code below unless you're really good. :-P //

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if the cookie exists
      offset += search.length
      //set the index of beginning value
      end = document.cookie.indexOf(";", offset);
      
    if (end == -1) // set the index of the end of cookie value
         end = document.cookie.length;
         returnvalue = unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

/*
function loadornot(){
if (get_cookie('popunder')==''){
load_pop_power()
document.cookie="popunder=yes"
}
}

function load_pop_power(){
win2 = window.open(popunder[Math.floor(Math.random()*(popunder.length))], "bw", p)
win2.blur()
window.focus()
}

if (one_time==0)
load_pop_power()
else
loadornot()
*/
