function right(e) {
	if(navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)){
		return false;

	}else if(navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)){
		alert("ScrapStore - Scrap Booking!");
		return false;
	}

	return true;
}

document.onmousedown=right;
if(document.layers)
	window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;

document.onselectstart=function(){
	return false;
}

nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

function nereidFade(object, destOp, rate, delta){
	if(!document.all)
	return

    if(object != "[object]"){  
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
        
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if(object.filters.alpha.opacity > destOp){
        direction = -1;
    }

    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;
 
    if(object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

var is_major;
var yesno;
var verticalpos="fromtop";
var isNav;
var isns6=(document.getElementById&&!document.all);
var isie=(document.all);
var is_ie6=(document.all);
var isie5=(isie && (is_major==4) && (agt.indexOf("msie 5.0")!=-1));
var isie4=(isie && (is_major<=4) && (agt.indexOf("msie 5.0")==-1) && (agt.indexOf("msie 6.0")==-1));
var isns=(navigator.appName=="Netscape");
var isns4 = (isns && (is_major == 4));
var checkTimeoutId;
var initOffsetY=0;

if(document.documentElement && document.documentElement.scrollTop){
	var scrollStart=document.documentElement.scrollTop;

}else if(document.body && document.documentElement.scrollTop){//I.E
	var scrollStart=document.body.scrollTop;

}else if(isns){
	var scrollStart=window.pageYOffset;
}

function checkLoaded(){
	if(document.documentElement && document.documentElement.scrollTop){
		var scrollCurrent=document.documentElement.scrollTop;

	}else if(document.body && document.body.scrollTop){//I.E
		var scrollCurrent=document.body.scrollTop;

	}else if(isns){
		var scrollCurrent=window.pageYOffset;
	}

	if(scrollCurrent!=scrollStart){
		showTimeoutId=setTimeout("show_survey()",50);

	}else{
		checkTimeoutId=setTimeout("checkLoaded()",50);
	}
}

function show_survey(){
  show("survey");
}

function show(tempId){
	var element=null;
	var id=tempId;

	clearTimeout(checkTimeoutId);

	if(document.getElementById){
		element=document.getElementById(id);

	}else if(document.all){
		element=document.all[id];

	}else if(document.layers){
		element=document.layers[id];
	}

	if(element){
		if(initOffsetY==0){
			initOffsetY=element.offsetTop;
		}
		
		element.style.visibility="visible";
		JSFX_FloatTopDiv(id);
	}
}

function JSFX_FloatTopDiv(tempId){
	var id=tempId;

	var startX=0;

	if(isns){
		startY=0;//12;//Math.ceil((window.innerHeight)/2);

	}else{
		if(is_ie6){
			startY=0;//12;//Math.ceil((document.documentElement.clientHeight)/2);

		}else{
			startY=0;//12;//Math.ceil((document.body.clientHeight)/2);
		}
	}

	var ns=(navigator.appName.indexOf("Netscape")!=-1);
	var x=startX;
	var y=startY;

	function ml(id){
		var el;
		if(isns6){
			el=document.getElementById(id);

		}else if(isie){
			el=document.all[id];

		}else if (isns){
			el.style=el;
		}

		el.sP=function(x,y){
			if(y>=initOffsetY){
				if(el.style){
					el.style.left=x+"px";
					el.style.top=y+"px";

				}else{
					el.left=x;
					el.top=y;
				}
			}
		}

		el.x=startX;
		if(verticalpos=="fromtop"){
			el.y=startY;

		}else{
			el.y=(ns)?pageYOffset+innerHeight:document.body.scrollTop+document.body.clientHeight;
			el.y-=startY;
		}

		return el;
	}

	window.stayTopLeft=function(){
		if(verticalpos=="fromtop"){
			if(document.documentElement && document.documentElement.scrollTop){
				var pY=document.documentElement.scrollTop;
				ftlObj.y+=(pY+startY-ftlObj.y)/10;
				if(ftlObj.y<initOffsetY){
					ftlObj.y=initOffsetY
				}

			}else if(document.body){
				var pY=document.body.scrollTop;
				ftlObj.y+=(pY+startY-ftlObj.y)/10;
				if(ftlObj.y<=initOffsetY){
					ftlObj.y=initOffsetY
				}

			}else if(isns){
				var pY=window.pageYOffset;
				ftlObj.y+=(pY+startY-ftlObj.y)/10;
				if(ftlObj.y<initOffsetY){
					ftlObj.y=initOffsetY
				}
			}

		}else{
			pY=(ns)?window.pageYOffset+innerHeight:document.documentElement.scrollTop;
			ftlObj.y+=(pY-startY-ftlObj.y)/20;
		}

		ftlObj.sP(ftlObj.x,ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}

	var ftlObj=ml(id);
	stayTopLeft();
}

insubmenu_produtos=0;
ultima_categoria_subcategoria=0;

function OPEN_submenu_produtos(categoria, cod_categoria){	
	CLOSE_submenu_produtos();

	categoria.style.backgroundColor='#550000';
	categoria.style.color='#FFFFFF';
	full_submenu_produtos=document.getElementById('menu_subcategoria_'+cod_categoria);	
	full_submenu_produtos.style.display="block";

	if(isns){
		eD=window.innerHeight;

	}else{
		if(is_ie6){
			eD=document.documentElement.offsetHeight;

		}else{
			eD=document.body.clientHeight;
		}
	}

	if(document.documentElement && document.documentElement.scrollTop){
		var k=document.documentElement.scrollTop;

	}else if(document.body){
		var k=document.body.scrollTop;

	}else if(isns){
		var k=window.pageYOffset;
	}

	y=full_submenu_produtos.offsetTop-k;
	h=full_submenu_produtos.offsetHeight;
	t=y+h;
	if(t>eD){
		full_submenu_produtos.style.top=(y+k)-h+18;
	}

	insubmenu_produtos=1;
	ultima_categoria_subcategoria=cod_categoria;
}

function CLOSE_submenu_produtos(){
	if(insubmenu_produtos!=1 && ultima_categoria_subcategoria!="0"){
		categoria=document.getElementById('menu_categoria_'+ultima_categoria_subcategoria);

		if(categoria.className=="link_categoria_catalogo_1"){
			categoria.style.backgroundColor='#891B0C';

		}else{
			categoria.style.backgroundColor='#831000';
		}

		categoria.style.color='#F6CE80';
		full_submenu_produtos=document.getElementById('menu_subcategoria_'+ultima_categoria_subcategoria);
		full_submenu_produtos.style.top='';
		full_submenu_produtos.style.display="none";		
	}

	insubmenu_produtos=0;
}

function OPEN_submenu_produtos2(categoria, cod_categoria){	
	CLOSE_submenu_produtos2();

	categoria.style.backgroundColor='#FF0800';
	categoria.style.color='#FFFFFF';
	full_submenu_produtos=document.getElementById('menu_subcategoria_'+cod_categoria);	
	full_submenu_produtos.style.display="block";

	if(isns){
		eD=window.innerHeight;

	}else{
		if(is_ie6){
			eD=document.documentElement.offsetHeight;

		}else{
			eD=document.body.clientHeight;
		}
	}

	if(document.documentElement && document.documentElement.scrollTop){
		var k=document.documentElement.scrollTop;
		
	}else if(document.body){
		var k=document.body.scrollTop;		

	}else if(isns){
		var k=window.pageYOffset;
	}
	
	y=full_submenu_produtos.offsetTop-k;
	h=full_submenu_produtos.offsetHeight;
	t=y+h;
	//window.status="k="+k+" y="+y+"  h="+h+" ("+"t="+t+">eD="+eD+")";
	if(t>eD){
		full_submenu_produtos.style.top=(y+k)-h+18;
	}

	insubmenu_produtos=1;
	ultima_categoria_subcategoria=cod_categoria;
}

function CLOSE_submenu_produtos2(){
	if(insubmenu_produtos!=1 && ultima_categoria_subcategoria!="0"){
		categoria=document.getElementById('menu_categoria_'+ultima_categoria_subcategoria);

		if(categoria.className=="link_categoria_menu_1"){
			categoria.style.backgroundColor='#B50500';

		}else{
			categoria.style.backgroundColor='#CD0803';
		}

		categoria.style.color='#FFFFFF';
		full_submenu_produtos=document.getElementById('menu_subcategoria_'+ultima_categoria_subcategoria);
		full_submenu_produtos.style.top='';
		full_submenu_produtos.style.display="none";		
	}

	insubmenu_produtos=0;
}

function HV_produto(cod_produto, on){
	if(on){
		document.getElementById('bordar_cima_produto_'+cod_produto).style.backgroundColor='#B0BF0F';
		document.getElementById('bordar_baixo_produto_'+cod_produto).style.backgroundColor='#B0BF0F';
		document.getElementById('veja_produto_'+cod_produto).style.visibility='visible';

	}else{
		document.getElementById('bordar_cima_produto_'+cod_produto).style.backgroundColor='#E8E8E8';
		document.getElementById('bordar_baixo_produto_'+cod_produto).style.backgroundColor='#E8E8E8';
		document.getElementById('veja_produto_'+cod_produto).style.visibility='hidden';
	}
}

function strim(str){
	return (str.replace(/(^\s*)|(\s*$)/g, "")=="")?0:1;
}

function trim(str){
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

function chval(validos,txt){
	if(event.keyCode!="13" && event.keyCode!="27"){
		ch=String.fromCharCode(event.keyCode);
		if(validos.indexOf(ch) == -1){
			txt.focus();
			return false;
		}
	}
	return true;
}

function chval2(valid, txt, event){
	var keyCode;
	var keyChar;
	var numpad = new Array();
	numpad[96] = '0';
	numpad[97] = '1';
	numpad[98] = '2';
	numpad[99] = '3';
	numpad[100] = '4';
	numpad[101] = '5';
	numpad[102] = '6';
	numpad[103] = '7';
	numpad[104] = '8';
	numpad[105] = '9';

	if(window.event){
		keyCode = window.event.keyCode;

	}else if(event){
		keyCode = event.which;

	}else{
		return true;
	}
	
	if((keyCode == null) || (keyCode == 0) || (keyCode == 8) || (keyCode == 9) || (keyCode == 13) || (keyCode == 27))
		return true;

	if(numpad[keyCode]){
		keyChar = numpad[keyCode];

	}else{
		keyChar = String.fromCharCode(keyCode);
		keyChar = keyChar.toLowerCase();		
	}	

	if(valid.indexOf(keyChar) == -1){
		txt.focus();
		return false;
	}

	return true;
}

function VF_pesquisa(f){
	pchave=trim(f.q.value);
	if(pchave=="" || pchave.length<3){
		alert('Entre com o nome do produto'+'\n'+'que está procurando...');
		f.q.value="";
		f.q.focus();
		return false;
	}else{
		return true;
	}
}

function VF_enquete(f){
	sem_resposta=1;
	for(i=0; f.cod_resposta_enquete[i]!=null; i++){
		if(f.cod_resposta_enquete[i].checked)
			sem_resposta=0;
	}

	if(sem_resposta){
		alert('Escolha uma alternativa...');
		return false;

	}else{		
		return true;
	}
}

txtdefaultnewsletter_nome="nome";
txtdefaultnewsletter_email="e-mail";

function VF_newsletter(f){
	nome=trim(f.nome_contato_newsletter.value);
	email=trim(f.email_contato_newsletter.value);

	if(nome=="" || nome==txtdefaultnewsletter_nome){
		alert('Entre com o seu Nome...');
		f.nome_contato_newsletter.focus();
		return false;

	}else if(email=="" || email==txtdefaultnewsletter_email){
		alert('Entre com o seu E-Mail...');
		f.email_contato_newsletter.focus();
		return false;
	}

	return true;
}

function ACT_newsletter(id, txt, on){
	txtdefaultnewsletter=(id=="nome")?txtdefaultnewsletter_nome:txtdefaultnewsletter_email;
	txt.value=trim(txt.value);

	if(on){
		txt.select();
		if(txt.value==txtdefaultnewsletter){
			txt.value="";
		}
	}else{
		if(txt.value==""){
			txt.value=txtdefaultnewsletter;
		}
	}
}

esgotou=0;
k=0;
stop=0;
function mask(campo,mascara,validos){
	ch=String.fromCharCode(event.keyCode);
	delimitador= new Array();
	pos= new Array();
	j=0;	
	cont=0;

	
	if(validos.indexOf(ch)==-1){
		campo.focus();
		return false;

	}else{
		if(mascara!=""){
			lencampo=campo.value.length;
			mascara=mascara.split('');
			lenmascara=mascara.length;
			
			for(i=0;i<lenmascara;i++){
				cont=i+1;
				if(mascara[i]!="@"){
					delimitador[j]=mascara[i];
					pos[j]=i;
					j++;
				}
			}
			
			for(i=0;i<=j-1;i++){
				posicao=pos[i]-1;	
				///alert(lencampo+"=="+posicao);
				if(lencampo==posicao){
					k=i;
				}
			}
			
			if(lencampo==lenmascara){
				stop=1;
				//ARRUMAR BUG

			}else{
				stop=0;
			}
	
			if(stop==1) return false;
				
			posicao=pos[k]-1;
			//alert(lencampo+"=="+posicao+"    k="+k);
			if(lencampo==posicao){
				campo.value=campo.value + ch + delimitador[k];
				campo.focus();
				return false;
			}else{
				return true;
			}							
		}
	}		
}

function validacpf(s){
	var i;
	var c = s.substr(0,9);
	var dv = s.substr(9,2);
	var d1 = 0;
	for (i = 0; i < 9; i++){
		d1 += c.charAt(i)*(10-i);
	}
	if (d1 == 0){
		return false;
	}
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(0) != d1){
		return false;
	}
	d1 *= 2;
	for (i = 0; i < 9; i++){
		d1 += c.charAt(i)*(11-i);
	}
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(1) != d1){
		return false;
	}
	return true;
}

function validandocpf(numCPF){
	semForm = numCPF.value.toString().replace(/\-|\./g,''); 
	if (semForm.length != 11){
		numCPF.focus();
		numCPF.select();
		return false;
	}

	var c=0, igual = false;
	while(c < 11){
		if(semForm.charAt(c) != semForm.charAt(0)){
			igual=false; break;
		}else 
			igual=true;
		c++;
	}

	if(igual==true){
		return false;
	} 

	if(!validacpf(semForm)){
		numCPF.select(); numCPF.focus();
		return false;
	}else{
		numCPF.focus();
		numCPF.select();
		return true;
	}
}

function VF_senhas(f){
	senha_atual_cliente=f.senha_atual_cliente;
	nova_senha_cliente=f.nova_senha_cliente;
	confirmacao_senha_cliente=f.confirmacao_senha_cliente;

	if(!strim(senha_atual_cliente.value)){
		alert('Entre com sua senha atual!');
		senha_atual_cliente.value='';
		senha_atual_cliente.focus();
		return false;

	}else if(!strim(nova_senha_cliente.value) || nova_senha_cliente.value.length<6){
		alert('Entre com a senha!');
		nova_senha_cliente.value='';
		confirmacao_senha_cliente.value='';
		nova_senha_cliente.focus();
		return false;

	}else if(nova_senha_cliente.value!=confirmacao_senha_cliente.value){
		alert('As senha não conferem! Entre novamente com a nova senha.');
		nova_senha_cliente.value='';
		confirmacao_senha_cliente.value='';
		nova_senha_cliente.focus();
		return false;
	}
	return true;
}

function VF_cliente(f){
	tipo_cliente=f.tipo_cliente;
	razao_social_cliente=f.razao_social_cliente;
	nome_fantasia_cliente=f.nome_fantasia_cliente;
	nome_cliente=f.nome_cliente;
	cpf_cnpj_cliente=f.cpf_cnpj_cliente;
	endereco_cliente=f.endereco_cliente;
	numero_localidade_cliente=f.numero_localidade_cliente;
	bairro_cliente=f.bairro_cliente;
	cidade_cliente=f.cidade_cliente;
	estado_cliente=f.estado_cliente;
	cep_cliente=f.cep_cliente;
	ddd_celular_cliente=f.ddd_celular_cliente;
	celular_cliente=f.celular_cliente;
	ddd_telefone_cliente=f.ddd_telefone_cliente;
	telefone_cliente=f.telefone_cliente;
	email_cliente=f.email_cliente;
	senha_cliente=f.senha_cliente;
	confirmacao_senha_cliente=f.confirmacao_senha_cliente;

	if(!strim(email_cliente.value)){
		alert('Entre com o seu E-Mail!');
		email_cliente.focus();
		return false;

	}else if(senha_cliente){
		if(!strim(senha_cliente.value) || senha_cliente.value.length<6){
			alert('Entre com a senha!');
			senha_cliente.value='';
			confirmacao_senha_cliente.value='';
			senha_cliente.focus();
			return false;

		}else if(senha_cliente.value!=confirmacao_senha_cliente.value){
			alert('As senha não conferem! Entre novamente com a senha.');
			senha_cliente.value='';
			confirmacao_senha_cliente.value='';
			senha_cliente.focus();
			return false;
		}

	}
	
	if(!tipo_cliente[0].checked && !tipo_cliente[1].checked){
		alert('Escolha um Tipo de Cliente!');
		return false;

	}else if(!strim(cpf_cnpj_cliente.value)){
		alert('Entre com o CPF / CNPJ!');
		cpf_cnpj_cliente.focus();
		return false;
	
	}else if(tipo_cliente[0].checked && !validandocpf(cpf_cnpj_cliente)){
		alert('CPF INVÁLIDO!');
		cpf_cnpj_cliente.select();
		cpf_cnpj_cliente.focus();
		return false;

	}else if(tipo_cliente[1].checked && !strim(razao_social_cliente.value)){
		alert('Entre com a Razão Social!');
		razao_social_cliente.focus();
		return false;

	}else if(tipo_cliente[1].checked && !strim(nome_fantasia_cliente.value)){
		alert('Entre com o Nome Fantasia!');
		nome_fantasia_cliente.focus();
		return false;

	}else if(!strim(nome_cliente.value)){
		alert('Entre com o Nome Completo do Cliente!');
		nome_cliente.focus();
		return false;	

	}else if(!strim(endereco_cliente.value)){
		if(f.cep_manual.value=="1"){
			alert('Entre com o Endereço!');
			endereco_cliente.focus();

		}else{
			alert('Entre com o CEP para localizar o seu Endereço!');
			cep_cliente.focus();
		}
		return false;

	}else if(!strim(numero_localidade_cliente.value)){
		alert('Entre com o Nº da Localidade!');
		numero_localidade_cliente.focus();
		return false;

	}else if(!strim(bairro_cliente.value)){
		if(f.cep_manual.value=="1"){
			alert('Entre com o Bairro!');
			bairro_cliente.focus();

		}else{
			alert('Entre com o CEP para localizar o seu Bairro!');
			cep_cliente.focus();
		}
		return false;

	}else if(!strim(cidade_cliente.value)){
		if(f.cep_manual.value=="1"){
			alert('Entre com a Cidade!');
			cidade_cliente.focus();

		}else{
			alert('Entre com o CEP para localizar a sua Cidade!');
			cep_cliente.focus();
		}
		return false;

	}else if(!strim(estado_cliente.value)){
		if(f.cep_manual.value=="1"){
			alert('Entre com o Estado!');
			estado_cliente.focus();

		}else{
			alert('Entre com o CEP para localizar o seu Estado!');
			cep_cliente.focus();
		}
		return false;

	}else if(!strim(cep_cliente.value)){
		alert('Entre com o CEP!');
		cep_cliente.focus();
		return false;

	}else if(!strim(celular_cliente.value) && !strim(telefone_cliente.value)){
		alert('Digite algum telefone!');
		ddd_celular_cliente.focus();
		return false;
	
	}else if(!strim(ddd_celular_cliente.value) && strim(celular_cliente.value)){
		alert('Entre com o DDD do Celular!');
		ddd_celular_cliente.focus();
		return false;

	}else if(!strim(ddd_telefone_cliente.value) && strim(telefone_cliente.value)){
		alert('Entre com o DDD do Telefone!');
		ddd_telefone_cliente.focus();
		return false;
	}

	f.erro_cep.value='0';
	return true;
}

function VF_contato(f){
	if(!strim(f.Nome.value)){
		alert('Entre com o seu Nome!');
		f.Nome.value='';
		f.Nome.focus();
		return false;

	}else if(!strim(f.Email.value)){
		alert('Entre com o seu E-Mail!');
		f.Email.value='';
		f.Email.focus();
		return false;
	
	}else if(!strim(f.DDD.value) && strim(f.Fone.value)){
		alert('Entre com o DDD do Telefone!');
		f.DDD.focus();
		return false;

	}else if(!strim(f.Sugestao.value)){
		alert('Entre com a sua Mensagem!');
		f.Sugestao.value='';
		f.Sugestao.focus();
		return false;
	}
	
	return true;
}

function VF_conclusao_compra(f){
	validade_promocao_semana_crianca = f.validade_promocao_semana_crianca;
	dvd1 = f.dvd1;
	dvd2 = f.dvd2;
	dvd3 = f.dvd3;
	dvd4 = f.dvd4;
	dvd5 = f.dvd5;

	dvds = new Array();
	dvds[1] = 'Os Sem-Floresta (DreamWorks)';
	dvds[2] = 'Kung Fu Panda (DreamWorks)';
	dvds[3] = 'Shrek Terceiro (DreamWorks)';
	dvds[4] = 'Mini Einsteins da Disney - A festa da Música (Disney)';
	dvds[5] = 'A Magia do Natal (Disney)';

	endereco_entrega=f.endereco_entrega;
	numero_localidade_entrega=f.numero_localidade_entrega;
	complemento_endereco_entrega=f.complemento_endereco_entrega;
	bairro_entrega=f.bairro_entrega;
	cidade_entrega=f.cidade_entrega;
	estado_entrega=f.estado_entrega;
	cep_entrega=f.cep_entrega;
	tipo_pagamento_compra=f.tipo_pagamento_compra;

	if(validade_promocao_semana_crianca.value == '1'){
		for(i = 1; i <= 5; i++){
			if(!strim(document.getElementById('dvdtmp' + i).value)){
				alert('Enumere de 1 à 5 de acordo com a sua preferência sem repetir!');
				document.getElementById('dvdtmp' + i).focus();
				return false;
			}
		}

		for(i = 1; i <= 5; i++){
			for(k = 1; k <= 5; k++){
				if(document.getElementById('dvdtmp' + k).value == document.getElementById('dvdtmp' + i).value && i != k){
					alert('Enumere de 1 à 5 de acordo com a sua preferência sem repetir!');
					document.getElementById('dvdtmp' + i).focus();
					return false;
				}
			}
		}

		for(i = 1; i <= 5; i++){
			for(k = 1; k <= 5; k++){
				if(document.getElementById('dvdtmp' + k).value == i){
					document.getElementById('dvd' + i).value = dvds[k];
					break;
				}
			}
		}			
	}
	
	if(tipo_pagamento_compra.value=="2" || tipo_pagamento_compra.value=="3" || tipo_pagamento_compra.value=="5" || tipo_pagamento_compra.value=="6"){
		nome_portador_cartao_compra=f.nome_portador_cartao_compra;
		numero_cartao_compra_p1=f.numero_cartao_compra_p1;
		numero_cartao_compra_p2=f.numero_cartao_compra_p2;
		numero_cartao_compra_p3=f.numero_cartao_compra_p3;
		numero_cartao_compra_p4=f.numero_cartao_compra_p4;
		mes_validade_cartao_compra=f.mes_validade_cartao_compra;
		ano_validade_cartao_compra=f.ano_validade_cartao_compra;
		codigo_seguranca_cartao_compra=f.codigo_seguranca_cartao_compra;

		if(!strim(nome_portador_cartao_compra.value)){
			alert('Entre com o Nome do Portador do Cartão!');
			nome_portador_cartao_compra.focus();
			return false;

		}else if(!strim(numero_cartao_compra_p1.value) || numero_cartao_compra_p1.value.length < 4){
			alert('Entre Corretamente com o Número do Cartão!');
			numero_cartao_compra_p1.focus();
			return false;

		}else if((!strim(numero_cartao_compra_p2.value) || numero_cartao_compra_p2.value.length < 4) && (tipo_pagamento_compra.value=="2" || tipo_pagamento_compra.value=="5")){
			alert('Entre Corretamente com o Número do Cartão!');
			numero_cartao_compra_p2.focus();
			return false;

		}else if((!strim(numero_cartao_compra_p2.value) || numero_cartao_compra_p2.value.length < 6) && (tipo_pagamento_compra.value=="3" || tipo_pagamento_compra.value=="6")){
			alert('Entre Corretamente com o Número do Cartão!');
			numero_cartao_compra_p2.focus();
			return false;

		}else if((!strim(numero_cartao_compra_p3.value) || numero_cartao_compra_p3.value.length < 4) && (tipo_pagamento_compra.value=="2" || tipo_pagamento_compra.value=="3" || tipo_pagamento_compra.value=="5")){
			alert('Entre Corretamente com o Número do Cartão!');
			numero_cartao_compra_p3.focus();
			return false;

		}else if((!strim(numero_cartao_compra_p3.value) || numero_cartao_compra_p3.value.length < 5) && tipo_pagamento_compra.value=="6"){
			alert('Entre Corretamente com o Número do Cartão!');
			numero_cartao_compra_p3.focus();
			return false;

		}else if((!strim(numero_cartao_compra_p4.value) || numero_cartao_compra_p4.value.length < 4) && (tipo_pagamento_compra.value=="2" || tipo_pagamento_compra.value=="5")){
			alert('Entre Corretamente com o Número do Cartão!');
			numero_cartao_compra_p4.focus();
			return false;

		}else if(!strim(mes_validade_cartao_compra.value)){
			alert('Entre com o Mês de Validade do Cartão!');
			mes_validade_cartao_compra.focus();
			return false;

		}else if(!strim(ano_validade_cartao_compra.value)){
			alert('Entre com o Ano de Validade do Cartão!');
			ano_validade_cartao_compra.focus();
			return false;

		}else if(!strim(codigo_seguranca_cartao_compra.value)){
			alert('Entre com o Código de Segurança do Cartão!');
			codigo_seguranca_cartao_compra.focus();
			return false;
		}
	}
	
	if(!strim(endereco_entrega.value)){
		alert('Entre com o Endereço!');
		endereco_entrega.focus();
		return false;

	}else if(!strim(numero_localidade_entrega.value)){
		alert('Entre com o Nº da Localidade!');
		numero_localidade_entrega.focus();
		return false;

	}else if(!strim(bairro_entrega.value)){
		alert('Entre com o Bairro!');
		bairro_entrega.focus();
		return false;

	}else if(!strim(cep_entrega.value)){
		alert('Entre com o CEP!');
		cep_entrega.focus();
		return false;
	
	}else if(!strim(cidade_entrega.value)){
		alert('Entre com a Cidade !');
		cidade_entrega.focus();
		return false;

	}else if(!strim(estado_entrega.value)){
		alert('Entre com o Estado!');
		estado_entrega.focus();
		return false;

	}else if(tipo_pagamento_compra.value==0 || tipo_pagamento_compra==""){
		alert('Escolha o Meio de Pagamento!');
		return false;

	}else if(!confirm('Todos as informaçãoes cadastradas estão realmente corretas? Deseja Finalizar sua compra?')){
		return false;
	}

	return true;
}

function VF_aviso_estoque(f){
	nome_aviso_estoque=f.nome_aviso_estoque;
	email_aviso_estoque=f.email_aviso_estoque;
	qtde_desejada_aviso_estoque=f.qtde_desejada_aviso_estoque;
	
	if(!strim(nome_aviso_estoque.value)){
		alert('Entre com o Nome!');
		nome_aviso_estoque.focus();
		return false;

	}else if(!strim(email_aviso_estoque.value)){
		alert('Entre com o E-Mail!');
		email_aviso_estoque.focus();
		return false;

	}else if(!strim(qtde_desejada_aviso_estoque.value) || parseInt(qtde_desejada_aviso_estoque.value)<=0){
		alert('Entre com a quantidade desejada!');
		qtde_desejada_aviso_estoque.focus();
		return false;
	}
}

function rowslc2(lin, on){
	if(on){
		lin.style.backgroundColor="#F3FBE3";
	}else{
		lin.style.backgroundColor="#FFFFFF";
	}
}

function overOut(obj, on){
	opacity=(on)?80:100;
	if(isie){
		obj.filters.alpha.opacity=opacity;

	}else{
		obj.style.MozOpacity=opacity;
	}
}

function accessCount(img){
	document.getElementById("accessController").src=img;
	cmd="accessCount('"+img+"&rand="+Math.random()+"')";
	access=window.setTimeout(cmd, 5000);
}

function VF_solicitacao_inscricao(f){
	nome_aluno=f.nome_aluno;
	email_aluno=f.email_aluno;
	endereco_aluno=f.endereco_aluno;
	numero_localidade_aluno=f.numero_localidade_aluno;
	bairro_aluno=f.bairro_aluno;
	cep_aluno=f.cep_aluno;
	cidade_aluno=f.cidade_aluno;
	estado_aluno=f.estado_aluno;
	ddd_telefone_celular_aluno=f.ddd_telefone_celular_aluno;
	telefone_celular_aluno=f.telefone_celular_aluno;
	ddd_telefone_contato_aluno=f.ddd_telefone_contato_aluno;
	telefone_contato_aluno=f.telefone_contato_aluno;

	tem_aula_selecionada=0;
	aulas=document.forms['frm_solicitacoes_inscricao'].elements['aulas[]'];
	for(i=0; i<aulas.length; i++){
		if(aulas[i].checked==true){
			tem_aula_selecionada=1;
			break;
		}
	}
	
	if(!tem_aula_selecionada){
		alert('Por favor! Escolha alguma aula!');
		location="#formulario_inscricao";
		return false;

	}else if(!strim(nome_aluno.value)){
		alert('Entre com seu Nome Completo!');
		nome_aluno.focus();
		return false;

	}else if(!strim(email_aluno.value)){
		alert('Entre com seu E-Mail!');
		email_aluno.focus();
		return false;

	}else if(!strim(bairro_aluno.value)){
		alert('Entre com seu Bairro!');
		bairro_aluno.focus();
		return false;

	}else if(!strim(cidade_aluno.value)){
		alert('Entre com a sua Cidade!');
		cidade_aluno.focus();
		return false;

	}else if(!strim(estado_aluno.value)){
		alert('Entre com o nome do seu Estado!');
		estado_aluno.focus();
		return false;

	}else if((!strim(ddd_telefone_celular_aluno.value) || !strim(telefone_celular_aluno.value)) && (!strim(ddd_telefone_contato_aluno.value) || !strim(telefone_contato_aluno.value))){
		alert('Entre com algum Telefone para contato!');
		ddd_telefone_contato_aluno.focus();
		return false;
	}

	return true;
}
