function system_InnerHTML(div, sText) {
	div.open();
	div.write(sText);
	div.close();
}

function system_LocalizeText(sText, arr) {
  var iNum;
  var sNewText = sText;
  for (var i=0; i<arr.length; i++) {
    iNum = i + 1;
    sNewText = system_ReplaceCharInString(sNewText, "#" + iNum + "#", arr[i], 0);
  }
  return sNewText;
}

function system_SetDateToXML(dtDate) {
		if (dtDate == "") {
			return "";
		}

		var dt = new Date(dtDate);
	
		sYr = dt.getFullYear();
		sMo = dt.getMonth() + 1;
		if (sMo < 10) {
			sMo = "0" + sMo;
		}
		sDt = dt.getDate();
		if (sDt < 10) {
			sDt = "0" + sDt;
		}
		sHr = dt.getHours();
		if (sHr < 10) {
			sHr = "0" + sHr;
		}
		sMi = dt.getMinutes();
		if (sMi < 10) {
			sMi = "0" + sMi;
		}
		sSe = dt.getSeconds();
		if (sSe < 10) {
			sSe = "0" + sSe;
		}
		return sYr + "/" + sMo + "/" + sDt + " " + sHr + ":" + sMi + ":" + sSe;
}

function system_CheckDate(strDate,strFormat)
{
	var intMonth = "";
	var intDay = "";
	var intYear = "";
			
	oDate = null;
	var arrDate = strDate.split("");
	var arrFormat = strFormat.toUpperCase().split("");
	
	var sLastDatePart = "";
	var iDateCounter = 0;
	for(var iFormatCounter = 0; iFormatCounter<arrFormat.length; iFormatCounter++)
	{
		switch (arrFormat[iFormatCounter])
		{
			case "D":
				if (sLastDatePart!="D")
				{
					sLastDatePart = arrFormat[iFormatCounter];
					while (!isNaN(arrDate[iDateCounter]) && iDateCounter < arrDate.length)
					{					
						intDay = intDay + arrDate[iDateCounter];
						iDateCounter++;
					}
				}
				sLastDatePart = "D";
				break;
			case "M":
				if (sLastDatePart!="M")
				{
					while (!isNaN(arrDate[iDateCounter]) && iDateCounter < arrDate.length)
					{
						intMonth = intMonth + arrDate[iDateCounter];
						iDateCounter++;
					}
				}
				sLastDatePart = "M";
				break;
			case "Y":
				if (sLastDatePart!="Y")
				{
					while (!isNaN(arrDate[iDateCounter]) && iDateCounter < arrDate.length)
					{
						intYear = intYear + arrDate[iDateCounter];
						iDateCounter++;
					}				
				}
				sLastDatePart = "Y";
				break;
			default:
				sLastDatePart = "";
				if (arrDate[iDateCounter]!=arrFormat[iFormatCounter])
				{
					return null;
				}
				iDateCounter++;
		}
	}
	if (iDateCounter < arrDate.length)
	{
		return null;
	}
	if (intMonth == "" || intDay == "" || intYear == "")
	{
		return null;
	}
	intMonth = Number(intMonth);
	intDay = Number(intDay);
	intYear = Number(intYear);
	if (intYear<51 && intYear>0)
	{
		intYear = 2000 + intYear;
	}
	if (intMonth<1 || intMonth>12)
	{
		return null;
	}
	if (intDay<1 || intDay>31)
	{
		return null;
	}
	if (intYear<0)
	{
		return null;
	}
	var oDate = new Date(intYear,intMonth - 1,intDay)
	if (oDate.getDate()!=intDay)
	{
		return null;
	}
	intMonth = intMonth -1;
	if (oDate.getMonth()!=intMonth)
	{
		return null;
	}

	if (oDate.getYear()!=intYear & oDate.getFullYear()!=intYear)
	{
		return null;
	}
	return oDate;
}

function system_GetDateFormat(oDate,strFormat,bGetTime){
//try
//{	
	if(oDate==null)
	return "";
	strFormat=strFormat.toUpperCase();
	var intDay = oDate.getDate();
	var intMonth = oDate.getMonth()+1;
	var intYear = oDate.getFullYear();
	
	var sFormattedDate=strFormat;
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"YYYY",intYear,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"YYY",intYear,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"YY",intYear,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"Y",intYear,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"MMMM",intMonth,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"MMM",intMonth,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"MM",intMonth,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"M",intMonth,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"DDD",intDay,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"DD",intDay,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"D",intDay,0);
	
	
     if (bGetTime) 
     {
			var intHour = oDate.getHours();
			var intMinute = oDate.getMinutes();
			var intSecond = oDate.getSeconds();
			if (intHour < 10) {
				intHour = "0" + intHour;
			}
			if (intMinute < 10) {
				intMinute = "0" + intMinute;
			}
			if (intSecond < 10) {
				intSecond = "0" + intSecond;
			}
      sFormattedDate = sFormattedDate + " " + intHour + ":" + intMinute + ":" + intSecond;
     }	
	
	return sFormattedDate;
//}
//catch(e)
//{
//	return "";
//}
}

function system_GetApplicationDateFormat()
{
	/*if (COMMON_DATE_FORMAT!="DD/MM/YYYY" && COMMON_DATE_FORMAT!="MM/DD/YYYY")
	{
		return "MM/DD/YYYY";
	}*/
	return COMMON_DATE_FORMAT;
}

function system_GetXMLSignOut(strIn){
var strRetVal  = strIn;
var intNumber= 0;
strRetVal = system_ReplaceCharInString(strRetVal,"&","&amp;",intNumber);
strRetVal = system_ReplaceCharInString(strRetVal,"<","&lt;",intNumber);
strRetVal = system_ReplaceCharInString(strRetVal,">","&gt;",intNumber);
//strRetVal = system_ReplaceCharInString(strRetVal,"'","&apos;",intNumber);
strRetVal = system_ReplaceCharInString(strRetVal,'"',"&quot;",intNumber);

return strRetVal;
}

function system_GetXMLSignIn(strIn){
var strRetVal  = strIn;
var intNumber= 0;
strRetVal = system_ReplaceCharInString(strRetVal,"&amp;","&",intNumber);
strRetVal = system_ReplaceCharInString(strRetVal,"&lt;","<",intNumber);
strRetVal = system_ReplaceCharInString(strRetVal,"&gt;",">",intNumber);
//strRetVal = system_ReplaceCharInString(strRetVal,"&apos;","'",intNumber);
strRetVal = system_ReplaceCharInString(strRetVal,"&quot;",'"',intNumber);

return strRetVal;
}


function system_ReplaceCharInString(parmStr,parmStrToFind,parmStrToReplace,intNumber){
	intNumber = 0;
	var strBase = "" + parmStr;
	var strRes="";
	var intPos = strBase.search(parmStrToFind);
	if (intPos==-1)
		{
		return parmStr;
		}
	while (intPos>-1)
		{
		intNumber++;
		strRes = strRes + strBase.substr(0,intPos) + parmStrToReplace;
		strBase = strBase.substr(intPos + parmStrToFind.length);
		intPos = strBase.search(parmStrToFind);
		if (intPos==-1)
			{
			strRes = strRes + strBase;
			}
		}
	return strRes;
}

function system_Trim(sString) {
	var sNew = new String(sString);
	if (sNew == "")
	{
		return "";
	}
	if (sNew == null)
	{
		return "";
	}
//	try {
		while(sNew.charAt(0) == " ") {
			sNew = sNew.substring(1, sNew.length);		
		}
		while(sNew.charAt(sNew.length-1) == " ") {
			sNew = sNew.substring(0, sNew.length-1);		
		}
		return sNew;
	//}
	//catch(e) {
	//	alert("Error at system_Trim: " + e.description);
	//	return "";
	//}
}

function system_GetDateFromXML(strDate,strFormatType,bGetTime)
{
	if(strDate=="")
		return "";
	strFormatType=strFormatType.toUpperCase();
	var sDate=system_Trim(strDate);
	var arrA=strDate.split(" ");
	var strTime=arrA[1];
	var arrB=arrA[0].split("/");
	var intYear=arrB[0];
	var intMonth=arrB[1];
	var intDay=arrB[2];
	
	var sFormattedDate=strFormatType;
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"YYYY",intYear,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"YYY",intYear,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"YY",intYear,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"Y",intYear,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"MMMM",intMonth,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"MMM",intMonth,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"MM",intMonth,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"M",intMonth,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"DDD",intDay,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"DD",intDay,0);
	sFormattedDate=system_ReplaceCharInString(sFormattedDate,"D",intDay,0);
	
	if(bGetTime)
		sFormattedDate+=" " + strTime;
	return sFormattedDate;
}

function system_HTMLSpace(iNumber) {
	sResult = "";
	for (var i=1; i<=iNumber; i++) {
		sResult = sResult + "\xA0";
	}
	return sResult;
}
////TelAviv Part
var system_oLoginWindow = null;

function system_LoginRoles(bGuestEnable, bSessionExpired,bAllowArchitect){
var bGuestEnableInside = 0;
var bAllowArchitectInside = 0;
var bSessionExpiredInside = 0;

  //kesav02 HouseHold Patch (March 11, 2004): optional block login prameter was added.
	if (BLOCKKTLOGIN == '1')
	{
		top.location.href = CSSERVERROOT;
		return;
	}

	if (bGuestEnable)
	{
		bGuestEnableInside = 1;
	}
	if (bSessionExpired)
	{
		bSessionExpiredInside = 1;
	}
	if (bAllowArchitect)
	{
		bAllowArchitectInside = 1
	}

	var strURL = "LoginCI_NS.asp?GuestEnable=" + bGuestEnableInside + "&SessionExpired=" + bSessionExpiredInside + 
				"&AllowArchitect=" + bAllowArchitectInside + "&RolesOn=1";
	
	var lWidth = LOGIN_DIMENSIONS_PAGE_WIDTH_NS;
	var lHeight = LOGIN_DIMENSIONS_PAGE_HEIGHT_NS;
	if (bSessionExpired == 1)
	{
		lWidth = LOGIN_DIMENSIONS_PAGE_WIDTH_SESSION_EXPIRED_NS;
		lHeight = LOGIN_DIMENSIONS_PAGE_HEIGHT_SESSION_EXPIRED_NS;
	}

	var lTop = (window.screen.availHeight)/2-lHeight/2;
	var lLeft = (window.screen.availWidth)/2-lWidth/2;
	
	var swindowFeatures = "directories=no,location=no,menubar=no,titlebar=no,resizable=no,status=no,toolbar=no,width=" + lWidth + ",height=" + lHeight + ",screenX=" + lLeft + ",screenY=" + lTop;
	system_oLoginWindow = window.open(strURL,"CI_Login",swindowFeatures);
	system_oLoginWindow.focus();	
	return system_oLoginWindow;
}

function system_LoginUserClosed()
{
	system_oLoginWindow=null;
}

function system_OpenCIWindow(strURL,strWindowName)
{
	var lHeight = window.screen.availHeight - 45;
	var lWidth = window.screen.availWidth - 12;
	var lTop = 0;
	var lLeft = 0;
	var swindowFeatures = "scrollbars=yes,directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no," + 
						"width=" + lWidth +  ",height=" + lHeight + ",screenX=" + lLeft + ",screenY=" + lTop;
	var oWin = window.open(strURL,strWindowName,swindowFeatures);
	oWin.focus();
	return oWin;
}

function system_OpenPreviewWindow(strURL)
{
	return system_OpenCIWindow(strURL,"Preview");
}

var system_oChangePasswordWindow = null;
function system_ChangePassword()
{
	var strURL = "Login_changePassword_NS.asp";
	var lTop = (window.screen.availHeight)/2-110/2;
	var lLeft = (window.screen.availWidth)/2-300/2;

	var swindowFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,width=350,height=160,screenX=" + lLeft + ",screenY=" + lTop;
	system_oChangePasswordWindow = window.open(strURL,"CIChangePassword",swindowFeatures);
	system_oChangePasswordWindow.focus();
	return system_oChangePasswordWindow;
}

function system_OpenAddCommentWindow(sGUID)
{
	var strURL = "ArcDocCommentEdit.asp?GUID=" + sGUID;
	var lTop = (window.screen.availHeight)/2-150/2;
	var lLeft = (window.screen.availWidth)/2-300/2;

	var swindowFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,width=360,height=150,screenX=" + lLeft + ",screenY=" + lTop;
	window.open(strURL,"CIPreferences",swindowFeatures);
	
}

var system_oNLSPreferencesWindow = null;
function system_OpenPreferencesWindow(strGUID,bNS4)
{

	return system_OpenGeneralPreferencesWindowReal(strGUID,bNS4);
}

function system_OpenGeneralPreferencesWindowReal(strGUID,bNS4)
{
	var strURL = "CIPreferences.asp?GUID=" + strGUID;
	if (bNS4)
	{
		lHeight = PREFERENCES_DIMENSIONS_PAGE_HEIGHT_NS_4;
		lWidth = PREFERENCES_DIMENSIONS_PAGE_WIDTH_NS_4;
	}
	else
	{
		lHeight = PREFERENCES_DIMENSIONS_PAGE_HEIGHT_NS_6;
		lWidth = PREFERENCES_DIMENSIONS_PAGE_WIDTH_NS_6;
	}
	var lTop = (window.screen.availHeight)/2-(lHeight/2);
	var lLeft = (window.screen.availWidth)/2-(lWidth/2);
	var swindowFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,width=" + lWidth + ",height=" + lHeight + ",screenX=" + lLeft + ",screenY=" + lTop;
	system_oNLSPreferencesWindow = window.open(strURL,"CIPreferences",swindowFeatures);
	system_oNLSPreferencesWindow.focus();
	return system_oNLSPreferencesWindow;
}

var system_oArchitectPreferencesWindow = null;
function system_OpenArchitectPreferencesWindow(sGUID,bIsArchitectActive,bIsFAQandDiscoverActive)
{

	window.setTimeout("system_OpenArchitectPreferencesWindowReal('" + sGUID + "'," + bIsArchitectActive + "," + bIsFAQandDiscoverActive + ")",50);
	return false;
}
function system_OpenArchitectPreferencesWindowReal(sGUID,bIsArchitectActive,bIsFAQandDiscoverActive)
{
	var strURL = "ArchitectPreferences.asp?GUID=" + sGUID + "&Architect=" + bIsArchitectActive + "&FAQ="+ bIsFAQandDiscoverActive;
	var width = PREFERENCES_NS_ARCHITECT_DIMENSIONS_PAGE_WIDTH;
	var height = PREFERENCES_NS_ARCHITECT_DIMENSIONS_PAGE_HEIGHT;
	var lTop = (window.screen.availHeight)/2-height;
	var lLeft = (window.screen.availWidth)/2-width/2;
	
	var swindowFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,width=" + width + ",height=" + height + ",screenX=" + lLeft + ",screenY=" + lTop;
	system_oArchitectPreferencesWindow = window.open(strURL,"CIArchitectPreferences",swindowFeatures);
	system_oArchitectPreferencesWindow.focus();
	return false;
}
function system_OpenDocument(KdId,lCallID)
{
	var strURL = "DocumentBuilder.asp?ExternalCallID=" + lCallID + "&KDID=" + KdId;
	system_OpenCIWindow(strURL,"Document");
	return false;
}

function system_OpenExpert(NodeID,KdId,lCallID)
{
	var strURL = "DTMain.asp?ExternalCallID=" + lCallID + "&NodeId=" + NodeID + "&KdId=" + KdId;
	system_OpenCIWindow(strURL,"Expert");
	return false;
}

function system_OpenSubmitKnowledge(sGUID){
	var lWidth = SUBMIT_KNOWLEDGE_NS_DIMENSIONS_PAGE_WIDTH;
	var lHeight = SUBMIT_KNOWLEDGE_NS_DIMENSIONS_PAGE_HEIGHT;
	var lLeft = (window.screen.availWidth-lWidth)/2;
	var lTop = (window.screen.availHeight-lHeight)/2;
	var swindowFeatures = "directories=no,location=no,menubar=no,resizable=no,status=yes,toolbar=no," + 
						"width=" + lWidth +  ",height=" + lHeight + ",screenX=" + lLeft + ",screenY=" + lTop;

	var oWin  = window.open("ArcDocUser.asp?GUID=" + sGUID,"CI_SubmitKnowledge",swindowFeatures);
	oWin.focus()
	return oWin;
}

function system_OpenOpenTicket(sGUID,sProblem,iKdId,iRole,externalCallID){
	
	
	if (system_OpenOpenTicket.arguments.length == 2)
		{
		iKdId = 0;
		iRole = 50;
		}
	var sURL;
	sURL = "CIOpenIssue_Request.asp?GUID=" + sGUID + "&sProblem=" + sProblem + "&KdId=" + iKdId + "&ExternalCallID=" + externalCallID;
	//if(iRole >= 50){
	//	if(externalCallID != 0 && externalCallID != ""){
			
	//		top.location.href = sURL;
	//		return;
	//	}
	//	else{
	//		var lWidth = window.screen.availWidth; //OPEN_TICKET_LARGE_NS_DIMENSIONS_PAGE_WIDTH;
	//		var lHeight = OPEN_TICKET_LARGE_NS_DIMENSIONS_PAGE_HEIGHT;
	//		var lLeft = (window.screen.availWidth-lWidth)/2;
	//		var lTop = (window.screen.availHeight-lHeight)/2;
	//	}

	//}
	//else{
		var lWidth = OPEN_TICKET_NS_DIMENSIONS_PAGE_WIDTH;
		var lHeight = OPEN_TICKET_NS_DIMENSIONS_PAGE_HEIGHT;
		var lLeft = (window.screen.availWidth-lWidth)/2;
		var lTop = (window.screen.availHeight-lHeight)/2;
		var swindowFeatures = "directories=no,location=no,menubar=no,resizable=yes,status=no,toolbar=no," + 
						"width=" + lWidth +  ",height=" + lHeight + ",screenX=" + lLeft + ",screenY=" + lTop;
	//}

	var oWin  = window.open(sURL,"",swindowFeatures);
	//var oWin  = window.open("CIOpenSDRequest.asp?GUID=" + sGUID + "&sProblem=" + sProblem,"CI_OpenTicket","");
	oWin.focus()
	return oWin;
}

function system_OpenOpenTicketLarge(sURL)
{
	var lWidth = OPEN_TICKET_LARGE_NS_DIMENSIONS_PAGE_WIDTH;// window.screen.availWidth;
	var lHeight = OPEN_TICKET_LARGE_NS_DIMENSIONS_PAGE_HEIGHT;
	var lLeft = (window.screen.availWidth-lWidth)/2;
	var lTop = (window.screen.availHeight-lHeight)/2;
	
	window.resizeTo(lWidth,lHeight); 
	window.moveTo(lLeft,lTop);

	window.location.href = sURL;
	
}

function system_OpenDTAudit(sGUID,pathID)
{

	var lWidth = OPEN_DTAUDIT_NS_DIMENSIONS_PAGE_WIDTH;
	var lHeight = OPEN_DTAUDIT_NS_DIMENSIONS_PAGE_HEIGHT;
	var lLeft = (window.screen.availWidth-lWidth)/2;
	var lTop = (window.screen.availHeight-lHeight)/2;
	
	var strMainWinFeatures ="directories=0," +
	"width=" + lWidth +  ",height=" + lHeight + ",left=" + lLeft + ",top=" + lTop +
	"location=0,menubar=0,toolbar=0,status=0,resizable=yes";
	return window.open("CIExpert.asp?GUID=" + sGUID + "&sessionid=" + system_Escape(pathID) + "&ShowNavigation=2&auditTrail=1","",strMainWinFeatures);
	
}

function system_OpenHelp(strFileName, strName, bAddFolderName)
{
	var strURL = "";
	if (system_OpenHelp.arguments.length > 2)
	{
		if (bAddFolderName)
		{
			strURL += "KT/";
		}
	}
	strURL += "help/" + strFileName;
	var wHelp = null;
	var strWindowName = "Help";
	if (system_OpenHelp.arguments.length > 1)
	{
		strWindowName = strName;
	}
	wHelp = window.open(strURL, strWindowName);
	wHelp.focus();
	return wHelp;
}
function system_IsCookiesEnabled()
{
	testValue=Math.floor(1000*Math.random());
	system_SetCookie('AreCookiesEnabled',testValue);
	if (testValue!=system_RetrieveCookie('AreCookiesEnabled'))
		return false;
	else
		return true; 
		
}

function system_SetCookie(strName, strValue)
{
		var dateExpires = new Date(2037, 11, 31);
		document.cookie = strName + "=" + system_Escape(strValue) + "; expires=" + dateExpires.toGMTString() + ";";
}

function system_RetrieveCookie(strName)
{
		var arrCookie = document.cookie.split("; ");
		for (var intCounter = 0; intCounter < arrCookie.length; intCounter++)
		{
			var arrCurrentCookie = arrCookie[intCounter].split("=");
			if (strName.toLowerCase() == arrCurrentCookie[0].toLowerCase())
			{
				return unescape(arrCurrentCookie[1]);
			}
		}
		return "";
}

function system_OpenExBuilder(iNodeId, strTitle,bIsAdmin)
{
	var strURL = "ExBuilderMain_NS.asp?NodeId=" + iNodeId + "&Title=" + system_Escape(strTitle);
	strWindowName = "TreeDesigner";
	var lHeight = window.screen.availHeight - 45;
	var lWidth = window.screen.availWidth - 12;
	var lTop = 0;
	var lLeft = 0;
	var swindowFeatures = "scrollbars=yes,directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no," + 
						"width=" + lWidth +  ",height=" + lHeight + ",screenX=" + lLeft + ",screenY=" + lTop;
	var oWin = window.open(strURL,strWindowName,swindowFeatures);
	oWin.focus();
	return oWin;
}

function system_LoginCloseWin()
{
	if (system_oLoginWindow!=null)
	{
		window.setTimeout("system_LoginSetWinNull()",10);
		system_oLoginWindow.close();
	}
}
function system_LoginSetWinNull()
{
	system_oLoginWindow=null;
}

function system_PreferencesCloseWin()
{

	if (system_oNLSPreferencesWindow!=null)
	{
		window.setTimeout("system_PreferencesSetWinNull()",10);
		system_oNLSPreferencesWindow.close();
	}
}

function system_PreferencesSetWinNull()
{
	system_oNLSPreferencesWindow=null;
}

function system_ArchitectPreferencesCloseWin()
{
	if (system_oArchitectPreferencesWindow!=null)
	{
		window.setTimeout("system_ArchitectPreferencesSetWinNull()",10);
		system_oArchitectPreferencesWindow.close();
	}
}

function system_ArchitectPreferencesSetWinNull()
{
	system_oArchitectPreferencesWindow=null;
}

var system_oZoomWindow = null;
var system_oPreviewWindow = null;

function system_Zoom()
{
	var strURL = "ExBuilderZoom_NS.asp?"
	
	var lTop = (window.screen.availHeight)/2-535/2;
	var lLeft = (window.screen.availWidth)/2-750/2;
	
	var swindowFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no," + 
						"width=750,height=535" + ",screenX=" + lLeft + ",screenY=" + lTop;
	
	system_oZoomWindow = window.open(strURL,"Zoom",swindowFeatures);
	system_oZoomWindow.focus();
}

function system_Preview(strText, iResponsesNumber,
						strResponse1, strResponse2, strResponse3, strResponse4,
						strResponse5, strResponse6, strResponse7)
{
	var strURL;
	var strResponse;
	strURL = "ExBuilderPreviewFrames_NS.asp";
	strURL += "?Text=" + system_Escape(strText);
	if (system_Preview.arguments.length > 1)
	{
		strURL += "&ResponsesNumber=" + iResponsesNumber;
		for (var iRespNumber = 1; iRespNumber <= iResponsesNumber; iRespNumber++)
		{
			switch (iRespNumber)
			{
				case 1:
					strResponse = strResponse1;
					break;
				case 2:
					strResponse = strResponse2;
					break;
				case 3:
					strResponse = strResponse3;
					break;
				case 4:
					strResponse = strResponse4;
					break;
				case 5:
					strResponse = strResponse5;
					break;
				case 6:
					strResponse = strResponse6;
					break;
				case 7:
					strResponse = strResponse7;
					break;
			}
			strURL += "&Response" + parseInt(iRespNumber) + "=" + system_Escape(strResponse);
		}
	}
	
	var lTop = (window.screen.availHeight)/2-515/2;
	var lLeft = (window.screen.availWidth)/2-680/2;
	
	var swindowFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,scrollbars=yes," + 
						"width=680,height=515" + ",screenX=" + lLeft + ",screenY=" + lTop;
	system_oPreviewWindow = window.open(strURL,"Preview",swindowFeatures);
	system_oPreviewWindow.focus();
}

function system_CloseZoom()
{
	if (system_oZoomWindow != null)
	{
		window.setTimeout("system_ZoomSetWinNull()", 10);
		system_oZoomWindow.close();
	}
}

function system_ClosePreview()
{
	if (system_oPreviewWindow != null)
	{
		window.setTimeout("system_PreviewSetWinNull()", 10);
		system_oPreviewWindow.close();
	}
}

function system_ZoomSetWinNull()
{
	system_oZoomWindow = null;
}

function system_PreviewSetWinNull()
{
	system_oPreviewWindow = null;
}

function system_ZoomSetWin(oWindow)
{
	system_oZoomWindow = oWindow;
}

function system_PreviewSetWin(oWindow)
{
	system_oPreviewWindow = oWindow;
}

var system_objOpenSearchUsersWindow = null;
function system_OpenSearchUsersWindow(sGUID, strTitle,KTRole)
{

	var strTitleParameter = "";
	var sKTRole = 40;
	if (system_OpenSearchUsersWindow.arguments.length == 2)
	{	
		strTitleParameter = strTitle;				
	}
	if (system_OpenSearchUsersWindow.arguments.length == 3)
	{	
		strTitleParameter = strTitle;
		sKTRole = KTRole;
	}
	
	var strURL = "SearchUsers.asp?GUID=" + sGUID + "&Title=" + system_Escape(strTitleParameter) + "&sKTRole=" + sKTRole;
	var width = SEARCH_USERS_NS_DIMENSIONS_PAGE_WIDTH;
	var height = SEARCH_USERS_NS_DIMENSIONS_PAGE_HEIGHT;
	
	var lTop = (window.screen.availHeight)/2-height/2;
	var lLeft = (window.screen.availWidth)/2-width/2;
	
	var swindowFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,width=" + width + ",height=" + height + ",screenX=" + lLeft + ",screenY=" + lTop;
	system_objOpenSearchUsersWindow = window.open(strURL,"SearchUsers",swindowFeatures);
	system_objOpenSearchUsersWindow.focus();
	return system_objOpenSearchUsersWindow;
}

var system_objOpenSDFieldSearchWindow = null;
function system_OpenSDFieldSearchWindow(sGUID, strFieldName, strTitle)
{
	var strTitleParameter = "";
	if (system_OpenSDFieldSearchWindow.arguments.length == 3)
	{	
		strTitleParameter = strTitle;				
	}
	
	var strURL = "SDFieldSearch.asp?GUID=" + sGUID + "&FieldName=" + strFieldName + "&Title=" + system_Escape(strTitleParameter);
	var width = SD_FIELD_SEARCH_NS_DIMENSIONS_PAGE_WIDTH;
	var height = SD_FIELD_SEARCH_NS_DIMENSIONS_PAGE_HEIGHT;
	
	var lTop = (window.screen.availHeight)/2-height/2;
	var lLeft = (window.screen.availWidth)/2-width/2;
	
	var swindowFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,width=" + width + ",height=" + height + ",screenX=" + lLeft + ",screenY=" + lTop;
	system_objOpenSDFieldSearchWindow = window.open(strURL,"SDFieldSearch",swindowFeatures);
	system_objOpenSDFieldSearchWindow.focus();
	return system_objOpenSDFieldSearchWindow;
}

function system_OpenConfirmWindow(strURL)
{
	var width = CONFIRM_NS_DIMENSIONS_PAGE_WIDTH;
	var height = CONFIRM_NS_DIMENSIONS_PAGE_HEIGHT;
	
	var lTop = (window.screen.availHeight)/2-height/2;
	var lLeft = (window.screen.availWidth)/2-width/2;
	
	var sFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,width=" + width + ",height=" + height + ",screenX=" + lLeft + ",screenY=" + lTop;
	window.open(strURL,"Workflow",sFeatures)
}
function system_OpenRejectWindow(strURL)
{
	var width = REJECT_NS_DIMENSIONS_PAGE_WIDTH;
	var height = REJECT_NS_DIMENSIONS_PAGE_HEIGHT;
	
	var lTop = (window.screen.availHeight)/2-height/2;
	var lLeft = (window.screen.availWidth)/2-width/2;
	
	var sFeatures = "directories=no,location=no,menubar=no,resizable=no,status=no,toolbar=no,width=" + width + ",height=" + height + ",screenX=" + lLeft + ",screenY=" + lTop;
	window.open(strURL,"Workflow",sFeatures)
}
function system_UploadFile(strFolderName,nImageOnly,bIsAdmin,sCaption,bModalWin)
{
	var lLeft = (window.screen.availWidth)/2-150;
	var lTop = (window.screen.availHeight)/2;	
	var sFeatures= "top=" + lTop + ",left=" + lLeft + ",Width=390px,Height=160px,resizable=no,status=yes,help=no"
	var sURL="CIUploadFileDlg.asp?Folder=" + strFolderName + "&ImageOnly=" + nImageOnly + "&Admin=" + bIsAdmin
	window.open(sURL,null,sFeatures);		

}

function system_OpenAbout(bIE5,folderURL)
{
	strfolderURL = ""
	if (system_OpenAbout.arguments.length>1)
	{
		strfolderURL = folderURL
	}
	
	var lHeight = 310;
	var lWidth = 415;
	var lTop = (window.screen.availHeight)/2-lHeight/2;
	var lLeft = (window.screen.availWidth)/2-lWidth/2;
	if (lTop<0)
		lTop=0;
	if (lLeft<0)
		lLeft=0;
	
	var strURL =strfolderURL + "About_Box.asp";
	var sWindowFeatures = "top=" + lTop + ",left=" + lLeft + ",width=" + lWidth + ",height=" + lHeight + ",menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no";
	return window.open(strURL, "KTAbout", sWindowFeatures);
}

function system_ViewFile(sFilePath,sRepsite)
{
	if(sFilePath=="")
		return;
	var sFeatures= "status=no,help=no,toolbar=no,menubar=no,location=no";
	var sURL="ArcDocGetFile.asp?FilePath=" + system_Escape(sFilePath)+
	"&RepSite=" + system_Escape(sRepsite)
	window.open(sURL,"",sFeatures);
}	

// @RT 5/16/03

function system_BrowserOS(){
	
	var BrowserOS="";
	
	if (navigator.userAgent.indexOf("Win") > -1){
		BrowserOS = "WIN";
	}

	if(navigator.userAgent.indexOf("Mac") > -1){
		BrowserOS = "MAC";
	}
	 
	return BrowserOS;
	
}	