//*************************************************************************************************
//* Handles popup error msges to klient. - Author: tobias.larsson@pc.nu
//*************************************************************************************************
function gJS_DoAlert(sMsg){
	if (sMsg != ""){
		alert(sMsg);
	}
}

//*************************************************************************************************
//* Handles client actions. - Author: jon@firstinsys.se
//*************************************************************************************************
function gJS_DoAction(sAction, sValue, sMsg, oButton){
	var oForm = document.getElementsByTagName("form")[0];

	if (sMsg != "") {
		if (confirm(sMsg)) {
			if (oButton != undefined) {
				oButton.disabled = true;
			}
			oForm.Action.value	= sAction;
			oForm.Value.value	= sValue;
			oForm.submit();
		}
	}
	else {
		if (oButton != undefined) {
			oButton.disabled = true;
		}
		oForm.Action.value	= sAction;
		oForm.Value.value	= sValue;
		oForm.submit();
	}
}

//*************************************************************************************************
//* Handles klient actions. - Author: tobias.larsson@pc.nu
//*************************************************************************************************
function gJS_DoAction_old(sAction, sValue, sMsg, oButton){
	if (sMsg != ""){
		if (confirm(sMsg)){
			if (oButton != undefined) {
				oButton.disabled = true;
			}
			document.forms(0).Action.value=sAction;
			document.forms(0).Value.value = sValue;
			document.forms(0).submit();
		}
	}else{
		if (oButton != undefined) {
			oButton.disabled = true;
		}
		document.forms(0).Action.value=sAction;
		document.forms(0).Value.value = sValue;
		document.forms(0).submit();
	}
}

//*************************************************************************************************
//* Handles klient actions in child frame. - Author: tobias.larsson@pc.nu
//*************************************************************************************************
function gJS_DoFrameAction(oFrame,sAction,sValue,sMsg){
	var oForm = oFrame.document.getElementsByTagName("form")[0];

	if (sMsg != "") {
		if (confirm(sMsg)) {							
			oForm.Action.value	= sAction;
			oForm.Value.value	= sValue;
			oForm.submit();
		}
	}
	else{
		oForm.Action.value	= sAction;
		oForm.Value.value	= sValue;
		oForm.submit();
	}
}

//*************************************************************************************************
//* Open a URL in a specific parent child frame. - Author: tobias.larsson@pc.nu 
//*************************************************************************************************
function gJS_DoLocation_ParentChildFrame(sFramename,sHref) {
	parent[sFramename].location.href = sHref;
}

//*************************************************************************************************
//* Submit form in a specific parent child frame. - Author: tobias.larsson@pc.nu
//*************************************************************************************************
function gJS_DoSubmit_ParentChildFrame(sFrameName){
	parent[sFrameName].document.forms(0).submit();
}

//*************************************************************************************************
//* Open a popup window in center of screen. - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_OpenPopupWinCenter(strURL, strName, intXSize, intYSize, strOptions) {
  var xpos = ((screen.width / 2) - (intXSize / 2)) - 5;
  var ypos = ((screen.height / 2) - (intYSize / 2)) - 40;
  var strCenter = "width=" + intXSize + ",height=" + intYSize + ",left=" + xpos + ",top=" + ypos;

  if (strOptions != "") strOptions = "," + strOptions
  window.open(strURL, strName, strCenter + strOptions);
}

//*************************************************************************************************
//* Open a popup window in center of the calling window. - Author: tobias.larsson@pc.nu
//*************************************************************************************************
function gJS_OpenPopupWinCenterOfWin(sURL,sWinName,iWidth,iHeight){
	if (document.all) {
		var w = (top.document.body.clientWidth / 2) + top.window.screenLeft;
		var h = (top.document.body.clientHeight / 2) + top.window.screenTop;
	}else if (document.layers) {
		var w = window.innerWidth;
		var h = window.innerHeight;
	}
	var xpos = w - (iWidth / 2);
	var ypos = h - (iHeight / 2);
	win = window.open(sURL,sWinName,'toolbar=no,location=no,directories=no,status=no,width='+iWidth+',height='+iHeight+',resize=no,top='+ ypos +',left='+ xpos);
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//*************************************************************************************************
//* Open a help popup. - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_OpenPopupHelp(sTopic, sTag) {
	var strURL = "/help/popup.asp?Topic=" + escape(sTopic) + "&Tag=" + escape(sTag);

	gJS_OpenPopupWinCenter(strURL, "HELP_POPUP", 280, 250, "scrollbars=yes");
}

//*************************************************************************************************
//* Open a Modal popup window in center of the calling window. - Author: tobias.larsson@pc.nu
//*************************************************************************************************
function gJS_CreateModalWindow( url, width, height, sizeable, status, scroll, data )
{
	if ( top.window.ie )
	{
		if (!data) data = window;
		if (!status) status = 'No';
		if (!scroll) scroll = 'No';
		if (!sizeable) sizeable = 'Yes';
		
		winprops = 	"dialogHeight:" + height + "px;dialogWidth:" + width + "px;"+
					"edge:Raised;center:Yes;help:No;resizable:" + sizeable + 
					";status:" + status + ";scroll:" + scroll +";";
					
		var result = top.window.showModalDialog( url, data, winprops);
		return result;
	}
	else
	{
		var newWindowWidth   = (width) ? width : (screen.availWidth * .75);
		var newWindowHeight  = (height) ? height - 30 : (screen.availHeight * .75);
		var newWindowAttribs = "modal,width=" + newWindowWidth + ",height=" + newWindowHeight +
							   ",status=no,resizable=yes,menubar=no,toolbar=no";
	
		top.window.open( url, "", newWindowAttribs);
	}
}

//*************************************************************************************************
//* Static Layer script II (By maXimus, maximus@nsimail.com, http://maximus.ravecore.com/)
//* Modified slightly/ permission granted to Dynamic Drive to feature script in archive
//* For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
//*************************************************************************************************
function gJS_StaticLayer(iObjectCount) {
	//configure below variable for layer position on page
	var offsetleft=0
	var offsettop=0
	var iOffsetTopAdd = 15; 
	if (iObjectCount == undefined) iObjectCount = 1;

	var ns4=document.layers?1:0
	var ie4=document.all?1:0
	var ns6=document.getElementById&&!document.all?1:0

	if (ns6||ie4||ns4)
		if (ie4) {object1.style.pixelTop=document.body.scrollTop+offsettop}
		else if (ns6) {document.getElementById("object1").style.top=window.pageYOffset+offsettop}
		else if (ns4) {eval(document.object1.top=eval(window.pageYOffset+offsettop));}
		setTimeout("gJS_StaticLayer(" + iObjectCount + ")",0);

	if (iObjectCount == 2) {
		// fix 2009-06-17 / jon
		// correctly position both relative and absolute positioned objects
		if (document.getElementById("object2").style.position != "absolute") {
			iOffsetTopAdd = 0;
		}

		if (ns6||ie4||ns4)
			if (ie4) { object2.style.pixelTop = document.body.scrollTop + offsettop + iOffsetTopAdd }
			else if (ns6) { document.getElementById("object2").style.top = window.pageYOffset + offsettop + iOffsetTopAdd }
			else if (ns4) { eval(document.object2.top = eval(window.pageYOffset + offsettop + iOffsetTopAdd)); }
	}
}

//*************************************************************************************************
//* Modified version to handle html pages with live content that won't reload.
//*************************************************************************************************
function gJS_StaticLayer2(iObjectCount) {
	//configure below variable for layer position on page
	var offsetleft=0
	var offsettop=0
	var iOffsetTopAdd = 15; 

	if (isObjectId("object1")) {
		if (iObjectCount == undefined) iObjectCount = 1;

		var ns4=document.layers?1:0
		var ie4=document.all?1:0
		var ns6=document.getElementById&&!document.all?1:0

		if (ns6||ie4||ns4)
			if (ie4) {object1.style.pixelTop=document.body.scrollTop+offsettop}
			else if (ns6) {document.getElementById("object1").style.top=window.pageYOffset+offsettop}
			else if (ns4) {eval(document.object1.top=eval(window.pageYOffset+offsettop));}

		if (iObjectCount == 2) {
			// fix 2009-06-17 / jon
			// correctly position both relative and absolute positioned objects
			if (document.getElementById("object2").style.position != "absolute") {
				iOffsetTopAdd = 0;
			}

			if (ns6 || ie4 || ns4)
				if (ie4) { object2.style.pixelTop = document.body.scrollTop + offsettop + iOffsetTopAdd }
				else if (ns6) { document.getElementById("object2").style.top = window.pageYOffset + offsettop + iOffsetTopAdd }
				else if (ns4) { eval(document.object2.top = eval(window.pageYOffset + offsettop + iOffsetTopAdd)); }
		}
	}

	setTimeout("gJS_StaticLayer2(" + iObjectCount + ")", 0);
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_CheckSwitchBox(sItemsName) {
	document.forms(0).chkSwitchBox.checked = true;

	if (sItemsName != "") {
		document.forms(0).chkSwitchBox.title = "Klicka här för att avmarkera alla " + sItemsName + "";
	}
}


//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_UncheckSwitchBox(sItemsName) {
	document.forms(0).chkSwitchBox.checked = false;

	if (sItemsName != "") {
		document.forms(0).chkSwitchBox.title = "Klicka här för att markera alla " + sItemsName + "";
	}
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_CountChecked(sElementName) {
	var c = 0; // #/checkboxs checked
	var n = 0; // #/checkboxs on page

	if (isObject(sElementName)) {
		n = document.forms(0)[sElementName].length;

		if (n == undefined) {
			if (document.forms(0)[sElementName].checked) {
				c = 1;
			}
		}
		else {
			for (var i = 0; i < n; i++) {
				var e = document.forms(0)[sElementName][i];
				if (e.type == "checkbox" && !e.disabled && e.checked) {
					c++;
				}
			}
		}
	}

	return(c);
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_SwitchAll(sElementName, sItemsName) {
	var n = 0; // #/checkboxs
	var c = 0; // #/checkboxs checked

	for (var i = 0; i < document.forms(0).elements.length; i++) {
		var e = document.forms(0).elements[i];
		if ((e.type == "checkbox") && (!e.disabled) && (e.name == sElementName)) {
			n++;
			if (e.checked) c++;
		}
	}

	if (c < n) {
		for (var i = 0; i < document.forms(0).elements.length; i++) {
			var e = document.forms(0).elements[i];
			if ((e.type == "checkbox") && (!e.disabled) && (e.name == sElementName)) {
				e.checked = true;
			}
		}
		gJS_CheckSwitchBox(sItemsName);
	}
	else {
		for (var i = 0; i < document.forms(0).elements.length; i++) {
			var e = document.forms(0).elements[i];
			if ((e.type == "checkbox") && (!e.disabled) && (e.name == sElementName)) {
				e.checked = false;
			}
		}
		gJS_UncheckSwitchBox(sItemsName);
	}
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_CheckAll(sElementName, sItemsName) {
	var n = 0;			// #/checkboxs
	var c = 0;			// #/checkboxs checked

	for (var i = 0; i < document.forms(0).elements.length; i++) {
		var e = document.forms(0).elements[i];
		if ((e.type == "checkbox") && (!e.disabled) && (e.name == sElementName)) {
			n++;
			if (e.checked) c++;
		}
	}

	if ((c == n) && (c > 0)) gJS_CheckSwitchBox(sItemsName);
	else gJS_UncheckSwitchBox(sItemsName);
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_GetChecked(sElementName, iIndex) {
	var sList = "";
	var j = 0;
	var n = 0; // #/checkboxs on page

	if (isObject(sElementName)) {
		n = document.forms(0)[sElementName].length;

		if (n == undefined) {
			if (document.forms(0)[sElementName].checked) {
				sList = "," + document.forms(0)[sElementName].value;
			}
		}
		else {
			for (var i = 0; i < n; i++) {
				var e = document.forms(0)[sElementName][i];
				if ((e.type == "checkbox" || e.type == "radio") && e.checked) {
					if (iIndex == 0) {
						sList = sList + "," + e.value;
					}
					else {
						if (j < iIndex) { j++; sList = e.value; }
					}
				}
			}
		}

		if (iIndex == 0) {
			sList = sList.substring(1, 1000);
		}
	}

	return(sList);
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_SetCheckbox(sElementName, bCheck, sSelList) {
	var j = 0;
	var n = 0; // #/checkboxs on page

	if (isObject(sElementName)) {
		n = document.forms(0)[sElementName].length;

		if (n == undefined) {
			document.forms(0)[sElementName].checked = bCheck;
		}
		else {
			for (var i = 0; i < n; i++) {
				var e = document.forms(0)[sElementName][i];

				if (e.value == sSelList) {
					e.checked = bCheck;
				}
				else {
					e.checked = !bCheck;
				}
			}
		}
	}
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_GetChecked_old(sElementName, iIndex) {
	var sList = "";
	var j = 0;

	for (var i = 0; i < document.forms(0).elements.length; i++) {
		var e = document.forms(0).elements[i];
		if (e.type == "checkbox" && e.checked && e.name == sElementName) {
			if (iIndex == 0) {
				sList = sList + "," + e.value;
			}
			else {
				if (j < iIndex) { j++; sList = e.value; }
			}
		}
	}

	if (iIndex == 0) {
		return(sList.substring(1, 1000));
	}
	else {
		return(sList);
	}
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function isObject(sName) {
	var oTest = document.getElementsByName(sName);
	if (oTest.length > 0) return(true);
	else return(false);
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function isObjectId(sID) {
	var oTest = document.getElementById(sID);
	if (oTest == null) return(false);
	else return(true);
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gListboxSelect(oListbox, sValue) {
	for (var i = 0; i < oListbox.length; i++) {
		if (oListbox.options[i].value == sValue) {
			oListbox.selectedIndex = i;
		}
	}
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gListboxClear(oListbox) {
	var iLength = oListbox.length;

	for (var i = 0; i < iLength; i++) {
		oListbox.options[0] = null;
	}
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gFieldError(sErrorMsg, oField) {
	if (sErrorMsg != "") {
		alert(sErrorMsg);
	}

	if (oField != undefined) {
		oField.focus();
		if ((oField.type == "text" || oField.type == "textarea") && oField.value != "") oField.select();
	}
	
	return(false);
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gValidateTime(sTime) {
	sTime = sTime.replace(/\./g, ":");

	var iHours;
	var iMinutes	= 0;
	var iPos		= sTime.indexOf(":");
	var bValidate	= false;

	if (iPos == -1) {
		if (!isNaN(sTime)) {
			if (sTime.length == 4) {
				iHours		= Number(sTime.substring(0, 1));
				iMiuntes	= Number(sTime.substring(2, 3));
			}
			else {
				iHours = Number(sTime);
			}

			if (iHours >= 0 && iHours <= 24 && iMinutes >= 0 && iMinutes <= 59)	bValidate = true;
		}
	}
	else if (iPos == 1 || iPos == 2) {
		iHours		= sTime.substring(0, iPos);
		iMinutes	= sTime.substring(iPos + 1, iPos + 4);

		if (iMinutes.length == 2 && !isNaN(iHours) && !isNaN(iMinutes)) {
			iHours		= Number(iHours);
			iMinutes	= Number(iMinutes);

			if (iHours >= 0 && iHours <= 24 && iMinutes >= 0 && iMinutes <= 59)	bValidate = true;
		}
	}

	return(bValidate);
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gJS_UpdateHitInfo(iPage, iPageCount, iHitCount, sName1, sName2) {

	if (iHitCount == 0) {
		parent.SetButtonsDisabled(true);
		if (parent.isObject("txtHitInfo"))	parent.frm.txtHitInfo.value		= "";
		if (parent.isObject("txtPageInfo"))	parent.frm.txtPageInfo.value	= "";
		if (parent.isObject("btnPrevPage"))	parent.frm.btnPrevPage.disabled	= true;
		if (parent.isObject("btnNextPage"))	parent.frm.btnNextPage.disabled	= true;
	}
	else {
//		if (isObject("S")) gJS_CheckAll("S", sName2);
		if (iPageCount >= 0) {
			parent.SetButtonsDisabled(false);

			if (parent.isObject("txtPageInfo")) parent.frm.txtPageInfo.value = "Sida " + iPage + " av " + iPageCount;

			if (iHitCount == 1) {
				if (parent.isObject("txtHitInfo")) parent.frm.txtHitInfo.value = iHitCount + " " + sName1;
			}
			else {
				if (parent.isObject("txtHitInfo")) parent.frm.txtHitInfo.value = iHitCount + " " + sName2;
			}

			if (iPage < iPageCount) {
				if (parent.isObject("btnNextPage")) parent.frm.btnNextPage.disabled = false;
			}
			else {
				if (parent.isObject("btnNextPage")) parent.frm.btnNextPage.disabled = true;
			}

			if (iPage > 1) {
				if (parent.isObject("btnPrevPage")) parent.frm.btnPrevPage.disabled = false;
			}
			else {
				if (parent.isObject("btnPrevPage")) parent.frm.btnPrevPage.disabled = true;
			}
		}
	}
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gForceWindowClose() {
	window.opener = top; 
	window.close(); 
}

//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gLtrim(sValue) { 
	return sValue.replace(/^[ ]+/, ''); 
} 
		 
//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gRtrim(sValue) { 
	return sValue.replace(/[ ]+$/, ''); 
} 
		 
//*************************************************************************************************
//* . - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gTrim(sValue) { 
	return gLtrim(gRtrim(sValue)); 
}

//*************************************************************************************************
//* Focus next form field based on tab index. - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gTabNext(oForm, oField) {
	var e;
	var n = oForm.length;
	var iTabIndex = oField.tabIndex;
	
	for (var i = 0; i < n; i++) {
		e = oForm[i];

		if (e != oField && e.tabIndex >= iTabIndex) {
			e.focus();
			e.select();
			return;
		}
	}
}

//*************************************************************************************************
//* Focus form field with matching tab index. - Author: jon.andersson@firstinsys.se
//*************************************************************************************************
function gTabFocus(oForm, iTabIndex) {
	var e;
	var n = oForm.length;
	
	for (var i = 0; i < n; i++) {
		e = oForm[i];

		if (e.tabIndex == iTabIndex) {
			e.focus();
			e.select();
			return;
		}
	}
}

//*************************************************************************************************
//* Get a numeric value from a string.
//*************************************************************************************************
function gGetNumeric(sValue, iDefault) {
	if (sValue == "") return(iDefault);
	if (!isNaN(sValue)) return(Number(sValue));

	sValue = gReplace(sValue, ",", ".");

	if (!isNaN(sValue)) return(Number(sValue));

	return(iDefault);
}

//*************************************************************************************************
//* String replace.
//*************************************************************************************************
function gReplace(strSource, lookFor, replaceWith) {
	strLowerCase = strSource.toLowerCase();
	lookForLower = lookFor.toLowerCase();

	while(strLowerCase.indexOf(lookForLower) != -1) {
		posStart = strLowerCase.indexOf(lookForLower);
		posEnd = posStart + lookFor.length;
		strLowerCase = strLowerCase.substring(0, posStart) + replaceWith + strLowerCase.substring(posEnd, strLowerCase.length);
		strSource = strSource.substring(0, posStart) + replaceWith + strSource.substring(posEnd, strSource.length);
	}

	return(strSource);
}

//*************************************************************************************************
//* Get XMLHTTP object with cross browser support.
//*************************************************************************************************
function gGetXMLHTTPObject() {
    var xmlHttp = null;

    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }

    return(xmlHttp);
}

//*************************************************************************************************
//* Validation of a string containing time.
//*************************************************************************************************
function gValidateTime(sTime) {
	sTime = sTime.replace(/\./g, ":");

	var iHours;
	var iMinutes	= 0;
	var iPos		= sTime.indexOf(":");
	var bValidate	= false;

	if (iPos == -1) {
		if (!isNaN(sTime)) {
			if (sTime.length == 4) {
				iHours		= Number(sTime.substring(0, 1));
				iMiuntes	= Number(sTime.substring(2, 3));
			}
			else {
				iHours = Number(sTime);
			}

			if (iHours >= 0 && iHours <= 24 && iMinutes >= 0 && iMinutes <= 59)	bValidate = true;
		}
	}
	else if (iPos == 1 || iPos == 2) {
		iHours		= sTime.substring(0, iPos);
		iMinutes	= sTime.substring(iPos + 1, iPos + 4);

		if (iMinutes.length == 2 && !isNaN(iHours) && !isNaN(iMinutes)) {
			iHours		= Number(iHours);
			iMinutes	= Number(iMinutes);
			
			if (iHours >= 0 && iHours <= 24 && iMinutes >= 0 && iMinutes <= 59)	bValidate = true;
		}
	}

	return(bValidate);
}

//*************************************************************************************************
//* Encode a string value to UTF8.
//*************************************************************************************************
function gUTF8Encode(sValue) {
    sValue = sValue.replace(/\r\n/g,"\n");
    var utftext = "";

    for (var n = 0; n < string.length; n++) {
        var c = sValue.charCodeAt(n);   

        if (c < 128) {   
            utftext += sValue.fromCharCode(c);   
        }   
        else if((c > 127) && (c < 2048)) {   
            utftext += sValue.fromCharCode((c >> 6) | 192);   
            utftext += sValue.fromCharCode((c & 63) | 128);   
        }   
        else {   
            utftext += sValue.fromCharCode((c >> 12) | 224);   
            utftext += sValue.fromCharCode(((c >> 6) & 63) | 128);   
            utftext += sValue.fromCharCode((c & 63) | 128);   
        }   
    }   

    return(utftext);
}

//*************************************************************************************************
//* Copy string to clipboard.
//*************************************************************************************************
function CopyToClipboard(sData) {
	if (window.clipboardData) {
	    window.clipboardData.setData("Text", sData);
	}
}

function gLoginAuth(iSecItUserID, iSecItSiteID, sAuthCode) {

	var oXML;
	var aAuthData;
	var bStatus;

	oXML = gGetXMLHTTPObject();
	oXML.open("GET", "fetch_auth.asp?AuthCode=" + sAuthCode + "&Rnd=" + Math.random(), false);
	oXML.send(null);

	aAuthData = oXML.responseText.split("|");

	if (aAuthData[0] == "0") {
		bStatus = false;
	}
	else if (aAuthData[0] == iSecItUserID) {
		bStatus = true;
	}
	else {
		gJS_DoFrameAction(parent.parent, "LoginFromAuth", aAuthData[1] + "," + aAuthData[2] + "," + iSecItSiteID, "");
		bStatus = true;
	}

	return bStatus;
}

function gCheckAuth(bOpenAuth) {
	if (bOpenAuth) {
		gOpenAuth();
	}

	ResetLogoutTimer();
}
