    var s_title = '';
    document.title = s_title;
    var _section;
    var _deeplink_section_name='';
    var _tracking_desc='';
    //
    function init() {
      _section = window.location.hash.substr(1).split(",")[0];      
      // check for team site
      if (window.location.href.indexOf("kayandclarke.co")>-1 && (_section=='' || _section=='mobile')) {
        _section='team';
      }
      // default to consultancy
      if (_section=='team') {
        s_title = "Kay & Clarke - Creative Team";
      } else {
        if (_section=='') {
          _section='consultancy';
        }
        if (window.location.href.indexOf('?')>-1) {
          _tracking_desc=window.location.href.substr(window.location.href.indexOf('?'));

          if (_tracking_desc=='?pov') {
            _section='consultancy';
            _deeplink_section_name = "our point of view";
          }
        }        
        if (window.location.href.indexOf("createbrandlove.co")>-1) {
          _deeplink_section_name = "create brand love";
        } else {
          if (window.location.hash.substr(1).split(",")[1]) {
            _deeplink_section_name = window.location.hash.substr(1).split(",")[1];
            window.location.hash = '#'+_section;
          };
        }
        s_title = "DarkRed Consulting | A BRAND LOVE AGENCY | Brand & Business strategists";
      }
      document.title = s_title;
      document.getElementById("mobile_title").innerHTML="<font style='font-size:24pt;' color='#ff9933'>"+s_title+"<br/></font><font color='#ff9933'>[This is the non-<a href='http://get.adobe.com/flashplayer/' style='color:#ff9933;' target='_blank'>flash</a>, mobile browser version of our website. Thanks for visiting.]</font>";
      
      var playerVersion = swfobject.getFlashPlayerVersion();

      if (window.location.hash.indexOf("mobile")==-1 && screen.width>=1000) {
        //if (playerVersion.major>9 || (playerVersion.major==9 && playerVersion.minor==0)) {
        if (playerVersion.major>=10) {
          //var fo = new SWFObject("application.swf?live=1&base_url=http://"+s_server+"/scripts/&location="+_section, "application_swf", "1000", "100%", "9", "#ffffff");
          //fo.addParam("allowScriptAccess", "always");
          //fo.write("swf");
          var flashvars = {};
          var params = {wmode:"opaque"};
          var attributes = {};
          swfobject.embedSWF("application.swf?live=1&base_url=http://"+s_server+"/scripts/&location="+_section+"&deeplink_section_name="+_deeplink_section_name, "swf", "1000", "100%", "10", false, flashvars, params, attributes);

          tracking(_section+':init'+_tracking_desc)
        }
      }
    }
    //
    function resize(i_height, i_width, s_hash) {
      var _height;
      if (document.body.clientHeight) {
        if (parseInt(i_height.substr(0,i_height.length-2))>document.body.clientHeight) {
          _height = i_height;
        } else {
          _height = document.body.clientHeight-1;
        }
      } else {
        _height = i_height;
      }
      document.getElementById('swf').style.height = _height;
      document.getElementById('swf').style.width = i_width;
      //
      if (s_hash!='' && window.location.href.indexOf("darkred")==-1) {
        document.title = s_title;
        window.location.hash = '#'+s_hash;
      } else {
        document.title = s_title
      }
    }
    //
    function go_top() {
      window.scrollTo(0,0);
    }
    //
    function scroll_page(i_offset) {
      window.scrollTo(0,window.document.body.scrollTop+(i_offset*10));
    }
    
    function reload_page() {
      window.open(document.location.href);
      window.close();
    }
    
    function swf_object(movieName) {
      if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
      } else {
        return document[movieName];
      }
    }
    
    function set_nav_ypos() {
      if (!document.getElementById('no_flash')) {
        //swf_object("application_swf").set_nav_ypos(document.body.scrollTop);
        swf_object("swf").set_nav_ypos(document.body.scrollTop);
      }
    }
    
    function no_flash() {
      checkResize();
      if (document.getElementById('no_flash')) {
        document.getElementById('no_flash').style.display = 'block';
        tracking('no flash');
      };
    }
    
    function checkResize() {
      if (document.getElementById('no_flash')) {
        document.body.style.backgroundColor='#ffffff';
        var _width;
        
        if (screen.width<380) {
          _width = screen.width;
        } else {
          _width = 380;
        }
        document.getElementById('swf').style.width = (_width)+'px';
        //
        //if (screen.width<380) {
          if (document.getElementById('img_clients')) {
            document.getElementById('img_clients').width = (_width/2);
          }
          if (document.getElementById('img_expert_review')) {
            document.getElementById('img_expert_review').width = (_width/2);
          }
          if (document.getElementById('img_evolving_consumer')) {
            document.getElementById('img_evolving_consumer').width = (_width/2);
          }
          if (document.getElementById('img_expert_review_book')) {
            document.getElementById('img_expert_review_book').width = (_width/2);
          }          
        //}
      }
    }
