function abreLolly(urlTexto, stArea, stTitulo, bolEmbalagem){
	include(urlTexto+'.asp', $('contTexto'));
	var foProduto = new FlashObject('../swf/'+urlTexto+'.swf', urlTexto, 170, 354, false, 8);
	foProduto.useExpressInstall('../swf/expressinstall.swf');
	foProduto.addParam('wmode', 'transparent');
	foProduto.write('imgProduto');			
	var foTitulo = new FlashObject('../swf/titulo_lolly.swf', 'flTitulo', 356, 97, false, 8);
	foTitulo.useExpressInstall('../swf/expressinstall.swf');
	foTitulo.addParam('wmode', 'transparent');			
	foTitulo.addVariable('$area', stArea);
	foTitulo.addVariable('$titulo', stTitulo);			
	foTitulo.write('contTitulo');
	abrePopBg();
	openBox('lollyProduto', {onOpen:function(){hDiv("openBoxPopBg");addEvent($("popBg"), 'click', function(){closeBox('lollyProduto')});}, onClose:function(){hDiv("popBg")}});
	$('contTexto').scrollTop=0;			
	if(bolEmbalagem){
		sDiv('txtEmabalem200');
	}else{
		hDiv('txtEmabalem200');
	}
}

function abreComoUsar(urlTexto){
	include('comousar/'+urlTexto+'.asp', $('contComoUsar'));
	abrePopBg();
	openBox('lollyComoUsar', {onOpen:function(){hDiv("openBoxPopBg");addEvent($("popBg"), 'click', function(){closeBox('lollyComoUsar')});}, onClose:function(){hDiv("popBg")}});
	$('contComoUsar').scrollTop=0;
}

function abreIdeal(){
	abrePopBg();
	openBox('lollyIdeal', {onOpen:function(){hDiv("openBoxPopBg");addEvent($("popBg"), 'click', function(){closeBox('lollyIdeal')});}, onClose:function(){hDiv("popBg")}});
}

function abreWebcard(stSrc){
	abrePopBg();
	openBox('lollyWebcard', {onOpen:function(){hDiv("openBoxPopBg");addEvent($("popBg"), 'click', function(){closeBox('lollyWebcard')});$('iframeWebcard').src=stSrc;}, onClose:function(){hDiv("popBg");$('iframeWebcard').src='about:blank';}});
}
function abrePrevisao(){
	try{
		abrePopBg();
		openBox('lollyPrevisao', {
			onOpen:function(){
				hDiv("openBoxPopBg");
				addEvent($("popBg"), 'click', function(){
					closeBox('lollyPrevisao');
				});
			}, onClose:function(){
				hDiv("popBg");
			}
		});
		return true;
	}catch(e){
		return false;
	}
}
function fechaPrevisao(){
	closeBox('lollyPrevisao');
	return true;
}

		
function getPosicaoElemento(elemID){
	var offsetTrail = document.getElementById(elemID);
	var offsetLeft = 0;
	var offsetTop = 0;
	var offsetRight = 0;
	while (offsetTrail) {
		offsetLeft += offsetTrail.offsetLeft;
		offsetTop += offsetTrail.offsetTop;
		offsetRight += offsetTrail.offsetRight;
		offsetTrail = offsetTrail.offsetParent;
	}
	if (navigator.userAgent.indexOf("Mac") != -1 && 
		typeof document.body.leftMargin != "undefined") {
		offsetLeft += document.body.leftMargin;
		offsetTop += document.body.topMargin;
	}
	return {left:offsetLeft, top:offsetTop};
}

function abrePopBg(){
	sDiv('popBg');
	var ___bgColor___="ffffff"
	var ___bgAlpha___="80";
	if(is.ie){
		$('popBg').style.background='#'+___bgColor___;
		$('popBg').style.filter='Alpha(Opacity='+___bgAlpha___+');';
	}else{
		$('popBg').style.background='#'+___bgColor___;
		$('popBg').style.opacity=(___bgAlpha___/100);
	}
	
	$('popBg').style.top=getPosicaoElemento('boxContainer').top+'px';
	$('popBg').style.left=getPosicaoElemento('boxContainer').left+'px';
}

function getTexts(linha){
	return textLinhas[linha];
}


function direcionaDica(obj){
	if(obj.value!='0')
		location.href=obj.value;
}

function viewContent(target) {
	var links = gTag('a', gElm(target));
	for(x=0;x<links.length;x++) {
		links[x].onclick = function() {
			this.href = 'javascript:;';
			var selected = this.rel;
			shDiv(selected);
		}
	}
}

var roller = new Function();
roller.toff = function() { clearTimeout(int1) };
roller.click = function() { return false; };
roller.motor = function() {
	if(arguments[0] == "d") {
		$("motor").scrollLeft = $("motor").scrollLeft + 5;
		int1 = setTimeout("roller.motor('d')",10);
	} else {
		$("motor").scrollLeft = $("motor").scrollLeft - 5;
		int1 = setTimeout("roller.motor('e')",10);
	}
}

function calcSizeMenu(){
	var itensMenu=gTag('li', $('ulmotor'));
	var size = 0;
	for(x=0;x<itensMenu.length;x++) {
		size += itensMenu[x].offsetWidth; 
	}
	$('ulmotor').style.width=size+'px';
}

function scrollToYear(elem) {
	var years = gTag('a', $('ulmotor'));
	for(x=0;x<years.length;x++) {
		if(years[x].firstChild.nodeValue == elem) {
			var liyears = gTag('li', $('ulmotor'));
			var size = 0;
			for(y=0;y<x;y++) {
				size += liyears[y].offsetWidth; 
			}
			$("motor").scrollLeft = size;
		}
	}
}