function trocabanner() {
  var ic = 1; 
  var imagem = new Array(ic); 
  imagem[0] = "<span class=\"idb2\"><script type=\"text/javascript\">addFlash('/Fotos/468x60.swf',468,60);</script><noscript><p>Seu navegador não suporta Javascript!</p></noscript></span>"; 

  function pickRandom(range) { 
     if (Math.random) return Math.round(Math.random() * (range-1));
     else {
       var now = new Date();
       return (now.getTime() / 1000) % range; }
     } 
	 var escolha = pickRandom(ic); 
	 
 document.writeln(''+imagem[escolha]+''); 
}

function addFlash(_src,_w,_h){
	var novoHtml = '';
 	novoHtml += '  <OBJECT height="'+_h+'" width="'+_w+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	novoHtml += '  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
	novoHtml += '  wmode="transparent" ALIGN="">';
	novoHtml += '    <PARAM NAME="movie"   VALUE="'+_src+'">';
	novoHtml += '    <PARAM NAME="quality" VALUE="high">';
	novoHtml += '    <PARAM NAME="wmode"   VALUE="transparent">';
	novoHtml += '    <PARAM NAME="bgcolor" VALUE="#FFFFFF">';
	novoHtml += '    <EMBED wmode="transparent" src="'+_src+'" pluginspage="http://www.macromedia.com/go/getflashplayer" height="'+_h+'" width="'+_w+'"></EMBED>';
	novoHtml += '  </OBJECT>';
  document.write(novoHtml);
}


// Setando as variáveis de aumento de fonte

var defaultFontSize = 120;
var maximumFontSize = 400;
var currentFontSize = defaultFontSize;

function resetFontSize() {
	resetSize = defaultFontSize - currentFontSize;
	changeFontSize(resetSize);
}

function changeFontSize(sizeDifference) {
	currentFontSize = currentFontSize + sizeDifference;

	if(currentFontSize > maximumFontSize) { alert('Você já chegou ao tamanho máximo!'); currentFontSize = 300;  }
	else if(currentFontSize < 60) { alert('Você já chegou ao tamanho mínimo!'); currentFontSize = 60;  }

	setFontSize(currentFontSize);
}

function setFontSize(fontSize){ document.getElementById('areaTexto').style.fontSize = fontSize + '%'; }


function areaTexto(x) {
	if (x == "A") { changeFontSize(10); }
	else if (x == "D") { changeFontSize(-10); }
	else { resetFontSize(); }
}

function closebanner()
{
  document.getElementById("flutuante").style.display = 'none';
}

function open_center(url, name, params, Wwidth, Wheight) {
    Swidth = screen.width;
    Sheight = screen.height;

    Wleft = Math.floor((Swidth / 2) - (Wwidth / 2) - 8);
    Wtop = Math.floor((Sheight / 2) - (Wheight / 2) - 20);

    params = params+",left="+Wleft+",top="+Wtop+",width="+Wwidth+",height="+Wheight;

    window.open(url, name, params);
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function URLDecode(txtEncoded) {
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef";
   var plaintext = "";
   var i = 0;
   if (txtEncoded > '') {
     while (i < txtEncoded.length) {
         var ch = txtEncoded.charAt(i);
  	   if (ch == "+") {
  	       plaintext += " ";
  		   i++;
  	   } else if (ch == "%") {
  			if (i < (txtEncoded.length-2)
  					&& HEXCHARS.indexOf(txtEncoded.charAt(i+1)) != -1
  					&& HEXCHARS.indexOf(txtEncoded.charAt(i+2)) != -1 ) {
  				plaintext += unescape( txtEncoded.substr(i,3) );
  				i += 3;
  			} else {
  				alert( 'Bad escape combination near ...' + txtEncoded.substr(i) );
  				plaintext += "%[ERROR]";
  				i++;
  			}
  		} else {
  		   plaintext += ch;
  		   i++;
  		}
  	} // while
  }
  return plaintext;
};

function GetQueryString(strParam) {
  hu = window.location.search.substring(1);

  gy = hu.split("&");

  for (i=0;i<gy.length;i++) {
    ft = gy[i].split("=");
    if (ft[0] == strParam) {
      return ft[1];
    }
  }
}

function randomizeBloggers(id, idshow, num)
{
    var content = new Array();
    var links = new Array();
    var tags = new Array();
    var randomness = '';
    
    var x = 0;
    
    $('#'+id+' a').each(function () {
        content[x] = $(this).html();
        links[x] = $(this).attr('href');
        x++;
    });
    
    var shownum = content.length;
    if (num > shownum) { num = shownum; }
    
    for (x = 0; x < num; x++)
    {
        randomness = Math.floor(Math.random()*content.length);
        tags[x] = '<a href="'+links[randomness]+'">'+content[randomness]+'</a>';
        content.splice(randomness, 1);
        links.splice(randomness, 1);
    }
    
    
    for (x = 0; x < num; x++)
    {
        $('#'+idshow).append(tags[x]);
    }
    
}

function gallerySlicer(order)
{
	var quantidade = $('#sysgalleries div');
	var paginas = Math.floor(quantidade.length / 28);
	if (paginas < (quantidade.length / 28)) { paginas++; }
	
	if (order == 'slice')
	{
	
	}
	else
	{
		$('#sysgalleries div').each(function (){
			if ($(this).attr('id') != 'slicer')
			{
				$(this).hide();
			}
		});
	
		$('#pag-'+order).show();
	}

}

