/*
 *  Script:		Sitewise.js
 *  Instance:		1
 *  version:		1.2
 *  created_by:		furmana 
 *  date_created:	Fri Dec 12 12:00:00 EDT 2002 
 *  Description:	Assigns content group variable based on URL.
 *			Includes Akamai Sitewise JavaScript to populate
 *			usage reporting engine.
 */

function wtl_Tag6_94033() {
        var ORDER= "";
        var SERVER= "";
        var CONTENTGROUP = "liquidfunds.com";
        var INVOICE= "";
        var CARTVIEW= "";
        var CARTADD= "";
        var CARTREMOVE= "";
        var CHECKOUT= "";
        var CARTBUY= "";
        var ADCAMPAIGN= "";
 
        var wtl_URL= document.URL;
        var wtl_Title= document.title;
 
        function D8 (d)
        {
                var fwd=0, seed= new Date('01/01/2000'), key= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
                var s= key.charAt( d.getFullYear()-2000)+key.charAt( d.getMonth()+1)+key.charAt( d.getDate());
                s+= key.charAt( d.getHours())+key.charAt( d.getMinutes())+key.charAt( d.getSeconds());
                while( seed.getDay()!=fwd) seed= new Date(seed.getTime() + 86400000);
                var w= Math.floor( (d.getTime()-(seed.getTime()+86400000)) / 604800000 );
                s+= key.charAt( (w-(w%16))/16 );
                s+= key.charAt( w%16);
                return s;
        }
 
        function A( B, C)
        {
                W+="&"+B+"="+escape(C);
        }
	var t = new Date();
        var W="http"+(document.URL.indexOf('https:')==0?'s':'')+"://statse.webtrendslive.com/S005-01-8-2-233860-94033/button6.asp?tagver=6&si=94033&fw=0";
        A( "server", typeof(SERVER)== "string" ? SERVER : "");
        A( "order", typeof(ORDER)== "string" ? ORDER : "");
        A( "Group", typeof(CONTENTGROUP)== "string" ? CONTENTGROUP : "");
        A( "invoice", typeof(INVOICE)== "string" ? INVOICE : "");
        A( "cartview", typeof(CARTVIEW)== "string" ? CARTVIEW : "");
        A( "cartadd", typeof(CARTADD)== "string" ? CARTADD : "");
        A( "cartremove", typeof(CARTREMOVE)== "string" ? CARTREMOVE : "");
        A( "checkout", typeof(CHECKOUT)== "string" ? CHECKOUT : "");
        A( "cartbuy", typeof(CARTBUY)== "string" ? CARTBUY : "");
        A( "adcampaign", typeof(ADCAMPAIGN)== "string" ? ADCAMPAIGN : "");
        A( "tz", t.getTimezoneOffset());
        A( "ch", t.getHours());
        A( "cl", D8(t));
        A( "ti", typeof(wtl_Title)== "string" ? wtl_Title : document.title);
        A( "url", typeof(wtl_URL)== "string" ? wtl_URL : document.URL);
        A( "rf", window.document.referrer);
        A( "js", "Yes");
        A( "ul", navigator.appName=="Netscape" ? navigator.language : navigator.userLanguage);
        if(typeof(screen)=="object")
        {
        A( "sr", screen.width+"x"+screen.height);
        A( "cd", screen.colorDepth);
        A( "jo", navigator.javaEnabled() ? "Yes" : "No");
        }
        if( W.length>2048 && navigator.userAgent.indexOf('MSIE')>=0)
                W= W.substring( 0, 2043)+"&tu=1";
 
        document.write('<IMG ID="WTL_TAG" BORDER="0" WIDTH="1" HEIGHT="1" SRC="'+W+'">');
}

var group = '';
var url = /(\w+):\/\/([\w\-.]+)\/(\S*)/;
//var url = /(\w+):\/\/([\w.]+)\/(\S*)/;
var text = document.URL;
var result = text.match(url);
if (result != null) {
   var fullurl = result[0];
   var protocol = result[1];
   var host = result[2];
   var path = result[3];
   var path_ns = result[3];
   var filePath = /html?$/;
   var result2 = path.match(filePath);
   if (result2 == null) {
      path += "index.html";
   }
   if (path.indexOf("?") > -1) {
        var path_array = path.split("?");
        path_ns = path_array[0];
   }
}
//alert("RESULT: " + result + " HOST: " + host + " PATH: " + path_ns);

var a = new Array();
var b = new Array();

if (location.hostname.indexOf("pubtest") == -1 && location.hostname.indexOf("dev.morganstanley") == -1 && location.hostname.indexOf("hqiinww16") == -1) { 	//ignore stag
   if ((location.hostname.indexOf("msvp.com")) > -1) {
      group = "Venture Partners";
   }
   else if ((location.hostname.indexOf("msdwvp.com")) > -1) {
      group = "Venture Partners";
   }
   else if ((location.hostname.indexOf("msdw-privateequity.com")) > -1) {
      group = "Private Equity";
   }
   else if ((location.hostname.indexOf("morganstanley.de")) > -1) {
      group = "IPCG_Germany";
   }
   else {

/* Array a contains URL regular expression 
 * Array b contains corresponding content group
 * if a sub-directory has a different content group
 * than its parent, you must list the sub-directory
 * first in Array a or its parent's content group
 * will override it.

 a[0] = new RegExp("^index\.html");	b[0] = "Corporate,Main Page"; 

      for (var element in a) {
         if (a[element].test(path_ns)) { 
            group = b[element]; 
            break; 
         }
         else if (a[element].test(path)) { 
            group = b[element]; 
            break; 
         }
         else { group = "Miscellaneous," + path_ns; }
      }
   }
   if (group.indexOf(",") == -1) {
      group = group + "," + path_ns; 
   }
 */
   }
   wtl_Tag6_94033();
}
//alert(path);
//alert(group);
