﻿function StdAnalytics() {
    
    var From,Mode,Locality; //From = AdvSearch; Mode = "Mappa"; Locality = "Milano" (QuickSearch Keyword)
    var City;
    var Reg,Pro,Com,Zon;
    var Price,MQ,Type,NLoc,Box,BuildingCond,Garden,OnlyFrom,Paging,OnlyPhoto,Last7;
    
    this.Init = Init;
    this.setGACookie = setGACookie;

    function Init() {
        this.City = "Altro";
        
        this.Reg = "N";
        this.Pro = "N";
        this.Com = "N";
        this.Zon = "N";
        
        this.Price = "0";
        this.MQ = "0";
        this.Type = "0";
        this.NLoc = "0";
        this.Box = "0";
        this.BuildingCond = "0";
        this.Garden = "0";
        this.OnlyFrom = "0";
        this.Paging = "0";
        this.OnlyPhoto = "0";
        this.Last7 = "0";
    }
    
    function setGACookie() {
        var strCookie;
        
        strCookie = "/" + this.From;
        
        if (this.Mode != null)
            strCookie += "/" + this.Mode;
            
        strCookie += "/" + this.City + "/" + this.Reg + "_" + this.Pro + "_" + this.Com + "_" + this.Zon;
        strCookie += "/" + this.Price + "_" + this.MQ + "_" + this.Type + "_" + this.NLoc + "_" + this.Box + "_" + this.BuildingCond + "_" + this.Garden + "_" + this.OnlyFrom + "_" + this.Paging + "_" + this.OnlyPhoto + "_" + this.Last7;
        
        if (this.Locality != null)
            strCookie += "?locality=" + this.Locality;
        
        setCookie("StdGA", strCookie, 1);
    }
}

//function RefineAnalytics() {

//    var City;
//    var pMin,pMax,Type,MQMin,MQMax,ContractType,BuildingType,Com,Zon;
//    
//    this.Init = Init; 
//    this.setRefineCookie = setRefineCookie;
//    
//    function Init() {
//        this.City = "Altro";
//        this.pMin = "0";
//        this.pMax = "0";
//        this.Type = "0";
//        this.MQMin = "0";
//        this.MQMax = "0";
//        this.ContractType = "0";
//        this.BuildingType = "0";
//        this.Com = "0";
//        this.Zon = "0";
//    }
//    
//    function setRefineCookie() {
//        var strCookie;
//        
//        strCookie = "/" + this.City + "/" + this.pMin + "_" + this.pMax + "_" + this.Type + "_" + this.MQMin;
//        strCookie += "_" + this.MQMax + "_" + this.ContractType + "_" + this.BuildingType + "_" + this.Com + "_" + this.Zon;
//        
//        setCookie("RefineGA", strCookie, 1);
//    }
//}