if(document.images) {
	/*
	sambaclub_on = new Image(); sambaclub_on.src = "images/menu_sambaclub_on.gif";
	sambaclub_off = new Image(); sambaclub_off.src = "images/menu_sambaclub.gif";
	blog_on = new Image(); blog_on.src = "images/menu_blog_on.gif";
	blog_off = new Image(); blog_off.src = "images/menu_blog.gif";
	fotos_on = new Image(); fotos_on.src = "images/menu_fotos_on.gif";
	fotos_off = new Image(); fotos_off.src = "images/menu_fotos.gif";
	colecao_on = new Image(); colecao_on.src = "images/menu_colecao_on.gif";
	colecao_off = new Image(); colecao_off.src = "images/menu_colecao.gif";
	downloads_on = new Image(); downloads_on.src = "images/menu_downloads_on.gif";
	downloads_off = new Image(); downloads_off.src = "images/menu_downloads.gif";
	contato_on = new Image(); contato_on.src = "images/menu_contato_on.gif";
	contato_off = new Image(); contato_off.src = "images/menu_contato.gif";
	*/
	sacola_de_compras_on = new Image(); sacola_de_compras_on.src = "images/btn_sacola_de_compras_on.gif";
	sacola_de_compras_off = new Image(); sacola_de_compras_off.src = "images/btn_sacola_de_compras.gif";
	vitrine_todas_on = new Image(); vitrine_todas_on.src = "images/btn_vitrine_todas_on.gif";
	vitrine_todas_off = new Image(); vitrine_todas_off.src = "images/btn_vitrine_todas_off.gif";
	meu_cadastro_on = new Image(); meu_cadastro_on.src = "images/btn_meu_cadastro_on.gif";
	meu_cadastro_off = new Image(); meu_cadastro_off.src = "images/btn_meu_cadastro.gif";
	meus_pedidos_on = new Image(); meus_pedidos_on.src = "images/btn_meus_pedidos_on.gif";
	meus_pedidos_off = new Image(); meus_pedidos_off.src = "images/btn_meus_pedidos.gif";
	emaberto_on = new Image(); emaberto_on.src = "images/btn_emaberto_on.gif";
	emaberto_off = new Image(); emaberto_off.src = "images/btn_emaberto.gif";
	postagem_on = new Image(); postagem_on.src = "images/btn_postagem_on.gif";
	postagem_off = new Image(); postagem_off.src = "images/btn_postagem.gif";
	enviados_on = new Image(); enviados_on.src = "images/btn_enviados_on.gif";
	enviados_off = new Image(); enviados_off.src = "images/btn_enviados.gif";
	cancelados_on = new Image(); cancelados_on.src = "images/btn_cancelados_on.gif";
	cancelados_off = new Image(); cancelados_off.src = "images/btn_cancelados.gif";
	insere_on = new Image(); insere_on.src = "images/btn_insere_on.gif";
	insere_off = new Image(); insere_off.src = "images/btn_insere_off.gif";
	newsletter_on = new Image(); newsletter_on.src = "images/btn_newsletter_on.gif";
	newsletter_off = new Image(); newsletter_off.src = "images/btn_newsletter_off.gif";
	clientes_on = new Image(); clientes_on.src = "images/btn_clientes_on.gif";
	clientes_off = new Image(); clientes_off.src = "images/btn_clientes_off.gif";
	colecoes_on = new Image(); colecoes_on.src = "images/btn_colecoes_on.gif";
	colecoes_off = new Image(); colecoes_off.src = "images/btn_colecoes_off.gif";
	logout_on = new Image(); logout_on.src = "images/btn_logout_on.gif";
	logout_off = new Image(); logout_off.src = "images/btn_logout_off.gif";
	quemusa_on = new Image(); quemusa_on.src = "images/btn_quemusa_on.gif";
	quemusa_off = new Image(); quemusa_off.src = "images/btn_quemusa_off.gif";
	testes_on = new Image(); testes_on.src = "images/btn_testes_on.gif";
	testes_off = new Image(); testes_off.src = "images/btn_testes_off.gif";
	desabilitados_on = new Image(); desabilitados_on.src = "images/btn_desabilitados_on.gif";
	desabilitados_off = new Image(); desabilitados_off.src = "images/btn_desabilitados_off.gif";
	usados_on = new Image(); usados_on.src = "images/btn_usados_on.gif";
	usados_off = new Image(); usados_off.src = "images/btn_usados_off.gif";
	/*
	entregues_on = new Image(); entregues_on.src = "images/btn_entregues_on_on.gif";
	entregues_off = new Image(); entregues_off.src = "images/btn_entregues_off.gif";
	*/
	liberar_on = new Image(); liberar_on.src = "images/btn_liberar_on.gif";
	liberar_off = new Image(); liberar_off.src = "images/btn_liberar_off.gif";
}

function swp(i,s) {
	document.images[i].src = eval(i+'_'+s+'.src');
}

function submenu(i,s) {
	document.getElementById('sub_sambaclub').style.display = 'none';
	document.getElementById('sub_fotos').style.display = 'none';
	document.getElementById('sub_colecao').style.display = 'none';
	if(document.getElementById('sub_'+i)) {
		switch(s) {
			case "on" :
			document.getElementById('sub_'+i).style.display = 'block';
			window.setTimeout('submenu("'+i+'","off")',7000);
			break;
		}
	}


}

function cform(id,vl,st) {
	switch(st) {
		case 'on' :
		document.getElementById(id).style.border = '1px solid black';
		break;
		case 'off' :
		document.getElementById(id).style.border = '1px solid #CCC';
		break;
	}
	if(document.getElementById(id).value == '') {
		document.getElementById(id).value = vl;
	} else if(document.getElementById(id).value == vl) {
		document.getElementById(id).value = '';
	}
}

function chkbox(campo, box) {
	if(campo.value == 'f') {
		document.getElementById(box).style.background = '#6C0';
		campo.value = 't';
	} else {
		document.getElementById(box).style.background = '#FFF';
		campo.value = 'f';
	}
}

function radbtn(campo, box, valor, cor, img) {
	document.getElementById('ibox1').style.border = '1px solid red';
	document.getElementById('ibox2').style.border = '1px solid red';
//	document.getElementById('ibox3').style.border = '1px solid red';
	document.getElementById(box).style.border = '1px solid black';
	if(document.images) {
		document.images['vitrine'].src = img;
	}
	campo.value = valor;
}

function radbtn2(campo, box, valor, cor, img) {
	document.getElementById('box1').style.border = '1px solid white';
	document.getElementById('box2').style.border = '1px solid white';
	document.getElementById(box).style.border = '1px solid black';
	if(document.images) {
		document.images['vitrine'].src = img;
	}
	campo.value = valor;
}

function valida_sacola(form) {
	c = new Array();
	msg = "Você deve preencher corretamente os seguintes campos:\n";
	if(form.fk_cor.value == 0) { c[c.length] = " - ESCOLHA A COR\n " }
	z = 0;
	for(i=0;i<form.tamanho.length;i++) {
		if(form.tamanho[i].checked == true) {
			z++;
		}
	}
//	if(z == 0) { c[c.length] = " - SELECIONE O TAMANHO\n " }
	if(form.quantidade.value == '') { c[c.length] = " - QUANTIDADE\n " }

	if(c.length) {
		for(i=0;i<c.length;i++) {
			msg+=c[i];
		}
		alert(msg);
		return false;
	}
	return true;
}

function submeter(f,a) {
	document.getElementById(f).acao.value = a;
	document.getElementById(f).submit();
}

function mesmo(form) {
	if (form.selall.checked)
	{
		form.e_nome.value = form.nome.value;
		form.e_rua.value = form.c_rua.value;
		form.e_numero.value = form.c_numero.value;
		form.e_complemento.value = form.c_complemento.value;
		form.e_bairro.value = form.c_bairro.value;
		form.e_cidade.value = form.c_cidade.value;
		form.e_uf.value = form.c_uf.value;
		form.e_cep.value = form.c_cep.value;
	}
	else
	{
		form.e_nome.value = "";
		form.e_rua.value = "";
		form.e_numero.value = "";
		form.e_complemento.value = "";
		form.e_bairro.value = "";
		form.e_cidade.value = "";
		form.e_uf.value = "";
		form.e_cep.value = "";
	}
}


function AbreThumb(foto, tamx, tamy) {
	lf = Math.floor(screen.width/2) - Math.floor(tamx/2);
	tp = Math.floor(screen.height/2) - Math.floor(tamy/2);
	w = new Window()
	w.src = foto;
	w.style="margin:0px;padding:0px";
	w.open(perfil,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=no,width=" + tamx + ",height=" + tamy + ", left = " + lf + ", top = " + tp)
}

function popup(perfil, tamx, tamy, yn) 
{
	lf = Math.floor(screen.width/2) - Math.floor(tamx/2);
	tp = Math.floor(screen.height/2) - Math.floor(tamy/2);
	window.open(perfil,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=" + yn + ",width=" + tamx + ",height=" + tamy + ", left = " + lf + ", top = " + tp)
}
function AbrePagina(perfil, tamx, tamy, yn) 
{
	lf = Math.floor(screen.width/2) - Math.floor(tamx/2);
	tp = Math.floor(screen.height/2) - Math.floor(tamy/2);
	window.open(perfil,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=" + yn + ",width=" + tamx + ",height=" + tamy + ", left = " + lf + ", top = " + tp)
}
function GerarSWF($arquivo,$largura,$altura,$id,$transparencia, $bgcolor){
	if($transparencia){
		$transparent = "wmode=\"transparent\" ";
	}else {
		$transparent = "";
	}
    document.writeln('    <object id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + $largura + '" height="' + $altura + '" id="' + $id + '" name="' + $id + '">');
    document.writeln('        <param name="movie" value="' + $arquivo + '" />');
    document.writeln('        <param name="FlashVars" value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />');
    document.writeln('        <param name="bgcolor" value="' + $bgcolor + '" />');
    document.writeln('        <param name="menu" value="false" />');
    document.writeln('        <param name="quality" value="high" />');
    document.writeln('        <param name="salign" value="tl" />');
    document.writeln('        <param name="scale" value="noscale" />');
	if($transparencia){
		document.writeln('        <param name="wmode" value="transparent" />');
	}
    document.writeln('        <embed id="globalnav-embed" src="' + $arquivo + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' + $transparent + 'flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="' + $bgcolor + '" menu="false" quality="high" salign="tl" scale="noscale" name="' + $id + '" width="' + $largura + '" height="' + $altura + '"></embed>');
    document.writeln('    </object>');
}

function showFlash(file, width, height, id, bgcolor, quality, transparent, align, style, events) {
	s="<object "+events+" type='application/x-shockwave-flash' data='"+file+"' "+(width?"width='"+width+"'":"")+" "+(height?"height='"+height+"'":"")+" "+(id?"id='"+id+"'":"")+" "+(align?"align='"+align+"'":"")+" "+(style?"style='"+style+"'":"")+" >";
	s+="<param name='movie' value='"+file+"' />";
	s+="<param name='allowScriptAcess' value='sameDomain' />";
	s+="<param name='menu' value='false' />";
	s+="<param name='quality' value='"+quality+"' />";
	if(transparent){
		s+="<param name='wmode' value='transparent'>";
	}
	if(bgcolor){
		s+="<param name='bgcolor' value='"+bgcolor+"' />";
	}
	s+="<param name='FlashVars' value='playerMode=embedded' />";
	s+="</object>";
	document.write(s);
}