var __reference = "";
var __searchme = "";
var __utmp = "";
var __medium = "";




function read_cookie(cookie_name) {
  var my_cookie=""+document.cookie;
  var ind=my_cookie.indexOf(cookie_name);
  if (ind==-1 || cookie_name=="") return ""; 
  var ind1=my_cookie.indexOf(';',ind);
  if (ind1==-1) ind1=my_cookie.length; 
  return unescape(my_cookie.substring(ind+cookie_name.length+1,ind1));
}

function superSetVar(appendValue) {
  var getVar = read_cookie('__utmv');       // read the __utmv cookie
  hasValue = getVar.indexOf(appendValue);   // does the cookie already have the value we want to append?
  if ( hasValue == -1 ) {                   // if the new value is not already in the cookie
    removePrefix = /^.*\.(.*)/.exec(getVar);  // __utmv cookie has the format 12345678.cookieValue - remove the ## prefix
    if (removePrefix && removePrefix[1]) {
      newVar = removePrefix[1] + appendValue; // append the value
    }else{
      newVar = appendValue;                 // this will execute if the cookie was not already set.
    }
      var superSetVarTracker = _gat._getTracker("UA-1-1");  // set up a tracker to call _setVar from
      superSetVarTracker._initData();  
      superSetVarTracker._setVar(newVar);                   // call _setVar with the new value
  }
}


function urchinTracker(page) {
pageTracker._trackPageview(page);
}


function getcookie(c_name, special)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
		{ 
			c_start=c_start + c_name.length+1; 
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;

			var cookie_to_use = unescape(document.cookie.substring(c_start,c_end));		
			if (special)
			{
				return cookie_to_use.toLowerCase()
			}
			return cookie_to_use;

	    } 
	}
	return "";
}

String.prototype.trim = function ()
{
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}

function matchregex(regex)
{
	var patt = new RegExp(regex + "=([^|]+)");

	if(result = patt.exec(__utmp))
	{
		return result[1];
	}
	return null;
	
}

function setcookie(c_name, value, expiredays)
{
	var exdate= new Date();
	exdate.setDate(exdate.getDate() + expiredays);
	document.cookie = c_name + "=" + value + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
}

function configurecwcookie(reference)
{

	if (__utmcw == "ExcludeVisit")
	{
		setcookie("__utmcw", "ExcludeVisit", 360);
	}
	else if (__utmcw.length == "0")
	{
		setcookie("__utmcw", reference, 360);
	}
	else
	{
		setcookie("__utmcw", __utmcw, 360);
	}

}
