function gb(){
	var u = navigator.userAgent;
	var b;
							if (u.indexOf("OPR/") !== -1 || u.indexOf("Opera") !== -1) {
								b = "Opera";
							}
							else if ( (u.indexOf("MSIE") !== -1 || u.indexOf("Trident") !== -1) && u.indexOf("MAXTHON") === -1 ) {
								b = "Internet Explorer";
							}
							else if (u.indexOf("FBAV") !== -1 || u.indexOf("FBAN") !== -1) {
								b = " Facebook";
							}
							else if (u.indexOf("Edge") !== -1 || u.indexOf("EdgA") !== -1) {
								b = "Edge";
							}
							else if (u.indexOf("SamsungBrowser") !== -1) {
								b = "Samsung Browser";
							}
							else if (u.indexOf("UCBrowser") !== -1) {
								b = "UC Browser";
							}
							else if (u.indexOf("Android") !== -1 && u.indexOf("Chrome") === -1 && u.indexOf("Firefox") === -1) {
								b = "Android Browser";
							}								
							else if (u.indexOf("Chrome") !== -1 || u.indexOf("CriOS") !== -1) {
								b = "Chrome";
							}
							else if (u.indexOf("Safari") !== -1 && u.indexOf("Chrome") === -1) {
								b = "Safari";
							}
							else if (u.indexOf("Firefox") !== -1) {
								b = "Firefox";
							}
							else  {
								b = "Other";
							}	
	return b;
}
function go(){
    var u = navigator.userAgent.toLowerCase()
    var o
    if (u.indexOf('windows phone') >= 0) {
      o = 'Windows Phone'
    } else if (u.indexOf('win') >= 0) {
      o = 'Windows'
    } else if (u.indexOf('kaios') >= 0) {
      o = 'Kaios'
    } else if (u.indexOf('android') >= 0 || u.indexOf('spreadtrum') >= 0) {
      o = 'Android'
    } else if (u.indexOf('linux') >= 0 || u.indexOf('cros') >= 0) {
      o = 'Linux'
    } else if (u.indexOf('iphone') >= 0 || u.indexOf('ipad') >= 0) {
      o = 'iOS'
    } else if (u.indexOf('mac') >= 0) {
      o = 'Mac'
    } else {
      o = 'Other'
    }
return o;	
}

var browser=gb();
var os=go();

/** docReady is a single plain javascript function that provides a method of scheduling one or more javascript functions to run at some later point when the DOM has finished loading. */
!function(t,e){"use strict";function n(){if(!a){a=!0;for(var t=0;t<o.length;t++)o[t].fn.call(window,o[t].ctx);o=[]}}function d(){"complete"===document.readyState&&n()}t=t||"docReady",e=e||window;var o=[],a=!1,c=!1;e[t]=function(t,e){return a?void setTimeout(function(){t(e)},1):(o.push({fn:t,ctx:e}),void("complete"===document.readyState||!document.attachEvent&&"interactive"===document.readyState?setTimeout(n,1):c||(document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):(document.attachEvent("onreadystatechange",d),window.attachEvent("onload",n)),c=!0)))}}("docReady",window);

function getCookie(name) {
	var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"));
	return matches ? decodeURIComponent(matches[1]) : null;
}

function getBackendParamsByName(cName, pName) {
	if (getCookie(cName)) {
		return getCookie(cName);
	} else if (typeof requestLink === 'function') {
		var obj = requestLink();
		return obj[pName] && obj[pName][1] ? obj[pName][1] : undefined;
	}
}

function addSessionId() {
	if (!getCookie("sid") && typeof requestLink === 'function') {
		var e = requestLink(), n = document.getElementsByTagName("a");
		if (e.sessionId && e.sessionId.length > 1 && n.length) {
			for (var t = 0, s = n.length; t < s; t++) {
				if (n[t].pathname === '/web/') {
					n[t].href = '/web/?'+ e.sessionId[0] +'=' + e.sessionId[1];
				}
			}
		}
	}
}

function returnSessionId () {
	if (!getCookie("sid") && typeof requestLink === 'function') {
		var sId = requestLink();
		url = '/web/?' + sId.sessionId[0] + '=' + sId.sessionId[1];
	} else {
		url = '/web/';
	}
	return url;
}	
docReady(function() {
	addSessionId();
});