	Event.observe (window, 'load', function(){
		var mainLightBox = $$('.home .mainLightBox')[0];
		if (mainLightBox) {
			var mainLightBoxClose = $$('.home .mainLightBox .close')[0];
			var banner = $$('.home .mainLightBox .banner')[0];
			var joinNow = $$('.home .mainLightBox .joinNow')[0];
			var overlay = $$('.home .overlay')[0];
			function resizeWindow() {
				var bodyHeight = $$('body')[0].getHeight();
				var bodyWidth = $$('body')[0].getWidth();
				if (bodyHeight < document.viewport.getHeight()) { bodyHeight = document.viewport.getHeight() - 15; }
				if (bodyWidth < 980) { bodyWidth = '980'; }
				
				if (document.viewport.getHeight() < 600) { mainLightBox.setStyle({ top: '0', marginTop: '0' }); } else { mainLightBox.setStyle({ top: '50%', marginTop: '-300px' }); }
				if (document.viewport.getWidth() < 980) { mainLightBox.setStyle({ left: '0', marginLeft: '0' }); } else { mainLightBox.setStyle({ left: '50%', marginLeft: '-490px' }); }
				overlay.setStyle({ width: bodyWidth+'px', height: bodyHeight+15+'px' });
				}
			resizeWindow();
			
			Event.observe (window, 'resize', function(){ resizeWindow(); });
			overlay.onclick = function() { hideAll(); };
			mainLightBox.onclick = function() { hideAll(); };
			mainLightBoxClose.onclick = function() { hideAll(); return false; };
			banner.onclick = function() { hideAll(); return false; };
			
			var hideAll = function() {
				mainLightBox.fade({ duration: 0.5 });
				overlay.fade({ duration: 0.5 });
			}
			window.setTimeout(hideAll, 15000);
		}

		var subaLightBox = $$('.subaLightBox')[0];
		if (subaLightBox) {
			var hideAll = function() {
							subaLightBox.fade({ duration: 0.5 });
						}
			window.setTimeout(hideAll, 30000);
		}
		
	});

var existMenuFile = true;
var browser = navigator.appName;
function initMenuStore()

{
if (browser == "Microsoft Internet Explorer") {
submenuIframe = $("subMenuStore").innerHTML;
$("subMenuStore").innerHTML = "<iframe id='iframeSub' class='iframeSub' style='display: none;' src='https://carrinho.blockbusteronline.com.br/locaonline/framework/skins/locaonline/lightwindow/images/arrow-up.gif'></iframe>" + submenuIframe ;
}
  try{
    var showTimer;
    var hideTimer;
	var showTimeriframe;
	var hideTimeriframe;
    if (document.getElementById) 
    {
        submenu = $("subMenuStore");
        submenu.onmouseover=function() {
            if(hideTimer != undefined) {
                clearTimeout(hideTimer);
				clearTimeout(hideTimeriframe);
			}
            showTimer = setTimeout("try{ if(!Element.visible('boxStoreMenu')){new Effect.Appear('boxStoreMenu', {duration: 0.2, queue: {position:'end', scope: 'menu', limit:10} });} } catch(e) { $('boxStoreMenu').display = '' }", 200);
			if (browser == "Microsoft Internet Explorer") {
				showTimeriframe = setTimeout("try{ if(!Element.visible('iframeSub')){new Effect.Appear('iframeSub', {duration: 0.2, queue: {position:'end', scope: 'menui', limit:10} });} } catch(e) { $('iframeSub').display = '' }", 200);
			}
		}
        submenu.onmouseout=function() {
            if(showTimer != undefined) {
                clearTimeout(showTimer);
				clearTimeout(showTimeriframe);
            }
            hideTimer = setTimeout("try { new Effect.Fade('boxStoreMenu', {duration: 0.2, queue: {position:'end', scope: 'menu', limit:10} }); } catch(e) { $('boxStoreMenu').display = 'none' }", 400);
			if (browser == "Microsoft Internet Explorer") {
				hideTimeriframe = setTimeout("try { new Effect.Fade('iframeSub', {duration: 0.2, queue: {position:'end', scope: 'menui', limit:10} }); } catch(e) { $('iframeSub').display = 'none' }", 390);
			}
		}
		
		
		
    } 
	}
	catch(e){}
	
 if (browser == "Microsoft Internet Explorer") {
submenuIframe2 = $("userSubLinks").innerHTML;
$("userSubLinks").innerHTML = "<iframe id='iframeSub2' class='iframeSub' style='display: none;' src='https://carrinho.blockbusteronline.com.br/locaonline/framework/skins/locaonline/lightwindow/images/arrow-up.gif'></iframe>" + submenuIframe2 ;
}
  try{
    var showTimer2;
    var hideTimer2;
	var showTimeriframe2;
	var hideTimeriframe2;
    if (document.getElementById) 
    {
        submenu2 = $("userSubLinks");
        submenu2.onmouseover=function() {
            if(hideTimer2 != undefined) {
                clearTimeout(hideTimer2);
				clearTimeout(hideTimeriframe2);
			}
			$('userSubLinks').addClassName('open');
            showTimer2 = setTimeout("try{ if(!Element.visible('boxSubLinks')){new Effect.Appear('boxSubLinks', {duration: 0.2, queue: {position:'end', scope: 'menu', limit:10} });} } catch(e) { $('boxSubLinks').display = '' }", 200);
			if (browser == "Microsoft Internet Explorer") {
				showTimeriframe2 = setTimeout("try{ if(!Element.visible('iframeSub2')){new Effect.Appear('iframeSub2', {duration: 0.2, queue: {position:'end', scope: 'menui', limit:10} });} } catch(e) { $('iframeSub2').display = '' }", 200);
			}
		}
        submenu2.onmouseout=function() {
            if(showTimer2 != undefined) {
                clearTimeout(showTimer2);
				clearTimeout(showTimeriframe2);
            }
			$('userSubLinks').removeClassName('open');
            hideTimer2 = setTimeout("try { new Effect.Fade('boxSubLinks', {duration: 0.2, queue: {position:'end', scope: 'menu', limit:10} }); } catch(e) { $('boxSubLinks').display = 'none' }", 400);
			if (browser == "Microsoft Internet Explorer") {
				hideTimeriframe2 = setTimeout("try { new Effect.Fade('iframeSub2', {duration: 0.2, queue: {position:'end', scope: 'menui', limit:10} }); } catch(e) { $('iframeSub2').display = 'none' }", 390);
			}
		}
		
		
		
    } 
	}
	
	catch(e){}

 if (browser == "Microsoft Internet Explorer") {
submenuIframe2 = $("userSubLinksBluRay1").innerHTML;
$("userSubLinksBluRay1").innerHTML = "<iframe id='iframeSub2' class='iframeSub' style='display: none;' src='https://carrinho.blockbusteronline.com.br/locaonline/framework/skins/locaonline/lightwindow/images/arrow-up.gif'></iframe>" + submenuIframe2 ;
}
  try{
    var showTimer2;
    var hideTimer2;
	var showTimeriframe2;
	var hideTimeriframe2;
    if (document.getElementById) 
    {
        submenu2 = $("userSubLinksBluRay1");
        submenu2.onmouseover=function() {
            if(hideTimer2 != undefined) {
                clearTimeout(hideTimer2);
				clearTimeout(hideTimeriframe2);
			}
			$('userSubLinksBluRay1').addClassName('open');
            showTimer2 = setTimeout("try{ if(!Element.visible('boxSubLinksBluRay1')){new Effect.Appear('boxSubLinksBluRay1', {duration: 0.2, queue: {position:'end', scope: 'menu', limit:10} });} } catch(e) { $('boxSubLinksBluRay1').display = '' }", 200);
			if (browser == "Microsoft Internet Explorer") {
				showTimeriframe2 = setTimeout("try{ if(!Element.visible('iframeSub2')){new Effect.Appear('iframeSub2', {duration: 0.2, queue: {position:'end', scope: 'menui', limit:10} });} } catch(e) { $('iframeSub2').display = '' }", 200);
			}
		}
        submenu2.onmouseout=function() {
            if(showTimer2 != undefined) {
                clearTimeout(showTimer2);
				clearTimeout(showTimeriframe2);
            }
			$('userSubLinksBluRay1').removeClassName('open');
            hideTimer2 = setTimeout("try { new Effect.Fade('boxSubLinksBluRay1', {duration: 0.2, queue: {position:'end', scope: 'menu', limit:10} }); } catch(e) { $('boxSubLinksBluRay1').display = 'none' }", 400);
			if (browser == "Microsoft Internet Explorer") {
				hideTimeriframe2 = setTimeout("try { new Effect.Fade('iframeSub2', {duration: 0.2, queue: {position:'end', scope: 'menui', limit:10} }); } catch(e) { $('iframeSub2').display = 'none' }", 390);
			}
		}
		
		
		
    } 
	}
	
	catch(e){}
	
	if (browser == "Microsoft Internet Explorer") {
submenuIframe2 = $("userSubLinksBluRay2").innerHTML;
$("userSubLinksBluRay2").innerHTML = "<iframe id='iframeSub2' class='iframeSub' style='display: none;' src='https://carrinho.blockbusteronline.com.br/locaonline/framework/skins/locaonline/lightwindow/images/arrow-up.gif'></iframe>" + submenuIframe2 ;
}
  try{
    var showTimer3;
    var hideTimer3;
	var showTimeriframe3;
	var hideTimeriframe3;
    if (document.getElementById) 
    {
        submenu2 = $("userSubLinksBluRay2");
        submenu2.onmouseover=function() {
            if(hideTimer3 != undefined) {
                clearTimeout(hideTimer3);
				clearTimeout(hideTimeriframe3);
			}
			$('userSubLinksBluRay2').addClassName('open');
            showTimer3 = setTimeout("try{ if(!Element.visible('boxSubLinksBluRay2')){new Effect.Appear('boxSubLinksBluRay2', {duration: 0.2, queue: {position:'end', scope: 'menu', limit:10} });} } catch(e) { $('boxSubLinksBluRay2').display = '' }", 200);
			if (browser == "Microsoft Internet Explorer") {
				showTimeriframe3 = setTimeout("try{ if(!Element.visible('iframeSub3')){new Effect.Appear('iframeSub3', {duration: 0.2, queue: {position:'end', scope: 'menui', limit:10} });} } catch(e) { $('iframeSub3').display = '' }", 200);
			}
		}
        submenu2.onmouseout=function() {
            if(showTimer3 != undefined) {
                clearTimeout(showTimer3);
				clearTimeout(showTimeriframe3);
            }
			$('userSubLinksBluRay2').removeClassName('open');
            hideTimer3 = setTimeout("try { new Effect.Fade('boxSubLinksBluRay2', {duration: 0.2, queue: {position:'end', scope: 'menu', limit:10} }); } catch(e) { $('boxSubLinksBluRay2').display = 'none' }", 400);
			if (browser == "Microsoft Internet Explorer") {
				hideTimeriframe3 = setTimeout("try { new Effect.Fade('iframeSub3', {duration: 0.2, queue: {position:'end', scope: 'menui', limit:10} }); } catch(e) { $('iframeSub3').display = 'none' }", 390);
			}
		}
		
		
		
    } 
	}
	catch(e){}
}


Event.observe (window, 'load', function(){
/* script para ABAS */
	try{
		var listTabs = $('tabs');
		if (listTabs) {
			var tabsContent = $('tabsContent');
			var tabsContentItem = $('tabsContent').childElements();
			var titTabsContent = $$('#tabsContent h4');
			var backButtons = $$('#tabsContent .backTop');
			var itemTabs = $$('#tabs li');
			var lnksTabs = $$('#tabs a');
			var firstCont = $$('#tabs li a')[0].innerHTML;
			$$('#tabs li')[0].addClassName('selected');
			for (x = 1; x < tabsContentItem.length; x++) { tabsContentItem[x].hide(); }
			for (w = 0; w < titTabsContent.length; w++) { titTabsContent[w].hide(); }
			for (z = 0; z < backButtons.length; z++) { backButtons[z].hide(); }
			for (i=0; i<lnksTabs.length; i++) {
				lnksTabs[i].onclick = function() {
					var contLnkTab = this.innerHTML;
					var relLnkTab = this.rel;
					for (x=0;x < itemTabs.length; x++) {
						var tabOn = itemTabs[x];
						var tabPosition = x + 1;
						if (tabPosition <= 9) {
							tabPosition = '0' + tabPosition;
						}

						if (tabOn.hasClassName('selected')) {
							var contLnkTabOff = tabOn.firstDescendant().innerHTML;
							tabOn.removeClassName('selected');
							$('tabCont' + tabPosition).hide();
						}
					}
					this.up('li').addClassName('selected');
					$(relLnkTab).show();
					return false;
				}
			}
			
		}
		if(paramHome == "BlocArtist" && paramPage >= 1){
				$$('#tabs li')[0].removeClassName('selected');
				$$('#tabs li')[1].addClassName('selected');
				$('tabCont01').hide();
				$('tabCont02').show();
		}
	}
	catch(e)
	{
	
	}
	try{
		$$('#rentMovieList ul').each(Element.hide);
		var linkToggle = $$('#rentMovieList h2 .subGenre');
		for (i=0; i<linkToggle.length; i++) {
			node = linkToggle[i];
			node.onclick = function() {
				if (this.up('li').hasClassName('open')) {
					this.up('li').removeClassName('open');
				} else {
					this.up('li').addClassName('open');
				}
				this.up('h2').next('ul').toggle();
			}
		}
	} catch(e)
	{
	
	}
});



	/* script para Carroussel Vertical com 2 ou 3 itens */
	function verticalScroll(idBoxCarrousel, idScrollCarrousel, idListCarrousel) {
	try{
		var boxHorizontalCarousel = $(idBoxCarrousel);
		if (boxHorizontalCarousel) {
			var deliveryCarrousel = $(idListCarrousel);
			var widthBoxProductCarousel = deliveryCarrousel.getHeight();
			var x = 0;
			
			var HeightScrollCarrousel = $(idScrollCarrousel).getHeight();
			if (browser == "Microsoft Internet Explorer") {
				widthBoxProductCarousel = widthBoxProductCarousel - 10;
			}
			if (HeightScrollCarrousel < widthBoxProductCarousel) {
				boxHorizontalCarousel.innerHTML += '<a href="#" id="paginaPrev'+ idListCarrousel +'" class="up" onclick="return false;"><img src="/locaonline/framework/skins/locaonline/img/imgArrowSelectUp.gif" alt="Sobe" /></a><a href="#" id="paginaNext'+ idListCarrousel +'" class="down" onclick="return false;"><img src="/locaonline/framework/skins/locaonline/img/imgArrowSelectDown.gif" alt="Desce" /></a>';

				/* script para o botao voltar da barra de scroll */
				$('paginaPrev' + idListCarrousel).observe('click', function(event){
					var scrollingDiv = $(idScrollCarrousel);
					var pageAnchor   = '';
					var delta        = -HeightScrollCarrousel;
					var updateUrl    = '';
					new Effect.Scroll(scrollingDiv, { y: delta, afterFinish: updateUrl, duration: 0.4 });
					Event.stop(event);
				});
				/* script para o botao avançar da barra de scroll */
				$('paginaNext'+ idListCarrousel).observe('click', function(event){
					var scrollingDiv = $(idScrollCarrousel);
					var pageAnchor   = '';
					var delta        = HeightScrollCarrousel;
					var updateUrl    = '';
					new Effect.Scroll(scrollingDiv, { y: delta, afterFinish: updateUrl, duration: 0.4 });
					Event.stop(event);
				});
				
			}
		}
	} catch(e){
	}
}
	
	//Ajusta a altura das divs
function adjustSidebarHeight(){
	var left = $('loginForm1');
	var right = $('loginForm2');
	
	if(left && right){
		var heightleft = left.clientHeight;
		var heightright = right.clientHeight;
		var offset = 0;
		
		if (heightleft > heightright){
			right.style.height = (heightleft - 20 ) + 'px';
			}
			else{
			left.style.height = (heightright - 20 ) + 'px';
		}

	}
}

//carrega funções
function addEvent(obj, evType, fn){
	if(obj.addEventListener)obj.addEventListener(evType,fn,true)
	if(obj.attachEvent)obj.attachEvent("on"+evType,fn)
}

addEvent(window,"load",adjustSidebarHeight);
addEvent(window,"resize",adjustSidebarHeight);


