function LeftOf(StringToSearch,SubString){	var i = StringToSearch.indexOf(SubString);	if(i<0){return '';}	return StringToSearch.substr(0,i);}function LeftBackOf(StringToSearch,SubString){	var i = StringToSearch.lastIndexOf(SubString);	if(i<0){return '';}	return StringToSearch.substr(0,i);}function RightOf(StringToSearch,SubString){	var i = StringToSearch.indexOf(SubString);	if(i<0){return '';}	return StringToSearch.substring(i+SubString.length,StringToSearch.length);}function RightBackOf(StringToSearch,SubString){	var i = StringToSearch.lastIndexOf(SubString);	if(i<0){return '';}	return StringToSearch.substring(i+SubString.length,StringToSearch.length);}function Middle( _cString, _cStart, _cEnd){	var cEndPart = RightOf( _cString, _cStart );	var cMiddle = LeftOf( cEndPart, _cEnd );	if(cMiddle.length == 0){return cEndPart;}	return cMiddle;}function NoSpaceStr( _cString , _nPart ){   var nFirst = 0;   var nLast = _cString.length-1;   // Left   if (_nPart & 1){while (_cString.charAt(nFirst)==" "){nFirst++;}}   // Right   if (_nPart & 2){while (_cString.charAt(nLast)==" "){   nLast--;}}   return _cString.substring(nFirst,nLast+1);}function SetCookie(pname, pvalue, validity){	if(pvalue != null){		if(validity > 0){					var today = new Date();			var expiry = new Date(today.getTime() + validity);			document.cookie = pname + '=' + pvalue + '; expires=' + expiry.toGMTString() + '; path=/;';		}		else{document.cookie = pname + '=' + pvalue + '; path=/;';}	}}function GetCookie(pname){	var index = document.cookie.indexOf(pname + '=');	if (index == -1){return null;}	index = document.cookie.indexOf("=", index) + 1;	var endstr = document.cookie.indexOf(";", index);	if (endstr == -1){endstr = document.cookie.length;}	return document.cookie.substring(index, endstr);}function SetElementPosition(_cElementID, _cTargetElementID, _cLeftPosition, _cTopPosition){	var g_oElement = document.getElementById(_cElementID);	if(g_oElement){		if(_cLeftPosition.length > 0 && _cTopPosition.length > 0){			g_oElement.style.position = 'absolute';			g_oElement.style.left = _cLeftPosition;			g_oElement.style.top = _cTopPosition;		}		else{			var g_oTargetElement = document.getElementById(_cTargetElementID);			if(g_oTargetElement){				if(g_oTargetElement.appendChild){g_oTargetElement.appendChild(g_oElement);}			}		}	}}function ListKeywordValue(sLKAlias , bReturn){	if( sLKAlias == '') return '';	str = document.forms[0].ListKeywordValueTranslation.value;	strbeg = str.indexOf(sLKAlias);	if(strbeg > -1){		str = str.substring(strbeg);		str = str.substring(str.indexOf(':=') + 2);		strend = str.indexOf('~');		if(strend > -1){str = str.substring(0,strend);}	}	else{str = sLKAlias;}	if( bReturn ){return str;	}	else{			result=document.write(str);   	          document.close();   	}}function LabelValue(sLNum){	str = document.forms[0].FormLabels.value;	if(arguments[2]){str = arguments[2];}	strbeg = str.indexOf(sLNum);	if(strbeg > -1){		str = str.substring(strbeg);		str = str.substring(str.indexOf(':=') + 2);		strend = str.indexOf('~');		if(strend > -1){str = str.substring(0,strend);}	}	else{str = sLNum;}	if(arguments[1]){return str;}	else{		result=document.write(str);		document.close();	}}Redirected = false;function Redirect(){	//if(!g_cIsMultiSite){return;}	if(g_cIsMultiSite=='1'){		var map = g_cMapping.split(',');		var redir_srv, redir_remote, redir_remote_part, remote, match=0, tmp_match;		remote = g_cRemote_Addr.split('.');		var i=0;		while(i<map.length && match<4){			redir_remote = map[i].substring(0,map[i].indexOf(':=')).split('.');			if(redir_remote.length<5){				tmp_match = 0;				var k = 0;				while(k < redir_remote.length && tmp_match >= 0){					redir_remote_part = parseInt(redir_remote[k]);					if( ! isNaN(redir_remote_part)){						if(remote[k] == redir_remote_part){tmp_match++;}						else{tmp_match = -1;}						k++;																}					else{k = redir_remote.length}									}				if(match < tmp_match){					match = tmp_match;					redir_srv = map[i].substring(map[i].indexOf(':=') + 2, map[i].length);				}			}			i++;		}		if(match == 0){redir_srv = g_cDefaultServer;}		if(redir_srv){			var url_tmp1 = window.location.href.substring(0,window.location.href.indexOf('//') + 2);			var url_tmp2 = window.location.href.substring(window.location.href.indexOf('//') + 2, window.location.href.length);			var url_tmp3 = url_tmp2.substring(url_tmp2.indexOf('/'), url_tmp2.length);			var cur_srv = url_tmp2.substring(0,url_tmp2.indexOf('/'));			if(cur_srv.toLowerCase() != redir_srv.toLowerCase()){window.location.href = url_tmp1 + redir_srv + url_tmp3;}			else{Redirected = true;}		}	}	else{Redirected = true;}}function Search(){   var cQuery = '';   var cExpToReplace = '';   var cNewExp = '';   var cResultView = '';   if( window.document.forms[0].QueryForSearchR ){cQuery = window.document.forms[0].QueryForSearchR.value;}   else{cQuery = window.document.forms[0].QueryForSearch.value;}   cQuery = NoSpaceStr(cQuery, 3);   cExpToReplace = / /gi;   cNewExp = g_cPageSearchRequestType;   if(cNewExp == '+AND+' || cNewExp == '+OR+'){cNewExp = '"' + cNewExp + '"';}   cQuery = cQuery.replace(cExpToReplace, cNewExp);   if( cQuery != null && cQuery != '' ){      cQuery = '("' + escape(cQuery) + '")';      if(g_cWebUserLanguageCode != null && g_cWebUserLanguageCode != ''){		cQuery = cQuery + '+AND+([PageLanguageForSelection]+CONTAINS+(' + g_cWebUserLanguageCode + '))';      }      cResultView = 'vEmPageSearch';      window.location = "" + g_cDbName + '/' + cResultView + '?SearchView&Query=' + escape(cQuery) + '&unid=-';   }}function CommonSubmit(){	Search();	return false;}function ContentRefresh(sLanguage){	var TrPageURLField = eval('g_cPageLanguage' + sLanguage + 'URL');	if(TrPageURLField){		if(TrPageURLField.length > 0){window.location.href = TrPageURLField;}		else{window.location.reload();}	}	else{window.location.reload();	}}function Login(){	if(top.location.href.indexOf('&login=1') < 0){top.location.href = top.location.href + '&login=1'}}function LaunchBookmark(_cTargetPageUNID, _oHotspot){	var cCurrentPageUNID = '';	var cTarget = '';	var cURL = '';	if(_oHotspot.target!=''){cTarget = _oHotspot.target;}	_oHotspot.target = '_self';	if (g_cPageCurrentPageUNID){cCurrentPageUNID = g_cPageCurrentPageUNID;}	if (_cTargetPageUNID != '' && cCurrentPageUNID != ''){		cURL = g_cDbName + "/PageLaunchBookmark?openagent&targetpageunid=" + _cTargetPageUNID + "&currentpageunid=" + cCurrentPageUNID + "&";		if(cTarget != ''){window.open(cURL, cTarget);}		else{window.location = cURL;}	}}function AddDocRequest(_cUNID){	var addDocReqWin = window.open('/' + g_cRequestsRepID + '/fAddDocRequest?OpenForm&unid=' + _cUNID,'AddDocRequestWin');	addDocReqWin.focus();}function AddDocRequest_CreateSyntax( _cUnid ){	return '<A href="javascript:AddDocRequest(\''+ _cUnid +'\')"> '+ g_cRequestsImage +' </A>';}function EventRegistration(_cUNID){	var oRegWin = window.open('/' + g_cRequestsRepID + '/fEventRegistration?OpenForm&unid=' + _cUNID,'RegistrationWin');	oRegWin.focus();}function OnlineReg_CreateSyntax( _cUnid ){	return '<A href="javascript:EventRegistration(\''+ _cUnid +'\')"> '+ g_cRequestsImage +' </A>';}