function is_msie()
{
    var m = navigator.userAgent.match(/MSIE (\d+(\.\d+)?)/);
    if (navigator.userAgent.indexOf('Opera') == -1 && m)
        return parseFloat(m[1]);
    else
        return 0;
}

function is_opera()
{
    var m = navigator.userAgent.match(/Opera.(\d+(\.\d+)?)/);
    return m ? parseFloat(m[1]) : 0;
}

function is_mozilla()
{
    var m = navigator.userAgent.match(/Gecko/),
        m1 = navigator.userAgent.match(/AppleWebKit/);
    return m && !m1 ? 1 : 0;
}

function is_webkit()
{
    var m = navigator.userAgent.match(/AppleWebKit/);
    return m ? 1 : 0;
}

function setCookie(name, value, expires, path, domain, secure)
{
    // set time, it's in milliseconds
	var today = new Date();
	today.setTime(today.getTime());
	
	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if (expires) {
	   expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date(today.getTime() + (expires));
	
	document.cookie = name + "=" +escape(value) +
	((expires) ? ";expires=" + expires_date.toGMTString() : "") + 
	((path) ? ";path=" + path : "") + 
	((domain) ? ";domain=" + domain : "") +
	((secure) ? ";secure" : "");
}

function getCookie(name)
{
    var srch = name + "=";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(srch);
        if (offset != -1) {
            offset += srch.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) {
                end = document.cookie.length;
            }
            return unescape(document.cookie.substring(offset, end));
        }
    }
}

var quirksMode = !document.compatMode || document.compatMode == 'BackCompat';

function getClientWidth()
{
    return !quirksMode ? document.documentElement.clientWidth : document.body.clientWidth;
}

function getClientHeight()
{
    return !quirksMode ? document.documentElement.clientHeight : document.body.clientHeight;
}

function getScrollLeft()
{
    return !quirksMode ? 
    	document.documentElement.scrollLeft :
    	document.body.scrollLeft;
}

function getScrollTop()
{
    return !quirksMode ? 
    	document.documentElement.scrollTop :
    	document.body.scrollTop;
}

function getScrollWidth()
{
    return !quirksMode ? 
    	document.documentElement.scrollWidth :
    	document.body.scrollWidth;
}

function getScrollHeight()
{
    return !quirksMode ? 
    	document.documentElement.scrollHeight :
    	document.body.scrollHeight;
}

function scrollTo(sl, st)
{
	if (!quirksMode) {
		document.documentElement.scrollLeft = sl;
		document.documentElement.scrollTop = st;
	} else {
		document.body.scrollLeft = sl;
		document.body.scrollTop = st;
	}
}

/*function getControlPixelPos(e, ofs_x, ofs_y, w, h, pad)
{  
    var l = ofs_x;
    var t = ofs_y;
    var ctl = e;
    if (!pad) pad = 0;
    
    while (e && e.tagName != 'BODY')
    {      
        var p = e.offsetParent;
        l += e.offsetLeft;
        t += e.offsetTop;
        l -= p && p.tagName != 'BODY' ? p.scrollLeft : 0;
        t -= p && p.tagName != 'BODY' ? p.scrollTop : 0;            
        e = p;          
    }
    
    if (w > 0 && h > 0) {
        if (l > getClientWidth()+getScrollLeft()-w-pad-1) {
            l += ctl.offsetWidth-w;
            if (l > getClientWidth()+getScrollLeft()-w-pad-1) {
                l = getClientWidth()+getScrollLeft()-w-pad-1;
            }
            if (l < getScrollLeft()+pad+1) {
                l = getScrollLeft()+pad+1;
            }
        }
        if (t > getClientHeight()+getScrollTop()-h-pad-1) {
            t = getClientHeight()+getScrollTop()-h-pad-1;
        }
        if (t < getScrollTop()+pad+1) {
            t = getScrollTop()+pad+1;
        }
    }
    return new Array(l, t);
}*/

function getControlPixelPos(e, ofs_x, ofs_y, w, h, pad, fixedPos)
{
    var l = ofs_x ? ofs_x: 0;
    var t = ofs_y ? ofs_y: 0;
    var ctl = e;
    if (!pad) pad = 0;

    if (e.getBoundingClientRect) {
    	var br = e.getBoundingClientRect();
    	l += br.left;
    	t += br.top;
    	if (!fixedPos) {
	    	l += getScrollLeft();
	    	t += getScrollTop();
    	}
    } else {
	    while (e && e.tagName != 'BODY') {
	        var p = e.offsetParent;
	        l += e.offsetLeft;
	        t += e.offsetTop;
	        l -= p && p.tagName != 'BODY' ? p.scrollLeft : 0;
	        t -= p && p.tagName != 'BODY' ? p.scrollTop : 0;
	        e = p;
	    }
	    if (fixedPos) {
	    	l -= getScrollLeft();
	    	t -= getScrollTop();
	    }
    }
    if (w > 0 && h > 0) {
        var sl = fixedPos ? 0 : getScrollLeft();
        var st = fixedPos ? 0 : getScrollTop();
        if (l > getClientWidth()+sl-w-pad-1) {
            l += ctl.offsetWidth-w;
            if (l > getClientWidth()+sl-w-pad-1) {
                l = getClientWidth()+sl-w-pad-1;
            }
            if (l < sl+pad+1) {
            	l = sl+pad+1;
           	}
        }
        if (t > getClientHeight()+st-h-pad-1) {
            t = getClientHeight()+st-h-pad-1;
        }
        if (t < st+pad+1) {
        	t = st+pad+1;
       	}
    }
    return new Array(l, t);
}


function trim(str, chars) 
{
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) 
{
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) 
{
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

function __getComputedStyle(element, style)
{
	var computedStyle;
	if (typeof element.currentStyle != 'undefined') {
		computedStyle = element.currentStyle; 
	} else { 
		computedStyle = document.defaultView.getComputedStyle(element, null); 
	}
	return computedStyle[style];
}

function valueFilter(e, forbidden) 
{ 
    var skip = false, 
        e = e || window.event, 
        key = String.fromCharCode(e.which || e.keyCode); 
 
    for (var i=0; i<forbidden.length; i++) { 
        if(String(forbidden[i]) === key.toLowerCase()) { 
            skip = true; 
            break; 
        } 
    } 
    if (skip) { 
        if(e.preventDefault) e.preventDefault(); 
        e.returnValue = false; 
    } 
    return true; 
} 

function valueFilterAllowed(e, allowed) 
{ 
    var skip = true, 
        e = e || window.event, 
        key = String.fromCharCode(e.which || e.keyCode);
    if ((e.which || e.keyCode) == 8 || (e.which || e.keyCode) == 9 ||
        ((e.which || e.keyCode) >= 35 && (e.which || e.keyCode) <= 40)) 
        return true;
    for (var i=0; i<allowed.length; i++) {
        if(String(allowed[i]) === key.toLowerCase()) { 
            skip = false; 
            break; 
        } 
    } 

    if (skip) { 
        if (e.preventDefault) e.preventDefault(); 
        e.returnValue = false; 
    } 
    return true;  
}

function disable(el, dis)
{
	el.disabled = dis ? true : false;
	el.style.backgroundColor = dis ? '#D4D0C8' : '';
}

hiddenElements = [];
function hideElementsByType(hideIn, showIn, tagname)
{
    var topObjPos = hideIn ? getObjPosition(hideIn) : null;
    var ctls = document.getElementsByTagName(tagname);
    for (var i = 0; i < ctls.length; i++) {
        var ctlPos = getObjPosition(ctls[i]);
        if (!topObjPos || (topObjPos.left <= ctlPos.right && 
            ctlPos.left <= topObjPos.right && 
            topObjPos.top <= ctlPos.bottom && 
            ctlPos.top <= topObjPos.bottom) &&
            ctls[i].style.visibility != 'hidden')
        {
            ctls[i].style.visibility = 'hidden';
            hiddenElements.push(ctls[i]);
        }
    }
    if (showIn) {
        var ctls = showIn.getElementsByTagName(tagname);
        for (i = 0; i < ctls.length; i++) { 
            ctls[i].style.visibility = 'visible';
        }
    }
}

function hideElements(hideIn, showIn)
{
    if (is_msie() && is_msie() < 7) {
        hideElementsByType(hideIn, showIn, 'SELECT');
    }
    hideElementsByType(hideIn, showIn, 'OBJECT');
    hideElementsByType(hideIn, showIn, 'EMBED');
}

function showElements() 
{
    if (document.getElementById('popupFadeBack') && 
        document.getElementById('popupFadeBack').style.display == '' ) return;
    for (var i = 0; i < hiddenElements.length; i++) {
        hiddenElements[i].style.visibility = 'visible';
    }
    hiddenElements = [];
}

function getObjPosition(obj) 
{ 
    var pos = getControlPixelPos(obj, 0, 0, 0, 0, 0);     
    return { left: pos[0], top: pos[1], 
        right: pos[0]+obj.offsetWidth, bottom: pos[1]+obj.offsetHeight, 
        width: obj.offsetWidth, height: obj.offsetHeight }; 
} 

function addWindowOnLoad(fnc)
{
    if (is_msie()) {
        window.attachEvent('onload', fnc);
    } else {
        window.addEventListener('load', fnc, false);
    }
}

// localStorage 
function putToLocalStorage(key, oValue, domain)
{
	if (typeof(localStorage) != "undefined") {
		var lStorage = localStorage[domain?domain:location.hostname];
		lStorage.setItem(key, toJson(oValue));
	} else {
        throw 'LocalStorage is not supported';
    }
}

function getFromLocalStorage(key, domain)
{
	if (typeof(localStorage) != "undefined") {
	   var lStorage = localStorage[domain?domain:location.hostname];
	   return lStorage.getItem(key);
	} else {
    	throw 'LocalStorage is not supported';
    }
}
function isLocalStorageAvailable()
{
	return (typeof(localStorage) != "undefined");
}

function putToSessionStorage(key, oValue)
{
	if (typeof(sessionStorage) != "undefined") {
        var sStorage = sessionStorage;
        sStorage.setItem(key, toJson(oValue));
    } else {
        throw 'SessionStorage is not supported';
    }
}

function getFromSessionStorage(key, domain)
{
    if (typeof(sessionStorage) != "undefined"){
        var sStorage = sessionStorage;
       return sStorage.getItem(key);
    } else {
        throw 'SessionStorage is not supported';
    }
}
function isSessionStorageAvailable()
{
    return (typeof(sessionStorage) != "undefined" && sessionStorage != null);
}

function putToGlobalStorage(key, oValue, domain)
{
    if (typeof(globalStorage) != "undefined") {
        var gStorage = globalStorage[domain?domain:location.hostname];
        gStorage.setItem(key, toJson(oValue));
    } else {
        throw 'GlobalStorage is not supported';
    }
}

function getFromGlobalStorage(key, domain)
{
    if (typeof(globalStorage) != "undefined") {
       var gStorage = globalStorage[domain?domain:location.hostname];
       return gStorage.getItem(key);
    } else {
        throw 'GlobalStorage is not supported';
    }
}
function isGlobalStorageAvailable()
{
    return (typeof(globalStorage) != "undefined");
}

function putToUserDataStorage(key, oValue)
{
    if (document.getElementById('storageElement') != "undefined") {
         putToUserData(key, toJson(oValue));
    } else {
        throw 'userData is not supported';
    }
}

function getFromUserDataStorage(key)
{
    if (document.getElementById('storageElement') != "undefined") {       
       return getFromUserData(key);
    } else {
        throw 'userData is not supported';
    }
}
function isUserDataStorageAvailable()
{
    return (is_msie() >= 5 && is_msie() <= 7 && document.getElementById('storageElement') != "undefined");
}

function toJson(item) 
{
	if (typeof (item.toJson) == 'function') 
       return item.toJson();
	
	var out = '';
    if (typeof(item) == 'number') {
        out = item.toString();
    } else if (typeof(item) == 'boolean') {
        out = item ? 'true' : 'false';
    } else if (typeof(item) == 'object') {
        var first = true;
        if (item.length != 'undefined') {
            // numeric array
            out = '[';
            for (var k = 0; k < item.length; k++) {
                if (!first) out += ', ';
                first = false;
                out += toJson(item[k]);
            }
            out += ']';
        } else {
            // hash
            out = '{';
            for (k1 in item) {
                if (!first) out += ', ';
                first = false;
                out +=  '"' + toJson(k1) + '": ' + toJson(item[k1]);
            }
            out += '}';
        }
    } else {
        // assume a string
        out = quote(item);

    }
    return out;
}

var escapeable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    meta = {    // table of character substitutions
                '\b': '\\b',
                '\t': '\\t',
                '\n': '\\n',
                '\f': '\\f',
                '\r': '\\r',
                '"' : '\\"',
                '\\': '\\\\'
            };


function quote(string) {
	// If the string contains no control characters, no quote characters, and no
	// backslash characters, then we can safely slap some quotes around it.
	// Otherwise we must also replace the offending characters with safe escape
	// sequences.
    escapeable.lastIndex = 0;
    return escapeable.test(string) ?
        '"' + string.replace(escapeable, function (a) {
            var c = meta[a];
            if (typeof c === 'string') {
                return c;
            }
            return '\\u' + ('0000' +
                    (+(a.charCodeAt(0))).toString(16)).slice(-4);
        }) + '"' :
        '"' + string + '"';
}


// client side storage for ie 5-7
function initUserData()
{
	if (is_msie() >= 5 && is_msie() <= 7) {
		storage = document.getElementById('userDataStorage');
		if (!storage.addBehavior) {
			throw new 'userData is not available';
		} else {
			storage.addBehavior("#default#userData");
			storage.load("userDataStorage");
		}
		return true;
	}
	return false;
}

function putToUserData(sKey, sValue) {
	if (typeof(storage) == "undefined" && initUserData() == false) return;
    storage.setAttribute(sKey, sValue);
    storage.save("userDataStorage");
}
 
function getFromUserData(sKey) {
	if (typeof(storage) == "undefined" && initUserData() == false) return ''; 
    return storage.getAttribute(sKey);
}
 
function removeFromUserData(sKey) {
	if (typeof(storage) == "undefined" && initUserData() == false) return;
    storage.removeAttribute(sKey);
    storage.save("userDataStorage");
}

function get_html_translation_table(table, quote_style) {
    // http://kevin.vanzonneveld.net
    // +   original by: Philip Peterson
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: noname
    // %          note: It has been decided that we're not going to add global
    // %          note: dependencies to php.js. Meaning the constants are not
    // %          note: real constants, but strings instead. integers are also supported if someone
    // %          note: chooses to create the constants themselves.
    // %          note: Table from http://www.the-art-of-web.com/html/character-codes/
    // *     example 1: get_html_translation_table('HTML_SPECIALCHARS');
    // *     returns 1: {'"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;'}
    
    var entities = {}, histogram = {}, decimal = 0, symbol = '';
    var constMappingTable = {}, constMappingQuoteStyle = {};
    var useTable = {}, useQuoteStyle = {};
    
    useTable      = (table ? table.toUpperCase() : 'HTML_SPECIALCHARS');
    useQuoteStyle = (quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT');
    
    // Translate arguments
    constMappingTable[0]      = 'HTML_SPECIALCHARS';
    constMappingTable[1]      = 'HTML_ENTITIES';
    constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
    constMappingQuoteStyle[2] = 'ENT_COMPAT';
    constMappingQuoteStyle[3] = 'ENT_QUOTES';
    
    // Map numbers to strings for compatibilty with PHP constants
    if (!isNaN(useTable)) {
        useTable = constMappingTable[useTable];
    }
    if (!isNaN(useQuoteStyle)) {
        useQuoteStyle = constMappingQuoteStyle[useQuoteStyle];
    }
    
    if (useQuoteStyle != 'ENT_NOQUOTES') {
        entities['34'] = '&quot;';
    }
 
    if (useQuoteStyle == 'ENT_QUOTES') {
        entities['39'] = '&#039;';
    }
 
    if (useTable == 'HTML_SPECIALCHARS') {
        // ascii decimals for better compatibility
        entities['38'] = '&amp;';
        entities['60'] = '&lt;';
        entities['62'] = '&gt;';
    } else if (useTable == 'HTML_ENTITIES') {
        // ascii decimals for better compatibility
      entities['38']  = '&amp;';
      entities['60']  = '&lt;';
      entities['62']  = '&gt;';
      entities['160'] = '&nbsp;';
      entities['161'] = '&iexcl;';
      entities['162'] = '&cent;';
      entities['163'] = '&pound;';
      entities['164'] = '&curren;';
      entities['165'] = '&yen;';
      entities['166'] = '&brvbar;';
      entities['167'] = '&sect;';
      entities['168'] = '&uml;';
      entities['169'] = '&copy;';
      entities['170'] = '&ordf;';
      entities['171'] = '&laquo;';
      entities['172'] = '&not;';
      entities['173'] = '&shy;';
      entities['174'] = '&reg;';
      entities['175'] = '&macr;';
      entities['176'] = '&deg;';
      entities['177'] = '&plusmn;';
      entities['178'] = '&sup2;';
      entities['179'] = '&sup3;';
      entities['180'] = '&acute;';
      entities['181'] = '&micro;';
      entities['182'] = '&para;';
      entities['183'] = '&middot;';
      entities['184'] = '&cedil;';
      entities['185'] = '&sup1;';
      entities['186'] = '&ordm;';
      entities['187'] = '&raquo;';
      entities['188'] = '&frac14;';
      entities['189'] = '&frac12;';
      entities['190'] = '&frac34;';
      entities['191'] = '&iquest;';
      entities['192'] = '&Agrave;';
      entities['193'] = '&Aacute;';
      entities['194'] = '&Acirc;';
      entities['195'] = '&Atilde;';
      entities['196'] = '&Auml;';
      entities['197'] = '&Aring;';
      entities['198'] = '&AElig;';
      entities['199'] = '&Ccedil;';
      entities['200'] = '&Egrave;';
      entities['201'] = '&Eacute;';
      entities['202'] = '&Ecirc;';
      entities['203'] = '&Euml;';
      entities['204'] = '&Igrave;';
      entities['205'] = '&Iacute;';
      entities['206'] = '&Icirc;';
      entities['207'] = '&Iuml;';
      entities['208'] = '&ETH;';
      entities['209'] = '&Ntilde;';
      entities['210'] = '&Ograve;';
      entities['211'] = '&Oacute;';
      entities['212'] = '&Ocirc;';
      entities['213'] = '&Otilde;';
      entities['214'] = '&Ouml;';
      entities['215'] = '&times;';
      entities['216'] = '&Oslash;';
      entities['217'] = '&Ugrave;';
      entities['218'] = '&Uacute;';
      entities['219'] = '&Ucirc;';
      entities['220'] = '&Uuml;';
      entities['221'] = '&Yacute;';
      entities['222'] = '&THORN;';
      entities['223'] = '&szlig;';
      entities['224'] = '&agrave;';
      entities['225'] = '&aacute;';
      entities['226'] = '&acirc;';
      entities['227'] = '&atilde;';
      entities['228'] = '&auml;';
      entities['229'] = '&aring;';
      entities['230'] = '&aelig;';
      entities['231'] = '&ccedil;';
      entities['232'] = '&egrave;';
      entities['233'] = '&eacute;';
      entities['234'] = '&ecirc;';
      entities['235'] = '&euml;';
      entities['236'] = '&igrave;';
      entities['237'] = '&iacute;';
      entities['238'] = '&icirc;';
      entities['239'] = '&iuml;';
      entities['240'] = '&eth;';
      entities['241'] = '&ntilde;';
      entities['242'] = '&ograve;';
      entities['243'] = '&oacute;';
      entities['244'] = '&ocirc;';
      entities['245'] = '&otilde;';
      entities['246'] = '&ouml;';
      entities['247'] = '&divide;';
      entities['248'] = '&oslash;';
      entities['249'] = '&ugrave;';
      entities['250'] = '&uacute;';
      entities['251'] = '&ucirc;';
      entities['252'] = '&uuml;';
      entities['253'] = '&yacute;';
      entities['254'] = '&thorn;';
      entities['255'] = '&yuml;';
    } else {
        throw Error("Table: "+useTable+' not supported');
        return false;
    }
    
    // ascii decimals to real symbols
    for (decimal in entities) {
        symbol = String.fromCharCode(decimal)
        histogram[symbol] = entities[decimal];
    }
    
    return histogram;
}

function html_entity_decode( string, quote_style ) {
    // http://kevin.vanzonneveld.net
    // +   original by: john (http://www.jd-tech.net)
    // +      input by: ger
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Onno Marsman
    // +   improved by: marc andreu
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // -    depends on: get_html_translation_table
    // *     example 1: html_entity_decode('Kevin &amp; van Zonneveld');
    // *     returns 1: 'Kevin & van Zonneveld'
    // *     example 2: html_entity_decode('&amp;lt;');
    // *     returns 2: '&lt;'
 
    var histogram = {}, symbol = '', tmp_str = '', entity = '';
    tmp_str = string.toString();
    
    if (false === (histogram = get_html_translation_table('HTML_ENTITIES', quote_style))) {
        return false;
    }
 
    // &amp; must be the last character when decoding!
    delete(histogram['&']);
    histogram['&'] = '&amp;';
 
    for (symbol in histogram) {
        entity = histogram[symbol];
        tmp_str = tmp_str.split(entity).join(symbol);
    }
    
    return tmp_str;
}

function addHandler(object, event, handler)
{
  if (typeof object.addEventListener != 'undefined')
    object.addEventListener(event, handler, false);
  else if (typeof object.attachEvent != 'undefined')
    object.attachEvent('on' + event, handler);
  else
    throw "Incompatible browser";
}

function removeHandler(object, event, handler)
{
  if (typeof object.removeEventListener != 'undefined')
    object.removeEventListener(event, handler, false);
  else if (typeof object.detachEvent != 'undefined')
    object.detachEvent('on' + event, handler);
  else
    throw "Incompatible browser";
}

function getXmlHttpRequest()
{
	var req = null;
	if (window.XMLHttpRequest) {
	    req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
	    try {
	        req = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch (e) {
	        try {
	            req = new ActiveXObject("Microsoft.XMLHTTP");
	        } catch (e) {
	            req = null;
	        }
	    }
	}
    return req;
}

function sendRequest(url)
{
    var xmlHttp = getXmlHttpRequest();
    if (xmlHttp) {
	    xmlHttp.open("GET", url, true);
	    xmlHttp.send(null);
    }
}

String.prototype.toBool = function() {
	return (/^true|1$/i).test(this);
}

function array_unique(array) {
    // original by: Carlos R. L. Rodrigues
    var p, i, j;
    for(i = array.length; i;){
        for(p = --i; p > 0;){
            if(array[i] === array[--p]){
                for(j = p; --p && array[i] === array[p];);
                i -= array.splice(p + 1, j - p).length;
            }
        }
    }
    return true;
}

var refreshSession = false;
if (typeof(ut_interval) == "undefined" || typeof(ut_enabled) == "undefined") ut_enabled = 0;
var trackVisitor = typeof (ut_current_site_id) != "undefined" && ut_enabled;
function callTracker()
{
    var matches = location.search.match(/psid=(?:[A-Za-z0-9_\.-]+)/g);
	var psid = (matches && matches[0]) ? matches[0] : (getCookie('psid') ? 'psid=' + getCookie('psid') : '');
    var url = location.protocol+'//'+location.hostname+'/core/track?'+psid+'&rand='+Math.random();
    if (refreshSession) {
        url += '&refresh_session=1';
    }
    if (trackVisitor) {
        url += '&current_site_id=' + ut_current_site_id + '&url=' + escape(location.href) +
            '&title=' + encodeURIComponent(top.document.title);
    }
    if (trackVisitor || refreshSession) {
        sendRequest(url);
        refreshSession = false;
        trackVisitor = false;
    }
}
setInterval(function() { refreshSession = true; }, 600000); // session refresh timer
if (ut_enabled)
    setInterval(function() { trackVisitor = true; }, ut_interval*1000); // tracker timer
callTracker();
setInterval("callTracker()", 5000);