
function updateList(updateSEID, markerSEID) {
   WC();
	var url=iViewURL+'?Base=invoke/TECTON.ui&xml=xmlList';
	if(updateSEID != null)
		url +='&updateSEID='+updateSEID;

	if(markerSEID != null)
		url +='&markerSEID='+markerSEID;
		
	//if(confirm(url))
		document.location.href = loadListURL( url );
}


function deleteList() {
	if(confirm(msgDeletePlanning))	{
		WC();
		document.location.href = loadListURL( iViewURL+'?Base=invoke/TECTON.ui&xml=xmlList&action=delete' );
	}
}

function newList() {
	if(confirm(msgNewPlanning))	{
		WC();
		document.location.href = loadListURL( iViewURL+'?Base=invoke/TECTON.ui&xml=xmlList&action=delete' );
	}
}

function showPageItem(elem) {
	if(elem) {
		var SEID=elem.getAttribute('name');
		showPageItemById(SEID);
	}	
}


function showPageItemById(SEID) {
	var iCli=event_send('tectonUpdatePage', SEID);
	if(iCli==0)
		if(event_debug) alert('tectonUpdatePage - failed');
}


function initPage() {
	// alert('initList');
    event_subscribe('tectonUpdateList', updateList);
    if(bUpdatePage)
		  showPageItemById(null);
    
}


function exitPage() {
    event_unsubscribe('tectonUpdateList', updateList);
}

function loadListURL( url ){
	try {
		if( eCATNew && eCATNew == 'true' ){
			if( url.indexOf('?') == -1 ) url += '?eCATNew=' + eCATNew;
			else url += '&eCATNew=' + eCATNew;
		}
	} catch(e){}
	
	return url;
}
