
	var LGPID = 'LiveGuide_paRicdKe-rD1jO';

	/**
	 * Added by Marc Ruhwedell <marc@mybanker.dk> instead of document.write();
	 * 
	 * Use jQuery to execute "LoadLiveGuide()". We use a function since we
	 * have to reload LiveGuide contents when there's a change to a list.
	 * 
	 */
	$(document).ready(function() {
		load_live_guide();
	});

	/**
	 * Added by Marc Ruhwedell <marc@mybanker.dk> instead of document.write();
	 * 
	 */
	function load_live_guide() {
		// Use jQuery to find all elements with class="nykredit_livechat".
		$(".nykredit_livechat").html('<img src="' + document.location.protocol + '//clients-liveguide01eu.netop.com/status.php?LiveGuideUID=paRicdKe-rHI4jW&from=' + escape(window.location) + '" border="0" style="cursor:pointer;" alt="Start netmøde" onClick="LGWin=window.open(\'https://clients-liveguide01eu.netop.com/swf.php?LiveGuideUID=paRicdKe-rHI4jW&myurl=' + escape(escape(window.location)) + '&title=' + escape(escape(document.title)) + LiveGuideGetCookie(LGPID + '_duration', 'LiveGuideCIDuration', 'duration') + LiveGuideGetCookie(LGPID + '_ref', 'LiveGuideCIRef', 'referrer') + LiveGuideGetCookie(LGPID + '_title', 'LiveGuideCITitle', 'title') + LiveGuideGetCookie(LGPID + '_url', 'LiveGuideCIUrl', 'url') + '\' ,\'NetopWebDesk\', \'width=250,height=640,status=yes,left=' + (screen.availWidth - 250) + ',top=0,resizable=1\');LGWin.focus();return false;" >');
	}

 function LiveGuideGetCookieValue(cookieName, noCookie) {
 	if (document.cookie.length>0) {
 		cookieStart = document.cookie.indexOf(cookieName + "=");

 		if (cookieStart != -1) {
 			cookieStart=cookieStart + cookieName.length + 1;
 			cookieEnd=document.cookie.indexOf(";", cookieStart);

 			if (cookieEnd == -1) {
 				cookieEnd = document.cookie.length;
 			}

 			return escape(document.cookie.substring(cookieStart,cookieEnd));
 		}
 	}

 	switch (noCookie) {
  	case 'title':
    return escape(escape(window.document.title));
    break;
   case 'url':
    return escape(escape(window.document.URL));
    break;
   case 'referrer':
    return escape(escape(window.document.referrer));
    break;
   default:
    return "";
  }
 }

 function LiveGuideGetCookie(cookieName, name, noCookie) {
 	if (noCookie == 'duration') {
 		var mydate = new Date().getTime();
 		var cookieValue = LiveGuideGetCookieValue(LGPID + '_date', noCookie);
 		var cookieValue = Math.abs(mydate - parseInt(cookieValue));
 	} else { 
 		var cookieValue = LiveGuideGetCookieValue(cookieName, noCookie);
  }

 	return ('&' + name + '=' + cookieValue);
 }
