/* 

(C) 2008 ErgoSum. Todos os direitos reservados. 

Website criado por Aristides da Silva Neto da ErgoSum.com.br
mr.hiddenanddangerous@gmail.com

PROIBIDA REPRODUÇÃO TOTAL OU PARCIAL DESTE STYLESHEET (CSS) 
OU DE QUALQUER OUTRA PARTE DO WEBSITE.

*/
function validarNumeros(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        return false
    }
    status = ""
    return true
}
function MudaCSS(ID, Tipo)
	{
	if(Tipo == 1)
		{
		$('#' + ID).addClass('SobreTR');
		}else{
		$('#' + ID).removeClass('SobreTR');
		}
	}
function ErgoCarrinho_Adiciona_Promocao(ID)
	{	
	$.blockUI({ message: 'Aguarde, adicionando ao carrinho' });
	$.ajax({
		   type: "POST",
		   url: "Ajax.php",
		   data: 'ct=Info&Acao=Adicionar_ao_carrinho&Verificar=' + ID + '',
		   cache: false,
		   error: function(Retorno)
		   			{
					alert('Oops!, Ocorreu um erro:' + Retorno);
		   			},
		   success: function(Retorno)
		   			{
					$.blockUI({ 
							  message: Retorno,
							  css: { 
								padding:        '5px',
								paddingLeft:	'26px',
								margin:         0,
								width:          '30%', 
								top:            '40%', 
								left:           '35%', 
								//textAlign:      'center', 
								color:          '#000', 
								border:         '3px solid #CCEACC',
								borderLeft:		'0',
								borderRight:	'0',
								background: 	'#EAFFEA url(Imagens/Sim.gif) no-repeat 5px 50%',
								cursor:         'wait'
							}
							});
					$('#TOTAL_PRODUTOS_CARRINHO').html('?');
					$('#' + Div).html('<form action="index.php?ct=Carrinho" method="get"><input type="hidden" name="ct" value="Carrinho" /><input type="image" src="Imagens/Botoes/Visualizar_carinho.png" onclick="this.form.submit();" /></form>');
					//setTimeout("$.unblockUI();", 1000)
		   			}
		 });
	}
function ErgoCarrinho_Adiciona_Dominio(Div, Nome, TLD)
	{	
	$.blockUI({ message: 'Aguarde, adicionando ao carrinho' });
	$.ajax({
		   type: "POST",
		   url: "Ajax.php",
		   data: 'ct=Dominios&Acao=Adicionar_ao_carrinho&Nome=' + Nome + '&TLD=' + TLD + '',
		   cache: false,
		   error: function(Retorno)
		   			{
					alert('Oops!, Ocorreu um erro:' + Retorno);
		   			},
		   success: function(Retorno)
		   			{
					$.blockUI({ 
							  message: Retorno,
							  css: { 
								padding:        '5px',
								paddingLeft:	'26px',
								margin:         0,
								width:          '30%', 
								top:            '40%', 
								left:           '35%', 
								//textAlign:      'center', 
								color:          '#000', 
								border:         '3px solid #CCEACC',
								borderLeft:		'0',
								borderRight:	'0',
								background: 	'#EAFFEA url(Imagens/Sim.gif) no-repeat 5px 50%',
								cursor:         'wait'
							}
							});
					$('#TOTAL_PRODUTOS_CARRINHO').html((parseInt($('#TOTAL_PRODUTOS_CARRINHO').html()) + 1));
					$('#' + Div).html('<form action="index.php?ct=Carrinho" method="get"><input type="hidden" name="ct" value="Carrinho" /><input type="image" src="Imagens/Botoes/Visualizar_carinho.png" onclick="this.form.submit();" /></form>');
					//setTimeout("$.unblockUI();", 1000)
		   			}
		 });
	}
	
function ErgoCarrinho_Adiciona_Hospedagem(Div, pID, cID)
	{	
	$.blockUI({ message: 'Aguarde, adicionando ao carrinho' });
	$.ajax({
		   type: "POST",
		   url: "Ajax.php",
		   data: 'ct=Info&Acao=Adicionar_ao_carrinho&cID=' + cID + '&pID=' + pID + '',
		   cache: false,
		   error: function(Retorno)
		   			{
					alert('Oops!, Ocorreu um erro:' + Retorno);
		   			},
		   success: function(Retorno)
		   			{
					$.blockUI({ 
							  message: Retorno,
							  css: { 
								padding:        '5px',
								paddingLeft:	'26px',
								margin:         0,
								width:          '30%', 
								top:            '40%', 
								left:           '35%', 
								//textAlign:      'center', 
								color:          '#000', 
								border:         '3px solid #CCEACC',
								borderLeft:		'0',
								borderRight:	'0',
								background: 	'#EAFFEA url(Imagens/Sim.gif) no-repeat 5px 50%',
								cursor:         'wait'
							}
							});
					$('#TOTAL_PRODUTOS_CARRINHO').html((parseInt($('#TOTAL_PRODUTOS_CARRINHO').html()) + 1));
					$('#' + Div).html('<form action="index.php?ct=Carrinho" method="get"><input type="hidden" name="ct" value="Carrinho" /><input type="image" src="Linguagens/Portugues_Brasileiro/Imagens/Botoes/Visualizar_carinho.png" onclick="this.form.submit();" /></form>');
					//setTimeout("$.unblockUI();", 1000)
		   			}
		 });
	}
function ErgoPopup_dinamico(URL, Largura, Altura, Nome)
	{	
	var Lar = (screen.width - Largura) / 2;
	var Alt = (screen.height - Altura) / 2;
	window.open(URL, Nome, 'width='+Largura+', height='+Altura+', top='+Alt+', left='+Lar+', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, fullscreen=no');
	}	
