function $(strId) {
	var i, arrReturn,arrStrId;
	if(arguments.length > 1) {
		arrStrId = new Array();
		for(i=0; i<arguments.length; i++)
			arrStrId.push(arguments[i]);
	}
	if(strId instanceof Array) {
		arrStrId = strId;
	}
	
	if(arrStrId instanceof Array) {
		arrReturn = new Array();
		for(i=0; i<arrStrId.length; i++)
			arrReturn[i] = document.getElementById(arrStrId[i]);
	} else {
		arrReturn = document.getElementById(strId);
	}
	return arrReturn;
}

function adicionarEvento(objeto,evento,funcao) {
	if (objeto.addEventListener)
			objeto.addEventListener(evento,funcao,true)
	if (objeto.attachEvent)
			objeto.attachEvent("on"+evento,funcao)
}

function removerEvento(objeto,evento,funcao) {
	if (objeto.removeEventListener)
			objeto.removeEventListener(evento,funcao,true)
	if (objeto.detachEvent)
			objeto.detachEvent("on"+evento,funcao)
}

function popup(end,npop,larg,alt) {
	window.open(end, npop, 'status=yes,height='+alt+',width='+larg+',top='+(window.screen.height/2-alt/2)+',left='+(window.screen.width/2-larg/2));
	return false;
}

function popupFlash(end,npop,larg,alt) {
	window.open(end, npop, 'status=yes,height='+alt+',width='+larg+',top='+(window.screen.height/2-alt/2)+',left='+(window.screen.width/2-larg/2));
}
function lunendertv(url) {
var w = 640;
var h = 562;
var lado = (screen.width - w) / 2;
var topo = (screen.height - h) / 2;
window.open('http://lunender.com.br/tvlunender.html','nome','height='+h+',width='+w+',top='+topo+',left='+lado+'');
}

function licenciados() {
var w = 720;
var h = 500;
var lado = (screen.width - w) / 2;
var topo = (screen.height - h) / 2;
window.open('swf/licenciados/','nome','height='+h+',width='+w+',top='+topo+',left='+lado+'');
}


		/**TROCAR LINHA**/
		/*var $url = $("a.URL").attr('rel');
		$("div.link a").click(function() {
				var id = $('ul.colecoes a:first').attr('id');
				var linha = $(this).attr("id");
				$("a.URL").attr('href',linha);

				$("ul#thumbs").animate( { 'opacity' : 0 }, function() {
					$("ul#thumbs").empty();
					$("ul#thumbs").animate({opacity: 1});
					$("ul#thumbs").append('<p class="loader">Carregando</p>');
					$.getJSON($url+'ajax/listar-fotos/enu_linha/'+linha,
						function(data)	{
							$("ul#thumbs").empty();
						 $.each(data, function(i,item){
							if(i==0) {
								abreFoto(item.foto_colecao_id);
								$('a.ATUAL').attr('rel',item.nome_colecao);
							}
							if(i<16) {
								$("ul#thumbs").append("<li><a id='"+item.enu_linha+"' href='javascript:void(0);' title='ver' rel='"+item.foto_colecao_id+"'><img alt='"+item.nome_foto+"' src='"+$url+"images/colecao/"+item.foto_colecao_id+"p.jpg' /></a></li>");
							} else {
								$("ul#thumbs").append("<li style='display:none;'><a id='"+item.enu_linha+"' href='javascript:void(0);' title='ver' rel='"+item.foto_colecao_id+"'><img alt='"+item.nome_foto+"' src='"+$url+"images/colecao/"+item.foto_colecao_id+"p.jpg' /></a></li>");
							}
						});
						$("ul#thumbs").animate({opacity: 1},800);
						clicar();
						//trocar(linha);
						trocarColecoes(linha);
                        paginar();
					});
			});
		});*/

		/**ABRE FOTO GRANDE**/
		function abreFoto(f) {
				foto.empty();
				foto.append("<img title=\'ver\' src=\'images/colecao/"+f+"g.jpg\' />");
				$('.ampliar').attr('href',"images/colecao/ampliar/"+f+"g.jpg");
				$('.ampliarFoto').attr('href',"images/colecao/ampliar/"+f+"g.jpg");
		}
