_site = 'ki.bf.default';
_zone = 'default';

// tile number
var dartTileNum = 1;

var pagePath = window.location.pathname;

if(!pagePath || /^\/$/.test(pagePath))
{
    _site = 'ki.bf.home';
    _zone = 'main';
}

if(/^\/shopping\.html/.test(pagePath))
{
    _site = 'ki.bf.shop';
    _zone = 'main';
}

if (/^\/allabout\.html/.test(pagePath)) {
    _site = 'ki.bf.breastfeeding';
    _zone = 'article';
}

if (/^\/all_about\//.test(pagePath)) {
    _site = 'ki.bf.breastfeeding';
    _zone = 'article';
}

if(/^\/helpme\.html/.test(pagePath) ||
   /^\/helpme\/helpme_answer_center\.html/.test(pagePath) ||
   /^\/helpme\/helpme_video\.html/.test(pagePath) ||
   /^\/ask_a_lactation_consultant_schedule\.html/.test(pagePath)
  )
{
    _site = 'ki.bf.breastfeeding';
    _zone = 'article';
}


if(/^\/books\.html/.test(pagePath) ||
   /^\/art_gallery\/Mom_photos_0\.html/.test(pagePath) ||
   /^\/artgallery\.html/.test(pagePath) ||
   /^\/celebrities\/celeb_main\.html/.test(pagePath) ||
   /^\/while_breastfeeding_main\.html/.test(pagePath) ||
   /^\/lighter\.html/.test(pagePath) ||
   /^\/for_moms\/weight_loss\.html/.test(pagePath) ||
   /^\/for_moms\/spice_marriage\.html/.test(pagePath) ||
   /^\/for_moms\/child_spouse_abuse\.html/.test(pagePath)
  )
{
    _site = 'ki.bf.moms';
    _zone = 'article';
}
else if (/^\/art_gallery\//.test(pagePath)) {
    _site = 'ki.bf.moms';
    _zone = 'article';
}
else if (/^\/celebrities\//.test(pagePath)) {
    _site = 'ki.bf.moms';
    _zone = 'article';
}

if (/^\/directory\/lcdirectory\.html/.test(pagePath)
|| /^\/directory\/states\//.test(pagePath))
{
    _site = 'ki.bf.local';
    _zone = 'lc';
}

if (/^\/directory\/doula_directory\.html/.test(pagePath)
|| /^\/directory\/doula_states_and_countries\//.test(pagePath))
 {
    _site = 'ki.bf.local';
    _zone = 'doula';
}

if (/^\/directory\/midwives_directory\.html/.test(pagePath)
|| /^\/directory\/midwives_states_countries\//.test(pagePath))
{
    _site = 'ki.bf.local';
    _zone = 'midwives';
}

if (/^\/directory\/cbe_directory\.html/.test(pagePath)
|| /^\/directory\/cbe_states_countries\//.test(pagePath))
{
    _site = 'ki.bf.local';
    _zone = 'cbe';
}

if (/^\/directory\/grief_marriage_directory\.html/.test(pagePath)
|| /^\/directory\/counseltors_states_countries\//.test(pagePath))
{
    _site = 'ki.bf.local';
    _zone = 'grief';
}

if (/^\/while_breastfeeding_kid_fun\.html/.test(pagePath) ||
    (
      /^\/baby_toddler\//.test(pagePath)
      && (
        /child_care\.html$/.test(pagePath) ||
        /potty_training\.html$/.test(pagePath) ||
        /safety\.html$/.test(pagePath) ||
        /teething\.html$/.test(pagePath) ||
        /travel\.html$/.test(pagePath)
      )
    )
  ) {
    _site = 'ki.bf.baby';
    _zone = 'article';
}
else if (/^\/baby_toddler\//.test(pagePath)) 
{
    _site = 'ki.bf.baby';
    _zone = 'article';
}

if (/^\/reviews\/(diapers|wipes|carseats|strollers|carriers|skincare|health_safety|bfgear|pumps|other)\.html/.test(pagePath)) 
{
    _site = 'ki.bf.reviews';
    _zone = 'results';
}
else if(/^\/reviews\//.test(pagePath))
{
    _site = 'ki.bf.reviews';
    _zone = 'main';
}

if(/^\/experts\/index\.php/.test(pagePath) && queryString("do") == "false")
{
    _site = 'ki.bf.experts';
    _zone = 'main';
}

if ((/^\/experts\/index\.php/.test(pagePath) && queryString("do") == "/public/signup/")
    || /^\/experts\/signup\//.test(pagePath))

{
    _site = 'ki.bf.experts';
    _zone = 'register';
}

if ((/^\/experts\/index\.php/.test(pagePath) && queryString("do") == "/public/")
    || /^\/experts\/login\//.test(pagePath))
{
    _site = 'ki.bf.experts';
    _zone = 'login';
}

if(/^\/experts\/become_bf_com_expert\.html/.test(pagePath))
{
    _site = 'ki.bf.experts';
    _zone = 'article';
}

if ('ki.bf.default' == _site && /^\/experts\//.test(pagePath)) {
    _site = 'ki.bf.experts';
    _zone = 'main';
}    


if(/^\/reading_room\//.test(pagePath))
{
    _site = 'ki.bf.index';
    _zone = 'readingroom';    
}

if(/^\/about_bfcom\.html/.test(pagePath))
{
    _site = 'ki.bf.index';
    _zone = 'about';
}

if(/^\/advocacy\//.test(pagePath))
{
    _site = 'ki.bf.index';
    _zone = 'advocacy';
}

if(/^\/workingmom\.shtml/.test(pagePath))
{
    _site = 'ki.bf.moms';
    _zone = 'workingmoms';
}

if(/^\/workingmom\//.test(pagePath))
{
    _site = 'ki.bf.moms';
    _zone = 'workingmoms';
}

// outputs debug information
if(queryString("_d") == "1" || queryString("_debug") == "true")
{
    window.onload = function()
    {
        var debugDiv = document.createElement("div");
        debugDiv.style.position = "absolute";
        debugDiv.style.top = "0px";
        debugDiv.style.left = "0px";
        debugDiv.style.backgroundColor = "#ff9999";
        debugDiv.style.border = "2px dashed #ff3333";
        debugDiv.style.padding = "3px";
        
        var tempDiv = document.createElement("div");
        tempDiv.appendChild(document.createTextNode("pagePath: " + pagePath));
        debugDiv.appendChild(tempDiv);

        tempDiv = document.createElement("div");
        tempDiv.appendChild(document.createTextNode("_site: " + _site));
        debugDiv.appendChild(tempDiv);
        
        tempDiv = document.createElement("div");
        tempDiv.appendChild(document.createTextNode("_zone: " + _zone));
        debugDiv.appendChild(tempDiv);
        
        tempDiv = document.createElement("div");
        tempDiv.appendChild(document.createTextNode("do: " + queryString("do")));
        debugDiv.appendChild(tempDiv);
        
        document.body.appendChild(debugDiv);
    }
}