﻿$(document).ready(function () {
  activeFlag = "0";
  var pageURL = window.globalPageURL;
  //var isIndex = pageURL.lastIndexOf("index");
  //if (isIndex != "-1") {
  var DirLng = pageURL.length;
  var begOfDir = pageURL.indexOf("case-studies/") + 13;
  pageURL = pageURL.slice(begOfDir, DirLng);
  //alert(pageURL + ", (" + begOfDir + ", " + DirLng + ")");
  //}
  $("#contentMain").find("ul.colNav li a[href='" + pageURL + "']").each(function () {
    $(this).attr({
      href: "#",
      rel: "nofollow",
      title: "you are here"
    }).css("cursor", "default").parent().addClass("current");
    var activeClass = $(this).parent().attr("class");
    if (activeClass != "overview current") {
      //$(this).parent(":not('.overview')").insertAfter("#activate");
      $("#activate").css("display", "block");
    }
    activeFlag = "1";
  });

  if (activeFlag == "0") {
    var main = $("#contentMain").find("ul.colNav li:first a");
    $(main).attr({
      href: "#",
      rel: "nofollow",
      title: "you are here"
    }).css("cursor", "default").parent().addClass("current");
  }
  //$("#contentMain a[rel*=screenshot]").lightBox();

});
