﻿function pstrk_regAction(p_trkInfo, p_trk_pid) 
{

	try {
		click_info(0, lngOriginal);
		click_info(1, 'TXT|' + p_trkInfo);
		p_trk_pid = parseFloat(p_trk_pid);
		if(p_trk_pid.toString() != "NaN") {
			click_flash(p_trk_pid);	
		}
		
		//alert('[PopStats] pstrk_regAction() OK');
	} catch(ex) {
		// Nada, futuramente um log.
	}
	//alert(p_trkInfo + ' ' + p_trk_pid);
	
}
function pstrk_RegUser(Email, Nome, cidade, estado, Pais, Endereco, CEP, telefone, celular, Companhia, Posicao, Profissao, BulkMailAuthorized) 
{
	var codCliente = "0804";
	var Institucional = "S";
	var extraParams = ""; //"|sexo=M|dia_nasc=01|mes_nasc=05|ano_nasc=1967|BulkMailAuthorized=1";
	if(cidade.length > 0) extraParams += "|cidade=" + cidade;
	if(estado.length > 0) extraParams += "|estado=" + estado;
	if(Pais.length > 0) extraParams += "|pais=" + Pais;
	if(Endereco.length > 0) extraParams += "|endereco=" + Endereco;
	if(CEP.length > 0) extraParams += "|cep=" + CEP;
	if(telefone.length > 0) extraParams += "|telefone=" + telefone;
	if(celular.length > 0) extraParams += "|celular=" + celular;
	if(Companhia.length > 0) extraParams += "|companhia=" + Companhia;	
	if(Posicao.length > 0) extraParams += "|posicao=" + Posicao;		
	if(Profissao.length > 0) extraParams += "|profissao=" + Profissao;			
	if(BulkMailAuthorized.length > 0) extraParams += "|BulkMailAuthorized=" + BulkMailAuthorized;			
	var oPopStatsAux = document.getElementById('popStatsAux');
	//alert("http://iv30.popstats.com.br/Affiliates/api/io.cfm?pt=U&afid="+ codCliente +"&email="+ Email +"&fv=nome="+ Nome + extraParams);
	oPopStatsAux.src = "http://iv30.popstats.com.br/Affiliates/api/io.cfm?pt=U&amp;afid="+ codCliente +"&email="+ Email +"&fv=nome="+ Nome + extraParams;
	
	//alert(Email + ' - ' + Nome + ' - ' + cidade  + ' - ' + estado + ' - ' + Pais + ' - ' + Endereco + ' - ' +  CEP + ' - ' + telefone + ' - ' + celular + ' - ' + Companhia + ' - ' + Posicao + ' - ' + Profissao + ' - ' + BulkMailAuthorized);
}

function pstrk_RegUser_Done() {
	alert('[PopStats] OK, usuário e cookie registrado !');
}
