
 function setCookie(name, value) { // use: setCookie("name", value);
  var today = new Date();
  var expiry = new Date(today.getTime() + 3 * 24 * 60 * 60 * 1000);
    if (value != null && value != "")
      document.cookie=name + "=" + escape(value) + ";path=/; expires=" + expiry.toGMTString();
    // update bikky
  }
  
  function getCookie(name) { // use: getCookie("name");
    bikky= document.cookie;
    var index = bikky.indexOf(name + "=");
    if (index == -1) return null;
    index = bikky.indexOf("=", index) + 1;
    var endstr = bikky.indexOf(";", index);
    if (endstr == -1) endstr = bikky.length;
    return unescape(bikky.substring(index, endstr));
  }
  
  	var sQuery =document.location.search.toUpperCase();
	var iStartOfId = sQuery.indexOf('REFID=');
	
	if (iStartOfId !=-1)
	{
		//This query has a referrer ID
		var sRefId = sQuery.substring(iStartOfId+6);
		var iEndOfId = sRefId.indexOf("&");
		if (iEndOfId!=-1)
		{   //It is part of a bigger string
			sRefId = sRefId.substring(0,iEndOfId);
		}
		iEndOfId = sRefId.indexOf("#");
		if (iEndOfId!=-1)
		{  //There was a # at the end
			sRefId = sRefId.substring(0,iEndOfId);
		}
		setCookie('refId',sRefId);
					
	}

function LaunchHelpPopup() {
		if (getCookie("SeenHelpPopup") != "YES")	{
			// is IE
			if(document.all)
			{
				window.open("pop-up.htm","","width=250,height=310,resizable=1")
			}
			// is Safari
			else if(navigator.userAgent.toLowerCase().indexOf("safari")!=-1)
			{	
				window.open("pop-up.htm","","width=254,height=292,resizable=1")				
			}
			// any other browser
			else
			{
				window.open("pop-up.htm","","width=250,height=285,resizable=1")				
			}
		}
}

