function id() {
  var elements = new Array();
  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string') element = document.getElementById(element);
    if (arguments.length == 1) return element;
    elements.push(element);
  }
  return elements;
}
player = {
	apagaCombos : function(){
		drops = document.body.getElementsByTagName('select');
		for(c=0;c<drops.length;c++){
			drops[c].style.visibility='hidden';
		}
	},

	reexibeCombos : function(box){
		if (id(box)) {
			drops = is(box).getElementsByTagName('select');
		}else {
			drops = document.body.getElementsByTagName('select');
		}
		for(c=0;c<drops.length;c++){
			drops[c].style.visibility='visible';
		}
	},

	removeElement: function(divNum) {
	  var olddiv = this.E(divNum);
	  document.body.removeChild(olddiv);
	},

	pegaMedidas : function(){
		// Pega altura e largura do conteudo da pagina
		var windowWidth, windowHeight;
		if (self.innerHeight) {	// Todos exceto IE entram aqui
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // IE 6, IE 7 entraram aqui
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // Nenhum testado entrou aqui, deixo por garantia
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}
		// Pega altura e largura da pagina
		var pageWidth, pageHeight;
		
		if (window.innerHeight && window.scrollMaxY) {	// Nenhum testado entrou aqui, mas deixo por garantia
			pageWidth = document.body.scrollWidth;
			pageHeight = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ 
			// Opera9, Mac 3 para windows entram aqui
			pageWidth = document.body.scrollWidth;
			pageHeight = document.body.scrollHeight;
		} else { //IE6, IE7, FF, Netscape entram aqui.
			pageWidth = document.body.offsetWidth;
			pageHeight = document.body.offsetHeight;
		}	

		if(pageHeight < windowHeight){
			pageHeight = windowHeight;
		}else {
			if(/Internet Explorer/.test(navigator.appName)) {
				pageHeight+=30;  // corrigir bug IE
			}
		}

		if(pageWidth < windowWidth){
			pageWidth = windowWidth;
		}

		// Pega altura e largura do scroll
		var scrollH, scrollV;

		if (self.pageYOffset) {
			scrollV = self.pageYOffset;
			scrollH = self.pageXOffset;
		} else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)){	 // Explorer 6 Strict
			scrollV = document.documentElement.scrollTop;
			scrollH = document.documentElement.scrollLeft;
		} else if (document.body) {// all other Explorers
			scrollV = document.body.scrollTop;
			scrollH = document.body.scrollLeft;	
		}

		return {pw:pageWidth,ph:pageHeight,ww:windowWidth,wh:windowHeight,sh:scrollH,sv:scrollV};
	},

	centralizaObj: function(divMain) {
		medidas = this.pegaMedidas(false);
		centroPgW = this.pegaMedidas().ww/2;
		centroPgH = this.pegaMedidas().wh/2;
		centroSiteW = (id(divMain).offsetWidth)/2;
		centroSiteH = (id(divMain).offsetHeight)/2;
		if ((centroPgH-centroSiteH)<0){
			pTop = 0;
		} else {
			pTop = centroPgH-centroSiteH;
		}
		if ((centroPgW-centroSiteW)<0){
			pLeft = 0;
		} else {
			pLeft = centroPgW-centroSiteW;
		}
		id(divMain).style.position="absolute";
		id(divMain).style.top=pTop+"px";
		id(divMain).style.left=pLeft+"px";
		this.posicionaBG(pTop-45,pLeft-94);
	},

	posicionaBG: function(pTop,pLeft) {
		document.body.style.backgroundPosition= pLeft+"px "+pTop+"px";
	}
}
