

$B = new Objeto();

$B.Extend('http://www.lookcard.com.br/Mini_site/js/class.loja.js');



onload(function(){

			$Body = new Objeto('body');	

			

				$Loja = new Loja();

				$Loja.Loc_itens    = 'Loja_itens';

				$Loja.Loc_valor    = 'Loja_valor';

				$Loja.ver_carrinho = function($r){  Link('Loja_lista.php?cod='+$r);  }

				//$Loja.Mini_lista = 'm_lista';

			

  

			     Cria_links();

TOPO_();

			

			//alert(document.getElementById('lk_inicial').id) 

		



window.setInterval(function(){

		if($MEMORIA != window.location.href){

		$MEMORIA = window.location.href;

		var $novo_url =  $MEMORIA.split('#');

		var $novo  = 'Engine.php?pg='+$novo_url[1];

		console('Carregando Aguarde...');

		$Body.Ajax($novo,function($rsp){ $Body.obj.innerHTML = $rsp; close_alert(); Cria_links(); });

		}},100);





			});



function Cria_links(){

	

	

			$LKINIC = new Objeto('lk_inicial');

			$LKQUEM = new Objeto('lk_quem_somos');

			$LKFOTO = new Objeto('lk_fotos');

			$LKVIDE = new Objeto('lk_videos');

			$LKONLI = new Objeto('lk_online');

			$LKLOCA = new Objeto('lk_localiza');

			$LKFALE = new Objeto('lk_fale_conosco');



	

			

			try{ $LKINIC.obj.onclick = function(){ Link('inicial.php');      } }catch(e){}

			try{ $LKQUEM.obj.onclick = function(){ Link('Quem.php');         } }catch(e){}

			try{ $LKFOTO.obj.onclick = function(){ Link('Fotos.php');        } }catch(e){}

			try{ $LKVIDE.obj.onclick = function(){ Link('Videos.php');       } }catch(e){}

			try{ $LKONLI.obj.onclick = function(){ Link('Loja_online.php');  } }catch(e){}

			try{ $LKLOCA.obj.onclick = function(){ Link('Localizacao.php');  } }catch(e){}

			try{ $LKFALE.obj.onclick = function(){ Link('Fale_conosco.php'); } }catch(e){}	

			

		

	

}







function Link($novo){

	var $url = window.location.href;

	$novo_url =  $url.split('#');

	window.location.href = $novo_url[0]+'#'+$novo;	

}



function Atualizar(){

	$MEMORIA = 'go!';

	$Loja.Link_lista();

}



$MEMORIA = window.location.href;





function F5(){

	var $url = window.location.href;

	if($url.indexOf('#') != -1){

	$url     = $url.split('#');

	//alert($url[1]);

	Link($url[1]);

	$MEMORIA = 'go!';

	}else{

	Link($PG_INICIAR);	

	}

}

F5();



function AMPimagem($src){

	//get('Grande_IMG').src = "";

	get('Grande_IMG').src = 'http://www.lookcard.com.br/imagem.php?img=fotos_galeria/'+$src+'&x=420&y=420';

}



function Click_video($num,$video){



	

	var $todos = get('area_videos').getElementsByTagName('div');

	for(var $i =0;$i<$todos.length;$i++){

	try{ $todos[$i].style.display  = 'none';  }catch(e){ }	

	}

	

	$todos = get('area_botoes').getElementsByTagName('div');

	for(var $i =0;$i<$todos.length;$i++){

	$v1 = new Objeto($todos[$i].id); $v1.atributo('class','icone_video');

	}

	var $v5 = new Objeto($num);

	$v5.atributo('class','icone_video_s');

	get($video).style.display = 'inline';

    

}



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// MAPA 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function Ampliar_mapa(){

	get('winmap2').src = '';

	$Body.ShowFND();

	get('winmap2').src = get('winmap2').title;

	var $obj = get('rota_map');

	var $x = $obj.style.width.replace('px','');

	var $y = $obj.style.height.replace('px','');

	$obj.style.marginLeft   = '-'+($x / 2)+'px';

	$obj.style.marginTop    = '-'+($y / 2)+'px';

	$obj.style.display = 'inline';

	get('Style_FND').onclick = function(){ 

	HideFND();

	fechar_mapa();

	

	}

	get('fechar_mapa').style.left = '905px';

	get('fechar_mapa').onclick = function(){ HideFND(); fechar_mapa();	}

	

}

//

function Map_rota(){

	

	$Body.ShowFND();

	get('winmap2').src = get('winmap2').name;

	var $obj = get('rota_map');

	var $x = $obj.style.width.replace('px','');

	var $y = $obj.style.height.replace('px','');

	$obj.style.marginLeft   = '-'+($x / 2)+'px';

	$obj.style.marginTop    = '-'+($y / 2)+'px';

	$obj.style.display = 'inline';

	get('Style_FND').onclick = function(){ 

	HideFND();

	fechar_mapa();

	

	}

	get('fechar_mapa').style.left = '881px';

	get('fechar_mapa').onclick = function(){ HideFND(); fechar_mapa();	}

}

function fechar_mapa(){

	get('rota_map').style.display = 'none';

	get('winmap2').src = '';

}

function TOPO_(){

	

var $gate = new Objeto();

	var $novo  = 'Engine.php?pg=topo.php';


	if(!$recebeTopo != ''){		
		
							  
		$gate.Ajax($novo,function($rsp){ 							  
							  
	try{	get('TOPO').src='http://www.lookcard.com.br/Mini_site/topos/'+$rsp; }catch(e){}
		
		get('bg_topo').style.backgroundImage = 'url(http://www.lookcard.com.br/Mini_site/topos/fnd_'+$rsp+')';		

										 

										});
	
	}else if($recebeTopo.indexOf('.swf') == -1){		
		
		
		$gate.Ajax($novo,function($rsp){ 							  
							  
		get('TOPO').src='http://www.lookcard.com.br/imagem.php?img=http://www.lookcard.com.br/img_topo/'+$recebeTopo+'&x=12000000&y=133;';		
		
		get('bg_topo').style.backgroundImage = 'url(http://www.lookcard.com.br/img_fnd_topo/'+$recebeFndTopo+')';	

										 

										});		
		
	}else{
		
		get('bg_topo').style.backgroundImage = 'url(http://www.lookcard.com.br/img_fnd_topo/'+$recebeFndTopo+')';		
		
	}
	
	
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Loja 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



function atributo($atr, $valor, $obj) {

    var newAttr 		= document.createAttribute($atr);

    newAttr.nodeValue 	= $valor;

    document.getElementById($obj).setAttributeNode(newAttr);

}





function mouse_out(){

// no seu caso use esta fun��o para mudar as classes

 

atributo('class', 'div_p_mae2', 	arguments[0]);

atributo('class', 'moldura2', 		arguments[1]);

atributo('class', 'div_p_nome2', 	arguments[2]);

atributo('class', 'div_p_preco2', 	arguments[3]);



}



function mouse_over(){

// no seu caso use esta fun��o para retonas as classes 



atributo('class', 'div_p_mae', 		arguments[0]);

atributo('class', 'moldura', 		arguments[1]);

atributo('class', 'div_p_nome', 	arguments[2]);

atributo('class', 'div_p_preco', 	arguments[3]);



}



//////////////////////////////////////////////////////////////

function Amliar_foto(){

	ShowFND();

	var $obj = get('Ampliar');

	var $x = $obj.style.width.replace('px','');

	var $y = $obj.style.height.replace('px','');

	$x = ($x / 2);

	$y = ($y / 2);

	//$x = $x - 100;

	$obj.style.marginLeft   = '-'+$x+'px';

	$obj.style.marginTop    = '-'+$y+'px';

	$obj.style.display = 'inline';

}

function fechar_foto(){

	HideFND();

    try{ get('Ampliar').style.display = 'none' }catch(e){ get('Janela_Vazia').style.display = 'none' }

	get('Style_FND').onclick = function(){  }

}

// ampliar foto loja //////////////////////////////////////////////////////////////

function AMP_foto_LOJA($obj){

ShowFND();



	var $src =  $obj.src.replace('x=225','x=800');

	$src = $src.replace('y=200','y=800');

	

get('Janela_Vazia').innerHTML     = '<img src="'+$src+'" id="img_loja" style="display:none;"  class="fotos_loja" onclick="fechar_foto();" onload="centraliza_imagen(this.src);" title="Clique para fechar" /><div id="loader_img">Aguarde carregando...</div>';

get('Janela_Vazia').style.display = 'inline';

get('Janela_Vazia').style.left    = '50%';

get('Janela_Vazia').style.top     = '50%';

get('Style_FND').onclick = function(){ fechar_foto(); }

get('Janela_Vazia').onclick = function(){ fechar_foto(); }



}



function centraliza_imagen($src){

	myImage = new Image();

	myImage.src = $src;

	largura = parseInt(myImage.width);

	altura = parseInt(myImage.height);

	//alert(largura + '\n\n' + altura);

	largura = largura / 2;

	altura  = altura  / 2;

	get('img_loja').style.marginLeft = '-'+largura+'px';

	get('img_loja').style.marginTop  = '-'+altura+'px';

	get('img_loja').style.display    = 'block';

	get('loader_img').style.display  = 'none';

	//get('Janela_Vazia').innerHTML += 'Clique na foto para fechar';

}



/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function Loja_ampliar_fotos($obj){

	

	var $src =  $obj.src.replace('x=50','x=225');

	$src = $src.replace('y=50','y=200');

	get('painel').src=$src;

	

	

	

}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Fun��es d loja Online

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function tabela_lista_loja($id){

	var novaurl = window.location.href.replace($id,'');

	window.location.href = novaurl;

//F5();	

	

}	

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Fun��o dialogo online





function valida_dig(){

	

	var $erro = false;

	

	$dig_nome      = get('nome');

	$dig_email     = get('email');

	$dig_tel       = get('tel');	

	$dig_endereco  = get('endereco');	

	

	if($dig_nome.value    == ''){ $erro = true;}

	if($dig_email.value   == ''){ $erro = true;}

	if($dig_tel.value     == '(43)'){ $erro = true;}	

	if($dig_endereco       == ''){ $erro = true;}		

	

	if($erro == true){ 

	  alert('Todos os campos são obrigatórios!'); 

	  }else{

	  get('chat2').style.display = 'none';

      get('chat').style.display  = 'inline'; 

	}

		

	

}



window.setTimeout(function(){if(window.location.href.split('#')[1] == ''){ Link('inicial.php');}},2000);

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Fun��o dialogo online ////////////////////////////////////////////////////////////////////////////////////////////////////////////



window.setInterval(function(){ escrever(); },1000);

function escrever(){

	$verif = 'n';

	try{  $verif = 's';

	

	

	get('escrevendo').onkeypress = function(e){  

	



   if (e.keyCode) { // IE  

     tecla = e.keyCode;  

   }else if(e.which) { // Firefox  

     tecla = e.which;  

   }  

   

   

	if(tecla == 13){ enviar(this); }

	

	}

	get('historico').scrollTop += 100;

	}catch(e){}

	if($verif == 's'){

		

		

	}

}



function enviar($obj){

	

	var $txt;

	var $url;

	var $atendimento = $B.idd; 

	$txt = $B.txtPARAhmtl($obj);

	$obj.value = '';

	//$obj.innerHTML = '';

	

	

	

	$url =  'Engine.php?pg=chat.php?nome='+get('nome').value;

	$url += '&atendimento='+$atendimento;

	$url += '&txt='+$txt;

	

	get('historico').innerHTML += '<br /> '+get('nome').value + ' Diz: <br />' + $txt;

	

	alert($url);

	

	$B.Ajax($url,function($r){ alert($r); });

	

	

	

}