/*  */
/* SATO.fi statistics related functions */
    var statisticTag = "";
    var statisticTagBc;
    
    // Page specific statistc tags
    var docLoc = document.location.toString().toLowerCase();
    if (docLoc.indexOf("index.htm") != -1 || docLoc == "http://www.sato.fi/") { statisticTag = "etusivu"; }
    else if (docLoc.indexOf("index_en.htm") != -1 ) { statisticTag = "etusivu_english"; }
    else if (docLoc.indexOf("haku.html") != -1) { statisticTag = "hakusivu"; }
    else if (docLoc.indexOf("hakutulos_vuokra.htm") != -1) {
        statisticTag = "hakutulos_vuokra";
        if ($("input[name='dd_senior']").attr("value") == 'true') { 
            statisticTag += '_seniori';
        }
        statisticTag += srp_stats_addurl;
    }
    else if (docLoc.indexOf("hakutulos_vuokra_kaikki.htm") != -1) {
        statisticTag = "hakutulos_vuokra"; 
        if ($("input[name='dd_senior']").attr("value") == 'true') { 
            statisticTag += '_seniori';
        }
    }
    else if (docLoc.indexOf("hakutulos_omistus.htm") != -1) { statisticTag = "hakutulos_omistus"; }
    else if (docLoc.indexOf("huoneisto.htm") != -1) { statisticTag = h_kohde + " - " + h_tyyppi + " (#" + huoneistoID + ")"; }
    else if (docLoc.indexOf("omistuskohde") != -1) { statisticTag = site_name + " (#" + kipiID + ")"; }
    else if (docLoc.indexOf("kohteentiedot") != -1) { statisticTag = site_name + " (#" + kipiID + ")"; }
    
    // Title specific statistic tags
    var pageTitle = document.title.toLowerCase();
    if (pageTitle.indexOf("kerro kaverille") != -1) { statisticTag = "kerro_kaverille"; }
    // Breadcrumb specific statistic tags
    if(statisticTag == ""){
        statisticTagBc = $("#breadcrumbs").text().toString();
        if (statisticTagBc && statisticTagBc != null && statisticTagBc != '') {        
            statisticTagBc = statisticTagBc.replace(/\n|\t|  /g,"");
            statisticTagBc = statisticTagBc.replace(/^\s+|\s+$/g, "");
            if (statisticTagBc.toLowerCase().indexOf("sato in english") == -1){
                statisticTagBc = statisticTagBc.replace("SATO > ", "");}
            statisticTag = statisticTagBc;
        }
    }
    
    if(statisticTag == ""){
        statisticTag = "general";
    }
//1.1.5.1 
var tmsec = new Array ('tmsec1=' + statisticTag); 
document.write("<div style=\"display:none;\">");
getTMqs('', '', 'sato_fi', 'fi', 'UTF-8', tmsec); 
document.write("</div>");
/* <script id="snoobi" type="text/javascript" src="http://eu1.snoobi.com/snoop.php?tili=sato_fi&page_name=Haluttu sivun nimi"></script> */
document.write("<scr" + "ipt src=\"http://eu1.snoobi.com/snoop.php?tili=sato_fi&page_name=" + encodeURIComponent(statisticTag) + "\" type=\"text/javascript\"><\/script>");
