
/*
M3 Source: For internal use only.

Author: Stephen W. Cote
Email: wranlon@hotmail.com

Copyright 2002, All Rights Reserved.
Do not copy, archive, or distribute without prior written consent of the author.

This composite contains the source for all M3 files.

Composite Template
     package.js
     org.cote.js.js
     org.cote.js.dom.event.js
     org.cote.js.dom.browser.js
     org.cote.js.xml.js
     org.cote.js.message.js
     org.cote.js.task.js
     org.cote.js.util.driver.js
     org.cote.js.util.config.js
     org.cote.js.dom.css.js
     org.cote.js.object.js
     org.cote.js.ui.object.js
     org.cote.js.ui.object.resultset.js
     org.cote.js.ui.object.menu.js
     org.cote.js.ui.object.container.js
     initialization.js
*/




var _js_packages=[],_js_packages_index=[];
function _js_package(c){
	var a,i=0,s,w=window,o,l;
	o = w;
	if(typeof c=="string"){
		if(!_js_packages_index[c]){
			l = _js_packages.length;
			_js_packages_index[c]=l;
			_js_packages[l]=c;
		}
		a = c.split(".");
		for(;i<a.length;){
			s=a[i++];
			if(typeof o[s]!="object") o[s]={};
			o = o[s];
		}
	}
}
function _js_validate_package(c){
	var a,i=0,s,w=window,o,l;
	o = w;
	if(typeof c=="string"){
		a = c.split(".");
		l = a.length;
		if(l==0) return false;
		for(;i<l;){
			s=a[i++];
			if(typeof o[s]!="object") return false;
			o = o[s];
		}
	}
	else{
		return false;
	}
	return true;
}



_js_package("org.cote.js");
org.cote.js={
	class_imports:{},
	_guid_counter:0
};
org.cote.js._get_gunid=function(){
	var d=new Date(),t,i=4,r,l,x=0;
	t=new String(d.getTime());
	r=new String(parseInt(Math.random() * (1000 * i)));
	l=r.length;
	for(;x <i - l;x++) r="0" + r;
	return ( "swc-" + (++org.cote.js._guid_counter) + "-" + t + "-" + r);
}

org.cote.js._application_scope={
	_objects:[],
	_objects_index:[],
	add_object:
function(o){
		var t = this,i=o.object_id,m;
		
		if(typeof t._objects_index[i] != "object"){
			m = t._objects.length;
			t._objects[m]=o;
			t._objects_index[i]=m;
			return true;
		}
		return false;
	},

	
	remove_object:
function(o){
		var t = this,i=o.object_id,m;
		
		if(typeof t._objects_index[i] == "number"){
			m = t._objects_index[i];
			t._objects[m]=null;
			t._objects_index[i]=null;
			return true;
		}
		return false;
	},
	get_object:
function(i){
		var t = this;
		
		if(typeof t._objects_index[i] == "number"){
			return t._objects[t._objects_index[i]];
		}
		return null;
	},
	object_exists:
function(i){
		var t = this;
		
		if(typeof t._objects_index[i] == "number"){
			return true;
		}
		return false;
	},
	_send_sigterm:
function(){
		var t = this,o,i;
		for(i=0;i<t._objects.length;i++){
			o = t._objects[i];
			if(o!=null && o.ready_state == 4 && typeof o.sigterm == "function"){
				o.sigterm();
			}
		}
	}
};

org.cote.js._implements=function(o,s){
	var _js = org.cote.js,v,a=arguments,i;
	
	
	var n_a = [];
	for(i=1;i<a.length;i++)
		n_a[n_a.length] = a[i];
	
	
	v = _js._forName.apply(this.caller,n_a);
	
	if(
		typeof o == "object"
		&&
		typeof v == "object"
	){
		for(i in v)
			o[i]=v[i];
		
	}
};
org.cote.js._forName=function(s){
	var _js=org.cote.js,v,a=arguments;
	if(typeof _js.class_imports[s]=="string"){
		eval("v=" + _js.class_imports[s]);
		return v;
	}
	switch(s){
		case "bootstrap_object":
		case "task_object":
			return {
				state:0,
				handled:0,
				name:a[1],
				type:a[2],
				src:a[3],
				handler:a[4],
				handler_type:a[5],
				id:a[6],
				index:a[7],
				data:0,
				depends:[],
				executed:0,
				busy:0
			};
			break;
		case "base_object":
			return{
				object_id:org.cote.js._get_gunid(),
				object_type:a[1],
				object_version:a[2],
				ready_state:0
			};
			break;
		case "basic_message":
			return {
				entry:a[1],
				index:-1,
				data:a[2],
				time:new Date(),
				id:_js._get_gunid()
			};
			break;
		case "basic_message_subscription":
			return {
				object:a[1],
				subscription_name:a[2],
				handler:a[3],
				target:a[4]
			};
			break;
		case "generic_object":
			return {
				parent_object:0,
				child_objects:[],
				child_objects_index:{},
				ready_state:0,
				top_object:0,
				layout_manager:0,
				style_manager:0,
				object_debug:
function(){
					alert(this.object_id);
				},
				object_config:{
					pointers:{},
					style_names:{},
					event_handlers:[],
					internal_event_listeners:[],
					dom_event_listeners:[]
				}
			};
			
			break;
		default:
			alert("skip: " + s);
			break;
	}
	return null;
}
org.cote.js._implements(org.cote.js._application_scope,"base_object","application_scope","0.1");
org.cote.js._application_scope.add_object(org.cote.js._application_scope);
		
		
			


_js_package("org.cote.js.dom");
org.cote.js.dom.event={
	_gevt:
function(o){
		return (typeof event=="object")?event:o;
	},
	_gevt_cancel:
function(o){
		(typeof o.preventDefault!="function")?(o.returnValue=false):o.preventDefault();
	},
	_gevt_dest:
function(e){
		return (e.relatedTarget)?e.relatedTarget:e.toElement;	
	},
	_gevt_org:
function(e){
		return (e.relatedTarget)?e.relatedTarget:e.fromElement;	
	},
	_gevt_src:
function(o){
		var s=org.cote.js.dom.event._gevt(o);
		if(o==null){
			org.cote.js.message.MessageService.sendMessage("Bad event reference","515.3",1);
			return o;
		}
		return (o.target)?o.target:o.srcElement;
	},

	_add_event_buffer:
function(o){
		var e = "_create_handler";
	
		try{
			o[e]=function(s,r,x,l){
				var b = (typeof r=="object" && r!=null?1:0),t=this,e,h,f;
				r = (b)?r:t;
				e = "_prehandle_" + s;
				
				
				b = (l?1:0);
				h = 
					"f=function(){\n"
					+ "try{\n"
					+ "var o="+ (b?'org.cote.js._application_scope.get_object(\"' + r.object_id + '\")':"this") + ";\n"
					+ "if(typeof o!=\"object\")return;\no._handle_" + s + ".apply(o,arguments);"
					+ "}\ncatch(e){ alert(t.object_id + \"::\" + s + \"::\" + (e.description?e.description:e.message));}\n"
					+ "}"
				;
				eval(h);
				if(!x) t[e] = f;
				return f;
			};
		}
		catch(e){
			alert("Error: " + e.description);
		}
	},
	disableMotionCapture:
function(o){
		var c = org.cote.js.dom.browser.client;
		switch(c.bswitch){
			case 1:
				o.releaseCapture();
				break;
			case 2:
				document.removeEventListener("mousemove",o.onmousemove,true);
				document.removeEventListener("mouseup",o.onmouseup,true);	
				break;
		}
	},
	enableMotionCapture:
function(o){
		var c = org.cote.js.dom.browser.client;
		switch(c.bswitch){
			case 1:
				o.setCapture();
				break;
			case 2:
				document.addEventListener("mousemove",o.onmousemove,true);
				document.addEventListener("mouseup",o.onmouseup,true);
				break;
		}
	},
	addEventListener:
function(o,e,f,t){
		
		var c = org.cote.js.dom.browser.client;
		switch(c.bswitch){
			case 1:
				o.attachEvent("on" + e,f);
				break;
			case 2:
				o.addEventListener(e,f,t);
				break;		
		}
	}
}



_js_package("org.cote.js.dom");
org.cote.js.dom.browser={
	_client_impl:
function(){
		var t=this;
		t.ver=0;
		t.type=0;
		t.bswitch=0;
		if(navigator.appName.match(/microsoft internet explorer/i)){
			t.type="ie";
			if(navigator.appVersion.match(/MSIE\s?([\d\.]*)/)){
				t.ver=parseFloat(navigator.appVersion.match(/MSIE\s?([\d\.]*)/)[1]);
			}
		}
		else if(navigator.appName.match(/netscape/i)){
			t.ver=parseFloat(navigator.appVersion);
			t.type="nav";
		}
		if(t.ver >= 5 && (t.type=="ie" || t.type=="nav")){
			if(t.type=="ie") t.bswitch=1;
			if(t.type=="nav") t.bswitch=2;
		}
	}
}
org.cote.js.dom.browser.client=new org.cote.js.dom.browser._client_impl();
			


_js_package("org.cote.js.xml");
org.cote.js.xml={
	_xml_request:null,
	_xml_request_id:null,
	_xml_requests:[],
	_xml_requests_map:[],
	serialize:
function(n){
		var v;
		if(typeof XMLSerializer=="function"){
			return (new XMLSerializer()).serializeToString(n);
		}
		else if(typeof n.xml == "string"){
			return n.xml;
		}
	},
	getCDATAValue:
function(n){
		var c,d="",i=0,e;
		c = n.childNodes;
		for(;i<c.length;i++){
			e=c[i];
			if(e.nodeName=="#cdata-section") d+=e.nodeValue;
		}
		return d;
	},
	queryNodes:
function(x,p,n,a,v){
		return org.cote.js.xml._queryNode(x,p,n,a,v,1);
	},
	queryNode:
function(x,p,n,a,v){
		return org.cote.js.xml._queryNode(x,p,n,a,v,0);
	},
	_queryNode:
function(x,p,n,a,v,z){
		
		var i=0,b,e,c,r=[];
		if(!z) r = null;
		
		c = x.getElementsByTagName(p);
		
		if(typeof n=="string"){
			if(!c.length){
				if(!z) return null;
				else return r;
			}
			c = c[0]; 
			e = c.getElementsByTagName(n);
		}
		else e = c;
		
		for(;i<e.length;i++){
			b = e[i];
			if((!a && !v) || (b.getAttribute(a) == v)){
				
				if(!z){
					r = b;
					break;
				}
				else r[r.length]=b;
				
			}
		}
		return r;
	},
	_handle_xml_request_load:
function(xml_id){
		var _x=org.cote.js.xml,o,v;
		if(typeof _x._xml_requests_map[xml_id] == "number"){
			o = _x._xml_requests[_x._xml_requests_map[xml_id]];
			
			v = {"xdom":null,"id":xml_id};
			if(o.obj != null && o.obj.responseXML != null){
				v.xdom = o.obj.responseXML;
			}
			o.completed = 1;
			org.cote.js.message.MessageService.publish("onloadxml",v);
			if(typeof o.handler=="function") o.handler("onloadxml",v);
		}	
	},
	_handle_xml_request_readystatechange:
function(xml_id){
		var _x=org.cote.js.xml,o;
		if(typeof _x._xml_requests_map[xml_id] == "number"){
			o = _x._xml_requests[_x._xml_requests_map[xml_id]];
			if(typeof o.obj == "object" && o.obj.readyState == 4){
				_x._handle_xml_request_load(xml_id);
			}
		}
	},
	
	getXml:
function(p,h,a,i){
	
		return org.cote.js.xml._request_xmlhttp(p,h,a,i,0,null);
	},
	
	_request_xmlhttp:
function(p,h,a,i,x,d){
		
		
		var _x=org.cote.js.xml,f,o=null,v,_m=org.cote.js.message.MessageService,y,z;
		if(typeof x=="undefined") x = 0;
		if(typeof d=="undefined") d = null;
		z = (x?"POST":"GET");
		if(typeof i!="string") i=org.cote.js._get_gunid();
		y = _x._xml_requests.length;
		_x._xml_requests[y] = {url:p,id:i,obj:null,handler:h,method:(x?1:0),completed:0};
		_x._xml_requests_map[i]=y;
		
		if(typeof XMLHttpRequest=="function"){
			o = _x._xml_requests[y].obj = new XMLHttpRequest();
			var m,e=new RegExp("^/");
			if(!p.match(e)){
				m=location.pathname;
				m=m.substring(0,m.lastIndexOf("/")+1);
				p=m + p;
			}
			p=location.protocol + "//" + location.host + p;
			_x._xml_requests[y].url = p;
			if(a){
				f = function(){org.cote.js.xml._handle_xml_request_load(i);};
				o.addEventListener("load",f,false);
			}
		}
		else{
			try{
				o = _x._xml_requests[y].obj = new ActiveXObject("Microsoft.XMLHTTP");
				if(a){
					f = function(){org.cote.js.xml._handle_xml_request_readystatechange(i);};
					o.onreadystatechange=f;
				}
			}
			catch(e){
				_m.sendMessage("XMLError: " + (e.description?e.description:e.message),"512.4",1);
			}
		}
		var foo = (a?true:false);
		o.open(z,p,foo);
		o.send(d);
		if(!a)
			return _x._xml_requests[y].obj.responseXML;
		
		return 1;
	},
	getInnerText:
function(s){
		var r = "",a,i,e;
		if(typeof s == "string") return s;
		if(typeof s=='object' && s.nodeType==3) return s.nodeValue;
		if(s.hasChildNodes()){
			a = s.childNodes;
			for(i=0;i<a.length;i++){
				e = a[i];
				if(e.nodeType==3) r+=e.nodeValue;
				if(e.nodeType==1 && e.hasChildNodes()){
					r+=this.getInnerText(e);
				}
			}
		}
		return r;
	},
	setInnerXHTML:
function(t,s,p){
		
		var i,y,e,a,l,x,n,v;
		if(!p){
			for(i=t.childNodes.length-1;i>=0;i--){
				t.removeChild(t.childNodes[i]);
			}
		}
		y=(s && typeof s=='object')?s.nodeType :(typeof s=="string")?33:-1;
		switch(y){
			case 1:
				e=document.createElement(s.nodeName);
				a=s.attributes;
				l=a.length;
				for(x=0;x<l;x++){
					n=a[x].nodeName;
					v=a[x].nodeValue;
					if(n=="style"){
						e.style.cssText=v;
					}
					else if(n=="id"){
						e.id=v;
					}
					else if(n=="class" && org.cote.js.dom.browser.client.bswitch==1){
						e.className=v;
					}
					else if(n.match(/^on/i)){
						eval("e." + n + "=function(){" + v  +"}");
					}
					else{
						e.setAttribute(n,v);
					}
				}
	
				if(s.hasChildNodes()){
					a=s.childNodes;
					l=a.length;
					for(x=0;x<l;x++){
						this.setInnerXHTML(e,a[x],1);
					}
				}
				t.appendChild(e);
				break;
			case 3:
				e=s.nodeValue;
				if(e){
					e=e.replace(/^\s*/,"");
					e=e.replace(/\s*$/,"");
					e=e.replace(/\s+/g," ");
					t.appendChild(document.createTextNode(e));
				}
				break;
			case 8:
				
				break;
			case 33:
				e=s;
				if(e){
					e=e.replace(/^\s*/,"");
					e=e.replace(/\s*$/,"");
					e=e.replace(/\s+/g," ");
					t.appendChild(document.createTextNode(e));
				}
				break;
			default:
		}
	}
};


_js_package("org.cote.js.message");


org.cote.js.message={
	MessageService:null,
	MessageServiceImpl:
function(){
		
		var t=this;
		t.object_config={
			pointers:{
				subscriptions:[],
				delayed_deliveries:[],
				entries:[],
				local_definitions:[]
			},
			status:{
				delivery_delay:50,
				maximum_entries:200,
				report_threshold:1
			},
			data:{
				message_levels:["ALL","DEBUG","ADVISORY","NORMAL","WARNING","ERROR","FATAL","NONE"],
				message_levels_map:{ALL:0,DEBUG:1,ADVISORY:2,NORMAL:3,WARNING:4,ERROR:5,FATAL:6,NONE:7},
				entry_definitions:[
					["Generic Error","An error occured.",100],
					["Status","[specify status message]",200],
					["Status","Created new instance.",201],
					["Status","Initialized.",202],
					["Status","Updated status.",203],
					["Operation Successful","The operation was successfully completed.",210],
					["Configuration Successful","An application component was successfully configured.",211],
					["Network Operation Successful","The network operation was successfully completed.",280],
					["Partial Operation Successful","A partial operation was successfully completed.",290],
					["Redirection","Operation was redirected to another process.",300],
					["Data Source Not Found","The specified data source was not found.",400],
					["File Not Found","The specified file source was not found.",410],		
					["Application Error","An application error occured.",500],
					["Application Configuration Error","An application error occured due to a missing or an incorrect configuration.",510],
					["Application Configuration Error","Invalid argument.",511],
					["Application Configuration Error","Object reference does not exist.",512],
					["Application Event Error","An error occured processing the event.",515],
					["Application Event Halted","An event handler was halted, probably because a UI element was mistakenly exposed.",516],
					["Late Callback Error","Late Callbacks are an internal event handling system.  Since only one late callback may be assigned per object, this error probably originated from multiple late callbacks being assigned at the same time.",517],
					["Custom Application Event Error","An error occured while processing an internal(custom) event.",518],
					["Internal Application Error","An internal application error occured, probably due to incomplete code.",520],
					["Internal Routine Halted","An internal routine was halted, probably because it would have caused an out-of-bounds exception, or it was going to exceed a pre-configured limit.",530],
					["Invalid Data Type","An unexpected data type was referenced.",540],
					["External Application Error","An external error occured with a referenced application.",550],
					["Network Connection Error","An error occured while connecting to the network.",600],
					["Network Configuration Error","An error occured while attempting to bind to a socket.",601],	
					["Network Disconnect Error","An error occured while disconnecting from the network.",610],
					["Network Timeout Error","An error occured because there was no network response (timed out).",620],
					["Network Transfer Error","An error occured while transferring data on the network.",650],
					["Network Transfer Error","An error occured while writing data to a socket.",651],
					["Network Transfer Error","An error occured while reading data from a socket.",652],
					["Syntax Error","The specified value is either not acceptible or not recognized.",700],
					["Input Required","You may not continue without specifying more information.",710]
				]
			}
		};

		t.setDeliveryDelay=function(i){
			if(typeof i == "number" && i >= 0){
				this.object_config.status.delivery_delay = i;
			}
		};
		t.subscribe=function(o,e,f,v){
			var c;
			c=t.object_config;
			
			if(arguments.length==4){
				if(!o) o=window;
				if(!v) v=null;
			}
			if(arguments.length==2){
				
				var t1=arguments[0],t2=arguments[1];
				o=window;
				e=t1;
				f=t2;
			}
	
			c.pointers.subscriptions[c.pointers.subscriptions.length]=org.cote.js._forName("basic_message_subscription",o,e,f,v);
		};
		t.unsubscribe=function(o,e,f){
			
			var t=this,a=[],l,i=0,z,c;
			c = t.object_config;
			
			if(arguments.length==2){
				var t1=arguments[0],t2=arguments[1];
				o=window;
				e=t1;
				f=t2;
			}
	
			l=c.pointers.subscriptions.length;
			for(;i<l;i++){
				z = c.pointers.subscriptions[i];
				if(
					z.object != o
					|| z.event_name != e
					|| z.function_pointer != f
				){
					a[a.length]=z;
				}
			}
			c.pointers.subscriptions=a;
		};
		
		t.sigterm=function(){
			var t=this,c;
			c = t.object_config;
			t.ready_state = 5;
			c.status.delivery_delay=0;
			c.pointers.delayed_deliveries=[];
		};
		t._delayPublish=function(e,i){
			var t=this,d,c;
			c = t.object_config;
			if(t.ready_state != 4) return;
			if(typeof i == "string"){
				d = c.pointers.delayed_deliveries[i];
				t._publish(e,d);
				c.pointers.delayed_deliveries[i] = null;
			}
		};
		t.publish=function(e,o){
			var t=this,c,x,d;
			c = t.object_config;
			
			if(c.status.delivery_delay){
				d = c.pointers.delayed_deliveries;
				x = org.cote.js._get_gunid();
				d[x] = o;
				setTimeout("org.cote.js._application_scope.get_object('" + t.object_id + "')._delayPublish('" + e + "','" + x + "')",c.status.delivery_delay);
			}
			else{
				t._publish(e,o);
			}
		};
		t._publish=function(e,o){
			var t=this,c,j,l,i=0,z,x,d;
			c = t.object_config;
			l=c.pointers.subscriptions.length;
			for(;i<l;i++){
				z=c.pointers.subscriptions[i];
				if(
					z.subscription_name==e
					&& (!z.target || z.target==o)
				){
					try{
						if(typeof z.handler == "string")
							z.object[z.handler](e,o);
						
						if(typeof z.handler == "function")
							z.handler(e,o);
					}
					catch(e){
						alert("Publish Error: " + e.message + "\n" + z.subscription_name + "\n" + z.handler );
					}
				}
			}
		};
		
		t.setReportThreshold=function(i){
			var c=t.object_config;
			if(typeof i == "number") i = c.data.message_levels[i];
			if(typeof c.data.message_levels_map[i] == "number"){
				c.status.report_threshold = c.data.message_levels_map[i];
			}
		};
		t.sendMessage=function(d,s,p){
			
			
			var o=null,v,c,t=this,ms;
			c=t.object_config;
			if(typeof s != "string") s = "200";
			v = t.parseMessageInstruction(s);
			if(v.threshold < c.status.report_threshold){
				return o;
			}
			if(typeof p != "number") p = 0;
		
			if(p) o=t._raiseBasicMessage(s,d,v);
			else o=t._createBasicMessage(s,d,v);
			ms = t.parseMessage(o);
			if(ms==null) ms = "[message error]";
			t.publish("onsendmessage",{message:ms,level:v.threshold,description:o.description});

			return o;
		};
		t._raiseBasicMessage=function(s,d,v){
			var t=this,o;
			
			o=t._createBasicMessage(s,d,v);
			
			alert(t.parseMessage(o));
			return o;
		};
		t._createBasicMessage=function(s,d,v){
			var o=org.cote.js._forName("basic_message",v,d),i,c,t=this;
			c = t.object_config;
			i = c.pointers.entries.length;
			
			if(i >= c.status.maximum_entries && c.status.maximum_entries > 0){
				c.pointers.entries.shift();
				i--;
			}
			
			o.index=i;
			c.pointers.entries[i]=o;
			return o;
		};
		
		t.parseMessage=function(o){
			var v = "[error]",a,l,d,c,t=this;
			c = t.object_config;
			if(typeof o=="object"){
				a=t._getMessageDefinition(o);
				d = o.time;
				
				var minutes = new String(d.getMinutes()),
					seconds = new String(d.getSeconds()),
					mseconds = new String(d.getMilliseconds())
				;
				if(seconds.length == 1) seconds="0" + seconds;
				if(minutes.length == 1) minutes = "0" + minutes;
				if(mseconds.length == 1) mseconds = "0" + mseconds;
				if(mseconds.length == 2) mseconds = "0" + mseconds;
				
				v =	d.getHours() + ":" + minutes + ":" + seconds + ":" + mseconds + "::";
				v+=t._getMessageStatusCode(o.entry.threshold) + ": ";

				v+=(a!=null?a[0]:"Default Message");
				v+=" (" + o.entry.message + ").";
				o.description = (a!=null?a[1]:""); 
				if(o.data){
					v+=" " + o.data;
				}
				else{
					v+=" " + o.description;
				}
			}
			
			return v;
		};
		t._getMessageStatusCode=function(i){
			return this.object_config.data.message_levels[i];
		};
	
		t._getMessageDefinition=function(o){
			var v=null,f=100,l,m,n,i=0,a,d,c,t=this;
			c = t.object_config;
			
			if(typeof o=="object"){
				l=c.data.entry_definitions.length;
				m=o.entry.major_code;
		
				n=o.entry.minor_code;
				for(;i<l;i++){
					a=c.data.entry_definitions[i];
					if(a.length>=2){
						d=a[2];
						if(m >= d && m < (d + f))
							v=a;
						
						if(v != null && m > (d + f)) break;
					}
				}
			}	
			return v;
		};
		t.parseMessageInstruction=function(s){
			var a=[],c,i=100,o,m=0,n,x=900,d,p,y;
			o=i;
			if(s) a=s.split(".");
			
			
			c=(a[0])?parseInt(a[0]):200;
		
			for(y=i;y<=x;y+=100){
				if(c >= i && c < (y + i))
					m=i;
				
				if(m > 0 && m <= (y+100)) break;
			}
		
			if(m < 0 || m > 900 || c < 0 || c > 900){
				m=200;
				c=200;
			}
		
			n=c - m;
			d=(a[1])?parseInt(a[1]):3;
			if(d > 7 || d < 0)d=3;
			l=(a[2])?parseInt(a[2]):0;
			p=(a[3])?parseInt(a[3]):0;
			return {
				"major_code":c,
				"major_base":m,
				"minor_code":n,
				"threshold":d,
				"location":l,
				"id":p,
				"description":"",
				"message":c + "." + d + "." + l + "." + p
			};
		};
		org.cote.js._implements(t,"base_object","message_service","0.1a");
		org.cote.js._application_scope.add_object(t);
				
		t.ready_state = 4;
	}
}
org.cote.js.message.MessageService=new org.cote.js.message.MessageServiceImpl();

_js_package("org.cote.js.task");
org.cote.js.task={
	TaskService:null,
	TaskServiceImpl:
function(){
		var t=this,_j=org.cote.js,_x=org.cote.js.xml,_m=org.cote.js.message.MessageService;
		org.cote.js._implements(t,"base_object","task_service","0.1a");
		t.object_config={
			pointers:{
				tasks:[],
				taskindex:[],
				tasknames:[]
			},
			status:{
				config_name:0,
				config_loaded:0,
				window_loaded:0
			}
		};
		
		t.sigterm=function(){
			var t=this,c;
			c = t.object_config;
			t.ready_state = 5;
		};
		t._handle_window_destroy=function(s,v){
			var t=this,c;
			c = t.object_config;
			t.sigterm();
			c.pointers.tasks=[];
			c.pointers.taskindex=[];
			c.pointers.tasknames=[];
		};
		
		t.processTasks=function(){
			var a,i,b;
			a = t.object_config.pointers.tasks;
			for(i=0;i<a.length;i++){
				b = a[i];
				if(b.state==4) continue;
				if(!b.state && !b.busy){
					t.handle_task(b,1);
				}
				else if(b.state==3 && !b.depends.length){
					b.state = 4;
					t._update_task_depends(b.name);
					_m.publish("_internal_task_event",{id:b.id,task:b});
				}
			}
		};
		t.addTaskDependency=function(b,i){
			if(typeof i == "object") i = i.id;
			
			b.depends[b.depends.length]=i;
			
			if(
				t.object_config.status.window_loaded
				&&
				i == "_dom_event_window_load"
			){
				t.returnDependency("_dom_event_window_load",1);
			}
		
		};
		t.getTaskDepends=function(b){
			var h,m,r=[];
			if(!b.depends.length) return r;
			for(h=0;h<b.depends.length;h++)
				r[h]=b.depends[h];
			return r;
		};

		t._update_task_depends=function(s){
			var a,b,i,h,m;
			a = t.object_config.pointers.tasks;
			for(i=0;i<a.length;i++){
				b = a[i];
				if(b.state == 4 || !b.depends.length){
					continue;
				}
				m = 0;
				for(h=0;h<b.depends.length;h++){
					if(b.depends[h] == s){
						b.depends[h] = 0;
					}
					else if(b.depends[h] != 0){
						m = 1;
					}
				}
				if(!m){
					b.depends = [];
				}
			}
			
			t.processTasks();
		};
		t.execTaskLoader=function(n,p,s,h,ht){
			t.object_config.status.config_name = n;
			return t.execTask(n,p,s,h,ht);
		};
		t.execTask=function(n,p,s,h,ht){
			var b=n;
			if(typeof n=="string") b=t.addTask(n,p,s,h,ht);
			if(b.state) return 0;
			t.handle_task(b);
			return b;
		};
		t.addTask=function(n,p,s,h,ht){
			
			var v,i=_j._get_gunid(),l,c;
			c=t.object_config;
			if(typeof c.pointers.tasknames[n]=="number"){
				alert('bad: duplicate task; this is an event problem');
				return;
			}
			l=c.pointers.tasks.length;
			if(typeof h!="string" && typeof h!="function") h = 0;
			if(!h) ht=0;
			v = _j._forName("task_object",n,p,s,h,ht,i,l);
			c.pointers.tasks[l]=v;
			c.pointers.tasknames[n]=l;
			c.pointers.taskindex[i]=l;
			return v;
		};
		t.getTaskByName=function(s){
			var c=t.object_config.pointers;
			if(typeof c.tasknames[s]=="number") return c.tasks[c.tasknames[s]];
			return 0;
		};
		t.getTaskById=function(i){
			var c=t.object_config.pointers;
			if(typeof c.taskindex[i]=="number") return c.tasks[c.taskindex[i]];
			return 0;
		};
		t.returnDependency=function(s,r){
			if(typeof s=="object") s = s.id;
			
			t._update_task_depends(s);
		};
		t._handle_task_event=function(s,v){
			var c = t.object_config,b,d;
			if(typeof v.id != "string") return 0;

			b = (v.task?v.task:t.getTaskById(v.id));
			d = (b.name == c.status.config_name?b:t.getTaskByName(c.status.config_name));
			if(!b.state){
				return t.handle_task(b);
			}
			else{
				
				if(
					b.state==4
					&&
					!b.handled
				){
					b.handled=1;
					if(b.handler && b.handler_type){
						switch(b.handler_type){
							case "function":
								if(typeof b.handler == "function")
									b.handler("ontaskcomplete",b);
								else if(typeof b.handler == "string" && typeof window[b.handler]=="function")
									window[b.handler]("ontaskcomplete",b);
								break;
							case "procedure":
								t.executeProcedure(d,b.handler);
								break;
							case "event":
								_m.publish(b.handler,this);
								break;
							default:
								alert("not handled: " + b.handler_type);
								break;
							
						}
					}
					_m.publish("ontaskcomplete",{name:b.name,id:b.id});
				}
			}
		};
		t.importTask=function(d,p,n,b){
			
			var e=n,z,g,h,f,ht;
			if(typeof n=="object"){
				e = n.getAttribute("rid");
			}
			z = _x.queryNode(d.obj,"tasks","task","id",e);
			if(z!=null){
				g = z.getAttribute("type");
				h = z.getAttribute("handler");
				ht = z.getAttribute("htype");
				f = z.getAttribute("src");
				if(typeof p=="object") p.depends[p.depends.length]=e;
				if(b) t.execTask(e,g,f,h,ht);
				else t.addTask(e,g,f,h,ht);
			}
		};
		t.handle_task=function(b,s){
			var r,z,y,a,n,m,i,d = (b.name == t.object_config.status.config_name?b:t.getTaskByName(t.object_config.status.config_name));
			

			
			if(typeof s=="undefined") s = 0;

			
			if(!b.executed){
				b.executed=1;
				switch(b.type){
					case "function":
						if(b.src=="static" && typeof t[b.handler]=="function"){
							try{
								eval(t[b.handler]());
							}
							catch(x){
								alert("Evaluate Task Node Error: " + x);
							}
						}
	
						break;
					case "xml":
						
						b.busy=1;
						_x.getXml(b.src,t._handle_load_xml,1,b.id);
						return;
						break;
					default:
						break;
				}
			}
			if(
				b.state
				||
				(
					t.object_config.status.config_name
					&&
					(!d || !t.object_config.status.config_loaded)
				)
			) return 0;
			b.state = 1;
			
			if(d && typeof d.obj=="object"){
				m = _x.queryNode(d.obj,"tasks","task","id",b.name);
				if(m!=null){
					
					switch(b.type){
						case "function":
							if(b.src=="dynamic" && m.hasChildNodes()){
								r = _x.getCDATAValue(m);
								eval(r);
								b.data = r;
						
							}
							break;
					}

					b.state = 2;
					a = _x.queryNodes(m,"exec-task");
	
					for(i=0;i<a.length;i++){
						t.importTask(d,b,a[i],1);
					}
	
					a = _x.queryNodes(m,"add-task");
					for(i=0;i<a.length;i++){
						t.importTask(d,b,a[i],0);
					}
	
					a = _x.queryNodes(m,"add-depends");
					for(i=0;i<a.length;i++){
						t.addTaskDependency(b,a[i].getAttribute("rid"));
					}
	
					a = _x.queryNodes(m,"execute-procedure");
					for(i=0;i<a.length;i++){
						b.depends[b.depends.length]=a[i].getAttribute("rid");
						t.executeProcedure(d,a[i].getAttribute("rid"));
					}
					
				}
			}
			
			
			b.state=3;
			if(!b.depends.length){
				b.state=4;
				_m.publish("_internal_task_event",{id:b.id,task:b});
				t._update_task_depends(b.name);
			}
			if(!s) t.processTasks();
		};
		t._handle_load_xml=function(n,x){
			var i = x.id,c=t.object_config,b;
				
			if(typeof c.pointers.taskindex[i]=="number"){
				b = t.getTaskById(i);
				b.busy=0;
				if(
					typeof x.xdom != "undefined"
				){
					b.obj = x.xdom;
				}
				else{
					_m.sendMessage("Null XML Response","512.5",1);
				}
				if(b.name == c.status.config_name){
					c.status.config_loaded=1;
				}
				_m.publish("_internal_task_event",{xml:x,id:i});
			}
		};
		t.executeProcedure=function(d,i){
			var n;
			n = _x.queryNode(d.obj,"procedures","procedure","id",i);
			if(n!=null) t.evaluateNode(n);
		};
		
		t.evaluateNode=function(n){
			var d = _x.getCDATAValue(n);
			try{
				eval(d);
			}
			catch(x){
				alert("TaskService: Evaluate Node Error: " + (x.description?x.description:x.message) + "\n" + d);
			}
		};
		t._handle_window_load=function(){
			t.object_config.status.window_loaded=1;
			t.returnDependency("_dom_event_window_load",1);
		};
		org.cote.js.dom.event._add_event_buffer(t);
		_m.subscribe(this,"_internal_task_event","_handle_task_event");
		_m.subscribe(this,"dom_event_window_load","_handle_window_load");
		_m.subscribe(t,"destroy","_handle_window_destroy",window);
		org.cote.js._application_scope.add_object(t);
	}
};

org.cote.js.task.TaskService=new org.cote.js.task.TaskServiceImpl();



_js_package("org.cote.js.util.driver");
org.cote.js.util.driver={
	ApplicationDriver:null,
	ApplicationDriverImpl:
function(){
		var t=this,_j=org.cote.js,_x=org.cote.js.xml,_m=org.cote.js.message.MessageService;
		org.cote.js._implements(t,"base_object","application_driver","0.1a");
		t.object_config={
			status:{
				driver_loaded:0,
				driver_name:null,
				application_loaded:0,
				application_ui_ready:0,
				window_loaded:0
			}
		};
		t.application_config={
		
		};
		t._terminate=function(){
			_m.publish("destroy",window);
		};
		t._handle_window_unload=function(){
			
			_j._application_scope._send_sigterm();
			
			this._terminate();
		};

		t._handle_window_load=function(){
			t.object_config.status.window_loaded=1;
			
			
			
			_m.publish("dom_event_window_load",this);
		};
		
		org.cote.js.dom.event._add_event_buffer(t);
		t._create_handler("window_load",0,0,1);
		t._create_handler("window_unload",0,0,1);
		org.cote.js._application_scope.add_object(t);
		_j.dom.event.addEventListener(window,"unload",t._prehandle_window_unload);
		_j.dom.event.addEventListener(window,"load",t._prehandle_window_load);
	}
};

org.cote.js.util.driver.ApplicationDriver=new org.cote.js.util.driver.ApplicationDriverImpl();


_js_package("org.cote.js.util.config");
org.cote.js.util.config={
	newInstance:
function(s,h,a){
		
		var n = {
			object_config:{
				pointers:{
					config:[],
					config_map:[],
					config_load_handler:0
				},
				status:{
					config_path:0,
					config_loaded:0,
					element_parent_name:"config",
					element_name:"param",
					attr_name_name:"name",
					attr_value_name:"value"
				}
			}
		};
		

		n.setElementParentName=function(s){
			this.object_config.status.param_parent_name = s;
		};
		n.setElementName=function(s){
			this.object_config.status.param_child_name = s;
		};
		n.setAttrNameName=function(s){
			this.object_config.status.attr_name_name = s;
		};
		n.setAttrValueName=function(s){
			this.object_config.status.attr_value_name = s;
		};
	
		n.load=function(s,h,a){
			
			var t = this,_j = org.cote.js,o,c;
			c = t.object_config;
			c.pointers.config_load_handler = (typeof h=="function"?h:0);
			o=_j.xml.getXml(s,null,a,t.object_id);
			
			
			if(!a)
				t._parse_config(o);
			
		};
		
		n._handle_load_xml=function(s,v){
			var t = this;
			if(v.id == t.object_id){
				this._parse_config(v.xdom);
			}
		};
		n.getParams=function(){
			return this.object_config.pointers.config;
		};
		
		n.getParam=function(x){
			var t=this,c,o;
			c = t.object_config;
			if(!c.status.config_loaded) return null;
			if(typeof x=="string")
				x = c.pointers.config_map[x];
			
			if(typeof x=="number" && typeof c.pointers.config[x]=="object")
				return c.pointers.config[x].value;
			
			return null;
		};
		
		n._parse_config=function(o){
			var t = this,c,p,i=0,a,n,v;
			c = t.object_config;
			if(typeof o == "object" && o.documentElement != null){
				c.status.config_loaded = 1;
				a = org.cote.js.xml.queryNodes(o,c.status.element_parent_name,c.status.element_name);
				for(;i<a.length;i++){
					p = a[i];
					n = p.getAttribute(c.status.attr_name_name);
					if(typeof n=="string" && n.length > 0){
						v = p.getAttribute(c.status.attr_value_name);
						if(typeof v!="string") v = "";
						c.pointers.config_map[n]=c.pointers.config.length;
						if(v == "#cdata" && p.hasChildNodes())
							v = org.cote.xml.getCDATAValue(n);
						
						c.pointers.config[c.pointers.config.length]={"name":n,"value":v};
					}
				}
			}
			if(typeof c.pointers.config_load_handler == "function"){
				c.pointers.config_load_handler("onconfigload",this);
			}
		};
		org.cote.js._application_scope.add_object(n);
		

		
		org.cote.js._implements(n,"base_object","config_util","0.1a");		
		org.cote.js.message.MessageService.subscribe(n,"onloadxml","_handle_load_xml");
		if(typeof s == "string"){
			if(!a) a =0;
			n.load(s,h,a);
		}
		
		return n;
	}
}


_js_package("org.cote.js.dom.css");
org.cote.js.dom.css={
	_get_offset_client_height:
function(o){
		var r=0,m;
		if(o){
			m=parseInt(o.style.borderLeftHeight) + parseInt(o.style.borderRightHeight);
			if(!isNaN(m)){
				r += m;
			}
			m=parseInt(o.style.paddingTop) + parseInt(o.style.paddingBottom);
			if(!isNaN(m)){
				r += m;
			}
		}
		return r;
	},
	_get_offset_client_width:
function(o){
		var r=0,m;
		if(o){
			m=parseInt(o.style.borderLeftWidth) + parseInt(o.style.borderRightWidth);
			if(!isNaN(m)){
				r += m;
			}
			m=parseInt(o.style.paddingLeft) + parseInt(o.style.paddingRight);
			if(!isNaN(m)){
				r += m;
			}
		}
		return r;
	},
	_gabs_top:
function(o){
		var c=o,t=0;
		while(c!=null && c.nodeName.toLowerCase()!="body"){
			t+=c.offsetTop;
			c=c.offsetParent;
		}
		return t;
	},
	_gabs_left:
function(o){
		var c=o,l=0;
		while(c!=null && c.nodeName.toLowerCase()!="body"){
			l+=c.offsetLeft;
			c=c.offsetParent;
		}	
		return l;
	},
	StyleManager:{
		_nullStyle:
function(o,b){
			o.style.backgroundImage="";
			o.style.backgroundColor="";
			o.style.margin="0px";
			if(b){
				o.style.width="0px";
				o.style.height="0px";
			}
			o.style.padding="0px";
			o.style.border="0px none";
		},
		newInstance:
function(owner){
			o = {
				owner:owner,
				styles:[],
				default_styles:[],
				base_name:null,
				style_source:null,
				style_names:{}
			};
			o.style_source = org.cote.js.dom.css.StyleSource;
			
			o.setStyleNames=function(c){
				var t = this,v=null,i;
				if(typeof t.owner != "object" || t.style_source==null) return v;
				v=t.style_source.extractStyleNames(c);
				if(v){
					for(i in v){
						t.owner.object_config.style_names[i]=v[i];
					}
				}
				
				return v;
			};
			o.getStyle=function(s,c,b){
				
				c=(c)?c:"default-style";
				var v=null,t=this,q;
				if(t.styles[c] && t.styles[c].styles[s]){
					v=t.styles[c].styles[s];
				}
				else{
					if(c){
						q=t.queryStyle(c);
						if(q && q[s]){
							v=q[s];
						}
					}
				}
				if(b) v=parseInt(v);
				return v;
			};
			o.putStyle=function(s,v,c){
				c=(c)?c:"default-style";
				var t=this;
				if(t.styles[c]) t.styles[c].styles[s]=v;
			};
			o.setStyle=function(o,s,v,c,b){
				
				c=(c)?c:"default-style";
				var t=this,d;
				if(!t.styles[c] && o){
					t.styles[c]={"obj":o,"styles":{}};
				}
				if(!o && !t.styles[c]){
					return;
				}
				o=(o)?o:t.styles[c].obj;
				if(t.styles[c] && o){
					d=t.styles[c]["styles"];
					d[s]=v;
					o.style[s]=v;
				}
			};
		
			o.queryStyle=function(s){
				var t=this,v;
				if(t.style_source==null) return;
				v=t.style_source.extractStyle(s);
				if(v) t.setDefaultStyles(v);
				return v;
			};
		
			o.init=function(o,c){
				c=(c)?c:"default-style";
				var t=this,v,i;
				if(c){
					v=t.queryStyle(c);
					if(!v) return false;
				}
				else{
					alert("mdiStyleManager.js::CMDIStyleManager::init = Class name not specified.");
				}
			
				if(o) t.default_styles[c]={"obj":o,"styles":t.getDefaultStyles()};
				for(i in t.default_styles[c].styles){
					t.setStyle(o,i,t.default_styles[c].styles[i],c);
				}
				return true;
			};
		
			o.applyStyle=function(o,c){
				c=(c)?c:"default-style";
				var t=this;
				if(!t.styles[c] && o) t.init(o,c);
				if(t.styles[c]) t._applyStyle(o,c);
			};
		
			o._applyStyle=function(o,c){
				c=(c)?c:"default-style";
				var t=this,s,v,i,u;
				s=t.styles[c];
				v=s.styles;
				o=(o)?o:s.obj;
				if(v && o){
					for(i in v){
						u=v[i];
						o.style[i]=v[i];
					}
				}
			};
		
			o.setDefaultStyles=function(v){
				this.default_style_data=v;
			};
			o.getDefaultStyles=function(){
				return this.default_style_data;
			};



			
			
			return o;
		
		}	
	},
	_add_style_buffer:
function(o){
		o["_load_style_names"]=function(c){
			c=(c)?c:null;
			var t=this;
			if(typeof t.style_manager == "object")
				return t.style_manager.setStyleNames(c);
			return null;
		}
	},
	StyleSource:null,
	StyleSourceImpl:
function(p){
		var t=this,_j=org.cote.js;
		t.xdom=null;
		
		_j._implements(t,"base_object","dom_style_source","0.1b");
		t.url = p;
		t.load=function(p){
			var _j=org.cote.js;
			if(typeof p!="string") p = t.url;
			
			_j.xml.getXml(p,t._handle_load_xml,1,t.object_id);
		};
		t._handle_load_xml=function(n,x){

			
			if(x.id == t.object_id){
				t.xdom=x.xdom;
				t.ready_state = 3;
				if(t.xdom != null) t.ready_state = 4;
				org.cote.js.message.MessageService.publish("onstyleload",this);
			}
		};
		t.setStyleSource=function(x){
			this.xdom=x;
		};
		t.extractStyleNames=function(s){
			var t=this,a,l,o=null,r=null,i=0;
			if(t.xdom==null) return r;
			a=t.xdom.getElementsByTagName("stylenames");
			l=a.length;
			for(;i<l;i++){
				if(a[i].getAttribute("name")==s){
					o=a[i];
					break;
				}
			}
			if(typeof o=="object"){
				a=o.getElementsByTagName("stylename");
				l=a.length;
				r={};
				for(i=0;i<l;i++){
					
					r[a[i].getAttribute("name")]=a[i].getAttribute("value");
				}
			}
			return r;
		};
		t.extractStyle=function(s){
			var t=this,a,l,o,r=null,i=0,v;
			a=t.xdom.getElementsByTagName("style-data");
			l=a.length;

			for(;i<l;i++){
				if(a[i].parentNode.getAttribute("name")==s){
					o=a[i];
					break;
				}
			}
			if(o){
				a=o.getElementsByTagName("style");
				l=a.length;
				v={};
				for(i=0;i<l;i++){
					v[a[i].getAttribute("name")]=a[i].getAttribute("value");
				}
			}
			return v;
		};
	
		org.cote.js._application_scope.add_object(t);
	}
};
	
	
		


_js_package("org.cote.js.object");
org.cote.js.object.newInstance=function(s,z){
	var o = org.cote.js._forName("generic_object"),_m=org.cote.js.message.MessageService,a=org.cote.js._application_scope;
	org.cote.js._implements(o,"base_object",s,z);
	if(a.add_object(o)){
		org.cote.js.dom.event._add_event_buffer(o);
		org.cote.js.dom.css._add_style_buffer(o);
		o._create_handler("debug");
		o._handle_debug=function(){
			alert("debug handler: " + this.object_id);
		};
	
		_m.subscribe(o,"ondebug","_handle_debug");
		
	}
	return o;
}
			


_js_package("org.cote.js.ui.object");
org.cote.js.ui.object.newInstance=function(s,z){
	var o = org.cote.js.object.newInstance(s,z),i=0,v,e;

	if(typeof org.cote.js.class_imports[s]=="string"){
		if(typeof z=="undefined") z = "0.0";

		eval("v=" + org.cote.js.class_imports[s]);

		
		o.object_config.style_name_id = v.style_name_id;
		o.object_config.style_names = v.style_names;
		o.object_config.status = v.status;
		o.object_config.pointers = v.pointers;
		e=v.event_handlers;
		for(;i<e.length;i++){
			o._create_handler(e[i],0,0,(v.event_handler_impl?1:0));
		}
	}
	return o;
}


_js_package("org.cote.js.ui.object");
org.cote.js.ui.object.resultset={
	newInstance:
function(parent_object){
		
		var n = org.cote.js.ui.object.newInstance("spec_resultset","0.1b");
		
		if(typeof parent_object!="object") parent_object = document.body;
		n.parent_object = parent_object;
	
		n._init=function(){
			var t=this,v,d,_m=org.cote.js.message.MessageService,_d=org.cote.js.dom.event,c;
			c = t.object_config;
			t.style_manager = org.cote.js.dom.css.StyleManager.newInstance(t);
			v = t._load_style_names(c.style_name_id);
			
			d = document.createElement("div");
			t.parent_object.appendChild(d);
			t.style_manager.init(d,c.style_names["resultContainer"]);
			
			_d.addEventListener(d,"mouseover",t._prehandle_mouseover,0);
			_d.addEventListener(d,"mouseout",t._prehandle_mouseout,0);
			_d.addEventListener(d,"click",t._prehandle_click,0);
			_m.subscribe(t,"destroy","_handle_window_destroy",window);
			_m.subscribe(t,"_buffer_updated","_handle_buffer_updated",t);
			c.pointers.container = d;
			
			
			t._create_handler("buffer_check",0,0,1);
			t._create_handler("commit_buffer",0,0,1);			
			t.ready_state = 4;
		};
		
		n._handle_window_destroy=function(){
			this.destroy();
		};
		
		n.setIsBuffered=function(b){
			var t=this,c;
			c=t.object_config;
			c.status.buffered=b;
			c.status.buffer_mark=0;
			c.pointers.buffer=[];
		};
		
		n.setBufferOffset=function(i){
			this.object_config.status.buffer_step=i;
		};
		
		n.setBufferDelay=function(i){
			this.object_config.status.buffer_delay=i;
		};
		n.destroy=function(){
			var t=this,c;
			c=t.object_config;
			if(t.ready_state == 4){
				t.clearItems();
				c.pointers.buffer=[];
				
				t.parent_object.removeChild(c.pointers.container);
				org.cote.js._application_scope.remove_object(t);
			}
			t.ready_state = 0;
		};
		n.addItem=function(s,d){
			var t=this,c;
			c=t.object_config;
			if(t.ready_state != 4) return;
			if(c.status.buffered){
				c.pointers.buffer[c.pointers.buffer.length]={"name":s,"data":d};
				if(c.status.auto_commit && !c.status.is_commit){
				
					
					window.setTimeout(t._prehandle_buffer_check,c.status.buffer_delay);
					
				}
			}
			else{
				t._addItem(s,d);
			}
		};
		
		n._handle_buffer_check=function(){
			var t=this,c;
			c=t.object_config;
			if(c.status.auto_commit && !c.status.is_commit){
				t._handle_commit_buffer();
			}
		};
		
		n.commitBuffer=function(){
			this._handle_commit_buffer();
		};
		
		n._handle_commit_buffer=function(){
			var t=this,c,l,b,m,i,v;
			c = t.object_config;
			c.status.is_commit=1;
			
			l=c.pointers.buffer.length;
			b = false;
			m = c.status.buffer_mark;
			for(i=m;i< (m + c.status.buffer_step) ;i++){
				if(i >= l){
					b=true;
					break;
				}
				v=c.pointers.buffer[i];
				t._addItem(v.name,v.data);
				c.status.buffer_mark++;
			}
			if(b){
				c.status.buffer_mark=0;
				c.pointers.buffer=[];
				c.status.is_commit=0;
				org.cote.js.message.MessageService.publish("onbuffercommitted",t);
			}
			else{
				window.setTimeout(t._prehandle_commit_buffer,c.status.buffer_delay);
			}
		};
		
		n.getBufferMark=function(){
			return this.object_config.status.buffer_mark;
		};
		
		n.getBufferSize=function(){
			return this.object_config.pointers.buffer.length;
		};
		
		n.getItemSize=function(){
			return this.object_config.pointers.results.length;
		};
		
		n.getItem=function(i){
			return this.object_config.pointers.results[i];
		};
		
		n.getActiveItem=function(){
			var c=this.object_config;
			if(c.status.activeItem){
				return c.pointers.results[c.pointers.resultsHash[c.status.active_item.getAttribute("rid")]]
			}
			return null;
		};
		
		n._addItem=function(s,d){
			var t=this,c,e,i=org.cote.js._get_gunid(),v,l;
			c=t.object_config;
			l=c.pointers.results.length;
			
			if(
				c.status.maximum_items > 0
				&& l >= c.status.maximum_items
			){
				if(c.status.maximum_rollover){
					t.clearItem(0);
					l--;
				}
				else{
					return;
				}
			}
			
			e=document.createElement("div");
		
			c.pointers.container.appendChild(e);
			t.style_manager.init(e,c.style_names["resultItem"]);


			
			if(d!="_avoid"){
				e.setAttribute("is-result-item","1");
			}
			e.setAttribute("rid",i);
			e.appendChild(document.createTextNode(s));

			v={"name":s,"data":d,"obj":e,"id":i,"index":l};
			
			c.pointers.results[l]=v;
			c.pointers.resultsHash[i]=l;
			
			if(c.status.auto_select) t.setActiveItem(l);
			if(c.status.auto_scroll) t.scrollToItem(l);
		};
		
		n._handle_mouseover=function(v){
			var t=this,o,c,e;
			c=t.object_config;
			if(typeof v=="number"){
				o=c.pointers.results[v].obj;
			}
			else{
				e=org.cote.js.dom.event._gevt(v);
				o=(typeof v!="undefined" && v.nodeType)?v:org.cote.js.dom.event._gevt_src(v);
				if(o && o.nodeType==3) o=o.parentNode;
			}
			if(o.getAttribute("is-result-item") && o != c.status.active_item){
				t.style_manager.applyStyle(o,c.style_names["resultItemHover"]);
			}
		};
		n._handle_mouseout=function(v){
			var t=this,o,c,e;
			c=t.object_config;
			e=org.cote.js.dom.event._gevt(v);
			o=(typeof v!="undefined" && v.nodeType)?v:org.cote.js.dom.event._gevt_src(v);
			if(o && o.nodeType==3) o=o.parentNode;
			if(o.getAttribute("is-result-item") && o != c.status.active_item){
				t.style_manager.applyStyle(o,c.style_names["resultItem"]);
			}
		};

		n.setActiveItem=function(i){
			this.selectItem(i,1);
		};
		
		n.selectItem=function(i,b){
			var t = this,c;
			c=t.object_config;
			if(c.pointers.results[i]!=null){
				t._handle_mouseover(i);
				t._handle_click(i,b);
				t.scrollToItem(i);
			}
		};
		
		n.scrollToItem=function(i){
			var t = this,c;
			c=t.object_config;
			if(c.pointers.results[i]!=null){
				c.pointers.container.scrollTop=c.pointers.results[i].obj.offsetTop;
			}
		};
		
		n._handle_click=function(v,b){
			var t=this,o,c,e;
			c=t.object_config;
			if(typeof(v)=="number"){
				o=c.pointers.results[v].obj;
			}
			else{
				e=org.cote.js.dom.event._gevt(v);
				o=(typeof v!="undefined" && v.nodeType)?v:org.cote.js.dom.event._gevt_src(v);
				if(o && o.nodeType==3) o=o.parentNode;
			}
	
			if(o.getAttribute("is-result-item")){
				if(o == c.status.active_item){
					c.status.active_item=null;
					t.style_manager.applyStyle(o,c.style_names["resultItemHover"]);
					return;
				}
				if(c.status.active_item!=null){
					t.style_manager.applyStyle(c.status.active_item,c.style_names["resultItem"]);
				}
				c.status.active_item=o;
				t.style_manager.applyStyle(o,c.style_names["resultItemActive"]);
				if(!b) org.cote.js.message.MessageService.publish("onresultclick",t);
			}
		};
		
		n.clearItem=function(i){
			var t=this,o,c,d;
			c=t.object_config;
			o=c.pointers.results[i];
			if(o){
				d=o.id;
				if(o.obj==c.status.active_item) c.status.active_item=null;
				c.pointers.resultsHash[d]=null;
				o=o.obj;
				c.pointers.container.removeChild(o);
				c.pointers.results.splice(i,1);
				
			}
		};
		n.clearItems=function(){
			var t=this,c,a,i;
			c=t.object_config;
			c.status.active_item=null;
			c.pointers.results=[];
			c.pointers.resultsHash=[];
			c.status.buffer_mark=0;
			c.pointers.buffer=[];
			a=c.pointers.container.childNodes;
			for(i=a.length - 1;i >= 0;i--){
				c.pointers.container.removeChild(a[i]);
			}
		};
		
		n._init();
		return n;
	}
}


_js_package("org.cote.js.ui.object");

org.cote.js.ui.object.menu={
	newInstance:
function(parent_object,menu_type){
		
		var n = org.cote.js.ui.object.newInstance("spec_menu","0.1b");
		
		if(typeof menu_type=="undefined") menu_type=1;
		
		n.object_config.status.menu_type = menu_type;
		
		if(typeof parent_object!="object") parent_object = document.body;
		n.parent_object = parent_object;
	
		n._init=function(){
			var t=this,v,d=0,_m=org.cote.js.message.MessageService,_d=org.cote.js.dom.event,c;
			c = t.object_config;
			t.ms = org.cote.js.message.MessageService;
			t.style_manager = org.cote.js.dom.css.StyleManager.newInstance(t);
			v = t._load_style_names(c.style_name_id);
			if(c.status.menu_type == 1){
				d = document.createElement("div");
				t.parent_object.appendChild(d);
				t.style_manager.init(d,c.style_names["menucont"]);
	
				_m.subscribe(t,"destroy","_handle_window_destroy",window);
				
				c.pointers.container = d;
			}
			if(c.status.menu_type == 2 && n.parent_object!=null){
				d = n.parent_object;
				_d.addEventListener(d,"contextmenu",t._prehandle_contextmenu);
			}
			
			if(d){
				_d.addEventListener(d,"mouseover",t._prehandle_mouseover,0);
				_d.addEventListener(d,"mouseout",t._prehandle_mouseout,0);
				_d.addEventListener(d,"click",t._prehandle_click,0);
				_d.addEventListener(d,"losecapture",t._prehandle_click,0);
				_d.addEventListener(d,"selectstart",t._handle_selectstart,0);
			}
			t.ready_state = 4;
			
		};
		n._handle_selectstart=function(){
			return false;
		};
		n._handle_window_destroy=function(){
			this.destroy();
		};
		n.destroy=function(){
			var t=this,c;
			c=t.object_config;
			if(t.ready_state == 4){
				t.parent_object.removeChild(c.pointers.container);
				org.cote.js._application_scope.remove_object(t);
			}
			t.ready_state = 0;
		};
		n.bindElement=function(o){
			var t=this,i,c;
			c=t.object_config;
			i=org.cote.js._get_gunid();
			o.setAttribute("lid",i);
			o.setAttribute("isMenuContext","1");
			c.pointers.menus[i]={"obj":o,"items":[]};
			c.pointers.menuIndex[c.pointers.menuIndex.length]=i;
			c.pointers.container = t.parent_object;
			return i;
		};
		
		n.addMenuLabel=function(s){
			var t=this,o,c,i;
			c=t.object_config;
			o=document.createElement("span");
			t.style_manager.init(o,c.style_names["menulabel"]);
			o.style.left=c.status.labelWidth + "px";
			
			c.pointers.container.appendChild(o);
			org.cote.js.xml.setInnerXHTML(o,s);
			c.status.labelWidth+=o.offsetWidth + c.status.labelOffset;
			o.setAttribute("isMenuLabel","1");
			i=org.cote.js._get_gunid();
			o.setAttribute("lid",i);

			c.pointers.menus[i]={"obj":o,"items":[]};
			c.pointers.menuIndex[c.pointers.menuIndex.length]=i;
			return i;
		};
		n.addMenuItem=function(i,l,f,b,w,y){
			
			var t=this,c,m,z,o;
			c=t.object_config;
			o=c.pointers.menus[i];
			m=o.items.length;
			if(typeof w!="number") w = 0;
			if(typeof y=="undefined") y = 0;
			o.items[m]={"mid":m,"pid":i,"type":w,"opt":y,"lobj":null,"pobj":0,"sobj":null,"obj":null,"sid":null,"label":l,"fp":f,"issub":(b)?1:0,"items":null,"id":null};
			if(b){
				z=o.items[m];
				z.sid=i;
				z.items=[];
				i=org.cote.js._get_gunid();
				z.id=i;
				c.pointers.menus[i]=z;
				c.pointers.menuIndex[c.pointers.menuIndex.length]=i;
				return i;
			}
			return null;
		};
		n._rebuildMenu=function(i,b){
			
			var t=this,c,m,z,a,l,x=0,o;
			c=t.object_config;
			o=c.pointers.menus[i];
			
			a=o.items;
			l=a.length;
			for(;x<l;x++){
				t._createMenuItem(i,x,b);
				
			}
		};
		n._createMenuItem=function(i,x,b){
			
			var t=this,c,m,z,w,s,l,o;
			c=t.object_config;
			o=c.pointers.menus[i].items[x];
			s=document.createElement("div");
			s.setAttribute("isMenuItem","1");
			s.setAttribute("mrid",i);
			s.setAttribute("irid",x);

			org.cote.js.xml.setInnerXHTML(s,o.label);


			if(o.fp!=null) s.setAttribute("fp",o.fp);
			t.style_manager.applyStyle(s,c.style_names["menuitem"]);
			if(!b){
				c.pointers.activeSub.appendChild(s);
				
			}
			else{
				c.pointers.menus[i].sobj.appendChild(s);
				
			}

			if(o.issub){
				z=document.createElement("span");
				z.setAttribute("isItemHelper","1");
				z.setAttribute("border","0");
				s.appendChild(z);
				s.setAttribute("srid",o.id);
				s.setAttribute("hasSub","1");
				t.style_manager.applyStyle(z,c.style_names["subarrow"]);
				o.pobj=z;
				o.obj=s;
			}
		};
		n._buildSub=function(i){
			this._activateMenu(i,1);
		};
		n._activateMenu=function(i,b){
			var t=this,c,o,k,l,m,x=0,y=0,p=org.cote.js.dom.browser.client.bswitch;
			c = t.object_config;
			if(c.pointers.menus[i]){
				if(!b && c.pointers.activeSub!=null){
					c.pointers.container.removeChild(c.pointers.activeSub);
				}
				o=document.createElement("span");
				t.style_manager.applyStyle(o,c.style_names["submenu"]);
				o.setAttribute("sid",i);
				if(!b){
					c.pointers.activeSub=o;
					c.status.activeId=i;
				}
				else{
					l=c.pointers.openSubs.length;
					
					t._closeSubs(c.pointers.menus[i].sid,0);
					c.pointers.openSubs[l]={"id":i,"obj":o};
					c.pointers.menus[i].sobj=o;
				}
	
				m=c.pointers.menus[i].obj;
				if(!b){
					if(c.status.menu_type==1){
						y=m.offsetTop + m.offsetHeight;
						x=m.offsetLeft;
					}
					else if(c.status.menu_type==2){
						y=c.status.client_y + (p==1?document.documentElement.scrollTop:document.body.scrollTop);
						x=c.status.client_x + (p==1?document.documentElement.scrollLeft:document.body.scrollLeft);
					}
					t._rebuildMenu(i);
				}
				else{
					if(c.status.menu_type==1){
						y=org.cote.js.dom.css._gabs_top(m) - org.cote.js.dom.css._gabs_top(c.pointers.container);
						x = (org.cote.js.dom.css._gabs_left(m) + m.offsetWidth) - org.cote.js.dom.css._gabs_left(c.pointers.container);
					}
					else if(c.status.menu_type==2){
						y=org.cote.js.dom.css._gabs_top(m);
						x=m.offsetWidth + org.cote.js.dom.css._gabs_left(m);
					}
					t._rebuildMenu(i,1);
				}
				o.style.left=x + "px";
				o.style.top=y + "px";
				c.pointers.container.appendChild(o);
			}
			else{
				alert("BAD BAD BAD");
			}
		};
		
		n._closeMenu=function(){
			var t=this,c;
			c = t.object_config;
			
			if(c.pointers.container != null){
				org.cote.js.dom.event.disableMotionCapture(c.pointers.container);
			}
			c.status.isActive=false;
			c.status.activeId=null;
			if(c.pointers.activeSub!=null){
				c.pointers.container.removeChild(c.pointers.activeSub);
				c.pointers.activeSub=null;
			}
			if(c.pointers.activeLabel!=null){
				t.style_manager.applyStyle(c.pointers.activeLabel,c.style_names["menulabel"]);
				c.pointers.activeLabel=null;
			}
			t._closeSubs();
		};
		n._closeSubs=function(i,s){
			var t=this,c,a,l,r,b=0,o,z,y;
			c = t.object_config;
			a = c.pointers.openSubs;
			l = a.length;
			r = [];
			for(x=l-1;x>=0;x--){
				if(a[x]!=null){
					if(a[x].id==i){
						b=1;
						break;
					}
					o=a[x].obj;
					if(!s && c.pointers.menus[a[x].id].obj.getAttribute("isStuck")){
						z = c.pointers.menus[a[x].id].obj;
						t.style_manager.applyStyle(z,c.style_names["menuitem"]);
						y = c.pointers.menus[z.getAttribute("mrid")].items[z.getAttribute("irid")];
						if(typeof y!="undefined" && y.pobj){
							t.style_manager.applyStyle(y.pobj,c.style_names["subarrow"]);
						}
					}
					if(o && o.parentNode) o.parentNode.removeChild(o);
					a[x]=null;
				}
			}
	
			for(x=0;x<l;x++){
				if(a[x]!=null){
					r[x]=a[x];
				}
			}
			c.pointers.openSubs=r;
		};
		
		
		
		n._handle_mouseover=function(v){
			var t=this,o,c,e,s,i,z,y;
			c=t.object_config;
			e=org.cote.js.dom.event._gevt(v);
			o=(typeof v!="undefined" && v.nodeType)?v:org.cote.js.dom.event._gevt_src(v);
			if(o && o.nodeType==3) o=o.parentNode;
			if(o==null) return;
			
			z=org.cote.js.dom.event._gevt_org(e);
			if(typeof z!="undefined" && z.nodeType==3) z = z.parentNode;
			if(o.getAttribute("isItemHelper")) o=o.parentNode;
			if(z && z.getAttribute("isItemHelper")) z=z.parentNode;
			
			if(o.getAttribute("isMenuContext")=="1"){
			}
			if(o.getAttribute("isMenuItem")=="1"){
				if(z==o) return false;	
				if(
					c.pointers.activeItem!=null
					&& c.pointers.activeItem!=o
					&& c.pointers.activeItem.getAttribute("isStuck") != "1"
				){
					t.style_manager.applyStyle(c.pointers.activeItem,c.style_names["menuitem"]);
				}
				s="menuitemhover";
				t.style_manager.applyStyle(o,c.style_names[s]);
				y = c.pointers.menus[o.getAttribute("mrid")].items[o.getAttribute("irid")];
				if(typeof y!="undefined" && y.pobj){
					t.style_manager.applyStyle(y.pobj,c.style_names["subarrowhover"]);
				}
				if(o.getAttribute("hasSub")=="1"){
					o.setAttribute("isStuck","1");
					t._buildSub(o.getAttribute("srid"));
				}
				else{
					t._closeSubs(o.getAttribute("mrid"));
				}
				c.pointers.activeItem=o;
			}
			if(o.getAttribute("isMenuLabel")=="1"){
				if(c.pointers.activeLabel!=null && c.pointers.activeLabel!=o){
					t.style_manager.applyStyle(c.pointers.activeLabel,c.style_names["menulabel"]);
				}
				c.pointers.activeLabel=o;
				s=(c.status.isActive)?"menulabelactive":"menulabelhover";
				t.style_manager.applyStyle(o,c.style_names[s]);
				i=o.getAttribute("lid");
				if(c.status.isActive && c.status.activeId!=i){
					t._closeSubs();
					this._activateMenu(i);
				}
			}
			org.cote.js.dom.event._gevt_cancel(e);
			return false;
			
		};
		n._handle_mouseout=function(v){
			var t=this,o,c,e,z,y;
			c=t.object_config;
			e=org.cote.js.dom.event._gevt(v);
			o=(typeof v!="undefined" && v.nodeType)?v:org.cote.js.dom.event._gevt_src(v);
			
			z=org.cote.js.dom.event._gevt_dest(e);
			
			if(o && o.nodeType==3) o=o.parentNode;
			if(z && z.nodeType==3) z = z.parentNode;
			if(o.getAttribute("isItemHelper")) o=o.parentNode;
			if(z && z.getAttribute("isItemHelper")) z=z.parentNode;
			if(o.getAttribute("isMenuLabel")=="1" && !c.status.isActive){
				c.pointers.activeLabel=null;
				t.style_manager.applyStyle(o,c.style_names["menulabel"]);
			}
			if(
				o.getAttribute("isMenuItem")=="1"
				&& o.getAttribute("isStuck")!="1"
			){
				if(z==o) return;
				c.pointers.activeItem=null;
				t.style_manager.applyStyle(o,c.style_names["menuitem"]);
			}
			org.cote.js.dom.event._gevt_cancel(e);
			return false;
		};
		n._handle_contextmenu=function(v,b){
			n._handle_click(v,b);
			org.cote.js.dom.event._gevt_cancel(v);
		};
		n._handle_click=function(v,b){
			var t=this,o,c,e,f;
			c=t.object_config;

			e=org.cote.js.dom.event._gevt(v);
			o=(typeof v!="undefined" && v.nodeType)?v:org.cote.js.dom.event._gevt_src(v);
			if(o && o.nodeType==3) o=o.parentNode;
			if(o.getAttribute("isItemHelper")) o=o.parentNode;

		
			if(o.getAttribute("isMenuItem")=="1"){
				f=o.getAttribute("fp");
				t._closeMenu();
				if(f!=null){
					try{
						if(typeof f=="string") eval(f);
						if(typeof f=="function") f();
					}
					catch(e){
						t.ms.sendMessage(e.toString(),"515.4");
					}
				}
				org.cote.js.message.MessageService.publish("onmenuitemclick",{fp:f,id:o.getAttribute("mrid") + ":" + o.getAttribute("irid"),label:org.cote.js.xml.getInnerText(o)});
				
			}
			else if(o.getAttribute("isMenuLabel")=="1" || o.getAttribute("isMenuContext")=="1"){
				if(!c.status.isActive){
					c.status.isActive=1;
					if(o.getAttribute("isMenuLabel")=="1"){
						t.style_manager.applyStyle(o,c.style_names["menulabelactive"]);
					}
					if(o.getAttribute("isMenuContext")=="1"){
						c.status.client_x = e.clientX;
						c.status.client_y = e.clientY;
					}
					t._activateMenu(o.getAttribute("lid"));
					org.cote.js.dom.event.enableMotionCapture(c.pointers.container);
				}
				else{
					c.status.isActive=false;
					c.status.activeId=null;
					if(c.pointers.activeSub!=null){
						c.pointers.container.removeChild(c.pointers.activeSub);
						c.pointers.activeSub=null;
						t._closeSubs();
					}
					if(o.getAttribute("isMenuLabel")=="1") t.style_manager.applyStyle(o,c.style_names["menulabelhover"]);
				}
			}
			else{
				t._closeMenu();
			}
		};
		
		n.loadMenu=function(p,i){
			var t=this,a,m,_t = org.cote.js.task.TaskService,_a = org.cote.js.util.driver.ApplicationDriver;
			if(typeof _a.application_config._menu_load_count != "number") _a.application_config._menu_load_count = 0;
			a = "menu_" + i + "_" + (++_a.application_config._menu_load_count);
			t.object_config.status.src_path = p;
			t.object_config.status.src_request_id = a;
			t.object_config.status.src_menu_id = i;
			m=_t.execTask(
				a,
				"xml",
				p,
				t._prehandle_load_menu,
				"function"
			);
			
					
		};
		n._handle_load_menu=function(s,v){
			var t=this,m,a,o,n,_x = org.cote.js.xml,c,h,l;
			c = t.object_config;
			if(typeof v.obj == "object" && v.obj.documentElement != null){
				m = _x.queryNode(v.obj,"menu-config","menus","id",c.status.src_menu_id);
				if(m!=null){
					a = _x.queryNodes(m,"menu");
					for(h=0;h<a.length;h++){
						o = a[h];
						n = o.getAttribute("label");
						if(typeof n != "string" || n.length == 0) n = "[ undefined ]";
						l = t.addMenuLabel(n);
						t._parse_menu_config(o,l);
					}
				}
			}
		};
		n._parse_menu_config=function(o,l){
			var t=this,_x = org.cote.js.xml,c,a,i,n,b,y,z,d;
			c = t.object_config;
			
			a = o.childNodes;
			for(i=0;i<a.length;i++){
				n = a[i];
				if(n.nodeType == 1 && n.nodeName == "menu-item"){
					b = (_x.queryNode(n,"sub-menu") != null);
					y = n.getAttribute("label");
					z = n.getAttribute("action");
					if(typeof y != "string" || y.length == 0) y = "[ undefined ]";
					if(typeof z != "string" || z.length == 0) z = null;
					
					d=t.addMenuItem(l,y,z,b);
					if(b) t._parse_menu_config(_x.queryNode(n,"sub-menu"),d);
				}
			}
			
		};		
		n._init();

		return n;
	}
}



_js_package("org.cote.js.ui.object");
org.cote.js.ui.object.container={
	newInstance:
function(parent_object,use_object){
		
		var n = org.cote.js.ui.object.newInstance("spec_container","0.1b");
		
		if(typeof parent_object!="object") parent_object = document.body;
		n.parent_object = parent_object;
	
		n._init=function(u){
			var t=this,v,d,_m=org.cote.js.message.MessageService,c;
			c = t.object_config;
			t.style_manager = org.cote.js.dom.css.StyleManager.newInstance(t);
			v = t._load_style_names(c.style_name_id);
			if(typeof u=="object"){
				d = u;
			}
			else{
				d = document.createElement("div");
				t.parent_object.appendChild(d);
			}
			
			t.style_manager.init(d,c.style_names["maincont"]);

			_m.subscribe(t,"destroy","_handle_window_destroy",window);
			
			c.pointers.container = d;
			
			t.ready_state = 4;
			
		};
		n._handle_window_destroy=function(){
			this.destroy();
		};
		n.destroy=function(){
			var t=this,c;
			c=t.object_config;
			if(t.ready_state == 4){
				if(t.parent_object && t.parent_object != c.pointers.container){
					t.parent_object.removeChild(c.pointers.container);
				}
				org.cote.js._application_scope.remove_object(t);			
			}
			t.ready_state = 0;
		};
		n.getContainer=function(){
			return this.object_config.pointers.container;
		};
		n._init(use_object);

		return n;
	}
}



if (typeof _js_validate_package=="function"){
	if(_js_validate_package("org.cote.js.message")){
		org.cote.js.message.MessageService.subscribe("application_initialized","handle_application_initialized");
		org.cote.js.message.MessageService.subscribe("onsendmessage","handle_send_message");
	}
	if(_js_validate_package("org.cote.js.task")){
		org.cote.js.task.TaskService.execTaskLoader(
			"_task_loader",
			"xml",
			"/servlet/connector?file=projects/mdi3/src/data/m3-config.xml",
			"proc_load_task_driver",
			"procedure"
		);			
	}
}


