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;
}
playerFunctions = {
	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 = medidas.ww/2;
		centroPgH = medidas.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;
		}
		this.posicionaBG(pTop-238,pLeft-301);
		id(divMain).style.position="absolute";
		id(divMain).style.top=pTop+"px";
		id(divMain).style.left=pLeft+"px";
	},

	posicionaBG: function(pTop,pLeft) {
		document.body.style.backgroundPosition= pLeft+"px "+pTop+"px";
	}
}
/*
CSS Browser Selector v0.3.1
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors

Available Browser Codes
	.ie - Internet Explorer (All versions)
	.ie8 - Internet Explorer 8.x
	.ie7 - Internet Explorer 7.x
	.ie6 - Internet Explorer 6.x
	.ie5 - Internet Explorer 5.x
	.gecko - Mozilla, Firefox (all versions), Camino
	.ff2 - Firefox 2
	.ff3 - Firefox 3
	.opera - Opera (All versions)
	.opera8 - Opera 8.x
	.opera9 - Opera 9.x
	.konqueror - Konqueror
	.webkit or safari - Safari, NetNewsWire, OmniWeb, Shiira, Google Chrome
	.chrome - Google Chrome
*/
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3')?g+' ff3':is('gecko/')?g:/opera(\s|\/)(\d+)/.test(ua)?'opera opera'+RegExp.$2:is('konqueror')?'konqueror':is('chrome')?w+' '+s+' chrome':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);