
limpabuscavar = 0;

function limpabusca(objt){
	//if(objt.value == 'fa&ccedil;a sua pesquisa'){
	if(limpabuscavar==0){
		objt.value = '';
		limpabuscavar=1;
	}
}

function dobusca(valor){
		if(valor==1){
			qbusca = document.getElementById('q2').value;
			document.getElementById('q').value = qbusca;
		}
		document.getElementById('cse-search-box').submit();
}

function topoofertalink(){
	window.open('http://www.submarino.com.br/produto/6/21621920/?franq=259073');
}

function geramenu(){
	
	// FILMES RANDOMICOS DO MENU TOPO
	// --------------------------------------------------
	i=0;
	var menuopc = new Array();
	var menulnk = new Array();
	var seles = new Array();
	var final	= '';

	menuopc[i] = 'O Poderoso Chefão';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/o_poderoso_chefao.htm'; i++;
	menuopc[i] = 'Batman - O Cavaleiro das Trevas';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/batman_o_cavaleiro_das_trevas.htm'; i++;
	menuopc[i] = 'O C&oacute;digo Da Vinci';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/o_codigo_da_vinci.htm'; i++;
	menuopc[i] = 'Distrito 9';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/distrito_9.htm'; i++;
	menuopc[i] = 'Clube da Luta';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/clube_da_luta.htm'; i++;
	menuopc[i] = 'Um Sonho de Liberdade';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/um_sonho_de_liberdade.htm'; i++;
	menuopc[i] = 'Cidade de Deus';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/cidade_de_deus.htm'; i++;
	menuopc[i] = 'Anjos e Demonios';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/anjos_e_demonios.htm'; i++;
	menuopc[i] = 'Sex And The City';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/sex_and_the_city_o_filme.htm'; i++;
	menuopc[i] = 'Star Trek';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/star_trek.htm'; i++;
	menuopc[i] = 'Avatar';
	menulnk[i] = 'http://www.portaldecinema.com.br/Filmes/avatar.htm'; i++;
	
	for(i=0; i<3; i++){
		var sel = Math.random();
		sel = Math.ceil(sel * 10);
		
		if(seles[sel] != null){
			i--;
			continue;
		}
		else seles[sel] = sel;
		
		final += "<a href='" + menulnk[sel] + "'>" + menuopc[sel] + "</a> \n";
	}
	
	hotmenu = document.getElementById('menufilmes');
	hotmenu.innerHTML = final;
	// --------------------------------------
	
	
	// ATORES RANDOMICOS DO MENU TOPO
	// --------------------------------------------------
	i=0;
	var menuopc = new Array();
	var menulnk = new Array();
	var seles = new Array();
	var final	= '';

	menuopc[i] = 'Angelina Jolie';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atrizes/angelina_jolie.htm'; i++;
	menuopc[i] = 'Scarlett Johansson';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atrizes/scarlett_johansson.htm'; i++;
	menuopc[i] = 'Winona Ryder';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atrizes/winona_ryder.htm'; i++;
	menuopc[i] = 'Natalie Portman';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atrizes/natalie_portman.htm'; i++;
	menuopc[i] = 'Meryl Streep';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atrizes/meryl_streep.htm'; i++;
	menuopc[i] = 'Johnny Depp';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atores/johnny_deep.htm'; i++;
	menuopc[i] = 'Al Pacino';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atores/al_pacino.htm'; i++;
	menuopc[i] = 'Brad Pitt';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atores/brad_pitt.htm'; i++;
	menuopc[i] = 'George Clooney';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atores/george_clooney.htm'; i++;
	menuopc[i] = 'Jim Carrey';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atores/jim_carrey.htm'; i++;
	menuopc[i] = 'Patrick Swayze';
	menulnk[i] = 'http://www.portaldecinema.com.br/Atores/patrick_swayze.htm'; i++;
	
	for(i=0; i<3; i++){
		var sel = Math.random();
		sel = Math.ceil(sel * 10);
		
		if(seles[sel] != null){
			i--;
			continue;
		}
		else seles[sel] = sel;
		
		final += "<a href='" + menulnk[sel] + "'>" + menuopc[sel] + "</a> \n";
	}
	
	hotmenu = document.getElementById('menuatores');
	hotmenu.innerHTML = final;
	// --------------------------------------
	
	
	// DIRETORES RANDOMICOS DO MENU TOPO
	// --------------------------------------------------
	i=0;
	var menuopc = new Array();
	var menulnk = new Array();
	var seles = new Array();
	var final	= '';

	menuopc[i] = 'Martin Scorsese';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/martin_scorsese.htm'; i++;
	menuopc[i] = 'Quentin Tarantino';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/quentin_tarantino.htm'; i++;
	menuopc[i] = 'Fernando Meirelles';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/fernando_meirelles.htm'; i++;
	menuopc[i] = 'Steven Spielberg';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/steven_spielberg.htm'; i++;
	menuopc[i] = 'Peter Jackson';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/peter_jackson.htm'; i++;
	menuopc[i] = 'Woody Allen';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/woody_allen.htm'; i++;
	menuopc[i] = 'James Cameron';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/james_cameron.htm'; i++;
	menuopc[i] = 'Tim Burton';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/tim_burton.htm'; i++;
	menuopc[i] = 'Ridley Scott';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/ridley_scott.htm'; i++;
	menuopc[i] = 'Stanley Kubrick';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/stanley_kubrick.htm'; i++;
	menuopc[i] = 'Francis Ford Coppola';
	menulnk[i] = 'http://www.portaldecinema.com.br/Diretores/francis_ford_coppola.htm'; i++;
	
	for(i=0; i<3; i++){
		var sel = Math.random();
		sel = Math.ceil(sel * 10);
		
		if(seles[sel] != null){
			i--;
			continue;
		}
		else seles[sel] = sel;
		
		final += "<a href='" + menulnk[sel] + "'>" + menuopc[sel] + "</a> \n";
	}
	
	hotmenu = document.getElementById('menudiretores');
	hotmenu.innerHTML = final;
	// --------------------------------------
	
}


// GERA LINK DA PROMOÇÃO
function gerapromo(){
	
		txtpromo = 'Ganhe ingressos para o filme Idas e Vindas do Amor';
		linkpromo = 'http://www.portaldecinema.com.br/promo72.htm';
	
		document.getElementById('promotit').innerHTML = '<a href="'+ linkpromo +'" class="menudirtit1">Promo&ccedil;&atilde;o</a>';
		document.getElementById('promotxt').innerHTML = '<a href="'+ linkpromo +'">' + txtpromo + '<br><br><img src="http://www.portaldecinema.com.br/Posteres/idas_e_vindas_do_amor.gif" border="0"></a>';
}

// GERA NOVIDADES
function geranews(){
	
		// FILMES ------------------------
		i = 0;
		var txt = new Array();
		var tlink = new Array();
		
		txt[i] = 'Como Treinar o Seu Dragao';
		tlink[i] = 'http://www.portaldecinema.com.br/Filmes/como_treinar_o_seu_dragao.htm'; i++;
		txt[i] = 'Ilha do Medo';
		tlink[i] = 'http://www.portaldecinema.com.br/Filmes/ilha_do_medo.htm'; i++;
		txt[i] = "Um Sonho Possivel";
		tlink[i] = 'http://www.portaldecinema.com.br/Filmes/um_sonho_possivel.htm'; i++;
		
		valor = document.getElementById('dirnews1').innerHTML = '<li class="dirnewstit"><a href="http://www.portaldecinema.com.br/lista_filmes.htm">Filmes</a></li>';
	
		for(n=0; n<txt.length;n++){
			valor += '<li><a href="'+tlink[n]+'">'+txt[n]+'</a></li>\n';
		}
		document.getElementById('dirnews1').innerHTML = valor;
		
		
		// ATORES ------------------------
		i = 0;
		var txt = new Array();
		var tlink = new Array();
		
		txt[i] = 'Patrick Swayze';
		tlink[i] = 'http://www.portaldecinema.com.br/Atores/patrick_swayze.htm'; i++;
		txt[i] = 'Leonardo Di Caprio';
		tlink[i] = 'http://www.portaldecinema.com.br/Atores/leonardo_di_caprio.htm'; i++;
		txt[i] = "Russell Crowe";
		tlink[i] = 'http://www.portaldecinema.com.br/Atores/russell_crowe.htm'; i++;
		
		valor = document.getElementById('dirnews2').innerHTML = '<li class="dirnewstit"><a href="http://www.portaldecinema.com.br/lista_atores.htm">Atores</a></li>';
	
		for(n=0; n<txt.length;n++){
			valor += '<li><a href="'+tlink[n]+'">'+txt[n]+'</a></li>\n';
		}
		document.getElementById('dirnews2').innerHTML = valor;
		
		
		// DIRETORES ------------------------
		i = 0;
		var txt = new Array();
		var tlink = new Array();
		
		txt[i] = 'James Cameron';
		tlink[i] = 'http://www.portaldecinema.com.br/Diretores/james_cameron.htm'; i++;
		txt[i] = 'Christopher Nolan';
		tlink[i] = 'http://www.portaldecinema.com.br/Diretores/christopher_nolan.htm'; i++;
		txt[i] = "Guillermo Del Toro";
		tlink[i] = 'http://www.portaldecinema.com.br/Diretores/guillermo_del_toro.htm'; i++;
		
		valor = document.getElementById('dirnews3').innerHTML = '<li class="dirnewstit"><a href="http://www.portaldecinema.com.br/lista_diretores.htm">Diretores</a></li>';
	
		for(n=0; n<txt.length;n++){
			valor += '<li><a href="'+tlink[n]+'">'+txt[n]+'</a></li>\n';
		}
		document.getElementById('dirnews3').innerHTML = valor;
		
		
		// CRITICAS ------------------------
		i = 0;
		var txt = new Array();
		var tlink = new Array();
		
		txt[i] = 'Guerra ao Terror';
		tlink[i] = 'http://www.portaldecinema.com.br/Filmes/guerra_ao_terror.htm'; i++;
		txt[i] = 'Premonicao 4';
		tlink[i] = 'http://www.portaldecinema.com.br/Filmes/premonicao_4.htm'; i++;
		txt[i] = "Ilha do Medo";
		tlink[i] = 'http://www.portaldecinema.com.br/Filmes/ilha_do_medo.htm'; i++;
		
		valor = document.getElementById('dirnews4').innerHTML = '<li class="dirnewstit"><a href="http://www.portaldecinema.com.br/colunas.htm">Cr&iacute;ticas</a></li>';
	
		for(n=0; n<txt.length;n++){
			valor += '<li><a href="'+tlink[n]+'">'+txt[n]+'</a></li>\n';
		}
		document.getElementById('dirnews4').innerHTML = valor;
}

// FUNCOES CARREGADAS NO LOAD DA PÁGINA
function funcoes_start(){
	
	if (screen.width>=1280){
		// document.getElementById('banner_skyscraper').style.margin = "0 0 0 333px";
		document.getElementById('banner_skyscraper').style.display = "block";
	}
	
	geramenu();
	gerapromo();
	geranews();
	
}

// FUNCOES LAYERS
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}