﻿/*
Include order:
dp_utils.js
popup.js
actions.js
forms.js	/forms/
tabcontrol.js	/forms/
views.js	/views/
datepicker.js	/forms, optional/
custom.js

$$ViewTemplateDefault onload:
init();

$$SearchTemplateDefault onload:
initViewSearch();

$$ESHWebTabControl subform:
ESHTabControlInit();

($$ESHWebPickList) | html/picklist.html | picklist.html onload:
init();
*/

//dp_utils.js
function getWindowWidth() { 
	if (typeof(window.innerWidth) == 'number') { return window.innerWidth; } /*Non-IE*/ 
	if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { return document.documentElement.clientWidth; } /*IE 6+ in 'standards compliant mode'*/
	if (document.body && (document.body.clientWidth || document.body.clientHeight)) { return document.body.clientWidth; } /*IE 4 compatible*/
	return 0;
}
function getClientWidth() {
	var iBodyWidth = (typeof(document.body.clientWidth) == 'number')?document.body.clientWidth:Number.MAX_VALUE;
	var iDocumentWidth = (typeof(document.documentElement.clientWidth) == 'number')?document.documentElement.clientWidth:Number.MAX_VALUE;
	var iMaxWidth = Math.max(iBodyWidth,iDocumentWidth);
	return (iMaxWidth==Number.MAX_VALUE)?getWindowWidth():iMaxWidth;
}

function elemPos(o) { var curleft = curtop = 0; do { curleft += o.offsetLeft; curtop += o.offsetTop; } while (o = o.offsetParent); return [curleft,curtop]; }
function elemSize(o) { return [o.offsetWidth,o.offsetHeight]; }
function eventTo(e){ return e.relatedTarget || e.toElement; }
function eventFrom(e){ return e.originalTarget || e.fromElement; }
function eventSource(e){ return e.target || e.srcElement; }

function hasElementClassName(o, c){ var re = new RegExp("(^|\\s)" + c + "(\\s|$)"); return re.test(o.className); }
function getElementsByClassName(c, p){ var ch = ((typeof(p)=='string')?document.getElementById(p):document.body).getElementsByTagName('*'); var e = []; for (var i=0; i < ch.length; i++){ if (hasElementClassName(ch[i], c)){ e.push(ch[i]); } } return e; }
function addClassName(o, c){ if (!hasElementClassName(o, c)){ o.className = o.className.split(/\s+/).concat(c).join(' '); } }
function removeClassName(o, c){ o.className = o.className.replace(new RegExp("(^|\\s)" + c + "(\\s|$)"), ' ').split(/\s+/).join(' '); }

function getCookie(cookieName) {
	var exp = new RegExp ( encodeURIComponent(cookieName) + "=([^;]+)" );
	if (exp.test(document.cookie + ";")) { exp.exec (document.cookie + ";"); return decodeURIComponent(RegExp.$1); } else { return null; }
}

function setCookie(cookieName, cookieValue, expireDays) {
	var sExpire;
	if (typeof(expireDays)!='undefined') {
		var dExpire = new Date();
		dExpire.setTime(dExpire.getTime() + (expireDays*24*60*60*1000));
		sExpire = '; expires=' + dExpire.toGMTString();
	} else { sExpire = ''; }

	var indexOfDomainName = location.hostname.indexOf('.');
	var sDomainName = (indexOfDomainName==-1)?location.hostname:location.hostname.substr(indexOfDomainName+1);
	document.cookie = encodeURIComponent(cookieName) + '=' + encodeURIComponent(cookieValue) + '; path=/; domain=' + sDomainName + sExpire;
	return (getCookie(cookieName)==cookieValue);
}



//popup.js
/*
u: URL string of the page wanted to be loaded
t: delay in millisecs before begin loading
n: window name string, identifying the window, may serve as target. use 'modal' to provide a modal msg box
a: arguments string for dialogbox (in case n=='modal')
mb: window menubar boolean or 0/1
tb: window toolbar boolean or 0/1
lb: window location text field boolean or 0/1
sb: window statusbar boolean or 0/1
s: window scrollable boolean or 0/1
r: window resizeable boolean or 0/1
c: center window boolean or 0/1
x,y,w,h: window position integers
*/

var wbi=2; //window inner border, this can be eliminated by body style="border:0px none"
var wb=4+wbi;
var wt=23+wbi;
var popupa;
var popupw;
var popuprv;
function urlopen(u,t,n,a,mb,tb,lb,sb,s,r,c,x,y,w,h){
	p='';
	if (n=='modal') {
		p=p+((c)?('center:1;'):('center:0;'));
		p=p+((!c&&x)?('dialogLeft:'+x+'px;'):(''));
		p=p+((!c&&y)?('dialogTop:'+y+'px;'):(''));
		p=p+((w)?('dialogWidth:'+w+'px;'):(''));
		p=p+((h)?('dialogHeight:'+h+'px;'):(''));
		p=p+((sb)?('status:1;'):('status:0;'));
		p=p+((s)?('scroll:1;'):('scroll:0;'));
		p=p+((r)?('resizable:1;'):('resizable:0;'));
		p=p+'help:0';
		popupa=a;
		if (t==0) {
			return window.showModalDialog(u,popupa,p);
		} else {
			setTimeout("popuprv=window.showModalDialog('"+u+"',popupa,'"+p+"');",t);
		}
	} else {
		if (c){
			aw=screen.availWidth-wb-wb;
			ah=screen.availHeight-wt-wb;
			w=((w)?((w>aw)?(aw):(w)):(400));
			h=((h)?((h>ah)?(ah):(h)):(300));
			p=p+'left='+(aw-w)/2+'px,';
			p=p+'top='+(ah-h)/2+'px,';
		} else {
			p=p+((x)?('left='+x+'px,'):(''));
			p=p+((y)?('top='+y+'px,'):(''));
		}
		p=p+((w)?('width='+w+'px,'):(''));
		p=p+((h)?('height='+h+'px,'):(''));
		p=p+((mb)?('menubar=1,'):('menubar=0,'));
		p=p+((tb)?('toolbar=1,'):('toolbar=0,'));
		p=p+((lb)?('location=1,'):('location=0,'));
		p=p+((sb)?('status=1,'):('status=0,'));
		p=p+((s)?('scrollbars=1,'):('scrollbars=0,'));
		p=p+((r)?('resizable=1,'):('resizable=0,'));
		setTimeout("popupw=window.open(" +'"' + u +'"' +",'"+n+"','"+p+"');",t);
	}
}

function safeCloseOnPopupLoad(){
	if (!popupw) { setTimeout('safeCloseOnPopupLoad();',1); } else if (!popupw.document) { setTimeout('safeCloseOnPopupLoad();',1); } else if (popupw.document.readyState!='complete') { setTimeout('safeCloseOnPopupLoad();',1); } else { window.opener=null; 	close(); popupw.focus(); }
}



//actions.js
// --------------------- NYELVFÜGGŐ !!!


//forms.js	/forms/
var docThis = $$('*');
var formThis = document.forms[0]; // this should be overriden in onLoad if other form is required

function eshWebDocumentValidate(){ return true; }
function eshPickList(f,iUNID,sSep,iMaxSelCount,sTitle,sView,iCol,sCategory,sDB,vRefreshOnChange){
	//f: a kivalasztott mezo, UNID eseten 
	var sPickListURLParams='';
	sPickListURLParams+='&needunid='+((typeof(iUNID)!='undefined')?((iUNID)?'1':'0'):'0');
	sPickListURLParams+='&sep='+((typeof(sSep)!='undefined')?sSep:'');
	sPickListURLParams+='&maxselcount='+((typeof(iMaxSelCount)!='undefined')?((iMaxSelCount>=0)?iMaxSelCount:0):0);
	sPickListURLParams+='&title='+((typeof(sTitle)!='undefined')?sTitle:'Selection dialog');
	sPickListURLParams+='&col='+((typeof(iCol)!='undefined')?iCol.toString():'1');
	sPickListURLParams+='&category='+((typeof(sCategory)!='undefined')?sCategory:'');
	sPickListURLParams+='&view='+((typeof(sView)!='undefined')?sView:'');
	sPickListURLParams+='&db='+((typeof(sDB)!='undefined')?sDB:'');

	var iMulti=((typeof(sSep)!='undefined') && (iMaxSelCount>1 || iMaxSelCount==0));
	var prevVal=f.value;

	//initially selected items
	if (!(f.value=='')) {
		if (iUNID) {
			var fUNID = $(f.name+'UNID');
			if (iMulti){
				var aInitSelectionsText=f.value.split(sSep);
				var aInitSelectionsValues=fUNID.value.split(', ');
				var aInitSelections=new Array;
				for (var i=0; i<aInitSelectionsValues.length; i++){
					aInitSelections[i]=aInitSelectionsText[i]+'|'+aInitSelectionsValues[i];
				}
				initSelection=aInitSelections;
			} else { initSelection=f.value+'|'+fUNID.value }
		} else { initSelection=(iMulti)?f.value.split(sSep):f.value; }
	} else { initSelection=''; }

	//popup dialog
	retval=showModalDialog('/html/picklist.html?Open'+sPickListURLParams, initSelection, 'center:1;edge:sunken;help:0;unadorned:1;status:0;resizable:0;scroll:0;dialogWidth:700px;dialogHeight:500px');

	if (retval[0]=='Cancel') { return; } // folytatas az eddig kijelolt dokumentummal

	//analyzing and returning result
	if (iUNID) {
		$('ESHWebPickListSourceDB').value=sDB;
		$('ESHWebPickListSourceField').value=f.name;
		if (iMulti) {
			var aResultSelectionsText=new Array;
			var aResultSelectionsValues=new Array;
			for (var i=0; i<retval[1].length; i++){
				sChoice=retval[1][i];
				var iPos=sChoice.indexOf('|');
				aResultSelectionsText[i]=sChoice.substr(0,iPos);
				aResultSelectionsValues[i]=sChoice.substr(iPos+1);
			}
			f.value=aResultSelectionsText.join(sSep);
			$('ESHWebPickListUNIDs').value=aResultSelectionsValues.join(',');
		} else {
			sChoice=retval[1][0];
			var iPos=sChoice.indexOf('|');
			f.value=sChoice.substr(0,iPos);
			$('ESHWebPickListUNIDs').value=sChoice.substr(iPos+1);
		}

		//calling agent on server to process UNID selection
		$('ESHWebPickListProcessUNIDsButton').click();
		return;
	} else {
		if (iMulti){
			var aSelections=new Array;
			for (var i=0; i<retval[1].length; i++){
				aSelections[i]=retval[1][i];
			}
			f.value=aSelections.join(sSep);
		} else {
			f.value=retval[1][0];
		}

		switch (typeof(vRefreshOnChange)){
		   case 'string':
		      $(vRefreshOnChange).click();
		      break;
		   case 'number':
		      if (vRefreshOnChange) if (!(prevVal==f.value)){ $('ViewRefreshFields').click(); };
		      break;
		   default:
			;	// parameter is missing
		} 
	}
}


function pickNames(f,sSep){ eshPickList(f,false,sSep,0,'','DirectoryAuthorizedUsersAndGroups',3); }


//tabcontrol.js	/forms/
//	Copyright (c) 2005 Robert Laszlo, dPortal & EduCon SH. http://www.dominoportals.com
/*
<div eshname="TabGroup1" eshtabgroup="1"><div eshtabcontrol="1" style="display:none" class="TabControl"></div>
<div eshlabel="Basics" eshdescription="" eshtabrow="1" style="display:none;" class="TabRow"><a href="" style="display:none"></a>
...
</div>
</div>

'<table cellspacing="0" class="TabControl"><tr><td class="TabControl" nowrap><img src="' + eshTabControlLeftTagsIMG + '" class="TabControl">'+
'<img src="' + eshTabControlSepImgIMG + '" class="TabControl">'+
'<img src="' + eshTabControlRightTagsIMG + '" class="TabControl"></td></tr></table>';

ESHTabControlActiveTabs: hidden field on $$ESHWebTabControl subform
*/




/* CUSTOM VARIABLES */
var eshTabControlLeftTagsIMG='/img/tabcontrol_sepleft.gif';
var eshTabControlSepImgIMG='/img/tabcontrol_sep.gif';
var eshTabControlRightTagsIMG='/img/tabcontrol_sepright.gif';


//function ESHTabControlRowCount(oTabGroup){ var iCount=0; for (var i=1; i<oTabGroup.childNodes.length; i++){ iCount+=(oTabGroup.childNodes[i].eshtabrow)?1:0; } return iCount; }
//function ESHTabControlColCount(oTabGroup){ var iCount=0; for (var i=0; i<oTabGroup.eshtabcontrol.all.length; i++){ iCount+=(oTabGroup.eshtabcontrol.all[i].tagName=='A')?1:0; } return iCount; }

// visszaadja a sTabGroupName-ben megadott azonosítójú fület
// Korábbi: for (var i=0; i<document.all.length; i++){ oTabGroup=document.all[i]; if(oTabGroup.eshtabgroup){ if (oTabGroup.eshname==sTabGroupName){ return oTabGroup; } } }
function ESHTabControlGetGroup(sTabGroupName){ return $$('div[eshname="'+sTabGroupName+'"]')[0]; }
function ESHTabControlGetNthTab(oTabGroup, n){ return $(oTabGroup.eshtabcontrol).select('A.TabControl')[n-1]; }
function ESHTabControlGetNthRow(oTabGroup, n){ var iCount = 0; for (var i=1; i<oTabGroup.childElements().length; i++){ if (oTabGroup.childElements()[i].hasAttribute('eshtabrow')){ if (++iCount==n) { return oTabGroup.childElements()[i]; } } } return null; }
function ESHTabControlHide(oTabGroup, iTab){ if (!iTab){ return; } var oTabRow=ESHTabControlGetNthRow(oTabGroup, iTab); oTabRow.style.display='none'; var oTab=ESHTabControlGetNthTab(oTabGroup, iTab); oTab.style.fontWeight='normal'; }
function ESHTabControlShow(oTabGroup, iTab){ ESHTabControlGetNthRow(oTabGroup, iTab).setStyle({display: 'block'}); ESHTabControlGetNthTab(oTabGroup, iTab).setStyle({fontWeight: 'bold'}); }

function ESHTabControlStoreActive(oTabGroup, sTab){
	var eshTabControlActiveTabsField=$('ESHTabControlActiveTabs'); // ESHTabControlActiveTabs: hidden field on $$ESHWebTabControl subform
	if (eshTabControlActiveTabsField.value==''){
		eshTabControlActiveTabsField.value=sTab;
	} else {
		var oTabControlActiveTabs=eshTabControlActiveTabsField.value.split(";");
		var iFound=false;
		for (var i=0; i<oTabControlActiveTabs.length&&!iFound; i++){ if (oTabGroup.eshname == oTabControlActiveTabs[i].substr(0, oTabControlActiveTabs[i].lastIndexOf('#'))){ iFound=true; oTabControlActiveTabs[i]=sTab; } }
		if (!iFound) { oTabControlActiveTabs[i]=sTab; }
		eshTabControlActiveTabsField.value=oTabControlActiveTabs.join(";");
	}
}

function ESHTabControlMakeActive(sTab){
	var iSepPos=sTab.lastIndexOf('#');
	var iRowNum=parseInt(sTab.substr(iSepPos+1, sTab.length-iSepPos));
	var oTabGroup=ESHTabControlGetGroup(sTab.substr(0, iSepPos));
	var oTabControl=oTabGroup.eshtabcontrol;
	if (oTabControl.eshactivetab==iRowNum){ return; }
	ESHTabControlHide(oTabGroup, oTabControl.eshactivetab);
	ESHTabControlShow(oTabGroup, iRowNum);
	oTabControl.eshactivetab=iRowNum;	
	ESHTabControlStoreActive(oTabGroup, sTab);
}

function ESHTabControlGetActive(oTabGroup){
	// ESHTabControlActiveTabs: hidden field on $$ESHWebTabControl subform
	// var eshTabControlActiveTabsField=document.all['ESHTabControlActiveTabs'];
	var eshTabControlActiveTabsField=$('ESHTabControlActiveTabs'); 
	if (eshTabControlActiveTabsField.value!=''){
		var oTabControlActiveTabs=eshTabControlActiveTabsField.value.split(";");
		for (var i=0; i<oTabControlActiveTabs.length; i++){
			var sTab=oTabControlActiveTabs[i];
			var iSepPos=sTab.lastIndexOf('#');
			var iRowNum=parseInt(sTab.substr(iSepPos+1, sTab.length-iSepPos));
			if (oTabGroup.eshname == sTab.substr(0, iSepPos)){ return iRowNum; }
		}
	}

	return 1;
}

function ESHTabControlInit(){
	var eshTabControlLeftTags='<table cellspacing="0" class="TabControl"><tr><td class="TabControl" nowrap><img src="' + eshTabControlLeftTagsIMG + '" class="TabControl">';
	var eshTabControlSepImg='<img src="' + eshTabControlSepImgIMG + '" class="TabControl">';
	var eshTabControlRightTags='<img src="' + eshTabControlRightTagsIMG + '" class="TabControl"></td></tr></table>';
	var oTabGroups=$$('div[eshname]');
	oTabGroups.each(function(oTabGroup, i) { 
		oTabGroup.eshtabcontrol = oTabGroup.childNodes[0];
		var oTabControl = oTabGroup.eshtabcontrol;
		var sControlInnerHTML=new Array;
		var iCount=0;
		oTabGroup.childElements().each(function(oTabRow, j) { 
			if (oTabRow.hasAttribute('eshtabrow')) { sControlInnerHTML[iCount]='<a id="'+oTabGroup.readAttribute('eshname')+'#'+(++iCount)+'" href="" class="TabControl" onClick="ESHTabControlMakeActive(this.id); this.blur(); return false;" title="' + oTabRow.readAttribute('eshdescription') + '">' + oTabRow.readAttribute('eshlabel') + '</a>';
			}
		}); 

		oTabControl.innerHTML = eshTabControlLeftTags + sControlInnerHTML.join(eshTabControlSepImg) + eshTabControlRightTags;
		oTabControl.eshactivetab = 0;
		if (iCount){ oTabControl.style.display='block'; ESHTabControlMakeActive(ESHTabControlGetNthTab(oTabGroup, ESHTabControlGetActive(oTabGroup)).id); }
    }); 
}


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//views.js	/views/
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var viewAlias;
var viewIsCategorized=false;
var viewDocSelectionAllowed=false;
var viewIsSearched=false;
var viewIsRestrictedToCategory;
var eshWebPickList;
var eshWebActionButtons;
var eshWebNavButtons;
var eshWebViewContentTable=null;

var dpIsView=false;

function init(){
	docThis=$$('*');
	viewDocSelectionAllowed = ($$('input[name="$$SelectDoc"]').length!=0);
	eshWebPickList=(window.parent)?((window.parent.eshWebPickList!=null)?'1':'0'):'0';
	if ($('ContentTable').childNodes[0].childNodes[0].childNodes[0].childNodes.length!=0){ eshWebViewContentTable=$('ContentTable').childNodes[0].childNodes[0].childNodes[0].childNodes[0]; eshWebViewContentTable.id='ESHWebViewContentTable'; }
	//eshWebViewContentTableInit();
}

function initViewSearch(){ init(); viewIsSearched=true; }
function navParams(){ return "&ActionButtons=" + eshWebActionButtons + "&NavButtons=" + eshWebNavButtons; }
function eshURLSearchView(iGoStart,iGoCount){ location.replace(location.pathname+'?SearchView&Query='+sQuery+'&Start='+iGoStart+'&Count='+iGoCount+'&SearchMax='+iSearchMax+ '&SearchOrder=4' + navParams()); }
function navFTSearch(){ s=document.forms('_ViewForm').Query.value; if ((s=='')||(s=='<query>')) { alert('Query field can not be empty!'); return false; } else { document.forms('_ViewForm').submit(); } }
function navAdvSearch(){ location.href=sSearchForm+'?OpenForm&view='+viewAlias; }
function navExpand(){ $('ViewNavExpand').click(); }
function navCollapse(){ $('ViewNavCollapse').click(); }
function goFirst(){ if (!viewIsSearched){ location.href="?OpenView&Start=1" + navParams(); } else { if (iStart==1) { return; } else { eshURLSearchView(1,iCount); } } }
function goBack(){ if (!viewIsSearched){ $('ViewNavBack').click(); } else { if (iStart==iPrevStart) { return; } else { eshURLSearchView(iPrevStart,iCount); } } }
function goAll(){ if (!viewIsSearched){ location.href="?OpenView&Start=1&Count=-1" + navParams(); } else { if (iCount>=iSearchMax) { return; } else { eshURLSearchView(1,iSearchMax); } } }
function goForward(){ if (!viewIsSearched){ $('ViewNavForward').click(); } else { if (iTotalHits<iNextStart) { return; } else { eshURLSearchView(iNextStart,iCount); } } }
function goLast(){ if (!viewIsSearched){ location.href="?OpenView&Start=" + eshWebViewLastPosition + navParams(); } else { if (iTotalHits-iCount+1<=iStart) { return; } else { eshURLSearchView((iTotalHits-iCount+1),iCount); } } }




function columnValue(e,i){
	/* Fel kellene k&#233;sz&#252;lni a kategoriz&#225;lt n&#233;zetekre is */
	if (viewIsSearched) {
		i+=1;
	} else {
		if (viewIsCategorized) { i+=0; } // mi van a gyerek/alkateg&#243;ria dokumentumokra? azok hogy n&#233;znek ki oszlopilag?
		if (viewDocSelectionAllowed) { i+=2 }
	}

	while ((e.tagName!='TR') && (e.parentElement)){ e=e.parentElement; }
	if (!e.parentElement){ return ''; }

	e=e.cells[i-1];
	return e.innerText;
}


/* Quick search feature using view's StartKey URL parameter */
function viewFormOnKeyPress(){
	if (viewIsSearched) { return; }

	e=window.event;
	o=e.srcElement;
	if (o.name=='Query'){
		if (e.keyCode=="13") { $('ftsearch').click(); return false; } else { return true; }
	} else if (!(e.altKey || e.ctrlKey || e.shiftKey) && (e.keyCode>=32)) {
		/*alert("The character typed was " + e.keyCode); alert("The Alt key state was " + e.altKey); alert("The Ctrl key state was " + e.ctrlKey); alert("The Shift key state was " + e.shiftKey); alert("The mouse was at " + e.offsetX + ", " + e.offsetY);
		alert("The affected control was " + e.srcElement); alert("The event was " + e.type); alert('Quicksearch:' + e.keyCode);*/
		quickSearch(e.keyCode);
		return true;
	}
};

function quickSearch(iUnicode){
	if (viewIsRestrictedToCategory) { return; }
	var qs=showModalDialog('/html/quicksearch.html', String.fromCharCode(iUnicode), 'center:1;edge:sunken;help:0;unadorned:1;status:0;resizable:0;scroll:0;dialogWidth:160px;dialogHeight:100px;');
	if (qs=='') { return; }

	var sNewURL=location.href;
	sNewURL=eshURLReplaceParamValue(sNewURL,'Start','');
	sNewURL=eshURLReplaceParamValue(sNewURL,'StartKey',qs);
	location.href=sNewURL;
}

function eshURLReplaceParamValue(sHref, sParam, sValue){
	var iURLSearchPos=sHref.indexOf('?');
	if (iURLSearchPos==-1) { iURLSearchPos=sHref.indexOf('!'); }
	if (iURLSearchPos==-1) { return sHref; }
	
	var sParamNameInURL='&'+sParam+'=';
	var sParamValueInURL=(sValue=='')?'':'&'+sParam+'='+sValue;
	var iParamPos=sHref.indexOf(sParamNameInURL, iURLSearchPos);
	if (iParamPos==-1) { return sHref+sParamValueInURL; }

	var iNextParamPos=sHref.indexOf('&',iParamPos+1);	
	if (iNextParamPos==-1) { iNextParamPos=sHref.length; }
	return sHref.substring(0,iParamPos)+sParamValueInURL+sHref.substr(iNextParamPos);
}



/* Scrolling content table */
function eshGetCellWidth(e){ if (!e.currentStyle){ e.currentStyle=e.style; } return e.clientWidth-parseInt(e.currentStyle.paddingLeft)-parseInt(e.currentStyle.paddingRight); }
function eshCalcCellsWidth(r){ for (var i=0; i<r.length; i++){ r[i].aWidth = eshGetCellWidth(r[i]); } }
function eshSetCellsWidth(r){ for (var i=0; i<r.length; i++){ r[i].width=r[i].aWidth; r[i].innerHTML='<span style="width:'+r[i].aWidth+';">'+r[i].innerHTML+'</span>'; } }
function eshSetTableWidth(t){ eshCalcCellsWidth(t.tHead.rows[0].cells); eshCalcCellsWidth(t.tBodies[0].rows[0].cells); eshSetCellsWidth(t.tHead.rows[0].cells); eshSetCellsWidth(t.tBodies[0].rows[0].cells); }

var eshOnResizeHandler;
function eshWebViewContentTableInit(){
	var pNode, tableHeader, tableScroller, theadViewContent, spanViewContent;

	theadViewContent=document.createElement('<thead>');
	eshWebViewContentTable.insertBefore(theadViewContent, eshWebViewContentTable.tBodies[0]);
	theadViewContent.appendChild(eshWebViewContentTable.tBodies[0].rows[0]);

	eshSetTableWidth(eshWebViewContentTable);
	pNode=eshWebViewContentTable.parentNode;

	spanViewContent=document.createElement('<span id="ESHScrollableViewContent" style="height:0px;overflow:auto;">');
	pNode.insertBefore(spanViewContent, eshWebViewContentTable);
	spanViewContent.appendChild(eshWebViewContentTable);
	spanViewContent.style.width='100%';

	tableHeader=eshWebViewContentTable.cloneNode(false);
	if (tableHeader.id){ tableHeader.id+='Header'; }
	tableHeader.appendChild(eshWebViewContentTable.tHead.cloneNode(true));
	tableHeader.style.borderBottom='none';
	eshWebViewContentTable.style.borderTop='none';
	eshWebViewContentTable.style.borderBottom='none';
	eshWebViewContentTable.tHead.style.display='none';

	tableScroller=document.createElement('<table cellspacing="0" cellpadding="0" style="width:100%;">');
	pNode.insertBefore(tableScroller, spanViewContent);
	tableScroller.insertRow(0).insertCell(0).appendChild(tableHeader);
	tableScroller.insertRow(1).insertCell(0).appendChild(spanViewContent);

	eshOnResizeRefreshViewContentTable();
	eshOnResizeHandler=window.onresize;
	window.onresize=eshOnResizeRefreshViewContentTable;
}

function eshOnResizeRefreshViewContentTable(){
	if (eshOnResizeHandler) eshOnResizeHandler();
	var rect=$('ESHScrollableViewContent').getClientRects()(0);
	var h=(rect.bottom-rect.top)-(document.body.scrollHeight-document.body.clientHeight);
	$('ESHScrollableViewContent').style.height=(h>0)?h:1;
}

function printPage(){ $('ESHScrollableViewContent').style.overflow=''; window.print(); $('ESHScrollableViewContent').style.overflow='auto'; }
function eshEmbeddingDocumentUNID(){ if (window.parent){ if (window.parent.eshWebDocumentUniqueID){ return window.parent.eshWebDocumentUniqueID; } } }



//datepicker.js	/forms, optional/
function pickDate(f){ f.value=showModalDialog('/html/datepicker.html', ''+f.value, 'center:1;edge:sunken;help:0;unadorned:1;status:0;resizable:0;scroll:0;dialogWidth:240px;dialogHeight:140px;'); return true; }
function pickTime(f){ f.value=showModalDialog('/html/timepicker.html', ''+f.value, 'center:1;edge:sunken;help:0;unadorned:1;status:0;resizable:0;scroll:0;dialogWidth:120px;dialogHeight:100px;'); return true; }
function pickDate2(f){ f.value=showModalDialog('/html/datepicker2.html', ''+f.value, 'center:1;edge:sunken;help:0;unadorned:1;status:0;resizable:0;scroll:0;dialogWidth:240px;dialogHeight:140px;'); return true; }



//custom.js
eshTabControlLeftTagsIMG='/img/tabcontrol_sepleft_emi.gif';
eshTabControlSepImgIMG='/img/tabcontrol_sep_emi.gif';
eshTabControlRightTagsIMG='/img/tabcontrol_sepright_emi.gif';
eshWebActionButtonSourceSep='<img src="/img/icon_dotv4_emi.gif" class="MenuIcon">';
eshWebNavButtonSourceSep='<img src="/img/icon_dotv4_emi.gif" class="MenuIcon">';

function openpic(largepic){ open('/html/imgpopup.html#'+largepic, largepic.substring(largepic.lastIndexOf('/')+1,largepic.lastIndexOf('.')), 'copyhistory=0,location=0,status=1,menubar=0,directories=0,toolbar=0,resizable=0,scrollbars=0'); }
function imgpopup(smallpic,largepic){ 	document.writeln('<img src="' + smallpic + '" alt="A k&#233;p eredeti nagys&#225;g&#225;ban val&#243; megtekint&#233;s&#233;hez kattintson ide!" onClick="openpic(' + "'" + largepic + "'" + ')" />'); }



// utils_emi.js
/* EMINFO general procedures */
function LoadNewWindow(url) { rc = window.open(url); }

/* EMINFO constants */
var EMINFOConstants = new Array;
EMINFOConstants['EMEDupCheckAgentCall']='EME duplicate check';

/* EMINFO functions */
var validEMEAzonosito = new Array;
validEMEAzonosito[0]=/^A-\d{1,4}\/\d{4}$/g;
validEMEAzonosito[1]=/^A-\d{1,4}\/\d{4}-I$/g;
validEMEAzonosito[2]=/^A-\d{1,4}\/\d{1,2}\/\d{4}$/g;
validEMEAzonosito[3]=/^A-\d{1,4}\/\d{1,2}\/\d{4}-I$/g;

function validateEMEAzonosito(sAzonosito) { for (i=0; i<validEMEAzonosito.length; i++) { if (validEMEAzonosito[i].test(sAzonosito)) { return true; } } return false; }

var sEMIErrorMessages = new Array;
sEMIErrorMessages['FormErrorValiadtionPrompt']='Az al&#225;bbi kit&#246;lt&#233;si hib&#225;k vannak:\n\n';
sEMIErrorMessages['FormSubmitConfirmationPrompt']='Az al&#225;bbiak figyelembev&#233;tel&#233;vel is folytatja?\n\n';
sEMIErrorMessages['InvalidEMEID']='- Az &#201;ME azonos&#237;t&#243; szintaxisa hib&#225;s!\n';
sEMIErrorMessages['InvalidDateRange_I']='- A szakv&#233;lem&#233;ny d&#225;tuma nem lehet k&#233;s&#337;bbi, mint az ideiglenes &#201;ME kiad&#225;s&#225;nak kelte!\n';
sEMIErrorMessages['InvalidDateRange_H']='- UEJ d&#225;tuma nem lehet k&#233;s&#337;bbi, mint a hosszabb&#237;tott &#201;ME kelte!\n';
sEMIErrorMessages['InvalidListaElemHier']='- A szakrendi sz&#225;m &#233;s n&#233;v nincs &#246;sszerendelve\n'

var sEMIWarningMessages = new Array;
sEMIWarningMessages['WarningDateRange_I']='- A szakv&#233;lem&#233;ny &#233;s az &#201;ME kelte k&#246;z&#246;tt a k&#252;l&#246;nbs&#233;g t&#246;bb, mint 30 nap!\n';
sEMIWarningMessages['WarningDateRange_H']='- Az UEJ d&#225;tuma &#233;s az &#201;ME tervezett kiad&#225;sa k&#246;z&#246;tt a k&#252;l&#246;nbs&#233;g t&#246;bb, mint 30 nap!\n';
sEMIWarningMessages['EMEPublishConfirmation']='- Az &#201;ME publik&#225;l&#225;sa visszavonhatatlan m&#369;velet!\n';








////////////////////////////////////////////////////////////////////////////////////////
//  actions_en.js
////////////////////////////////////////////////////////////////////////////////////////
function actionEditDocument(){ location.replace('?EditDocument'); }
function actionDeleteDocument(){ if (window.confirm('Click OK to continue to permanently delete this document.\nOtherwise click Cancel.')) { document.getElementById('Remove').click(); } }
function actionHistoryBack(){ history.back(); }
function searchGoBack(){ location.replace('?OpenView'); }
function actionExportExcelHTMAsXLS(){ document.getElementById('ExportExcelHTMAsXLS').click(); }

var eshWebActionButtonSourceSep='<img src="/img/icon_dotv4.gif" class="MenuIcon">';
var eshWebActionButtonSourceSlices_Edit=new Array;
var eshWebActionButtonSourceSlices_Read=new Array;
var eshWebActionButtonPossible_Edit='$';
var eshWebActionButtonPossible_Read='$';

eshWebCurrentUserIsEditor=false;
eshWebCurrentUserIsDeleter=false;
eshWebCurrentUserIsOwner=false;


var eshWebDocumentParentUNID='';

function eshWebActionButtonSourceSliceCreate(sParam, sMode, sCommand, sLabel, sPopup, bShow){
	if (typeof(bShow)!='undefined') { 	if (!bShow) { return; } }

	if (sMode!='read'){
		eshWebActionButtonSourceSlices_Edit[sParam]='<a onClick="'+sCommand+';this.blur();return false;" class="Menu" href="" title="'+sPopup+'">'+sLabel+'</a>'
		eshWebActionButtonPossible_Edit+=','+sParam;
	}
	if (sMode!='edit'){
		eshWebActionButtonSourceSlices_Read[sParam]='<a onClick="'+sCommand+';this.blur();return false;" class="Menu" href="" title="'+sPopup+'">'+sLabel+'</a>'
		eshWebActionButtonPossible_Read+=','+sParam;
	}
}

function eshWebActionButtonInit(){
	eshWebActionButtonSourceSliceCreate('save', 'edit', 'document.getElementById('+"'"+'Save'+"'"+').click()', 'Save', 'Edit this document.', eshWebCurrentUserIsEditor);
	eshWebActionButtonSourceSliceCreate('edit', 'read', 'actionEditDocument()', 'Edit', 'Edit this document.', eshWebCurrentUserIsEditor);
	eshWebActionButtonSourceSliceCreate('print', '', 'window.print()', 'Print', 'Print this document.');
	eshWebActionButtonSourceSliceCreate('delete', 'read', 'actionDeleteDocument()', 'Delete', 'Delete this document.', eshWebCurrentUserIsDeleter);
	eshWebActionButtonSourceSliceCreate('close', 'edit', 'try{if (window.opener){window.opener.location.href=window.opener.location.href;window.opener.focus();}}catch(e){};window.opener=null;window.close();', 'Close', 'Close this window. Unsaved changes are lost.');
	eshWebActionButtonSourceSliceCreate('close', 'read', 'if (window.opener){window.opener.focus();}window.opener=null;window.close();', 'Close', 'Close this window.');
	eshWebActionButtonSourceSliceCreate('searchgoback', '', 'searchGoBack()', 'Back', 'Opens view without full text filter');
	eshWebActionButtonSourceSliceCreate('createCategory', '', 'eshWebCreateNew('+"'"+'Category'+"'"+')', 'New Category', '');
	eshWebActionButtonSourceSliceCreate('createPerson', '', 'eshWebCreateNew('+"'"+'Person'+"'"+')', 'New Person', '');
	eshWebActionButtonSourceSliceCreate('createGroup', '', 'eshWebCreateNew('+"'"+'Group'+"'"+')', 'New Group', '');
	eshWebActionButtonSourceSliceCreate('createOrganization', '', 'eshWebCreateNew('+"'"+'Organization'+"'"+')', 'New Organization', '');
	eshWebActionButtonSourceSliceCreate('createSyncRule', '', 'eshWebCreateNew('+"'"+'SyncRule'+"'"+')', 'New SyncRule', '');
	eshWebActionButtonSourceSliceCreate('createInformation', '', 'eshWebCreateNew('+"'"+'Information'+"'"+')', 'New Information', '');

	eshWebActionButtonSourceSliceCreate('createSite', '', 'eshWebCreateNew('+"'"+'Site'+"'"+')', 'New Site', '');
	eshWebActionButtonSourceSliceCreate('createMenuItem', '', 'eshWebCreateNew('+"'"+'MenuItem'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', 'New Menuitem', '');
	eshWebActionButtonSourceSliceCreate('createMenuItemContent', '', 'eshWebCreateNew('+"'"+'MenuItemContent'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', 'New Menuitem Content', '');
	eshWebActionButtonSourceSliceCreate('createPage', '', 'eshWebCreateNew('+"'"+'Page'+"'"+')', 'New Page', '');
	eshWebActionButtonSourceSliceCreate('createPageContent', '', 'eshWebCreateNew('+"'"+'PageContent'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', 'New Page Content', '');
	eshWebActionButtonSourceSliceCreate('createCodeTemplate', '', 'eshWebCreateNew('+"'"+'CodeTemplate'+"'"+')', 'New Code Template', '');
	eshWebActionButtonSourceSliceCreate('createCodeTemplateContent', '', 'eshWebCreateNew('+"'"+'CodeTemplateContent'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', 'New Code Template Content', '');
	eshWebActionButtonSourceSliceCreate('createContentClass', '', 'eshWebCreateNew('+"'"+'ContentClass'+"'"+')', 'New Content Class', '');
	eshWebActionButtonSourceSliceCreate('createContentCategory', '', 'eshWebCreateNew('+"'"+'ContentCategory'+"'"+')', 'New Content Category', '');
	eshWebActionButtonSourceSliceCreate('createLanguage', '', 'eshWebCreateNew('+"'"+'Language'+"'"+')', 'New Language', '');
	eshWebActionButtonSourceSliceCreate('createImage', '', 'eshWebCreateNew('+"'"+'Image'+"'"+')', 'New Image', '');
	eshWebActionButtonSourceSliceCreate('createImageGallery', '', 'eshWebCreateNew('+"'"+'ImageGallery'+"'"+')', 'New Image Gallery', '');

	eshWebActionButtonSourceSliceCreate('createEMIPhonebook', '', 'eshWebCreateNew('+"'"+'Telefon'+"'"+')', '&#218;j telefonk&#246;nyv bejegyz&#233;s', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvany', '', 'eshWebCreateNew('+"'"+'Szabvany'+"'"+')', '&#218;j szabv&#225;ny', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyRendeles', '', 'eshWebCreateNew('+"'"+'SzabvanyRendeles'+"'"+')', '&#218;j szabv&#225;ny rendel&#233;s', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyModositas', '', 'eshWebCreateNew('+"'"+'SzabvanyModositas'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j m&#243;dos&#237;t&#225;s', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyPeldany', '', 'eshWebCreateNew('+"'"+'SzabvanyPeldany'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j p&#233;ld&#225;ny', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyMasolat', '', 'eshWebCreateNew('+"'"+'SzabvanyMasolat'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j m&#225;solat', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyKiado', '', 'eshWebCreateNew('+"'"+'SzabvanyKiado'+"'"+')', '&#218;j kiad&#243;', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyVisszavono', '', 'eshWebCreateNew('+"'"+'SzabvanyVisszavono'+"'"+')', '&#218;j visszavon&#243;', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyArkategoria', '', 'eshWebCreateNew('+"'"+'SzabvanyArkategoria'+"'"+')', '&#218;j &#225;rkat.', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyNyelv', '', 'eshWebCreateNew('+"'"+'SzabvanyNyelv'+"'"+')', '&#218;j nyelv', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyEuropaiDirektiva', '', 'eshWebCreateNew('+"'"+'SzabvanyEuropaiDirektiva'+"'"+')', '&#218;j EU dir.', '');
	eshWebActionButtonSourceSliceCreate('createEMISzabvanyICS', '', 'eshWebCreateNew('+"'"+'SzabvanyICS'+"'"+')', '&#218;j ICS', '');
	eshWebActionButtonSourceSliceCreate('refreshSzabvanyPeldanyszam', '', 'location.href='+"'"+'SzabvanyPeldanyszamFrissites?OpenAgent'+"'"+';', 'P&#233;ld&#225;nysz&#225;mok friss&#237;t&#233;se', '');
	eshWebActionButtonSourceSliceCreate('createEME', '', 'eshWebCreateNew('+"'"+'EME'+"'"+')', '&#218;j &#201;ME dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createSZRJ', '', 'eshWebCreateNew('+"'"+'SZRJ'+"'"+')', '&#218;j SZRJ dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createJobTitle', '', 'eshWebCreateNew('+"'"+'JobTitle'+"'"+')', '&#218;j Titulus dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createTravelReport', '', 'eshWebCreateNew('+"'"+'TravelReport'+"'"+')', '&#218;j &#218;tijelent&#233;s dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createSzakreferens', '', 'eshWebCreateNew('+"'"+'Szakreferens'+"'"+')', '&#218;j Szakreferens dokumentum', '');
	eshWebActionButtonSourceSliceCreate('searchSzabvanytar', '', 'location.href='+"'"+'SearchEMISzabvanyok'+"'"+';', 'Keres&#233;s', 'Keres&#233;s');
	eshWebActionButtonSourceSliceCreate('searchSzabvanytarIntranet', '', 'location.href='+"'"+'SearchEMISzabvanyKeresesIntranet'+"'"+';', 'Keres&#233;s', 'Keres&#233;s');
	eshWebActionButtonSourceSliceCreate('searchSzabvanytar2', '', 'location.href='+"'"+'SearchEMISzabvanyKereses2'+"'"+';', 'Search', 'Search');
	eshWebActionButtonSourceSliceCreate('createQualifiedBuildingCompany', '', 'eshWebCreateNew('+"'"+'QualifiedBuildingCompany'+"'"+')', '&#218;j Min&#337;s&#237;tett &#201;p&#237;t&#233;si V&#225;llakoz&#225;s dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createHibajegy', '', 'eshWebCreateNew('+"'"+'Hibajegy'+"'"+')', '&#218;j Hibajegy', '');
	eshWebActionButtonSourceSliceCreate('createEsemeny', '', 'eshWebCreateNew('+"'"+'Esemeny'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j esem&#233;ny', '');


	eshWebActionButtonSourceSliceCreate('createEbedRendelesiHet', '', 'eshWebCreateNew('+"'"+'EbedRendelesiHet'+"'"+')', '&#218;j Rendel&#233;s h&#233;t dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createEbedRendeles', '', 'eshWebCreateNew('+"'"+'EbedRendeles'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Eb&#233;d rendel&#233;s dokumentum', '');
	eshWebActionButtonSourceSliceCreate('openEbedRendelesIsmertetes', '', 'eshOpenWindow('+"'"+'/res2/ebedrendeles.pdf'+"'"+')', 'Elektronikus eb&#233;drendel&#233;s ismertet&#233;se', '');
	eshWebActionButtonSourceSliceCreate('createPenzforgalom', '', 'eshWebCreateNew('+"'"+'Penzforgalom'+"'"+')', '&#218;j P&#233;nzforgalom dokumentum', '');

	eshWebActionButtonSourceSliceCreate('createMinosegiJel', '', 'eshWebCreateNew('+"'"+'MinosegiJel'+"'"+')', '&#218;j Min&#337;s&#233;gjel', '');
	eshWebActionButtonSourceSliceCreate('createMinosegiJelGrafika', '', 'eshWebCreateNew('+"'"+'MinosegiJelGrafika'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Min&#337;s&#233;gjel Grafika', '');
	eshWebActionButtonSourceSliceCreate('createMinosegiJelPDF', '', 'eshWebCreateNew('+"'"+'MinosegiJelPDF'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Min&#337;s&#233;gjel PDF', '');

	eshWebActionButtonSourceSliceCreate('createMeasureTool', '', 'eshWebCreateNew('+"'"+'MeasureTool'+"'"+')', '&#218;j M&#233;r&#337;m&#369;szer dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createMeasureToolOrganizationalUnit', '', 'eshWebCreateNew('+"'"+'MeasureToolOrganizationalUnit'+"'"+')', '&#218;j M&#233;r&#337;m&#369;szer szervezeti egys&#233;g', '');

	eshWebActionButtonSourceSliceCreate('createTMI', '', 'eshWebCreateNew('+"'"+'TMI'+"'"+')', '&#218;j T&#369;zv&#233;delmi Megfelel&#337;s&#233;gi Igazol&#225;s dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createTMT', '', 'eshWebCreateNew('+"'"+'TMT'+"'"+')', '&#218;j T&#369;zv&#233;delmi Megfelel&#337;s&#233;gi Tan&#250;s&#237;tv&#225;ny dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createBauxit', '', 'eshWebCreateNew('+"'"+'Bauxit'+"'"+')', '&#218;j Bauxit &#201;p&#252;let dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createTermekTanusitas', '', 'eshWebCreateNew('+"'"+'TermekTanusitas'+"'"+')', '&#218;j term&#233;k Megfelel&#337;s&#233;gi Tan&#250;s&#237;tv&#225;ny', '');
	eshWebActionButtonSourceSliceCreate('createUzemTanusitas', '', 'eshWebCreateNew('+"'"+'UzemTanusitas'+"'"+')', '&#218;j &#220;zemi Gy&#225;rt&#225;sellen&#337;rz&#233;si Tan&#250;s&#237;tv&#225;ny', '');
	eshWebActionButtonSourceSliceCreate('createFelvono', '', 'eshWebCreateNew('+"'"+'Felvono'+"'"+')', '&#218;j Felvon&#243; dokumentum', '');

	eshWebActionButtonSourceSliceCreate('createATB', '', 'eshWebCreateNew('+"'"+'ATB'+"'"+')', '&#218;j Alkalmaz&#225;stechnikai Bizony&#237;tv&#225;ny dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createTVB', '', 'eshWebCreateNew('+"'"+'TVB'+"'"+')', '&#218;j T&#237;pusvizsg&#225;lati Bizony&#237;tv&#225;ny dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createTVJ', '', 'eshWebCreateNew('+"'"+'TVJ'+"'"+')', '&#218;j T&#237;pusvizsg&#225;lati Jegyz&#337;k&#337;nyv dokumentum', '');

	eshWebActionButtonSourceSliceCreate('createWorker', '', 'eshWebCreateNew('+"'"+'Worker'+"'"+')', '&#218;j Munkav&#225;llal&#243; dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createJobRoleDefinition', '', 'eshWebCreateNew('+"'"+'JobRoleDefinition'+"'"+')', '&#218;j Munkak&#246;r/Feladatk&#246;r defin&#237;ci&#243; dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createJobRoleAssigned', '', 'eshWebCreateNew('+"'"+'JobRoleAssigned'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Munkak&#246;r/Feladatk&#246;r hozz&#225;rendel&#233;s', '');
	eshWebActionButtonSourceSliceCreate('createLanguageKnowledge', '', 'eshWebCreateNew('+"'"+'LanguageKnowledge'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Nyelvismeret', '');
	eshWebActionButtonSourceSliceCreate('createQualification', '', 'eshWebCreateNew('+"'"+'Qualification'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Szakk&#233;pzetts&#233;g', '');
	eshWebActionButtonSourceSliceCreate('createSkill', '', 'eshWebCreateNew('+"'"+'Skill'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j K&#233;szs&#233;g', '');
	eshWebActionButtonSourceSliceCreate('createExperience', '', 'eshWebCreateNew('+"'"+'Experience'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Gyakorlat', '');

	eshWebActionButtonSourceSliceCreate('createCIBEvent', '', 'eshWebCreateNew('+"'"+'CIBEvent'+"'"+')', '&#218;j Esem&#233;ny', '');
	eshWebActionButtonSourceSliceCreate('createCIBFile', '', 'eshWebCreateNew('+"'"+'CIBFile'+"'"+')', '&#218;j Let&#246;lthet&#337; anyag', '');
	eshWebActionButtonSourceSliceCreate('createCIBAttachmentDescription', '', 'eshWebCreateNew('+"'"+'CIBAttachmentDescription'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Csatolt f&#225;jl le&#237;r&#225;ssal', '');

	eshWebActionButtonSourceSliceCreate('createMuszeng3', '', 'eshWebCreateNew('+"'"+'Muszeng3'+"'"+')', '&#218;j &#201;ME dokumentum', '');
	eshWebActionButtonSourceSliceCreate('createAVJ', '', 'eshWebCreateNew('+"'"+'AVJ'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j AVJ', '');
	eshWebActionButtonSourceSliceCreate('createRVJ', '', 'eshWebCreateNew('+"'"+'RVJ'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j RVJ', '');
	eshWebActionButtonSourceSliceCreate('createEgyebCsatolmany', '', 'eshWebCreateNew('+"'"+'EgyebCsatolmany'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Egy&#0233;b Csatolm&#0225;ny', '');

	eshWebActionButtonSourceSliceCreate('createSzakrendiListaAlapElem', '', 'eshWebCreateNew('+"'"+'SzakrendiListaAlapElem'+"'"+')', '&#218;j Szakrendi lista alapelem', '');
	eshWebActionButtonSourceSliceCreate('createSzakrendiListaElem', '', 'eshWebCreateNew('+"'"+'SzakrendiListaElem'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Szakrendi lista elem', '');
	/* already defined: eshWebActionButtonSourceSliceCreate('createPerson', '', 'eshWebCreateNew('+"'"+'Person'+"'"+')', '&#218;j Szem&#233;ly', ''); */
	eshWebActionButtonSourceSliceCreate('createOrganisation', '', 'eshWebCreateNew('+"'"+'Organisation'+"'"+')', '&#218;j Szervezet', '');
	eshWebActionButtonSourceSliceCreate('createTitulus', '', 'eshWebCreateNew('+"'"+'Titulus'+"'"+')', '&#218;j Titulus', '');
	eshWebActionButtonSourceSliceCreate('createUgyfelTorzsAdat', '', 'eshWebCreateNew('+"'"+'UgyfelTorzsAdat'+"'"+')', '&#218;j &#220;gyf&#233;l', '');


	eshWebActionButtonSourceSliceCreate('createETAG', '', 'eshWebCreateNew('+"'"+'ETAG'+"'"+')', '&#218;j ETAG', '');
	eshWebActionButtonSourceSliceCreate('createSzakvelemeny', '', 'eshWebCreateNew('+"'"+'Szakvelemeny'+"'"+')', '&#218;j Szakv&#0233;lem&#0233;ny', '');
	eshWebActionButtonSourceSliceCreate('createArajanlat', '', 'eshWebCreateNew('+"'"+'Arajanlat'+"'"+')', '&#218;j &#0193;raj&#0225;nlat', '');
	eshWebActionButtonSourceSliceCreate('createKozbeszerzes', '', 'eshWebCreateNew('+"'"+'Kozbeszerzes'+"'"+')', '&#218;j K&#0246;zbeszerz&#0233;s', '');
	eshWebActionButtonSourceSliceCreate('createPalyazat', '', 'eshWebCreateNew('+"'"+'Palyazat'+"'"+')', '&#218;j P&#0225;ly&#0225;zat', '');
	eshWebActionButtonSourceSliceCreate('createCsatolmany', '', 'eshWebCreateNew('+"'"+'Csatolmany'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j Csatolm&#0225;ny', '');

	eshWebActionButtonSourceSliceCreate('createKerdessor', '', 'eshWebCreateNew('+"'"+'Kerdessor'+"'"+')', '&#218;j K&#0233;rd&#0233;ssor', '');
	eshWebActionButtonSourceSliceCreate('createKerdes', '', 'eshWebCreateNew('+"'"+'Kerdes'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j K&#0233;rd&#0233;s', '');
	eshWebActionButtonSourceSliceCreate('createKerdoiv', '', 'eshWebCreateNew('+"'"+'createKerdoiv'+"'"+')', '&#218;j K&#0233;rd&#0337;&#0237;v', '');
	eshWebActionButtonSourceSliceCreate('createQuestionSet', '', 'eshWebCreateNew('+"'"+'QuestionSet'+"'"+')', '&#218;j K&#0233;rd&#0233;ssor', '');
	eshWebActionButtonSourceSliceCreate('createQuestion', '', 'eshWebCreateNew('+"'"+'Question'+"'"+','+"'&ParentUNID="+eshWebDocumentParentUNID+"'"+')', '&#218;j K&#0233;rd&#0233;s', '');
	eshWebActionButtonSourceSliceCreate('createSurvey', '', 'eshWebCreateNew('+"'"+'createSurvey'+"'"+')', '&#218;j K&#0233;rd&#0337;&#0237;v', '');

	eshWebActionButtonSourceSliceCreate('createRMA', '', 'eshWebCreateNew('+"'"+'RMA'+"'"+')', '&#218;j RMA', '');

	eshWebActionButtonSourceSliceCreate('createMinositettFelhasznalo', '', 'eshWebCreateNew('+"'"+'MinositettFelhasznalo'+"'"+')', '&#218;j Min&#0337;s&#0237;tett Felhaszn&#0225;l&#0243;', '');
	eshWebActionButtonSourceSliceCreate('createTema', '', 'eshWebCreateNew('+"'"+'Tema'+"'"+')', '&#218;j T&#0233;ma', '');

	eshWebActionButtonSourceSliceCreate('createEMV', '', 'eshWebCreateNew('+"'"+'EMV'+"'"+')', '&#218;j &#0201;MV', '');

	eshWebActionButtonSourceSliceCreate('login', '', 'location.search+='+"'"+'&Login'+"'"+';', 'Login', '');
	eshWebActionButtonSourceSliceCreate('reorderMenuItems', '', 'urlopen(eshWebDBPath+'+"'"+'ReorderSubMenuItems?OpenAgent&ParentUNID='+eshWebDocumentParentUNID+"'"+',0,'+"'"+'_blank'+"'"+','+"'"+''+"'"+',0,0,0,1,1,1,1,0,0,1000,650);', 'Reorder Menuitems', '');
	eshWebActionButtonSourceSliceCreate('export', '', 'actionExportExcelHTMAsXLS();this.blur();return false;', 'Export');
}



var eshWebNavButtonSourceSep='<img src="/img/icon_dotv4.gif" class="MenuIcon">';
var eshWebNavButtonSourceSlices=new Array; // this will contain all nav source codes
var eshWebNavButtonPossible='$';

function eshWebNavButtonSourceSliceCreate(sParam, sCommand, sImageSource, sPopup, sAnchor, sPrefix){
	eshWebNavButtonSourceSlices[sParam]=(typeof(sPrefix)=='undefined'?'':sPrefix)+'<a '+(typeof(sAnchor)=='undefined'?'':'name="'+sAnchor+'"')+'onClick="'+sCommand+';this.blur();return false;" href="" class="Menu"><img src="/img/'+sImageSource+'" alt="'+sPopup+'" class="MenuIcon"></a>';
	eshWebNavButtonPossible+=','+sParam
}

function eshWebNavButtonInit(){
	eshWebNavButtonSourceSliceCreate('ftsearch', 'navFTSearch()', 'navsearch.gif', 'Search this view with full text search', 'ftsearch', '<input class="ViewActionsSearch" name="Query" size="10" value="<query>" title="Tip: Use * wildcard at the end of the word!" onFocus="this.select();"> ');
	eshWebNavButtonSourceSliceCreate('advsearch', 'navAdvSearch()', 'navsearchadv.gif', 'Search this view with customized search form');
	eshWebNavButtonSourceSliceCreate('expand', 'navExpand()', 'navexpandall.gif', 'Expand entries');
	eshWebNavButtonSourceSliceCreate('collapse', 'navCollapse()', 'navcollapseall.gif', 'Collapse entries');
	eshWebNavButtonSourceSliceCreate('first', 'goFirst()', 'navfirst.gif', 'Jump to first entry');
	eshWebNavButtonSourceSliceCreate('back', 'goBack()', 'navback.gif', 'Step one page back');
	eshWebNavButtonSourceSliceCreate('all', 'goAll()', 'navall.gif', 'Show all entries');
	eshWebNavButtonSourceSliceCreate('forward', 'goForward()', 'navforward.gif', 'Step one page forward');
	eshWebNavButtonSourceSliceCreate('last', 'goLast()', 'navlast.gif', 'Jump to last entry');
	eshWebNavButtonSourceSliceCreate('refresh', 'location.href=location.href', 'navrefresh.gif', 'Refresh this page');
	eshWebNavButtonSourceSliceCreate('print', 'window.print()', 'navprint.gif', 'Print this page');
}

function eshURLParamsToSource(sParamsPermitted, sParamsPossible, sParamSep, sSourceSlices, sSourceSep){
	if (sParamsPermitted==''){ return sSourceSlices.join(sSourceSep); }
	if (sParamsPermitted.indexOf('none')!=-1) { return ''; }
	
	var aParams=sParamsPermitted.split(sParamSep);
	var aParamsPossible=sParamsPossible.split(sParamSep);
	var aSource=new Array;
	var iSourceCount=0;
	if (sParamsPermitted.indexOf('full')!=-1){
		for (var i=1; i<aParamsPossible.length; i++){ if (sParamsPermitted.indexOf(aParamsPossible[i]+'=0')==-1) { aSource[iSourceCount++]=sSourceSlices[aParamsPossible[i]]; } }
	} else {
		for (var i=1; i<aParamsPossible.length; i++){ if (sParamsPermitted.indexOf(aParamsPossible[i]+'=1')!=-1) { aSource[iSourceCount++]=sSourceSlices[aParamsPossible[i]]; } }
	}
	return aSource.join(sSourceSep);
}

function eshWebCreateNew(sForm, sParentUNID){ eshOpenWindow(sForm+'?OpenForm'+((typeof(sParentUNID)!='undefined')?('&ParentUNID='+sParentUNID):(''))); }
function eshOpenWindow(sLink){ urlopen(sLink,0,'_blank','',0,0,0,1,1,1,1,0,0,1000,650); }

var oESHTabControlActiveTabs;
var oContentTable;
Event.observe(window, 'load', function() {
	oESHTabControlActiveTabs = $('ESHTabControlActiveTabs');
	if (oESHTabControlActiveTabs!=null) { ESHTabControlInit(); }	// forms
	// eshWebActionButtonInit();	// forms/views
	// eshWebNavButtonInit();		// forms/views

	oContentTable = $('ContentTable');
	if (oContentTable!=null) {
		if (dpIsView) { init();	}	// views

		oContentTable.observe('click', function(event) {
			o = Event.element(event);
			if ((o.tagName=="A") && (o.href.indexOf('?OpenDocument')!=-1)) {
				if (eshWebPickList=='0') { urlopen(o.href,0,'_blank','',0,0,0,1,1,1,1,0,0,1000,650); } else { try {window.parent.addSelected(o);} catch(e) {} }
				o.blur();
				Event.stop(event);
			}
		});
	}
});
