function abrirComponenteAlbum(pagina) {
	window.open(pagina,'',"left=0,top=0,height=150,width=300,scrollbar=no");
	return false;
}


function getParams() {
        locate = window.location.toString();
	idx = locate.indexOf('?');
	params = new Array();
	if (idx != -1) {
	  var pairs = locate.substring(idx+1, locate.length).split('&');
	  for (var i=0; i<pairs.length; i++) {
	    nameVal = pairs[i].split('=');
	    params[nameVal[0]] = nameVal[1];
	  }
	}
	return params;
}


function isBrowser(b,v) {
  /*
  ** Check if the current browser is compatible
  **  b  browser name
  **  v  version number (if 0 don't check version)
  ** returns true if browser equals and version equals or greater
  */
  var detect = navigator.userAgent.toLowerCase();
  place = detect.indexOf(b);
  detect = detect.substring(place + 1 + b.length);
  detect = detect.substring(0,detect.indexOf(' ') - 1);
  return (place != -1) && ((v == "0") || (v <= parseFloat(detect)));
  }


// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
function correctPNG() {
  if (isBrowser("msie",5.5))
    for (var i=0; i<document.images.length; i++) {
      var img = document.images[i];
      var imgName = img.src.toUpperCase();
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
        var imgID = (img.id) ? "id='" + img.id + "' " : "";
	var imgClass = (img.className) ? "class='" + img.className + "' " : "";
	var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
	var imgStyle = "display:inline-block;" + img.style.cssText ;
	if (img.align == "left")
          imgStyle = "float:left;" + imgStyle;
	if (img.align == "right")
          imgStyle = "float:right;" + imgStyle;
	if (img.parentElement.href)
          imgStyle = "cursor:hand;" + imgStyle;
	var strNewHTML = "<span " + imgID + imgClass + imgTitle
	  + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	  + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
	img.outerHTML = strNewHTML;
	i = i-1;
      }
    }
}


function setCols(elementName,cols) {
	parent.document.getElementById(elementName).cols = cols;
	return false;
}


function trocaIdioma(idioma) {
	for(i=0; i<parent.window.frames.length; i++) {
	  enderecoAtual = parent.window.frames[i].location.toString();
	  posicaoTroca = enderecoAtual.indexOf('.htm');
          if (posicaoTroca <=0) {
            posicaoTroca = enderecoAtual.indexOf('language=') + 11;
          }
	  if ((posicaoTroca > 0) && 
              ((enderecoAtual.charAt(posicaoTroca - 3) == '_') ||
               (enderecoAtual.charAt(posicaoTroca - 3) == '=')))  {
            parent.window.frames[i].location.replace(enderecoAtual.substring(0,posicaoTroca - 2) + idioma + enderecoAtual.substring(posicaoTroca,enderecoAtual.length));
	  }
	}
	return false;
}


// Utilizado quando NÃO deseja-se exibir o frame 2
function naoMostraFrame2() {
	try {
	  parent.window.frames[2].location = '';
	  setCols('mainFrameset','0,*');
	}
	catch(e) {}
	return true;
}




if (isBrowser("msie",5.5)) {
  window.attachEvent("onload", correctPNG);
}