
/*FILEHEAD(/in/Library/jpf.js)SIZE(54079)TIME(1213646892662)*/
VERSION = 0x000900;

DOC_NODE = 100;

NOGUI_NODE = 101;

GUI_NODE = 102;

KERNEL_MODULE = 103;

MF_NODE = 104;

var HTTP_GET_VARS ={
}
,vars = location.href.split(/[\?\&\=]/);


for(var k = 1;k < vars.length;k += 2)HTTP_GET_VARS[vars[k]]= vars[k + 1]|| "";

Array.prototype.dataType = "array";

Number.prototype.dataType = "number";

Date.prototype.dataType = "date";

Boolean.prototype.dataType = "boolean";

String.prototype.dataType = "string";

RegExp.prototype.dataType = "regexp";

Function.prototype.dataType = "function";

jpf ={
	AppData:null,IncludeStack:[],isInitialized:false,debug:false,browserDetect:function(){
		this.isOpera = navigator.userAgent.toLowerCase().indexOf("opera")!= - 1;
		this.isKonqueror = navigator.userAgent.toLowerCase().indexOf("konqueror")!= - 1;
		this.isSafari = ! this.isOpera &&((navigator.vendor && navigator.vendor.match(/Apple/)? true:false)|| navigator.userAgent.toLowerCase().indexOf("safari")!= - 1 || this.isKonqueror);
		this.isSafariOld = false;
		
		if(this.isSafari){
			var matches = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
			
			if(matches)this.isSafariOld = parseInt(matches[1])< 420;
		};
		this.isGecko = ! this.isOpera && ! this.isSafari && navigator.userAgent.toLowerCase().indexOf("gecko")!= - 1;
		this.isGecko3 = this.isGecko && navigator.userAgent.toLowerCase().indexOf("firefox/3")!= - 1;
		this.isIE = document.all && ! this.isOpera && ! this.isSafari ? true:false;
		this.isIE50 = this.isIE && navigator.userAgent.toLowerCase().indexOf("5.0")!= - 1;
		this.isIE55 = this.isIE && navigator.userAgent.toLowerCase().indexOf("5.5")!= - 1;
		this.isIE6 = this.isIE && navigator.userAgent.toLowerCase().indexOf("6.")!= - 1;
		this.isIE7 = this.isIE && navigator.userAgent.toLowerCase().indexOf("7.")!= - 1;
		
		if(this.onbrowsercheck)this.onbrowsercheck();
	}
	,setCompatFlags:function(){
		this.TAGNAME = jpf.isIE ? "baseName":"localName";
		this.hasContentEditable = jpf.isIE || jpf.isSafari;
		this.styleSheetRules = jpf.isIE ? "rules":"cssRules";
		this.brokenHttpAbort = jpf.isIE6;
		this.canUseHtmlAsXml = jpf.isIE;
		this.supportNamespaces = ! jpf.isIE;
		this.cannotSizeIframe = jpf.isIE;
		this.supportOverflowComponent = jpf.isIE;
		this.hasDocumentFragment = ! jpf.isIE55;
		this.hasEventSrcElement = jpf.isIE;
		this.canHaveHtmlOverSelects = ! jpf.isIE6 && ! jpf.isIE5;
		this.hasInnerText = jpf.isIE;
		this.hasMsRangeObject = jpf.isIE;
		this.hasContentEditable = jpf.isIE || jpf.isOpera;
		this.descPropJs = jpf.isIE;
		this.hasClickFastBug = jpf.isIE;
		this.hasExecScript = window.execScript ? true:false;
		this.canDisableKeyCodes = jpf.isIE;
		this.hasTextNodeWhiteSpaceBug = jpf.isIE;
		this.canUseInnerHtmlWithTables = ! jpf.isIE;
		this.hasSingleResizeEvent = ! jpf.isIE;
		this.hasStyleFilters = jpf.isIE;
		this.cantParseXmlDefinition = jpf.isIE50;
		this.hasDynamicItemList = ! jpf.isIE || jpf.isIE7;
		this.canImportNode = jpf.isIE;
		this.hasSingleRszEvent = ! jpf.isIE;
		this.hasXPathHtmlSupport = ! jpf.isIE;
		this.hasReadyStateBug = jpf.isIE50;
		this.dateSeparator = jpf.isIE ? "-":"/";
		this.canInsertGlobalCode = ! jpf.isSafari && ! jpf.isGecko;
		this.canCreateStyleNode = ! jpf.isIE;
		this.supportFixedPosition = ! jpf.isIE || jpf.isIE7;
		this.maxHttpRetries = this.isOpera ? 0:3;
	}
	,start:function(){
		this.host = location.href.split("?")[0].replace(/(\/\/[^\/]*)\/.*$/,"$1");
		this.hostPath = location.href.split("?")[0].replace(/\/[^\/]*$/,"")+ "/";
		this.CWD = location.href.split("?")[0].replace(/^(.*\/)[^\/]*$/,"$1")+ "/";
		this.browserDetect();
		this.setCompatFlags();
		this.hasDeskRun = this.hasWebRun = false;
		
		if(this.isIE)this.importClass(runIE,true,self);
		
		if(this.isSafari)this.importClass(runSafari,true,self);
		
		if(this.isOpera)this.importClass(runOpera,true,self);
		
		if(this.isGecko || ! this.isIE && ! this.isSafari && ! this.isOpera)this.importClass(runGecko,true,self);
		runGecko = runOpera = runSafari = runIE = runXpath = runNonIe = runXslt = undefined;
		this.oHttp = new this.http();
		this.Init.addConditional(this.loadIncludes,null,['BODY','HTTP','XMLDatabase','TelePort']);
		
		try{
			if(jpf.isIE)document.execCommand("BackgroundImageCache",false,true);
		}
		catch(e){
		};
		this.root = true;
	}
	,startDependencies:function(){
		jpf.status("Loading Dependencies...");
		
		for(var i = 0;i < this.KernelModules.length;i ++)jpf.include("Library/Core/" + this.KernelModules[i],true);
		
		for(var i = 0;i < this.TelePortModules.length;i ++)jpf.include("Library/TelePort/" + this.TelePortModules[i],true);
		
		for(var i = 0;i < this.Components.length;i ++)jpf.include("Library/Components/" + this.Components[i]+ ".js",true);
		jpf.Init.interval = setInterval("if(jpf.checkLoadedDeps()){clearInterval(jpf.Init.interval);jpf.start()}",100);
	}
	,ns:{
		jpf:"http://www.javeline.com/2005/PlatForm",xsd:"http://www.w3.org/2001/XMLSchema",xhtml:"http://www.w3.org/1999/xhtml",xslt:"http://www.w3.org/1999/XSL/Transform",xforms:"http://www.w3.org/2002/xforms",ev:"http://www.w3.org/2001/xml-events"}
	,findPrefix:function(xmlNode,xmlns){
		if(xmlNode.nodeType == 9){
			if(! xmlNode.documentElement)return false;
			
			if(xmlNode.documentElement.namespaceURI == xmlns)return xmlNode.prefix || xmlNode.scopeName;
			var docEl = xmlNode.documentElement;
		}
		else{
			if(xmlNode.namespaceURI == xmlns)return xmlNode.prefix || xmlNode.scopeName;
			var docEl = xmlNode.ownerDocument.documentElement;
			
			if(docEl && docEl.namespaceURI == xmlns)return xmlNode.prefix || xmlNode.scopeName;
			
			while(xmlNode.parentNode){
				xmlNode = xmlNode.parentNode;
				
				if(xmlNode.namespaceURI == xmlns)return xmlNode.prefix || xmlNode.scopeName;
			}
		};
		
		if(docEl){
			for(var i = 0;i < docEl.attributes.length;i ++){
				if(docEl.attributes[i].nodeValue == xmlns)return docEl.attributes[i][jpf.TAGNAME]}
		};
		return false;
	}
	,getWindowWidth:function(){
		return(jpf.isIE ? document.documentElement.offsetWidth:window.innerWidth);
	}
	,getWindowHeight:function(){
		return(jpf.isIE ? document.documentElement.offsetHeight:window.innerHeight);
	}
	,toString:function(){
		return "[Javeline (jpf)]";
	}
	,emptyf:function(){
	}

,all:[],getElement:function(parent,nr){
		var nodes = parent.childNodes;
		
		for(var j = 0,i = 0;i < nodes.length;i ++){
			if(nodes[i].nodeType != 1)continue;
			
			if(j ++ == nr)return nodes[i];
		}
	}
	,inherit:function(classRef){
		classRef.call(this);
	}
	,makeClass:function(oBlank){
		if(oBlank.inherit)return;
		oBlank.inherit = this.inherit;
		oBlank.inherit(jpf.Class);
	}
	,root:true,named:{
	}

,cancelBubble:function(e,o){
		e.cancelBubble = true;
		
		if(o.focussable && ! o.disabled)jpf.window.__focus(o);
	}
	,setStyleRule:function(name,type,value,stylesheet){
		var rules = document.styleSheets[stylesheet || 0][jpf.styleSheetRules];
		
		for(var i = 0;i < rules.length;i ++){
			if(rules.item(i).selectorText == name){
				rules.item(i).style[type]= value;
				return;
			}
		}
	}
	,setStyleClass:function(oEl,className,exclusion,special){
		if(! oEl || this.disabled)return;
		
		if(! exclusion)exclusion = new Array();
		exclusion.push(className);
		var re = new RegExp("(?:(^| +)" + exclusion.join("|")+ "($| +))","gi");
		
		if(special){
			if(oEl.firstChild.style.display == "none"){
				oEl.firstChild.style.display = "block";
				new jpf.GuiAnimation(oEl.firstChild,'fade',0,1,0,10,10);
			}
			else{
				new jpf.GuiAnimation(oEl.firstChild,'fade',1,0,0,10,10,function(){oEl.firstChild.style.display = "none";
				}
			);
			}
		}
		else{
			oEl.className != null ?(oEl.className = oEl.className.replace(re," ")+ " " + className):oEl.setAttribute("class",(oEl.getAttribute("class")|| "").replace(re," ")+ " " + className);
		};
		return oEl;
	}
	,importStylesheet:function(def,win){
		for(var i = 0;i < def.length;i ++){
			if(def[i][1]){
				if(jpf.isIE)(win || window).document.styleSheets[0].addRule(def[i][0],def[i][1]);
				else(win || window).document.styleSheets[0].insertRule(def[i][0]+ " {" + def[i][1]+ "}",0);
			}
		}
	}
	,importCssString:function(doc,cssString,media){
		var htmlNode = doc.getElementsByTagName("head")[0];
		
		if(jpf.canCreateStyleNode){
			var head = document.getElementsByTagName("head")[0];
			var style = document.createElement("style");
			style.appendChild(document.createTextNode(cssString));
			head.appendChild(style);
		}
		else{
			htmlNode.insertAdjacentHTML("beforeend",".<style media='" +(media || "all")+ "'>" + cssString + "</style>");
		}
	}
	,loadStylesheet:function(filename,title){
		with(o = document.getElementsByTagName("head")[0].appendChild(document.createElement("LINK"))){
			rel = "stylesheet";
			type = "text/css";
			href = filename;
			title = title;
		};
		return o;
	}
	,getStyle:function(el,prop){
		if(typeof document.defaultView != "undefined" && typeof document.defaultView.getComputedStyle != "undefined")return document.defaultView.getComputedStyle(el,'').getPropertyValue(prop);
		return el.currentStyle[prop];
	}
	,addEventListener:function(oHtml,eventName,method){
		if(oHtml.addEventListener)oHtml.addEventListener(eventName,method,false);
		else oHtml["on" + eventName]= method;
	}
	,removeNode:function(element){
		if(! element)return;
		
		if(! jpf.isIE){
			if(element.parentNode)element.parentNode.removeChild(element);
			return;
		};
		var garbageBin = document.getElementById('IELeakGarbageBin');
		
		if(! garbageBin){
			garbageBin = document.createElement('DIV');
			garbageBin.id = 'IELeakGarbageBin';
			garbageBin.style.display = 'none';
			document.body.appendChild(garbageBin);
		};
		garbageBin.appendChild(element);
		garbageBin.innerHTML = '';
	}
	,uniqueHtmlIds:0,setUniqueHtmlId:function(oHtml){
		oHtml.setAttribute("id","q" + this.uniqueHtmlIds ++)}
	,getUniqueId:function(oHtml){
		return this.uniqueHtmlIds ++;
	}
	,local:[],locals:{
	}

,getRoot:function(){
		return this.root ? this:window.opener.jpf;
	}
	,getActiveWindow:function(){
		return this.getRoot().activeWindow;
	}
	,getPath:function(path){
		return(path.match(/http\:\/\/|file\:\/\//)? path:jpf.hostPath + path);
	}
	,register:function(o,tagName,nodeType){
		o.tagName = tagName;
		o.nodeType = nodeType || NOGUI_NODE;
		o.uniqueId = this.all.push(o)- 1;
		this.makeClass(o);
		
		if(o.nodeType == MF_NODE)DeskRun.register(o);
		
		if(! this.root){
			this.local.push(o);
			this.locals[o.uniqueId]= true;
		}
	}
	,lookup:function(uniqueId){
		return this.all[uniqueId];
	}
	,localLookup:function(uniqueId){
		if(this.locals.length && ! this.locals[uniqueId])return;
		return this.all[uniqueId];
	}
	,findHost:function(o){
		var node = o;
		
		while(o && ! o.host && o.parentNode)o = o.parentNode;
		return o && o.host && typeof o.host != "string" ? o.host:false;
	}
	,sleep:function(ms){
		if(! window.showModalDialog)return;
		window.showModalDialog('javascript:document.writeln("<script>window.setTimeout(function () { window.close(); }, ' + ms + ');</script>")');
	}
	,availHTTP:[],releaseHTTP:function(http){
		if(jpf.brokenHttpAbort)return;
		
		if(self.XMLHttpRequestUnSafe && http.constructor == XMLHttpRequestUnSafe)return;
		http.onreadystatechange = this.emptyf;
		http.abort();
		this.availHTTP.push(http);
	}
	,setReference:function(name,o,global){
		if(self[name]&& self[name].hasFeature)return;
		return(self[name]= o);
	}
	,getRules:function(node){
		var rules ={
		};
		
		for(var w = node.firstChild;w;w = w.nextSibling){
			if(w.nodeType != 1)continue;
			else{
				if(! rules[w[jpf.TAGNAME]])rules[w[jpf.TAGNAME]]=[];
				rules[w[jpf.TAGNAME]].push(w);
			}
		};
		return rules;
	}
	,status:function(str){
		if(! jpf.debug)return;
		
		if(false && jpf.isOpera)status = str;
		else 
		if(jpf){
			var dt = new Date();
			var date = dt.getHours()+ ":" + dt.getMinutes()+ ":" + dt.getSeconds()+ ":" + dt.getMilliseconds();
			jpf.debugMsg("[" + date + "] " + str.replace(/\n/g,"<br />").replace(/\t/g,"&nbsp;&nbsp;&nbsp;")+ "<br />","status");
		}
		else document.title = str;
	}
	,issueWarning:function(nr,msg){
		if(! self.jpf.debug)return;
		
		if(jpf.warnings[msg])return;
		jpf.status("[Warning - " + nr + "]:<br />" + msg.replace(/\n/g,"<br />")+ "<br />");
		jpf.warnings[msg]= true;
	}
	,warnings:{
	}

,debugInfo:"",debugMsg:function(msg,type,forceWin){
		if(! jpf.debug)return;
		
		if(jpf.debugFilter.match(new RegExp("!" + type + "(\||$)","i")))return;
		
		if(jpf.debugType.toLowerCase()== "window" || this.win && ! this.win.closed || forceWin){
			this.win = window.open("","debug");
			
			if(! this.win){
				if(! this.haspopupkiller)alert("Could not open debug window, please check your popupkiller");
				this.haspopupkiller = true;
			}
			else this.win.document.write(msg);
		};
		this.debugInfo += msg;
		
		if(this.ondebug)this.ondebug(msg);
	}
	,showDebug:function(){
		this.win = window.open("","debug");
		this.win.document.write(this.debugInfo);
	}
	,formErrorString:function(number,control,process,message,jmlContext,outputname,output){
		var str =["---- Javeline Error ----"];
		
		if(jmlContext){
			if(jmlContext.nodeType == 9)jmlContext = jmlContext.documentElement;
			var c = jmlContext.ownerDocument.outerHTML ||(jmlContext.ownerDocument.xml || jmlContext.ownerDocument.serialize())|| "";
			var jmlStr =(jmlContext.outerHTML || jmlContext.xml || jmlContext.serialize()).replace(/\<\?xml\:namespace prefix = j ns = "http\:\/\/www.javeline.net\/j" \/\>/g,"").replace(/xmlns:j="[^"]*"\s*/g,"");
			var linenr = c.substr(0,c.indexOf(jmlStr)).split("\n").length;
			str.push("jml file: [line: " + linenr + "] " + jpf.removePathContext(jpf.hostPath,jmlContext.ownerDocument.documentElement.getAttribute("filename")));
		};
		
		if(control)str.push("Control: '" +(control.name ||(control.jml ? control.jml.getAttribute("id"):null)|| "{Anonymous}")+ "' [" + control.tagName + "]");
		
		if(process)str.push("Process: " + process);
		
		if(message)str.push("Message: [" + number + "] " + message);
		
		if(outputname)str.push(outputname + ": " + output);
		
		if(jmlContext)str.push("\n===\n" + jmlStr);
		return str.join("\n");
	}
	,DragMode:{
		modes:{
		}
	,removeMode:function(mode){
			this.modes[mode]= null;
		}
		,defineMode:function(mode,struct){
			this.modes[mode]= struct;
		}
		,setMode:function(mode){
			for(prop in this.modes[mode])
			if(prop.match(/^on/))document.body[prop]= this.modes[mode][prop];
			this.mode = mode;
		}
		,clear:function(){
			for(prop in this.modes[this.mode])
			if(prop.match(/^on/))document.body[prop]= null;
			this.mode = null;
		}
	}
	,Plane:{
		init:function(){
			if(! this.plane){
				this.plane = document.createElement("DIV");
				this.plane.style.background = "url(spacer.gif)";
				this.plane.style.position = "absolute";
				this.plane.style.zIndex = 99999;
				this.plane.style.left = 0;
				this.plane.style.top = 0;
			}
		}
		,show:function(o){
			this.init();
			this.current = o;
			this.lastZ = this.current.style.zIndex;
			this.current.style.zIndex = 100000;
			o.parentNode.appendChild(this.plane);
			var p = document.body == this.plane.parentNode ? document.documentElement:this.plane.parentNode;
			this.plane.style.display = "block";
			this.plane.style.left = p.scrollLeft;
			this.plane.style.top = p.scrollTop;
			var diff = jpf.isOpera ?[0,0]:jpf.compat.getDiff(p);
			this.plane.style.width =(p.offsetWidth - diff[0])+ "px";
			this.plane.style.height =(p.offsetHeight - diff[1])+ "px";
			return this.plane;
		}
		,hide:function(){
			this.plane.style.display = "none";
			this.current.style.zIndex = this.lastZ;
			return this.plane;
		}
	}
	,Popup:{
		cache:{
		}
	,setContent:function(cacheId,content,style,width,height){
			if(! this.popup)this.init();
			this.cache[cacheId]={
				content:content,style:style,width:width,height:height};
			content.style.position = "absolute";
			return content.ownerDocument;
		}
		,removeContent:function(cacheId){
			this.cache[cacheId]= null;
			delete this.cache[cacheId];
		}
		,init:function(){
			this.popup ={
			};
		}
		,show:function(cacheId,x,y,animate,ref,width,height,callback){
			if(! this.popup)this.init();
			
			if(this.last != cacheId)this.hide();
			var o = this.cache[cacheId];
			var popup = o.content;
			o.content.onmousedown = function(e){
				(e || event).cancelBubble = true;
			};
			o.content.style.zIndex = 10000000;
			var pos = jpf.compat.getAbsolutePosition(ref);
			var top = y + pos[1];
			var p = jpf.compat.getOverflowParent(o.content);
			var moveUp =(top + height + y)> p.offsetHeight + p.scrollTop;
			popup.style.top = top + "px";
			popup.style.left =(x + pos[0])+ "px";
			popup.style.width =((width || o.width)- 3)+ "px";
			
			if(animate){
				var iVal,steps = 7,i = 0;
				iVal = setInterval(function(){var value = ++ i *((height || o.height)/ steps);
					popup.style.height = value + "px";
					
					if(moveUp)popup.style.top =(top - value - y)+ "px";
					else popup.scrollTop = - 1 *(i - steps - 1)*((height || o.height)/ steps);
					popup.style.display = "block";
					
					if(i > steps){
						clearInterval(iVal);
						callback(popup);
					}
				}
				,10);
			}
			else{
				popup.style.height =(height || o.height)+ "px"};
			this.last = cacheId;
		}
		,hide:function(){
			if(this.cache[this.last])this.cache[this.last].content.style.display = "none";
		}
		,forceHide:function(){
			if(this.last){
				var o = jpf.lookup(this.last);
				
				if(! o)this.last = null;
				else o.dispatchEvent("onpopuphide");
			}
		}
		,destroy:function(){
			if(! this.popup)return;
		}
	}
	,include:function(sourceFile,doBase){
		jpf.status("including js file: " + sourceFile);
		var head = document.getElementsByTagName("head")[0];
		var elScript = document.createElement("script");
		elScript.defer = true;
		elScript.src = doBase ?(jpf.basePath || "")+ sourceFile:sourceFile;
		head.appendChild(elScript);
	}
	,Init:{
		queue:[],cond:{
			combined:[]}
		,done:{
		}
	,add:function(func,o){
			if(this.inited)func.call(o);
			else 
			if(func)this.queue.push([func,o]);
		}
		,addConditional:function(func,o,strObj){
			if(typeof strObj != "string"){
				if(this.checkCombined(strObj))return func.call(o);
				this.cond.combined.push([func,o,strObj]);
			}
			else 
			if(self[strObj])func.call(o);
			else{
				if(! this.cond[strObj])this.cond[strObj]=[];
				this.cond[strObj].push([func,o]);
				this.checkAllCombined();
			}
		}
		,checkAllCombined:function(){
			for(var i = 0;i < this.cond.combined.length;i ++){
				if(! this.cond.combined[i])continue;
				
				if(this.checkCombined(this.cond.combined[i][2])){
					this.cond.combined[i][0].call(this.cond.combined[i][1]);
					this.cond.combined[i]= null;
				}
			}
		}
		,checkCombined:function(arr){
			for(var i = 0;i < arr.length;i ++){
				if(! this.done[arr[i]])return false;
			};
			return true;
		}
		,run:function(strObj){
			this.inited = true;
			this.done[strObj]= true;
			this.checkAllCombined();
			var data = strObj ? this.cond[strObj]:this.queue;
			
			if(! data)return;
			
			for(var i = 0;i < data.length;i ++)data[i][0].call(data[i][1]);
		}
	}
	,getJmlDocFromString:function(xmlString){
		var str = xmlString.replace(/\<\!DOCTYPE[^>]*>/,"").replace(/&nbsp;/g," ").replace(/^[\r\n\s]*/,"").replace(/<\s*\/?\s*\w+:\s*[\w-]*[\s>\/]/g,function(m){return m.toLowerCase()}
	);
		
		if(! this.supportNamespaces)str = str.replace(/xmlns\=\"[^"]*\"/g,"");
		var xmlNode = jpf.getObject("XMLDOM",str);
		
		if(jpf.xmlParseError)jpf.xmlParseError(xmlNode);
		var nodes = xmlNode.selectNodes("//@*[not(contains(local-name(), '.')) and not(translate(local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = local-name())]");
		
		for(var i = 0;i < nodes.length;i ++){
			(nodes[i].ownerElement || nodes[i].selectSingleNode("..")).setAttribute(nodes[i].nodeName.toLowerCase(),nodes[i].nodeValue);
		};
		return xmlNode;
	}
	,loadIncludes:function(docElement){
		if(false && window.opener && window.opener.jpf.JMLParser){
			if(document.all)document.body.innerHTML = window.opener.jpf.JMLParser.xml.outerHTML;
			LoadData["interface"]=[window.opener.jpf.JMLParser.xmlClass,document.all ? document.getElementsByTagName("jpf.JMLParser")[0]:window.opener.jpf.JMLParser.xml];
			document.body.style.display = "block";
			return;
		};
		
		if((! jpf.canUseHtmlAsXml || document.body.getAttribute("mode")!= "html")&& ! docElement){
			return new jpf.http().getString((document.body.getAttribute("xmlurl")|| location.href).split(/#/)[0],function(xmlString,status,extra){if(status != __HTTP_SUCCESS__){
					if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
					else{
						var commError = new Error(0,jpf.formErrorString(0,null,"Loading XML application data","Could not load XML from remote source: " + extra.message));
						
						if(jpf.document.dispatchEvent("onerror",jpf.extend({error:commError,state:status}
						,extra))!== false)throw commError;
						return;
					}
				};
				var xmlNode = jpf.getJmlDocFromString(xmlString);
				
				if(jpf.isIE)document.body.innerHTML = "";
				else{
					var nodes = document.body.childNodes;
					
					for(var i = nodes.length - 1;i >= 0;i --)nodes[i].parentNode.removeChild(nodes[i]);
				};
				return jpf.loadIncludes(xmlNode);
			}
			,true);
		}
		else 
		if(! docElement)docElement = document;
		var prefix = jpf.findPrefix(docElement,jpf.ns.jpf);
		
		if(prefix)prefix += ":";
		
		if(jpf.isSafariOld)prefix = "j";
		jpf.AppData = jpf.supportNamespaces ? docElement.createElementNS(jpf.ns.jpf,prefix + "application"):docElement.createElement(prefix + "application");
		var head = $xmlns(docElement,"head",jpf.ns.xhtml)[0];
		
		if(head){
			var nodes = head.childNodes;
			
			for(var i = nodes.length - 1;i >= 0;i --)
			if(nodes[i].namespaceURI && nodes[i].namespaceURI != jpf.ns.xhtml)jpf.AppData.insertbefore(nodes[i],jpf.AppData.firstChild);
		};
		var body =(docElement.body ? docElement.body:$xmlns(docElement,"body",jpf.ns.xhtml)[0]);
		
		for(var i = 0;i < body.attributes.length;i ++)jpf.AppData.setAttribute(body.attributes[i].nodeName,body.attributes[i].nodeValue);
		var nodes = body.childNodes;
		
		for(var i = nodes.length - 1;i >= 0;i --)jpf.AppData.insertBefore(nodes[i],jpf.AppData.firstChild);
		docElement.documentElement.appendChild(jpf.AppData);
		jpf.loadJMLIncludes(jpf.AppData);
		
		if($xmlns(jpf.AppData,"loader",jpf.ns.jpf).length){
			jpf.loadScreen ={
				show:function(){
					this.oExt.style.display = "block";
				}
				,hide:function(){
					this.oExt.style.display = "none";
				}
			};
			
			if(jpf.isGecko || jpf.isSafari)document.body.innerHTML = "";
			
			if(jpf.isSafariOld){
				var q = jpf.getElement($xmlns(jpf.AppData,"loader",jpf.ns.jpf)[0],0).serialize();
				document.body.insertAdjacentHTML("beforeend",q);
				jpf.loadScreen.oExt = document.body.lastChild;
			}
			else{
				var htmlNode = jpf.getElement($xmlns(jpf.AppData,"loader",jpf.ns.jpf)[0],0);
				
				if(htmlNode.ownerDocument == document)jpf.loadScreen.oExt = document.body.appendChild(htmlNode.cloneNode(true));
				else{
					document.body.insertAdjacentHTML("beforeend",htmlNode.xml || htmlNode.serialize());
					jpf.loadScreen.oExt = document.body.lastChild;
				}
			}
		};
		document.body.style.display = "block";
		
		if(! self.ERROR_HAS_OCCURRED)jpf.Init.interval = setInterval('if(jpf.checkLoaded()) jpf.initialize()',20);
	}
	,loadJMLIncludes:function(xmlNode,doSync){
		var nodes = $xmlns(xmlNode,"include",jpf.ns.jpf);
		
		if(nodes.length){
			xmlNode.setAttribute("loading","loading");
			
			for(var i = nodes.length - 1;i >= 0;i --){
				jpf.loadJMLInclude(nodes[i],doSync);
			}
		}
		else xmlNode.setAttribute("loading","done");
		var nodes = $xmlns(xmlNode,"skin",jpf.ns.jpf);
		
		for(var i = 0;i < nodes.length;i ++){
			if(! nodes[i].getAttribute("src")&& ! nodes[i].getAttribute("name")|| nodes[i].childNodes.length)continue;
			var path = nodes[i].getAttribute("src")? jpf.getAbsolutePath(jpf.hostPath,nodes[i].getAttribute("src")):jpf.getAbsolutePath(jpf.hostPath,nodes[i].getAttribute("name"))+ "/index.xml";
			jpf.loadJMLInclude(nodes[i],doSync,path,true);
		};
		return true;
	}
	,loadJMLInclude:function(node,doSync,path,isSkin){
		jpf.status("Loading include file: " +(path || jpf.getAbsolutePath(jpf.hostPath,node.getAttribute("src"))));
		this.oHttp.getString(path || jpf.getAbsolutePath(jpf.hostPath,node.getAttribute("src")),function(xmlString,state,extra){if(state != __HTTP_SUCCESS__){
				if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
				else{
					var commError = new Error(1007,jpf.formErrorString(1007,null,"Loading Includes","Could not load Include file '" +(path || extra.userdata[0].getAttribute("src"))+ "'\nReason: " + extra.message,node));
					
					if(! jpf.document || jpf.document.dispatchEvent("onerror",jpf.extend({error:commError,state:state}
					,extra))!== false)throw commError;
					return;
				}
			};
			
			if(! isSkin){
				var xmlNode = jpf.getJmlDocFromString(xmlString).documentElement;
				
				if(xmlNode[jpf.TAGNAME].toLowerCase()== "skin")isSkin = true;
				else 
				if(xmlNode[jpf.TAGNAME]!= "application"){
					throw new Error(0,jpf.formErrorString(0,null,"Loading Includes","Could not find handler to parse include file for '" + xmlNode[jpf.TAGNAME]+ "' expected 'skin' or 'application'",node));
				}
			};
			
			if(isSkin){
				var xmlNode = jpf.XMLDatabase.getXml(xmlString);
				jpf.PresentationServer.Init(xmlNode,node,path);
				jpf.IncludeStack[extra.userdata[1]]= true;
				
				if(extra.userdata[0].parentNode)extra.userdata[0].parentNode.removeChild(extra.userdata[0]);
			}
			else{
				jpf.IncludeStack[extra.userdata[1]]= xmlNode;
				extra.userdata[0].setAttribute("iid",extra.userdata[1]);
				xmlNode.setAttribute("filename",extra.url);
			};
			jpf.loadJMLIncludes(xmlNode);
		}
		,! doSync,[node,jpf.IncludeStack.push(false)- 1]);
	}
	,checkLoaded:function(){
		for(var i = 0;i < jpf.IncludeStack.length;i ++){
			if(! jpf.IncludeStack[i]){
				jpf.status("Waiting for: [" + i + "] " + jpf.IncludeStack[i]);
				return false;
			}
		};
		
		if(! document.body)return false;
		jpf.status("Dependencies loaded");
		return true;
	}
	,checkLoadedDeps:function(){
		jpf.status("Loading...");
		
		for(var i = 0;i < this.Modules.length;i ++){
			if(! jpf[this.Modules[i]]){
				return false;
			}
		};
		
		for(var i = 0;i < this.TelePortModules.length;i ++){
			var mod = this.TelePortModules[i].replace(/(^.*\/|^)([^\/]*)\.js$/,"$2").toLowerCase();
			
			if(! jpf[mod]){
				return false;
			}
		};
		
		for(var i = 0;i < this.Components.length;i ++){
			if(this.Components[i].match(/^_base/)|| this.Components[i]== "HtmlWrapper")continue;
			
			if(! jpf[this.Components[i].toLowerCase()]){
				return false;
			}
		};
		
		if(! document.body)return false;
		jpf.status("Dependencies loaded");
		return true;
	}
	,initialize:function(){
		jpf.status("Initializing...");
		clearInterval(jpf.Init.interval);
		jpf.Init.run();
		
		if(jpf.JMLParser && jpf.AppData)jpf.JMLParser.parse(jpf.AppData);
		
		if(jpf.loadScreen && jpf.appsettings.autoHideLoading)jpf.loadScreen.hide();
	}
	,saveData:function(instruction,xmlContext,callback,multicall,userdata,arg,isGetRequest){
		if(! instruction)return false;
		var data = instruction.split(":");
		var instrType = data.shift();
		switch(instrType){
			case "url":case "url.post":case "url.eval":var oPost = instrType == "url.post" ? new jpf.post():new jpf.get();
			var xmlNode = xmlContext;
			var x = instrType == "url.eval" ? eval(data.join(":")).split("?"):data.join(":").split("?");
			var url = x.shift();
			var cgiData = x.join("?").replace(/\=(xpath|eval)\:([^\&]*)\&/g,function(m,type,content){if(type == "xpath"){
					var retvalue,o = xmlNode.selectSingleNode(RegExp.$1);
					
					if(! o)retvalue = "";
					else 
					if(o.nodeType >= 2 && o.nodeType <= 4)retvalue = o.nodeValue;
					else retvalue = o.serialize ? o.serialize():o.xml;
				}
				else 
				if(type == "eval"){
					try{
						var retvalue = eval(content);
					}
					catch(e){
					}
			};
				return "=" + retvalue + "&";
			}
		);
			
			if(arg && arg.length){
				var arg = arg[0];
				var pdata = arg.nodeType ? arg.xml || arg.serialize():jpf.serialize(arg);
				url += "?" + cgiData;
			}
			else{
				var pdata = cgiData};
			oPost.urls["saveData"]= url;
			oPost.addMethod("saveData",callback,null,true);
			oPost.callWithString("saveData",pdata,callback);
			break;
			case "rpc":var parsed = this.parseInstructionPart(data.join(":"),xmlContext,arg);
			arg = parsed.arguments;
			var q = parsed.name.split(".");
			var obj = eval(q[0]);
			var method = q[1];
			
			if(multicall)obj.force_multicall = true;
			
			if(userdata)obj[method].userdata = userdata;
			
			if(! obj.multicall)obj.callbacks[method]= callback;
			var retvalue = obj.call(method,arg ? obj.fArgs(arg,obj.names[method],(obj.vartype != "cgi" && obj.vexport == "cgi")):null);
			
			if(obj.multicall)return obj.purge(callback,"&@^%!@");
			else 
			if(multicall){
				obj.force_multicall = false;
				return obj;
			};
			
			if(! obj.multicall && ! obj[method].async && callback)return callback(retvalue);
			break;
			case "call":var parsed = this.parseInstructionPart(data.join(":"),xmlContext,arg);
			var retvalue = self[parsed.name].apply(null,parsed.arguments);
			
			if(callback)callback(retvalue,__HTTP_SUCCESS__,{userdata:userdata}
		);
			break;
			case "eval":
			try{
				var retvalue = eval(data[1]);
			}
			catch(e){
			};
			
			if(callback)callback(retvalue,__HTTP_SUCCESS__,{userdata:userdata}
		);
			break;
			case "cookie":var parsed = this.parseInstructionPart(data.join(":"),xmlContext,arg);
			var q = parsed.name.split(".");
			var cur_value = jpf.getcookie(q[0]);
			cur_value = cur_value ? jpf.unserialize(cur_value)||{
			}
		:{
			};
			
			if(! isGetRequest)cur_value[q[1]]= parsed.arguments[0];
			jpf.setcookie(q[0],jpf.serialize(cur_value));
			
			if(callback)callback(cur_value ? cur_value[q[1]]:null,__HTTP_SUCCESS__,{userdata:userdata}
		);
			break;
			default:return false;
			break;
		}
	}
	,getData:function(instruction,xmlContext,callback,multicall,arg){
		var instrParts = instruction.match(/^([^\|]*)(?:\|([^|]*)){0,1}$/);
		var operators =(instrParts[2]|| "").split(":");
		var get_callback = function(data,state,extra){
			if(state != __HTTP_SUCCESS__)return callback(data,state,extra);
			operators[2]= data;
			
			if(operators[0]&& data){
				if(typeof data == "string")data = jpf.XMLDatabase.getXml(data);
				data = data.selectSingleNode(operators[0]);
				
				if(! data)throw new Error(0,jpf.formErrorString(0,null,"Loading new data","Could not load data by doing selection on it using xPath: '" + operators[0]+ "'."));
			};
			extra.userdata = operators;
			return callback(data,state,extra);
		};
		
		if(this.saveData(instrParts[1],xmlContext,get_callback,multicall,operators,arg,true)!== false)return;
		var data = instruction.split(":");
		var instrType = data.shift();
		
		if(instrType.substr(0,1)== "#"){
			instrType = instrType.substr(1);
			var retvalue,oJmlNode = self[instrType];
			
			if(! oJmlNode.value)retvalue = null;
			else{
				if(data[2])retvalue = oJmlNode.value.selectSingleNode(data[2]);
				else retvalue = oJmlNode.value;
			}
		}
		else{
			var model = jpf.NameServer.get("model",instrType);
			
			if(! model)throw new Error(1068,jpf.formErrorString(1068,jmlNode,"Loading data","Could not find model by name: " + instrType,x));
			
			if(! model.data)retvalue = null;
			else{
				if(data[1])retvalue = model.data.selectSingleNode(data[1]);
				else retvalue = model.data;
			}
		};
		
		if(callback)get_callback(retvalue,__HTTP_SUCCESS__,{userdata:operators}
	);
		else{
			jpf.issueWarning(0,"Returning data directly in jpf.getData(). This means that all callback communication ends in void!");
			return retvalue;
		}
	}
	,setModel:function(instruction,jmlNode,isSelection){
		if(! instruction)return;
		var data = instruction.split(":");
		var instrType = data[0];
		
		if(instrType.match(/^(?:url|url.post|rpc|call|eval|cookie|gears)$/)){
			jmlNode.setModel(new jpf.Model().loadFrom(instruction));
		}
		else 
		if(instrType.substr(0,1)== "#"){
			instrType = instrType.substr(1);
			
			if(isSelection){
				var sb2 = jmlNode.getSelectionSmartBinding()|| jpf.JMLParser.getFromSbStack(jmlNode.uniqueId,1);
				
				if(sb2)sb2.model = new jpf.Model().loadFrom(instruction);
			}
			else 
			if(! self[instrType]|| ! jpf.JMLParser.inited){
				jpf.JMLParser.addToModelStack(jmlNode,data)}
			else{
				var oConnect = eval(instrType);
				
				if(oConnect.connect)oConnect.connect(jmlNode,null,data[2],data[1]|| "select");
				else jmlNode.setModel(new jpf.Model().loadFrom(instruction));
			};
			jmlNode.connectId = instrType;
		}
		else{
			var model = jpf.NameServer.get("model",data.shift());
			
			if(! model)throw new Error(1068,jpf.formErrorString(1068,jmlNode,"Finding model","Could not find model by name: " + instrType));
			
			if(isSelection){
				var sb2 = jmlNode.getSelectionSmartBinding()|| jpf.JMLParser.getFromSbStack(jmlNode.uniqueId,1);
				
				if(sb2){
					sb2.model = model;
					sb2.modelXpath[jmlNode.uniqueId]= data.join(":");
				}
			}
			else jmlNode.setModel(model,data.join(":"));
		}
	}
	,parseInstructionPart:function(instrPart,xmlNode,arg){
		var parsed ={
		}
	,s = instrPart.split("(");
		parsed.name = s.shift();
		
		if(! arg){
			arg = s.join("(");
			arg = arg.substr(0,arg.length - 1);
			arg = arg ? arg.split(","):[];
			
			for(var i = 0;i < arg.length;i ++){
				if(typeof arg[i]== "object")continue;
				
				if(typeof arg[i]== "string"){
					if(arg[i].match(/^xpath\:(.*)$/)){
						var o = xmlNode ? xmlNode.selectSingleNode(RegExp.$1):null;
						
						if(! o)arg[i]= "";
						else 
						if(o.nodeType >= 2 && o.nodeType <= 4)arg[i]= o.nodeValue;
						else arg[i]= o.xml || o.serialize();
					}
					else 
					if(arg[i].match(/^call\:(.*)$/)){
						arg[i]= self[RegExp.$1](xmlNode,instrPart);
					}
					else 
					if(arg[i].match(/^\((.*)\)$/)){
						arg[i]= this.processArguments(RegExp.$1.split(";"),xmlNode,instrPart);
					}
					else{
						arg[i]= eval(arg[i]);
					}
				}
				else arg[i]= arg[i]|| "";
			}
		};
		parsed.arguments = arg;
		return parsed;
	}
	,destroy:function(exclude){
		this.Popup.destroy();
		
		for(var i = 0;i < this.all.length;i ++)
		if(this.all[i]&& this.all[i]!= exclude && this.all[i].destroy)this.all[i].destroy();
		document.oncontextmenu = null;
		document.onmousedown = null;
		document.onselectstart = null;
		document.onkeyup = null;
		document.onkeydown = null;
		
		for(var i = 0;i < this.availHTTP.length;i ++){
			this.availHTTP[i]= null;
		};
		jpf.XMLDatabase.unbind(jpf.window);
	}

};

var $ = function(tag,doc,prefix,force){
	return(doc || document).getElementsByTagName((prefix &&(force || jpf.isGecko || jpf.isOpera)? prefix + ":":"")+ tag);
};

var $xmlns = function(xmlNode,tag,xmlns,prefix){
	if(! jpf.supportNamespaces){
		if(! prefix)prefix = jpf.findPrefix(xmlNode,xmlns);
		
		if(xmlNode.style)return xmlNode.getElementsByTagName(tag);
		else{
			if(prefix)(xmlNode.nodeType == 9 ? xmlNode:xmlNode.ownerDocument).setProperty("SelectionNamespaces","xmlns:" + prefix + "='" + xmlns + "'");
			return xmlNode.selectNodes(".//" +(prefix ? prefix + ":":"")+ tag);
		}
	}
	else return xmlNode.getElementsByTagNameNS(xmlns,tag);
};

var $j = function(xmlNode,tag){
	return $xmlns(xmlNode,tag,jpf.ns.jpf);
};

jpf.setcookie = function(name,value,expire,path,domain,secure){
	var ck = name + "=" + escape(value)+ ";";
	
	if(expire)ck += "expires=" + new Date(expire + new Date().getTimezoneOffset()* 60).toGMTString()+ ";";
	
	if(path)ck += "path=" + path + ";";
	
	if(domain)ck += "domain=" + domain;
	
	if(secure)ck += "secure";
	document.cookie = ck;
	return true};

jpf.getcookie = function(name){
	var aCookie = document.cookie.split("; ");
	
	for(var i = 0;i < aCookie.length;i ++){
		var aCrumb = aCookie[i].split("=");
		
		if(name == aCrumb[0])return unescape(aCrumb[1]);
	};
	return "";
};

jpf.delcookie = function(name,domain){
	document.cookie = name + "=blah; expires=Fri, 31 Dec 1999 23:59:59 GMT;" + domain ? 'domain=' + domain:'';
};

jpf.getXmlValue = function(xmlNode,xpath){
	if(! xmlNode)return "";
	xmlNode = xmlNode.selectSingleNode(xpath);
	
	if(xmlNode && xmlNode.nodeType == 1)xmlNode = xmlNode.firstChild;
	return xmlNode ? xmlNode.nodeValue:"";
};

jpf.getXmlValues = function(xmlNode,xpath){
	var out =[];
	
	if(! xmlNode)return out;
	var nodes = xmlNode.selectNodes(xpath);
	
	if(! nodes.length)return out;
	
	for(var i = 0;i < nodes.length;i ++){
		var n = nodes[i];
		
		if(n.nodeType == 1)n = n.firstChild;
		out.push(n.nodeValue || "");
	};
	return out;
};

jpf.removeParts = function(str){
	q = str.replace(/^\s*function\s*\w*\s*\([^\)]*\)\s*\{/,"");
	q = q.replace(/\}\s*$/,"");
	return q;
};

jpf.importClass = function(ref,strip,win){
	if(! ref)throw new Error(1018,jpf.formErrorString(1018,null,"importing class","Could not load reference. Reference is null"));
	
	if(! jpf.hasExecScript)return ref();
	
	if(! strip)return(win.execScript ? win.execScript(ref.toString()):eval(ref.toString()));
	var q = jpf.removeParts(ref.toString());
	return win.execScript ? win.execScript(q):eval(q);
};

jpf.Init.run('jpf');

/*FILEHEAD(/in/Library/Components/Bar.js)SIZE(1389)TIME(1213477409693)*/
jpf.bar = function(pHtmlNode){
	jpf.register(this,"bar",GUI_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	this.inherit(jpf.Presentation);
	this.inherit(jpf.JmlNode);
	this.draw = function(){
		this.oExt = this.__getExternal();
	};
	this.__loadJML = function(x){
		var oInt = this.__getLayoutNode("Main","container",this.oExt);
		this.oInt = this.oInt ? jpf.JMLParser.replaceNode(oInt,this.oInt):jpf.JMLParser.parseChildren(x,oInt,this);
	}

}

/*FILEHEAD(/in/Library/Components/Browser.js)SIZE(3393)TIME(1203724026556)*/

/*FILEHEAD(/in/Library/Components/Button.js)SIZE(7916)TIME(1203724026556)*/
jpf.submit = jpf.trigger = jpf.button = function(pHtmlNode,tagName){
	jpf.register(this,tagName || "button",GUI_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	this.inherit(jpf.Presentation);
	this.focussable = true;
	this.value = null;
	this.setActive = this.__enable = function(){
		this.__doBgSwitch(1);
	};
	this.setInactive = this.__disable = function(){
		this.__doBgSwitch(4);
		this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Over",this.baseCSSname + "Down"]);
	};
	this.__doBgSwitch = function(nr){
		if(this.bgswitch &&(this.bgoptions[1]>= nr || nr == 4)){
			if(nr == 4)nr = this.bgoptions[1]+ 1;
			var strBG = this.bgoptions[0]== "vertical" ? "0 -" +(parseInt(this.bgoptions[2])*(nr - 1))+ "px":"-" +(parseInt(this.bgoptions[2])*(nr - 1))+ "px 0";
			this.__getLayoutNode("Main","background",this.oExt).style.backgroundPosition = strBG;
		}
	};
	this.__setStateBehaviour = function(value){
		this.value = value || false;
		this.isBoolean = true;
		this.__setStyleClass(this.oExt,this.baseCSSname + "Bool");
		
		if(this.value){
			this.__setStyleClass(this.oExt,this.baseCSSname + "Down");
			this.__doBgSwitch(this.states["Down"]);
		}
	};
	this.__setNormalBehaviour = function(){
		this.value = null;
		this.isBoolean = false;
		this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Bool"]);
	};
	this.setValue = function(value){
		if(value === undefined)value = ! this.value;
		this.value = value;
		
		if(this.value)this.__setStyleClass(this.oExt,this.baseCSSname + "Down",[this.baseCSSname + "Over"]);
		else this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Down"]);
		this.dispatchEvent("onclick");
	};
	this.setCaption = function(value){
		if(this.oCaption)this.oCaption.nodeValue = value;
	};
	this.setIcon = function(url){
		if(this.oIcon.tagName == "img")this.oIcon.setAttribute("src",this.iconPath + url);
		else this.oIcon.style.backgroundImage = "url(" + this.iconPath + url + ")";
	};
	this.inherit(jpf.JmlNode);
	this.inherit(jpf.BaseButton);
	this.__setState = function(state,e,strEvent){
		if(this.disabled)return;
		this.__doBgSwitch(this.states[state]);
		this.__setStyleClass(this.oExt,(state != "Out" ? this.baseCSSname + state:""),[(this.value ? "":this.baseCSSname + "Down"),this.baseCSSname + "Over"]);
		this.dispatchEvent(strEvent,e);
		
		if(state != "Down")e.cancelBubble = true;
	};
	this.draw = function(clear,parentNode,Node,transform){
		this.oExt = this.__getExternal();
		this.oIcon = this.__getLayoutNode("Main","icon",this.oExt);
		this.oCaption = this.__getLayoutNode("Main","caption",this.oExt);
		this.__setupEvents();
	};
	this.__clickHandler = function(){
		if(this.isBoolean){
			this.value = ! this.value;
			return true;
		}
	};
	this.__supportedProperties =["icon","value","tooltip","state","color","caption","action","target"];
	this.__handlePropSet = function(prop,value){
		if(prop == "icon")this.setIcon(value);
		else 
		if(prop == "value")this.sValue = value;
		else 
		if(prop == "tooltip")this.oExt.setAttribute("title",value);
		else 
		if(prop == "state")this.__setStateBehaviour(value == 1);
		else 
		if(prop == "color")this.oCaption.parentNode.style.color = value;
		else 
		if(prop == "caption")this.setCaption(value);
	};
	this.__loadJML = function(x){
		this.setCaption(x.firstChild ? x.firstChild.nodeValue:"");
		this.bgswitch = x.getAttribute("bgswitch")? true:false;
		
		if(this.bgswitch){
			this.__getLayoutNode("Main","background",this.oExt).style.backgroundImage = "url(" + this.mediaPath + x.getAttribute("bgswitch")+ ")";
			this.__getLayoutNode("Main","background",this.oExt).style.backgroundRepeat = "no-repeat";
			this.bgoptions = x.getAttribute("bgoptions")? x.getAttribute("bgoptions").split("\|"):["vertical",2,16];
		}
	}

}

/*FILEHEAD(/in/Library/Components/Checkbox.js)SIZE(5564)TIME(1203724026556)*/

/*FILEHEAD(/in/Library/Components/Collection.js)SIZE(1226)TIME(1203724026571)*/

/*FILEHEAD(/in/Library/Components/Colorpicker.js)SIZE(10483)TIME(1203724026571)*/

/*FILEHEAD(/in/Library/Components/Container.js)SIZE(3314)TIME(1203724026571)*/

/*FILEHEAD(/in/Library/Components/Datagrid.js)SIZE(49375)TIME(1213479939834)*/

/*FILEHEAD(/in/Library/Components/Datastore.js)SIZE(1907)TIME(1203724026571)*/

/*FILEHEAD(/in/Library/Components/Dropdown.js)SIZE(11673)TIME(1203724527603)*/

/*FILEHEAD(/in/Library/Components/Errorbox.js)SIZE(2282)TIME(1203724026571)*/

/*FILEHEAD(/in/Library/Components/FastList.js)SIZE(4382)TIME(1203724265728)*/

/*FILEHEAD(/in/Library/Components/FileUploadBox.js)SIZE(9579)TIME(1203724314899)*/

/*FILEHEAD(/in/Library/Components/Flash.js)SIZE(2582)TIME(1202845529234)*/

/*FILEHEAD(/in/Library/Components/Frame.js)SIZE(1925)TIME(1203724026587)*/

/*FILEHEAD(/in/Library/Components/Hbox.js)SIZE(5461)TIME(1213479573209)*/
jpf.hbox = jpf.vbox = function(pHtmlNode,tagName){
	jpf.register(this,tagName,GUI_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	function checkSplitters(node){
		var lastNode = node.children[node.children.length - 1];
		
		if(lastNode.splitter && node.parent){
			var p = node;
			p.splitter = lastNode.splitter;
			p.edgeMargin = Math.max(p.edgeMargin,p.splitter);
			lastNode.splitter = null;
			
			if(p.parent && p.stackId == p.parent.children.length - 1){
				p.parent.splitter = p.splitter;
				p.parent.edgeMargin = Math.max(p.parent.edgeMargin,p.parent.splitter);
				p.splitter = null;
			}
		};
		var firstNode = node.children[0];
		
		if(firstNode && node.parent){
			if(node.vbox){
				node.fwidth = firstNode.fwidth;
				firstNode.fwidth = null;
			}
			else{
				node.fheight = firstNode.fheight;
				firstNode.fheight = null;
			};
			node.weight = firstNode.weight;
		};
		
		for(var i = 0;i < node.children.length;i ++){
			if(! node.children[i].node)checkSplitters(node.children[i]);
		}
	};
	this.compileAlignment = function(){
		var n = this.aData.children;
		
		for(var f = false,i = 0;i < n.length;i ++){
			if(n[i].template == "bottom"){
				if(n[i].splitter){
					n[i - 1].splitter = n[i].splitter;
					n[i - 1].edgeMargin = Math.max(n[i - 1].edgeMargin,n[i - 1].splitter);
					n[i].splitter = null;
				}
			}
		};
		checkSplitters(this.aData);
		jpf.layoutServer.compile(pHtmlNode);
	};
	this.addAlignNode = function(jmlNode){
		var align = jmlNode.jml.getAttribute("align").split("-");
		var s = this.aData.children;
		var a = jmlNode.aData;
		
		if(align[1]== "splitter"){
			a.splitter = align[2]|| 5;
			a.edgeMargin = Math.max(a.edgeMargin,a.splitter);
		};
		align = align[0];
		a.template = align;
		
		if(align == "top"){
			for(var p = s.length,i = 0;i < s.length;i ++){
				if(s[i].template != "top"){
					p = i;
					break;
				}
			};
			
			for(var i = s.length - 1;i > p;i ++){
				s[i + 1]= s[i];
				s[i].stackId = i + 1;
			};
			s[p]= a;
			s[p].stackId = p;
			a.parent = this.aData;
		}
		else 
		if(align == "bottom"){
			a.stackId = s.push(a)- 1;
			a.parent = this.aData;
		}
		else{
			var hbox = null;
			
			for(var p = 0,i = 0;i < s.length;i ++){
				if(s[i].hbox){
					hbox = s[i];
					break;
				}
				else 
				if(s[i].node && s[i].template == "top")p = i;
			};
			
			if(! hbox){
				var hbox = new jpf.hbox(this.pHtmlNode,"hbox");
				hbox.loadJML(jpf.XMLDatabase.getXml("<hbox />"));
				hbox.parentNode = this;
				hbox.aData.jmlNode = hbox;
				hbox = hbox.aData;
				hbox.parent = this.aData;
				
				if(p){
					for(var i = s.length - 1;i > p;i --){
						s[i + 1]= s[i];
						s[i].stackId ++;
					};
					s[p + 1]= hbox;
					hbox.stackId = p + 1;
				}
				else hbox.stackId = s.push(hbox)- 1;
			};
			var col,n = hbox.children;
			
			for(var i = 0;i < n.length;i ++){
				if(n[i].template == align){
					col = n[i];
					break;
				}
			};
			
			if(! col){
				var col = new jpf.vbox(this.pHtmlNode,"vbox");
				col.loadJML(jpf.XMLDatabase.getXml("<vbox />"));
				col.parentNode = hbox.jmlNode;
				col = col.aData;
				col.parent = hbox;
				col.template = align;
				
				if(align == "left"){
					n.unshift(col);
					
					for(var i = 0;i < n.length;i ++)n[i].stackId = i;
				}
				else 
				if(align == "right")col.stackId = n.push(col)- 1;
				else 
				if(align == "middle"){
					for(var f,i = 0;i < n.length;i ++)
					if(n[i].template == "right")f = i;
					var rcol = n[f];
					
					if(rcol){
						n[f]= col;
						col.stackId = f;
						rcol.stackId = n.push(rcol)- 1;
					}
					else{
						col.stackId = n.push(col)- 1;
					}
				}
			};
			a.stackId = col.children.push(a)- 1;
			a.parent = col;
		}
	};
	this.loadJML = function(x,pJmlNode,ignoreBindclass,id){
		this.name = x.getAttribute("id");
		
		if(x){
			if(! this.parentNode)this.parentNode = pJmlNode;
			this.jml = x;
		}
		else x = this.jml;
		this.inherit(jpf.JmlDomAPI);
		this.oInt = this.oExt = this.jml.parentNode.lastChild == this.jml.parentNode.firstChild ? pHtmlNode:pHtmlNode.appendChild(document.createElement("div"));
		
		if(this.jml.getAttribute("cssclass"))this.oExt.className = this.jml.getAttribute("cssclass");
		
		if(id)this.oExt.setAttribute("id",id);
		this.drawed = true;
		this.dispatchEvent("ondraw");
		var l = jpf.layoutServer.get(pHtmlNode,(x.getAttribute("margin")|| "").split(/,\s*/));
		this.aData = jpf.layoutServer.parseXml(x,l,null,true);
		this.oInt = jpf.JMLParser.parseChildren(x,pHtmlNode,this);
		
		if(! this.parentNode)return;
		
		if(! this.parentNode.tagName || ! this.parentNode.tagName.match(/^(?:vbox|hbox)$/)){
			l.root = this.aData;
			
			if(this.aData.children.length)jpf.layoutServer.compile(pHtmlNode);
		}
		else{
			this.aData.stackId = this.parentNode.aData.children.push(this.aData)- 1;
			this.aData.parent = this.parentNode.aData;
		}
	}

}

/*FILEHEAD(/in/Library/Components/HtmlWrapper.js)SIZE(2095)TIME(1213479504380)*/

/*FILEHEAD(/in/Library/Components/Insert.js)SIZE(3003)TIME(1203724359946)*/

/*FILEHEAD(/in/Library/Components/Jslt.js)SIZE(3261)TIME(1203724026618)*/

/*FILEHEAD(/in/Library/Components/Label.js)SIZE(3627)TIME(1203783381109)*/

/*FILEHEAD(/in/Library/Components/Layoutbuilder.js)SIZE(13658)TIME(1213479593849)*/

/*FILEHEAD(/in/Library/Components/Lineselect.js)SIZE(3529)TIME(1203724557821)*/

/*FILEHEAD(/in/Library/Components/List.js)SIZE(6870)TIME(1203724026618)*/
jpf.select = jpf.select1 = jpf.list = function(pHtmlNode,tagName,jmlNode){
	jpf.register(this,tagName || "list",GUI_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	this.__getCaptionElement = function(){
		var x = this.__getLayoutNode("Item","caption",this.selected);
		
		if(! x)return;
		return x.nodeType == 1 ? x:x.parentNode;
	};
	this.inherit(jpf.BaseList);
	this.keyHandler = this.__keyHandler;
	this.inherit(jpf.Rename);
	this.inherit(jpf.JmlNode);
	this.draw = function(){
		this.oExt = this.__getExternal();
		this.oInt = this.__getLayoutNode("Main","container",this.oExt);
		this.oExt.onmousedown = function(e){
			if(! e)e = event;
			
			if(e.ctrlKey || e.shiftKey)return;
			var srcElement = jpf.hasEventSrcElement ? e.srcElement:e.target;
			
			if(this.host.allowDeselect &&(srcElement == this || srcElement.getAttribute(jpf.XMLDatabase.htmlIdTag)))this.host.clearSelection();
		};
		this.oExt.onclick = function(e){
			this.host.dispatchEvent("onclick",{htmlEvent:e || event}
		);
		};
		this.listtype = parseInt(this.__getOption("Main","type"))|| 1;
		this.behaviour = parseInt(this.__getOption("Main","behaviour"))|| 1;
		this.mode = this.mode || this.jml.getAttribute("mode")|| "normal";
		
		if(this.mode == "check" || this.mode == "radio"){
			this.allowDeselect = false;
			this.ctrlSelect = true;
			this.addEventListener("onafterrename",function(){var sb = this.getSelectionSmartBinding();
				
				if(! sb)return;
				sb.__updateSelection();
			}
		);
			
			if(this.mode == "check")this.autoselect = false;
			
			if(this.mode == "radio")this.multiselect = false;
		};
		this.more = this.jml.getAttribute("more")? true:false;
		
		if(this.more){
			this.delayedSelect = false;
			this.addEventListener("onxmlupdate",function(e){if("insert|add|synchronize|move".indexOf(e.action)> - 1)this.oInt.appendChild(this.moreItem);
			}
		);
			this.addEventListener("onafterrename",function(){var caption = this.applyRuleSetOnNode("caption",this.indicator);
				var xmlNode = this.findXmlNodeByValue(caption);
				var curNode = this.indicator;
				
				if(xmlNode != curNode || ! caption){
					if(xmlNode && ! this.isSelected(xmlNode))this.select(xmlNode);
					this.remove(curNode);
				}
				else 
				if(! this.isSelected(curNode))this.select(curNode);
			}
		);
			this.addEventListener("onbeforeselect",function(){if(arguments[0]&& this.isSelected(arguments[0])&& arguments[0].getAttribute('custom')== '1'){
					this.setIndicator(arguments[0]);
					this.value = arguments[0];
					var j = this;
					setTimeout(function(){j.startRename()}
				);
					return false;
				}
			}
		);
		}
	};
	this.__loadJML = function(x){
		if(this.jml.childNodes.length)this.loadInlineData(this.jml);
		
		if(this.hasFeature(__MULTIBINDING__)&& x.getAttribute("value"))this.setValue(x.getAttribute("value"));
		
		if(x.getAttribute("multibinding")== "true" && ! x.getAttribute("ref"))this.inherit(jpf.MultiLevelBinding);
	};
	this.__destroy = function(){
		this.oExt.onclick = null;
		jpf.removeNode(this.oDrag);
		this.oDrag = null;
	}

}

/*FILEHEAD(/in/Library/Components/mediaflow/MFBrowser.js)SIZE(3512)TIME(1203724557853)*/

/*FILEHEAD(/in/Library/Components/mediaflow/MFButton.js)SIZE(3710)TIME(1203724557853)*/

/*FILEHEAD(/in/Library/Components/mediaflow/MFCheckbox.js)SIZE(4796)TIME(1203724557853)*/

/*FILEHEAD(/in/Library/Components/mediaflow/MFDisplay.js)SIZE(4528)TIME(1203724557853)*/

/*FILEHEAD(/in/Library/Components/mediaflow/MFDropdown.js)SIZE(10896)TIME(1203724557853)*/
jpf.MFDropdown = function(pHtmlNode){
	jpf.register(this,"MFDropdown",MF_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	this.animType = 1;
	this.animSteps = document.all ? 5:8;
	this.animSpeed = document.all ? 20:10;
	this.itemSelectEvent = "onmouseup";
	this.hasCheckbox = false;
	this.dragdrop = false;
	this.reselectable = true;
	this.focussable = true;
	this.inherit(jpf.BaseList);
	this.autoselect = false;
	this.multiselect = false;
	this.addEventListener("onafterselect",function(e){if(IS_IE)e = event;
		this.slideUp();
		this.oExt.caption = this.applyRuleSetOnNode("Caption",this.value);
		this.oExt.Redraw();
		this.__updateOtherBindings();
	}

);
	this.addEventListener("onafterdeselect",function(){this.oExt.caption = "";
		this.oExt.Redraw();
	}

);
	function setMaxCount(){
		if(! this.XMLRoot)return;
		this.setMaxItems(this.getTraverseNodes().length);
		
		if(this.isOpen == 2)this.slideDown();
	};
	this.addEventListener("onafterload",setMaxCount);
	this.addEventListener("onxmlupdate",setMaxCount);
	this.__showSelection = function(value){
		var bc = this.getSelectionBindClass();
		
		if(value === undefined){
			var value = bc.applyRuleSetOnNode("Value",bc.XMLRoot,null,true);
			value = value ? bc.applyRuleSetOnNode("Caption",bc.XMLRoot,null,true):"";
		}
	};
	this.__updateOtherBindings = function(){
		if(! this.multiselect){
			var bc = this.getSelectionBindClass(),caption;
			
			if(bc &&(caption = bc.bindingRules["Caption"])){
				var xmlNode = XMLDatabase.createNodeFromXpath(bc.XMLRoot,bc.bindingRules["Caption"][0].getAttribute("select"));
				
				if(! xmlNode)return;
				XMLDatabase.setNodeValue(xmlNode,this.applyRuleSetOnNode("Caption",this.value));
			}
		}
	};
	this.__blur = function(){
		this.slideUp();
	};
	this.keyHandler = function(key,ctrlKey,shiftKey,altKey){
		if(! this.XMLRoot)return;
		switch(key){
			case 38:
			if(! this.value && ! this.indicator)return;
			var node = this.getNextTraverseSelected(this.indicator || this.value,false);
			
			if(node)this.select(node);
			break;
			case 40:var node;
			
			if(! this.value && ! this.indicator){
				node = this.getFirstTraverseNode();
				
				if(! node)return;
			}
			else node = this.getNextTraverseSelected(this.indicator || this.value,true);
			
			if(node)this.select(node);
			break;
		}
	};
	this.inherit(jpf.JmlNode);
	this.slideToggle = function(e){
		if(! e)e = event;
		
		if(this.isOpen)this.slideUp();
		else this.slideDown(e);
	};
	this.slideDown = function(e){
		if(this.dispatchEvent("onslidedown")=== false)return false;
		this.isOpen = true;
		this.oSlider.style.display = "block";
		this.oSlider.style[IS_IE ? "overflowY":"overflow"]= "hidden";
		this.oSlider.style.display = "";
		this.oSlider.style.height =(this.sliderHeight - 1)+ "px";
		this.oSlider.style.width =(this.jml.getAttribute("width")- 2)+ "px";
		jpf.Popup.show(this.uniqueId,0,this.jml.getAttribute("height"),true,this.oLoc,this.jml.getAttribute("width"),this.containerHeight,function(container){container.style[IS_IE ? "overflowY":"overflow"]= "auto";
		}
	);
	};
	this.slideUp = function(){
		if(this.isOpen == 2)return;
		
		if(this.dispatchEvent("onslideup")=== false)return false;
		this.isOpen = false;
		
		if(this.value){
			var htmlNode = XMLDatabase.findHTMLNode(this.value,this);
			
			if(htmlNode)this.__setStyleClass(htmlNode,'',["hover"]);
		};
		jpf.Popup.hide();
	};
	this.addEventListener("onpopuphide",this.slideUp);
	this.setMaxItems = function(count){
		this.sliderHeight = count ?(Math.min(this.maxItems,count)* 18)+ 1:10;
		this.containerHeight = count ?(Math.min(this.maxItems,count)* 18)+ 1:10;
		
		if(this.containerHeight > 20)this.containerHeight = Math.ceil(this.containerHeight * 0.9);
	};
	this.disable = this.enable = function(){
	};
	this.__removeClearMessage = function(){
		var nodes = this.oSlider.childNodes;
		
		for(var i = 0;i < nodes.length;i ++){
			if(nodes[i].getAttribute("id").match(/empty/))this.oSlider.removeChild(nodes[i]);
		}
	};
	this.draw = function(){
		this.animType = this.__getOption("Main","animtype")|| 1;
		this.clickOpen = this.__getOption("Main","clickopen")|| "button";
		this.oExt = jdwin.CreateWidget("button");
		this.oLoc = this.pHtmlNode.appendChild(document.createElement("div"));
		this.oLoc.style.position = "absolute";
		this.oLoc.style.left = this.jml.getAttribute("left");
		this.oLoc.style.top = this.jml.getAttribute("top");
		this.oSlider = XMLDatabase.htmlImport(this.__getLayoutNode("Container"),document.body);
		this.oInt = this.__getLayoutNode("Container","contents",this.oSlider);
		this.pHtmlDoc = jpf.Popup.setContent(this.uniqueId,this.oSlider,jpf.PresentationServer.getTemplate(this.skinName).selectSingleNode("style").firstChild.nodeValue);
		this.listtype = parseInt(this.__getLayoutNode("Main","type"))|| 1;
	};
	this.__loadJML = function(x){
		this.name = x.getAttribute("id");
		this.maxItems = x.getAttribute("max-items")|| 5;
		this.disableremove = x.getAttribute("disableremove")!= "false";
		this.direction = x.getAttribute("direction")|| "down";
		this.clearOnNoSelection = x.getAttribute("clearonnoselection")== "true";
		this.bgswitch = x.getAttribute("bgswitch")? true:false;
		
		if(this.bgswitch){
			this.bgoptions = x.getAttribute("bgoptions")? x.getAttribute("bgoptions").split("\|"):["vertical",2];
			this.oExt.InitButton(0,0,0,this.bgoptions[1],this.mediaPath.replace(/jav\:\//,"")+ x.getAttribute("bgswitch"),this.parentNode.offsetHeight ? 1:0);
			this.oExt.locked = false;
			this.oExt.clicked = false;
			this.oExt.disabled = false;
			var clr = "0x000000";
			var il = this.jml.getAttribute("in_left");
			var it = this.jml.getAttribute("in_top");
			var ib = this.jml.getAttribute("in_bottom");
			var ir = this.jml.getAttribute("in_right");
			var s = this.jml.getAttribute("center");
			this.oExt.SetFont(0,"Arial",10,0,clr,il ? il:4,it ? it:4,ir ? ir:18,ib ? ib:0,s);
			this.oExt.SetFont(1,"Arial",10,0,clr,il ? il:4,it ? it:4,ir ? ir:18,ib ? ib:0,s);
			this.oExt.SetFont(2,"Arial",10,0,clr,il ? il:4,it ? it:4,ir ? ir:18,ib ? ib:0,s);
		};
		var jmlNode = this;
		this.oExt.onbuttonclick = function(){
			jmlNode.slideToggle({}
	);
		};
		
		if(x.childNodes.length)this.loadInlineData(x);
		this.setMaxItems();
		
		if(x.getAttribute("multibinding")== "true" && ! x.getAttribute("bind"))this.inherit(jpf.MultiLevelBinding);
	};
	this.__destroy = function(){
		jpf.Popup.removeContent(this.uniqueId);
	}

}

/*FILEHEAD(/in/Library/Components/mediaflow/MFList.js)SIZE(12317)TIME(1203724557853)*/

/*FILEHEAD(/in/Library/Components/mediaflow/MFMenu.js)SIZE(8873)TIME(1203724557853)*/

/*FILEHEAD(/in/Library/Components/mediaflow/MFSlider.js)SIZE(4835)TIME(1203724557853)*/

/*FILEHEAD(/in/Library/Components/Menu.js)SIZE(11484)TIME(1203724026618)*/

/*FILEHEAD(/in/Library/Components/ModalWindow.js)SIZE(20508)TIME(1213483132740)*/
jpf.WinServer ={
	count:9000,wins:[],setTop:function(win){
		win.setZIndex(this.count ++);
		this.wins.remove(win);
		this.wins.push(win);
		return win;
	}
	,setNext:function(){
		if(this.wins.length < 2)return;
		var nwin,start = this.wins.shift();
		do{
			if(this.setTop(nwin || start).visible)break;
			nwin = this.wins.shift();
		}
		
		while(start != nwin);
	}
	,setPrevious:function(){
		if(this.wins.length < 2)return;
		this.wins.unshift(this.wins.pop());
		var nwin,start = this.wins.pop();
		do{
			if(this.setTop(nwin || start).visible)break;
			nwin = this.wins.pop();
		}
		
		while(start != nwin);
	}
	,remove:function(win){
		this.wins.remove(win);
	}

};

jpf.modalwindow = function(pHtmlNode,tagName,jmlNode,isWidget){
	jpf.register(this,"modalwindow",GUI_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	this.focussable = true;
	this.inherit(jpf.Presentation);
	this.minWT = null;
	this.minHT = null;
	this.setCaption = function(caption){
		this.oTitle.nodeValue = caption;
	};
	this.setIcon = function(icon){
		if(! this.oIcon)return;
		
		if(this.oIcon.tagName.toLowerCase()== "img")this.oIcon.src = this.iconPath + icon;
		else this.oIcon.style.backgroundImage = "url(" + this.iconPath + ")";
	};
	this.display = function(center,x,y){
		this.setProperty("visible",true);
		
		if(x)this.oExt.style.left = x + "px";
		
		if(y)this.oExt.style.top = y + "px";
		
		if(center){
			this.oExt.style.left = Math.max(0,((jpf.getWindowWidth()- this.oExt.offsetWidth)/ 2))+ "px";
			this.oExt.style.top = Math.max(0,((jpf.getWindowHeight()- this.oExt.offsetHeight)/ 3))+ "px";
		};
		
		if(! this.isModal)jpf.WinServer.setTop(this);
	};
	this.syncAlignment = function(oItem){
		if(oItem.hidden == 3)jpf.WinServer.setTop(this);
		
		if(oItem.state > 0){
			this.__setStyleClass(this.oExt,this.baseCSSname + "Min",[this.baseCSSname + "Edit",this.baseCSSname + "Max"]);
		}
		else{
			this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Min",this.baseCSSname + "Edit",this.baseCSSname + "Max"]);
		}
	};
	this.close = function(){
		this.setProperty("visible",false);
		this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Min",this.baseCSSname + "Edit",this.baseCSSname + "Max"]);
		this.dispatchEvent('onclose');
		state[0]= state[1]= state[2]= 1};
	var state =[];
	var lastheight = null;
	this.min = function(){
		if(state[0]< 0){
			state[0]= 1;
			this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Min"]);
			
			if(this.aData && this.aData.hidden != 3)this.aData.restore();
			else{
				if(this.aData && this.aData.hidden == 3)this.aData.restore();
				this.oExt.style.height =(lastheight - jpf.compat.getHeightDiff(this.oExt))+ "px";
			};
			this.dispatchEvent('onrestore')}
		else{
			state[0]= - 1;
			state[1]= 1;
			
			if(state[2]< 1)this.max();
			state[2]= 1;
			this.__setStyleClass(this.oExt,this.baseCSSname + "Min",[this.baseCSSname + "Edit",this.baseCSSname + "Max"]);
			
			if(this.aData && this.aData.hidden != 3)this.aData.minimize(this.minheight);
			else{
				if(this.aData && this.aData.hidden == 3)this.aData.minimize(this.minheight);
				lastheight = this.oExt.offsetHeight;
				this.oExt.style.height = Math.max(0,this.minheight - jpf.compat.getHeightDiff(this.oExt))+ "px";
			};
			this.dispatchEvent('onminimize')};
		
		if(this.aData)this.purgeAlignment();
	};
	var startpos = null;
	this.max = function(){
		if(state[2]< 0){
			state[2]= 1;
			this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Max"]);
			this.oExt.style.left = startpos[0];
			this.oExt.style.top = startpos[1];
			this.oExt.style.width = startpos[2];
			this.oExt.style.height = startpos[3];
			var pNode =(this.oExt.parentNode == document.body ? document.documentElement:this.oExt.parentNode);
			pNode.style.overflow = startpos[4];
			jpf.layoutServer.play(this.pHtmlNode);
			
			if(this.aData && this.aData.state > 0 && this.aData.hidden != 3){
				this.aData.restore();
				this.purgeAlignment();
			};
			this.dispatchEvent('onrestore')}
		else{
			state[2]= - 1;
			state[1]= 1;
			
			if(state[0]< 1)this.min();
			state[0]= 1;
			this.__setStyleClass(this.oExt,this.baseCSSname + "Max",[this.baseCSSname + "Min",this.baseCSSname + "Edit"]);
			var pNode =(this.oExt.parentNode == document.body ? document.documentElement:this.oExt.parentNode);
			startpos =[this.oExt.style.left,this.oExt.style.top,this.oExt.style.width,this.oExt.style.height,pNode.style.overflow];
			var diff = jpf.compat.getDiff(this.oExt);
			var verdiff = diff[1];
			var hordiff = diff[0];
			var box = jpf.compat.getBox(jpf.compat.getStyle(this.oExt,"borderWidth"));
			pNode.style.overflow = "hidden";
			this.oExt.style.left =(- 1 * box[3])+ "px";
			this.oExt.style.top =(- 1 * box[0])+ "px";
			var htmlNode = this.oExt;
			jpf.layoutServer.pause(this.pHtmlNode,function(){htmlNode.style.width =(htmlNode.parentNode.offsetWidth - hordiff + box[1]+ box[3])+ "px";
				htmlNode.style.height =(htmlNode.parentNode.offsetHeight - verdiff + box[0]+ box[2])+ "px";
			}
		);
			jpf.WinServer.setTop(this);
			this.dispatchEvent('onmaximize')}
	};
	this.edit = function(oHtml){
		if(state[1]< 0){
			if(this.dispatchEvent('oneditstop')=== false)return false;
			state[1]= 1;
			this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Edit"]);
			
			if(oHtml)oHtml.innerHTML = "edit";
		}
		else{
			state[1]= - 1;
			state[0]= 1;
			this.__setStyleClass(this.oExt,this.baseCSSname + "Edit",[this.baseCSSname + "Min"]);
			
			if(oHtml)oHtml.innerHTML = "close";
			this.dispatchEvent('oneditstart');
		}
	};
	var hEls =[];
	this.__handlePropSet = function(prop,value){
		switch(prop){
			case "visible":
			if(jpf.isTrue(value)){
				if(this.isModal){
					this.oCover.style.height = Math.max(document.body.scrollHeight,document.documentElement.offsetHeight)+ 'px';
					this.oCover.style.width = Math.max(document.body.scrollWidth,document.documentElement.offsetWidth)+ 'px';
					this.oCover.style.display = "block";
				};
				
				if(jpf.layoutServer)jpf.layoutServer.forceResize(this.oInt);
				
				if(this.center){
					this.oExt.style.left =((jpf.getWindowWidth()- this.oExt.offsetWidth)/ 2)+ "px";
					this.oExt.style.top =((jpf.getWindowHeight()- this.oExt.offsetHeight)/ 3)+ "px";
				};
				
				if(! this.isRendered){
					this.addEventListener("onafterrender",function(){this.dispatchEvent("ondisplay");
						this.removeEventListener("ondisplay",arguments.callee);
					}
				);
				}
				else this.dispatchEvent("ondisplay");
				
				if(! jpf.canHaveHtmlOverSelects && this.hideSelects){
					hEls =[];
					var nodes = document.getElementsByTagName("select");
					
					for(var i = 0;i < nodes.length;i ++){
						var oStyle = jpf.compat.getStyle(nodes[i],"display");
						hEls.push([nodes[i],oStyle]);
						nodes[i].style.display = "none";
					}
				}
			}
			else 
			if(jpf.isFalse(value)){
				if(this.isModal)this.oCover.style.display = "none";
				this.dispatchEvent("onclose");
				
				if(! jpf.canHaveHtmlOverSelects && this.hideSelects){
					for(var i = 0;i < hEls.length;i ++){
						hEls[i][0].style.display = hEls[i][1];
					}
				}
			};
			break;
		}
	};
	this.keyHandler = function(key,ctrlKey,shiftKey,altKey){
		switch(key){
			case 27:
			if(this.btnclose && ! this.aData)this.close();
			break;
			default:break;
		}
	};
	
	if(isWidget){
		this.positionHolder = document.body.appendChild(document.createElement("div"));
		var winNode = this;
		this.winMouseDown = function(e){
			if(! e)e = event;
			MOVER = this;
			this.coX = e.clientX;
			this.stX = this.host.oExt.offsetLeft;
			this.coY = e.clientY;
			this.stY = this.host.oExt.offsetTop;
			var htmlNode = this.host.oExt;
			var p = this.host.positionHolder;
			p.className = "position_holder";
			htmlNode.parentNode.insertBefore(p,htmlNode);
			p.style.height =(htmlNode.offsetHeight -(jpf.isIE6 ? 0:13))+ "px";
			var diff = jpf.compat.getDiff(htmlNode);
			var lastSize =[htmlNode.style.width,htmlNode.style.height];
			htmlNode.style.width =(htmlNode.offsetWidth - diff[0])+ "px";
			var toX = e.clientX - this.coX + this.stX;
			var toY = e.clientY - this.coY + this.stY;
			htmlNode.style.left = toX + "px";
			htmlNode.style.top = toY + "px";
			htmlNode.style.position = "absolute";
			htmlNode.style.zIndex = htmlNode.parentNode.style.zIndex = 100000;
			htmlNode.parentNode.style.position = "relative";
			htmlNode.parentNode.style.left = "0";
			jpf.Animate.fade(htmlNode,0.8);
			jpf.DragMode.mode = true;
			document.cData =[htmlNode,p];
			document.onmousemove = this.host.winMouseMove;
			document.onmouseup = function(){
				document.onmousemove = document.onmouseup = null;
				htmlNode.style.position = "";
				htmlNode.style.left = 0;
				htmlNode.style.top = 0;
				htmlNode.style.width = lastSize[0];
				htmlNode.style.zIndex = htmlNode.parentNode.style.zIndex = 1;
				p.parentNode.insertBefore(htmlNode,p);
				p.parentNode.removeChild(p);
				jpf.Animate.fade(htmlNode,1);
				var grids = winNode.getElementsByTagName("datagrid");
				
				for(var i = 0;i < grids.length;i ++){
					grids[i].updateWindowSize(true);
				};
				jpf.DragMode.mode = null;
			};
			e.cancelBubble = true;
			return false;
		};
		function insertInColumn(el,ey){
			var pos = jpf.compat.getAbsolutePosition(el);
			var cy = ey - pos[1];
			var nodes = el.childNodes;
			
			for(var th = 0,i = 0;i < nodes.length;i ++){
				if(nodes[i].nodeType != 1 || jpf.getStyle(nodes[i],"position")== "absolute")continue;
				th = nodes[i].offsetTop + nodes[i].offsetHeight;
				
				if(th > cy){
					if(th -(nodes[i].offsetHeight / 2)> cy)el.insertBefore(document.cData[1],nodes[i]);
					else el.insertBefore(document.cData[1],nodes[i].nextSibling);
					break;
				}
			};
			
			if(i == nodes.length)el.appendChild(document.cData[1]);
		};
		this.winMouseMove = function(e){
			if(! e)e = event;
			var o = MOVER;
			var toX = e.clientX - o.coX + o.stX;
			var toY = e.clientY - o.coY + o.stY;
			var db = MOVER.host.oExt;
			db.style.top = "10000px";
			var ex = e.clientX + document.documentElement.scrollLeft;
			var ey = e.clientY + document.documentElement.scrollTop;
			var el = document.elementFromPoint(ex,ey);
			
			if(el.isColumn){
				insertInColumn(el,ey);
			}
			else{
				while(el.parentNode && ! el.isColumn){
					el = el.parentNode;
				};
				
				if(el.isColumn)insertInColumn(el,ey);
				else status = "notfound" + new Date();
			};
			db.style.left = toX + "px";
			db.style.top = toY + "px";
			e.cancelBubble = true;
		}
	}
	else{
		this.winMouseDown = function(e){
			if(! e)e = event;
			
			if(this.host.aData){
				if(!(state[2]< 0))this.host.startDocking(e);
				return;
			};
			
			if(! this.host.draggable)return;
			
			if(! e)e = event;
			MOVER = this;
			this.coX = e.clientX;
			this.stX = this.host.oExt.offsetLeft;
			this.coY = e.clientY;
			this.stY = this.host.oExt.offsetTop;
			document.onmousemove = this.host.winMouseMove;
			document.onmouseup = function(){
				document.onmousemove = document.onmouseup = null;
			};
			return false;
		};
		this.winMouseMove = function(e){
			if(! e)e = event;
			var o = MOVER;
			var toX = e.clientX - o.coX + o.stX;
			var toY = e.clientY - o.coY + o.stY;
			var db = MOVER.host.oExt;
			db.style.left = toX + "px";
			db.style.top = toY + "px";
		}
	};
	this.inherit(jpf.Docking);
	this.inherit(jpf.JmlNode);
	this.setZIndex = function(value){
		this.oExt.style.zIndex = value + 1;
		
		if(this.isModal)this.oCover.style.zIndex = value;
	};
	function addButton(prop,type,func,oButtons){
		if(! this[prop])this[prop]= jpf.isTrue(this.jml.getAttribute(prop));
		
		if(this[prop]&& this.__hasLayoutNode(type)){
			this.__getNewContext(type);
			var btn = oButtons.appendChild(this.__getLayoutNode(type));
			btn.setAttribute("onclick",func);
			btn.setAttribute("onmousedown","jpf.setStyleClass(this, 'down');event.cancelBubble = true;");
			btn.setAttribute("onmouseup","jpf.setStyleClass(this, '', ['down'])");
			btn.setAttribute("onmouseover","jpf.setStyleClass(this, 'hover')");
			btn.setAttribute("onmouseout","jpf.setStyleClass(this, '', ['hover', 'down'])");
		}
	};
	this.draw = function(){
		this.popout = this.jml.getAttribute("popout")== "true";
		
		if(this.popout)this.pHtmlNode = document.body;
		this.oExt = this.__getExternal(null,null,function(oExt){var oButtons = this.__getLayoutNode("Main","buttons",oExt);
			addButton.call(this,"btnclose","CloseBtn","jpf.lookup(" + this.uniqueId + ").close()",oButtons);
			addButton.call(this,"btnmax","MaxBtn","jpf.lookup(" + this.uniqueId + ").max()",oButtons);
			addButton.call(this,"btnmin","MinBtn","jpf.lookup(" + this.uniqueId + ").min()",oButtons);
			
			if(isWidget && $xmlns(this.jml,"config",jpf.ns.jpf).length)addButton.call(this,"btnedit","EditBtn","jpf.lookup(" + this.uniqueId + ").edit(this)",oButtons);
		}
	);
		this.oTitle = this.__getLayoutNode("Main","title",this.oExt);
		this.oIcon = this.__getLayoutNode("Main","icon",this.oExt);
		this.oDrag = this.__getLayoutNode("Main","drag",this.oExt);
		
		if(! isWidget){
			var oCover = this.__getLayoutNode("Cover");
			
			if(oCover){
				this.oCover = jpf.XMLDatabase.htmlImport(oCover,this.pHtmlNode);
				this.oCover.style.display = "none";
			}
		};
		this.movable = this.jml.getAttribute("movable")!= "false";
		
		if(this.movable)this.oDrag.onmousedown = this.winMouseDown;
		this.oDrag.host = this;
		
		if(! this.hasFeature(__DATABINDING__)&&(this.jml.getAttribute("smartbinding")|| this.jml.getAttribute("actions"))){
			this.inherit(jpf.DataBinding);
			this.inherit(jpf.Transaction);
			this.inherit(jpf.EditTransaction);
		}
	};
	this.__loadJML = function(x,skinName){
		if(x.getAttribute("minwidth"))this.minWT = x.getAttribute("minwidth");
		
		if(x.getAttribute("minheight"))this.minHT = x.getAttribute("minheight");
		
		if(x.getAttribute("title"))this.setCaption(x.getAttribute("title"));
		
		if(x.getAttribute("icon"))this.setIcon(x.getAttribute("icon"));
		this.hideSelects = x.getAttribute("hide-selects")== "true";
		this.center = x.getAttribute("center")== "true";
		this.isModal = this.oCover &&(x.getAttribute("modal")!= "false");
		this.draggable = x.getAttribute("draggable")!= "false";
		
		if(this.center)this.oExt.style.position = "absolute";
		
		if(! this.isModal){
			this.oExt.onmousedown = function(e){
				if(! this.host.aData && ! this.host.modal || this.host.aData.hidden == 3)jpf.WinServer.setTop(this.host);
			}
		};
		jpf.WinServer.setTop(this);
		var oInt = this.__getLayoutNode("Main","container",this.oExt);
		var oSettings = this.__getLayoutNode("Main","settings_content",this.oExt);
		
		if(! isWidget){
			this.oInt = this.oInt ? jpf.JMLParser.replaceNode(oInt,this.oInt):jpf.JMLParser.parseChildren(this.jml,oInt,this,true);
		}
		else{
			var oConfig = $xmlns(this.jml,"config",jpf.ns.jpf)[0];
			
			if(oConfig)oConfig.parentNode.removeChild(oConfig);
			var oBody = $xmlns(this.jml,"body",jpf.ns.jpf)[0];
			oBody.parentNode.removeChild(oBody);
			jpf.JMLParser.parseChildren(this.jml,null,this);
			
			if(oConfig)this.jml.appendChild(oConfig);
			this.jml.appendChild(oBody);
			
			if(oSettings && oConfig){
				this.oSettings = this.oSettings ? jpf.JMLParser.replaceNode(oSettings,this.oSettings):jpf.JMLParser.parseChildren(oConfig,oSettings,this,true);
			};
			this.oInt = this.oInt ? jpf.JMLParser.replaceNode(oInt,this.oInt):jpf.JMLParser.parseChildren(oBody,oInt,this,true);
			
			if(oBody.getAttribute("cssclass"))this.__setStyleClass(this.oInt,oBody.getAttribute("cssclass"))};
		
		if(this.isModal)this.oCover.style.display = "none";
		
		if(! this.jml.getAttribute("visible")|| jpf.isFalse(this.jml.getAttribute("visible"))){
			this.oExt.style.display = "none";
			this.visible = false;
		};
		this.minwidth = this.__getOption("Main","min-width");
		this.minheight = this.__getOption("Main","min-height");
	};
	this.__destroy = function(){
		if(this.oDrag){
			this.oDrag.host = null;
			jpf.removeNode(this.oDrag);
			this.oDrag = null;
		};
		this.oTitle = null;
		this.oIcon = null;
		this.oCover = null;
		
		if(this.oExt)this.oExt.onmousedown = null;
	}

}

/*FILEHEAD(/in/Library/Components/Pages.js)SIZE(1472)TIME(1203724644056)*/

/*FILEHEAD(/in/Library/Components/Palette.js)SIZE(4199)TIME(1203724557837)*/

/*FILEHEAD(/in/Library/Components/Picture.js)SIZE(1771)TIME(1202845529234)*/

/*FILEHEAD(/in/Library/Components/Portal.js)SIZE(9635)TIME(1205331766046)*/

/*FILEHEAD(/in/Library/Components/Progressbar.js)SIZE(3717)TIME(1203724026634)*/

/*FILEHEAD(/in/Library/Components/Radiobutton.js)SIZE(10961)TIME(1203724693306)*/

/*FILEHEAD(/in/Library/Components/Repeat.js)SIZE(5319)TIME(1203724026649)*/

/*FILEHEAD(/in/Library/Components/RichTextEditor.js)SIZE(7385)TIME(1203724026649)*/

/*FILEHEAD(/in/Library/Components/RTEHelper.js)SIZE(5332)TIME(1203724557837)*/

/*FILEHEAD(/in/Library/Components/RTETemplateViewer.js)SIZE(2172)TIME(1203724557837)*/

/*FILEHEAD(/in/Library/Components/Slider.js)SIZE(9042)TIME(1203724704134)*/

/*FILEHEAD(/in/Library/Components/Sourceedit.js)SIZE(8207)TIME(1203724711446)*/

/*FILEHEAD(/in/Library/Components/Splitter.js)SIZE(12122)TIME(1213481159896)*/
jpf.splitter = function(pHtmlNode){
	jpf.register(this,"splitter",GUI_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	var jmlNode = this;
	this.focussable = true;
	this.inherit(jpf.Presentation);
	this.update = function(){
		var b = this.type == "vertical" ?{
			fsize:"fwidth",size:"width",offsetPos:"offsetLeft",offsetSize:"offsetWidth",pos:"left"}
		:{
			fsize:"fheight",size:"height",offsetPos:"offsetTop",offsetSize:"offsetHeight",pos:"top"};
		var jmlNode = this.refNode;
		var htmlNode = this.refHtml;
		var v = jpf.layoutServer.vars;
		var oItem = this.oItem;
		var itemStart = htmlNode ? htmlNode[b.offsetPos]:v[b.pos + "_" + oItem.id];
		var itemSize = htmlNode ? htmlNode[b.offsetSize]:v[b.size + "_" + oItem.id];
		var row = oItem.parent.children;
		
		for(var z = 0,i = 0;i < row.length;i ++)
		if(! row[i][b.fsize])z ++;
		
		if(! oItem[b.fsize]&& z > 1){
			for(var rTotal = 0,rSize = 0,i = oItem.stackId + 1;i < row.length;i ++){
				if(! row[i][b.fsize]){
					rTotal += row[i].weight || 1;
					rSize +=(row[i].node ? row[i].oHtml[b.offsetSize]:v[b.size + "_" + row[i].id]);
				}
			};
			var diff = this.oExt[b.offsetPos]- itemStart - itemSize;
			var rEach =(rSize - diff)/ rTotal;
			
			for(var i = 0;i < oItem.stackId;i ++){
				if(! row[i][b.fsize])row[i].original.weight =(row[i].node ? row[i].oHtml[b.offsetSize]:v[b.size + "_" + row[i].id])/ rEach;
			};
			oItem.original.weight =(itemSize + diff)/ rEach;
			needRecalc = true;
		}
		else{
			var isNumber = oItem[b.fsize]? oItem[b.fsize].match(/^\d+$/):false;
			var isPercentage = oItem[b.fsize]? oItem[b.fsize].match(/^([\d\.]+)\%$/):false;
			
			if(isNumber || isPercentage || ! oItem[b.fsize]){
				var diff = this.oExt[b.offsetPos]- itemStart - itemSize;
				var newHeight = this.oExt[b.offsetPos]- itemStart;
				
				for(var total = 0,size = 0,i = oItem.stackId + 1;i < row.length;i ++){
					if(! row[i][b.fsize]){
						total += row[i].weight || 1;
						size +=(row[i].node ? row[i].oHtml[b.offsetSize]:v[b.size + "_" + row[i].id]);
					}
				};
				
				if(total > 0){
					var ratio =((size - diff)/ total)/(size / total);
					
					for(var i = oItem.stackId + 1;i < row.length;i ++)row[i].original.weight = ratio *(row[i].weight || 1);
				}
				else{
					for(var i = oItem.stackId + 1;i < row.length;i ++){
						if(row[i][b.fsize].match(/^\d+$/)){
							var nHeight =(row[i].node ? row[i].oHtml[b.offsetSize]:v[b.size + "_" + row[i].id])- diff;
							row[i].original[b.fsize]= "" + Math.max(0,nHeight,row[i].minheight || 0);
							
							if(row[i][b.fsize]- nHeight != 0)diff = row[i][b.fsize]- nHeight;
							else break;
						}
						else 
						if(row[i][b.fsize].match(/^([\d\.]+)\%$/)){
							var nHeight =(row[i].node ? row[i].oHtml[b.offsetSize]:v[b.size + "_" + row[i].id])- diff;
							row[i].original[b.fsize]= Math.max(0,((parseFloat(RegExp.$1)/(row[i].node ? row[i].oHtml[b.offsetSize]:v[b.size + "_" + row[i].id]))* nHeight))+ "%";
							break;
						}
					}
				};
				
				if(oItem.original[b.fsize]){
					oItem.original[b.fsize]= isPercentage ?((parseFloat(isPercentage[1])/ itemSize)* newHeight)+ "%":"" + newHeight;
				};
				needRecalc = true;
			}
		};
		
		if(needRecalc){
			jpf.layoutServer.compile(this.oExt.parentNode);
			jpf.layoutServer.activateRules(this.oExt.parentNode);
			return;
		};
		jpf.layoutServer.forceResize(this.oExt.parentNode);
	};
	this.onmouseup = function(){
		jmlNode.__setStyleClass(jmlNode.oExt,"",["moving"]);
		jpf.Plane.hide();
		jmlNode.update();
		jmlNode.__setStyleClass(document.body,"",["n-resize","w-resize"]);
		jpf.DragMode.clear();
	};
	this.onmousemove = function(e){
		if(! e)e = event;
		
		if(jmlNode.type == "vertical"){
			if(e.clientX >= 0){
				var pos = jpf.compat.getAbsolutePosition(jmlNode.oExt.offsetParent);
				jmlNode.oExt.style.left =(Math.min(jmlNode.max,Math.max(jmlNode.min,(e.clientX - pos[0])- jmlNode.tx)))+ "px";
			}
		}
		else{
			if(e.clientY >= 0){
				var pos = jpf.compat.getAbsolutePosition(jmlNode.oExt.offsetParent);
				jmlNode.oExt.style.top =(Math.min(jmlNode.max,Math.max(jmlNode.min,(e.clientY - pos[1])- jmlNode.ty)))+ "px";
			}
		};
		e.returnValue = false;
		e.cancelBubble = true;
	};
	this.inherit(jpf.JmlNode);
	var lastinit,sizeArr,verdiff,hordiff;
	this.init = function(size,refNode,oItem){
		this.min = 0;
		this.max = 1000000;
		this.size = parseInt(size)|| 3;
		this.refNode = null;
		this.refHtml = null;
		var pNode;
		
		if(refNode){
			if(typeof refNode != "object")refNode = jpf.lookup(refNode);
			this.refNode = refNode;
			this.refHtml = this.refNode.oExt;
			pNode = this.refHtml.parentNode;
			oItem = refNode.aData.calcData;
		}
		else pNode = oItem.pHtml;
		this.oItem = oItem;
		
		if(pNode && pNode != this.oExt.parentNode)pNode.appendChild(this.oExt);
		var diff = jpf.compat.getDiff(this.oExt);
		verdiff = diff[0];
		hordiff = diff[1];
		sizeArr =[];
		this.type = oItem.parent.vbox ? "horizontal":"vertical";
		var layout = jpf.layoutServer.get(this.oExt.parentNode).layout;
		var name = "splitter" + this.uniqueId;
		layout.addRule("var " + name + " = jpf.lookup(" + this.uniqueId + ").oExt");
		var vleft =[name + ".style.left = "];
		var vtop =[name + ".style.top = "];
		var vwidth =[name + ".style.width = -" + hordiff + " + "];
		var vheight =[name + ".style.height = -" + verdiff + " + "];
		var oNext = oItem.parent.children[oItem.stackId + 1];
		
		if(this.type == "horizontal"){
			vwidth.push("Math.max(");
			
			if(oItem.node){
				vleft.push(oItem.id + ".offsetLeft");
				vtop.push(oItem.id + ".offsetTop + " + oItem.id + ".offsetHeight");
				vwidth.push(oItem.id + ".offsetWidth");
			}
			else{
				vleft.push("v.left_" + oItem.id);
				vtop.push("v.top_" + oItem.id + " + v.height_" + oItem.id);
				vwidth.push("v.width_" + oItem.id);
			};
			vwidth.push(",",oNext.node ? oNext.id + ".offsetWidth":"v.width_" + oNext.id,")");
			layout.addRule(vwidth.join(""));
			this.oExt.style.height =(oItem.splitter - hordiff)+ "px";
		}
		else{
			vheight.push("Math.max(");
			
			if(oItem.node){
				vleft.push(oItem.id + ".offsetLeft + " + oItem.id + ".offsetWidth");
				vtop.push(oItem.id + ".offsetTop");
				vheight.push(oItem.id + ".offsetHeight");
			}
			else{
				vleft.push("v.left_" + oItem.id + " + v.width_" + oItem.id);
				vtop.push("v.top_" + oItem.id);
				vheight.push("v.height_" + oItem.id);
			};
			vheight.push(",",oNext.node ? oNext.id + ".offsetHeight":"v.height_" + oNext.id,")");
			layout.addRule(vheight.join(""));
			this.oExt.style.width =(oItem.splitter - hordiff)+ "px";
		};
		layout.addRule(vleft.join(""));
		layout.addRule(vtop.join(""));
		var row = oItem.parent.children;
		
		if(this.type == "vertical"){
			layout.addRule(name + ".host.min = " +(oItem.node ? "document.getElementById('" + oItem.id + "').offsetLeft":"v.left_" + oItem.id)+ " + " + parseInt(oItem.minwidth || oItem.childminwidth || 10));
			var max =[],extra =[];
			
			for(var hasRest = false,i = oItem.stackId + 1;i < row.length;i ++){
				if(! row[i].fwidth)hasRest = true;
			};
			
			for(var d,i = oItem.stackId + 1;i < row.length;i ++){
				d = row[i];
				
				if(d.minwidth || d.childminheight)max.push(parseInt(d.minwidth || d.childminheight));
				else 
				if(d.fwidth){
					if(! hasRest && i == oItem.stackId + 1)max.push(10);
					else 
					if(d.fwidth.indexOf("%")!= - 1)max.push("(" + d.parent.innerspace + ") * " +(parseFloat(d.fwidth)/ 100));
					else max.push(d.fwidth);
				}
				else max.push(10);
				max.push(d.edgeMargin);
			};
			layout.addRule(name + ".host.max = v.left_" + oItem.parent.id + " + v.width_" + oItem.parent.id + " - (" +(max.join("+")|| 0)+ ")");
		}
		else{
			layout.addRule(name + ".host.min = " +(oItem.node ? "document.getElementById('" + oItem.id + "').offsetTop":"v.top_" + oItem.id)+ " + " + parseInt(oItem.minheight || oItem.childminheight || 10));
			var max =[],extra =[];
			
			for(var hasRest = false,i = oItem.stackId + 1;i < row.length;i ++){
				if(! row[i].fheight)hasRest = true;
			};
			
			if(! hasRest && oNext.state > 0)return this.oExt.parentNode.removeChild(this.oExt);
			
			for(var d,i = oItem.stackId + 1;i < row.length;i ++){
				d = row[i];
				
				if(d.minheight || d.childminheight)max.push(parseInt(d.minheight || d.childminheight));
				else 
				if(d.fheight){
					if(! hasRest && i == oItem.stackId + 1)max.push(10);
					else 
					if(d.fheight.indexOf("%")!= - 1)max.push("(" + d.parent.innerspace + ") * " +(parseFloat(d.fheight)/ 100));
					else max.push(d.fheight);
				}
				else max.push(10);
				max.push(d.edgeMargin);
			};
			layout.addRule(name + ".host.max = v.top_" + oItem.parent.id + " + v.height_" + oItem.parent.id + " - (" +(max.join("+")|| 0)+ ")");
		};
		this.__setStyleClass(this.oExt,this.type,[this.type == "horizontal" ? "vertical":"horizontal"]);
		
		if(this.type == "vertical")this.__setStyleClass(this.oExt,"w-resize",["n-resize"]);
		else this.__setStyleClass(this.oExt,"n-resize",["w-resize"]);
		return this;
	};
	this.draw = function(){
		this.oExt = this.__getExternal();
		this.oExt.onmousedown = function(e){
			if(! e)e = event;
			var pos = jpf.compat.getAbsolutePosition(this);
			
			if(jmlNode.type == "vertical")jmlNode.tx = e.clientX - pos[0];
			else jmlNode.ty = e.clientY - pos[1];
			jmlNode.startPos = jmlNode.type == "vertical" ? this.offsetLeft:this.offsetTop;
			e.returnValue = false;
			e.cancelBubble = true;
			jpf.Plane.show(this);
			jmlNode.__setStyleClass(this,"moving");
			jmlNode.__setStyleClass(document.body,jmlNode.type == "vertical" ? "w-resize":"n-resize",[jmlNode.type == "vertical" ? "n-resize":"w-resize"]);
			jpf.DragMode.setMode("splitter" + jmlNode.uniqueId);
		}
	};
	this.__loadJML = function(x){
		if(x.getAttribute("left")|| x.getAttribute("top")){
			var O1 = x.getAttribute("left")|| x.getAttribute("top");
			var O2 = x.getAttribute("right")|| x.getAttribute("bottom");
			O1 = O1.split(/\s*,\s*/);
			O2 = O2.split(/\s*,\s*/);
			
			for(var i = 0;i < O1.length;i ++)O1[i]= O1[i];
			
			for(var i = 0;i < O2.length;i ++)O2[i]= O2[i];
			setTimeout(function(){jmlNode.init(x.getAttribute("type"),x.getAttribute("size"),x.getAttribute("min"),x.getAttribute("max"),x.getAttribute("change"),O1,O2);
			}
		);
		}
	};
	jpf.Plane.init();
	jpf.DragMode.defineMode("splitter" + this.uniqueId,this);
	this.__destroy = function(){
		jpf.DragMode.removeMode("splitter" + this.uniqueId);
	}

}

/*FILEHEAD(/in/Library/Components/State.js)SIZE(4641)TIME(1203724723915)*/

/*FILEHEAD(/in/Library/Components/Statusbar.js)SIZE(3910)TIME(1213479888115)*/
jpf.statusbar = function(pHtmlNode){
	jpf.register(this,"statusbar",GUI_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	var rest;
	this.panels =[];
	this.inherit(jpf.Presentation);
	this.getPanel = function(id){
		return this.panels[id];
	};
	this.addPanel = function(xmlNode){
		this.__getNewContext("Panel");
		var p = this.__getLayoutNode("Panel");
		
		if(xmlNode.getAttribute("css"))p.setAttribute("style",xmlNode.getAttribute("css"));
		var elPanel = jpf.XMLDatabase.htmlImport(p,this.oInt,this.oInt.firstChild);
		var elPanelInt = this.__getLayoutNode("Panel","container",elPanel);
		var oPanel ={
			host:this,oExt:elPanel,oInt:elPanelInt,oIcon:this.__getLayoutNode("Panel","icon",elPanel),oCaption:this.__getLayoutNode("Panel","caption",elPanel),setCaption:function(caption){
				this.oInt.innerHTML = caption;
			}
			,setIcon:function(iconURL){
				if(this.oIcon.tagName && this.oIcon.tagName.match(/^img$/i))elIcon.src = this.host.iconPath + iconURL;
				else this.oIcon.style.backgroundImage = "url(" + this.host.iconPath + iconURL + ")";
			}
			,setStatus:function(iconURL,caption){
				this.setIcon(iconURL);
				this.setCaption(caption);
			}
		};
		
		if(xmlNode.getAttribute("icon")){
			oPanel.setIcon(xmlNode.getAttribute("icon"));
			this.__setStyleClass(oPanel.oExt,"win_panel_icon");
		};
		var wt = xmlNode.getAttribute("width");
		
		if(wt == "rest" || wt == "*"){
			this.__setStyleClass(oPanel.oExt,"rest");
			rest = oPanel;
		}
		else 
		if(wt)oPanel.oExt.style.width = wt + "px";
		
		if(xmlNode.getAttribute("height"))oPanel.oExt.style.height = xmlNode.getAttribute("height")+ "px";
		
		if(oPanel.oCaption)oPanel.setCaption(xmlNode.firstChild ? xmlNode.firstChild.nodeValue:"");
		
		if(xmlNode.getAttribute("id"))this.panels[xmlNode.getAttribute("id")]= oPanel;
		this.panels.push(oPanel);
		
		if(this.lastpages){
			var childs = this.lastpages[id].childNodes;
			
			for(var i = childs.length - 1;i >= 0;i --)elPanelInt.insertBefore(childs[i],elPanelInt.firstChild);
		}
		else 
		if(elPanelInt && ! oPanel.oCaption)jpf.JMLParser.parseChildren(xmlNode,elPanelInt,this);
		return oPanel;
	};
	this.inherit(jpf.JmlNode);
	this.draw = function(){
		this.oExt = this.__getExternal();
		this.oInt = this.__getLayoutNode("Main","container",this.oExt);
		this.oCorner = this.__getLayoutNode("Main","corner",this.oExt);
		rest = null;
		var nodes = this.jml.childNodes;
		
		for(var p,i = 0;i < nodes.length;i ++){
			if(nodes[i].nodeType != 1)continue;
			var tagName = nodes[i][jpf.TAGNAME];
			
			if(tagName == "panel"){
				p = this.addPanel(nodes[i]);
				
				if(this.panels.length == 1)this.__setStyleClass(p.oExt,"first");
			}
		};
		
		if(p)this.__setStyleClass(p.oExt,"last");
	}

}

/*FILEHEAD(/in/Library/Components/Submitform.js)SIZE(24287)TIME(1203724743853)*/

/*FILEHEAD(/in/Library/Components/Tab.js)SIZE(1621)TIME(1203724757384)*/

/*FILEHEAD(/in/Library/Components/Text.js)SIZE(9831)TIME(1203724766978)*/

/*FILEHEAD(/in/Library/Components/Textbox.js)SIZE(22114)TIME(1203724800978)*/
jpf.input = jpf.secret = jpf.textarea = jpf.textbox = function(pHtmlNode,tagName){
	jpf.register(this,tagName || "textbox",GUI_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	this.inherit(jpf.Presentation);
	this.inherit(jpf.DataBinding);
	this.focussable = true;
	this.nonSizingHeight = true;
	var focusSelect = false;
	var masking = false;
	this.setValue = function(value){
		return this.setProperty("value",value);
	};
	this.__clear = function(){
		this.value = "";
		
		if(this.oInt.tagName.toLowerCase().match(/input|textarea/i))this.oInt.value = "";
		else{
			this.oInt.innerHTML = "";
			
			if(! jpf.hasMsRangeObject)return;
			
			try{
				var range = document.selection.createRange();
				range.moveStart("sentence",- 1);
				range.select();
			}
			catch(e){
			}
	}
	};
	this.getValue = function(){
		return this.isHTMLBox ? this.oInt.innerHTML:this.oInt.value;
	};
	this.insert = function(text){
		if(jpf.hasMsRangeObject){
			try{
				this.oInt.focus();
			}
			catch(e){
			};
			var range = document.selection.createRange();
			
			if(this.oninsert)text = this.oninsert(text);
			range.pasteHTML(text);
			range.collapse(true);
			range.select();
		}
		else{
			this.oInt.value += text;
		}
	};
	this.__enable = function(){
		this.oInt.disabled = false;
	};
	this.__disable = function(){
		this.oInt.disabled = true;
	};
	this.select = function(){
		this.oInt.select();
	};
	this.deselect = function(){
		this.oInt.deselect();
	};
	this.__insertData = function(str){
		return this.setValue(str);
	};
	this.keyHandler = function(){
	};
	this.keyHandlerWA = function(key,ctrlKey,shiftKey,altKey,e){
		if(this.dispatchEvent("onkeydown",{keyCode:key,ctrlKey:ctrlKey,shiftKey:shiftKey,altKey:altKey,htmlEvent:e}
	)=== false)return false;
		
		if(false && jpf.isIE &&(key == 86 && ctrlKey || key == 45 && shiftKey)){
			var text = window.clipboardData.getData("Text");
			
			if((text = this.dispatchEvent("onkeydown",{text:this.onpaste(text)}
		)=== false))return false;
			
			if(! text)text = window.clipboardData.getData("Text");
			this.oInt.focus();
			var range = document.selection.createRange();
			range.text = "";
			range.collapse();
			range.pasteHTML(text.replace(/\n/g,"<br />").replace(/\t/g,"&nbsp;&nbsp;&nbsp;"));
			return false;
		}
	};
	this.__focus = function(){
		if(! this.oExt || this.oExt.disabled)return;
		this.__setStyleClass(this.oExt,this.baseCSSname + "Focus");
		
		try{
			this.oInt.focus();
		}
		catch(e){
		};
		
		if(masking)this.setPosition();
		
		if(this.selectFocus){
			focusSelect = true;
			this.select();
		}
	};
	this.__blur = function(){
		if(! this.oExt)return;
		this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Focus"]);
		
		if(masking){
			var r = this.oExt.createTextRange();
			r.collapse();
			r.select();
		};
		
		try{
			this.oExt.blur();
			document.body.focus();
		}
		catch(e){
		};
		
		if(this.changeTrigger == "enter")this.change(this.getValue());
		focusSelect = false;
		
		if(this.oContainer)setTimeout('var o = jpf.lookup(' + this.uniqueId + ');o.oContainer.style.display = "none"',100);
	};
	this.__supportedProperties =["value"];
	this.__handlePropSet = function(prop,value){
		switch(prop){
			case "value":
			if(this.isHTMLBox){
				if(this.oInt.innerHTML != value)this.oInt.innerHTML = value;
			}
			else 
			if(this.oInt.value != value){
				this.oInt.value = value;
			};
			break;
		}
	};
	this.inherit(jpf.JmlNode);
	this.draw = function(){
		this.oExt = this.__getExternal(null,null,function(oExt){if(this.jml.getAttribute("mask")== "PASSWORD" || this.tagName == "secret"){
				this.jml.removeAttribute("mask");
				this.__getLayoutNode("Main","input").setAttribute("type","password");
			};
			oExt.setAttribute("onmousedown",'this.host.dispatchEvent("onmousedown", {htmlEvent : event});');
			oExt.setAttribute("onmouseup",'this.host.dispatchEvent("onmouseup", {htmlEvent : event});');
			oExt.setAttribute("onclick",'this.host.dispatchEvent("onclick", {htmlEvent : event});');
		}
	);
		this.oInt = this.__getLayoutNode("Main","input",this.oExt);
		
		if(! jpf.hasContentEditable && ! this.oInt.tagName.toLowerCase().match(/input|textarea/)){
			var node = this.oInt;
			this.oInt = node.parentNode.insertBefore(document.createElement("textarea"),node);
			node.parentNode.removeChild(node);
			this.oInt.className = node.className;
			
			if(this.oExt == node)this.oExt = this.oInt;
		};
		this.oInt.onselectstart = function(e){
			if(! e)e = event;
			e.cancelBubble = true};
		this.oInt.host = this;
		this.oInt.onkeydown = function(e){
			if(this.disabled)return false;
			
			if(! e)e = event;
			
			if(this.host.changeTrigger == "enter")
			if(e.keyCode == 13)this.host.change(this.host.getValue());
			else 
			if(jpf.isSafari && this.host.XMLRoot)setTimeout('var o = jpf.lookup(' + this.host.uniqueId + ');o.change(o.getValue())');
			
			if(e.ctrlKey &&(e.keyCode == 66 || e.keyCode == 73 || e.keyCode == 85))return false;
			
			if(this.host.oContainer){
				var oTxt = this.host;
				var keyCode = e.keyCode;
				setTimeout(function(){oTxt.fillAutocomplete(keyCode);
				}
			);
			};
			
			if(! this.host.mask)return this.host.keyHandlerWA(e.keyCode,e.ctrlKey,e.shiftKey,e.altKey,e);
		};
		this.oInt.onkeyup = function(e){
			var keyCode =(e || event).keyCode,jmlNode = this.host;
			
			if(this.host.changeTrigger != "enter"){
				setTimeout(function(){if(! jmlNode.mask)jmlNode.change(jmlNode.getValue());
					jmlNode.dispatchEvent("onkeyup",{keyCode:keyCode}
				);
				}
			);
			}
			else{
				jmlNode.dispatchEvent("onkeyup",{keyCode:keyCode}
			);
			}
		};
		this.oInt.onfocus = function(){
			if(this.host.initial && this.value == this.host.initial){
				this.value = "";
				this.host.__setStyleClass(this.host.oExt,"",[this.host.baseCSSname + "Initial"]);
			}
		};
		this.oInt.onblur = function(){
			if(this.host.initial && this.value == ""){
				this.value = this.host.initial;
				this.host.__setStyleClass(this.host.oExt,this.host.baseCSSname + "Initial");
			}
		};
		
		if(! this.oInt.tagName.toLowerCase().match(/input|textarea/)){
			this.isHTMLBox = true;
			this.oInt.unselectable = "Off";
			this.oInt.contentEditable = true;
			this.oInt.style.width = "1px";
			this.oInt.select = function(){
				var r = document.selection.createRange();
				r.moveToElementText(this);
				r.select();
			}
		};
		this.oInt.deselect = function(){
			if(! document.selection)return;
			var r = document.selection.createRange();
			r.collapse();
			r.select();
		}
	};
	this.__loadJML = function(x){
		if(jpf.hasMsRangeObject){
			this.mask = x.getAttribute("mask");
			
			if(this.mask){
				masking = true;
				this.inherit(jpf.TextboxMask);
				
				if(! this.mask.match(/PASSWORD/))this.setMask(this.mask);
				this.maskmsg = x.getAttribute("maskmsg");
			}
		};
		this.initial = x.getAttribute("initial")|| "";
		
		if(this.initial){
			this.oInt.onblur();
			this.setValue(this.initial);
		};
		this.changeTrigger = jpf.XMLDatabase.getInheritedAttribute(x,"change")|| "realtime";
		this.selectFocus = x.getAttribute("focusselect")== "true";
		
		if(this.mask){
			this.selectFocus = false;
			this.changeTrigger = "enter";
		};
		
		if(this.selectFocus){
			this.oInt.onmouseup = function(){
				if(focusSelect){
					this.select();
					focusSelect = false;
				};
				this.host.dispatchEvent("onmouseup");
				return false;
			}
		};
		
		if(x.getAttribute("maxlength")&& this.oInt.tagName.toLowerCase().match(/input|textarea/))this.oInt.maxLength = parseInt(x.getAttribute("maxlength"));
		var ac = $xmlns(x,"autocomplete",jpf.ns.jpf)[0];
		
		if(ac){
			this.inherit(jpf.TextboxAutocomplete);
			this.initAutocomplete(ac);
		};
		jpf.JMLParser.parseChildren(this.jml,null,this);
	};
	this.__destroy = function(){
		this.oInt.onkeypress = this.oInt.onmouseup = this.oInt.onkeydown = this.oInt.onkeyup = this.oInt.onselectstart = null;
	}

};

jpf.TextboxMask = function(){
	var _FALSE_ = 9128748732;
	var _REF ={
		"0":"\\d","1":"[12]","9":"[\\d ]","#":"[\\d +-]","L":"[A-Za-z]","?":"[A-Za-z ]","A":"[A-Za-z0-9]","a":"[A-Za-z0-9 ]","X":"[0-9A-Fa-f]","V":"[0-9A-Fa-fV]","x":"[0-9A-Fa-f ]","&":"[^\s]","C":"."};
	var lastPos = - 1;
	var masking = false;
	var initial,pos,myvalue,format,fcase,replaceChar,oExt = this.oExt;
	this.setPosition = function(setpos){
		setPosition(setpos || lastPos || 0);
	};
	this.__clear = function(){
		this.value = "";
		
		if(this.mask)return this.setValue("");
	};
	this.__supportedProperties =["value"];
	this.__handlePropSet = function(prop,value){
		switch(prop){
			case "value":var data = "";
			
			if(this.includeNonTypedChars){
				for(var i = 0;i < initial.length;i ++){
					if(initial.substr(i,1)!= value.substr(i,1))data += value.substr(i,1);
				}
			};
			this.__insertData(data || value);
			break;
		}
	};
	this.keyHandler = function(key,ctrlKey,shiftKey,altKey,e){
		if(this.dispatchEvent("onkeydown",{keyCode:key,ctrlKey:ctrlKey,shiftKey:shiftKey,altKey:altKey,htmlEvent:e}
	)=== false)return false;
		switch(key){
			case 39:setPosition(lastPos + 1);
			break;
			case 37:setPosition(lastPos - 1);
			break;
			case 35:case 34:setPosition(myvalue.length);
			break;
			case 33:case 36:setPosition(0);
			break;
			case 8:deletePosition(lastPos - 1);
			setPosition(lastPos - 1);
			break;
			case 46:deletePosition(lastPos);
			setPosition(lastPos);
			break;
			default:
			if(key == 67 && ctrlKey)window.clipboardData.setData("Text",this.getValue());
			else return;
			break;
		};
		return false};
	this.__initMasking = function(){
		this.keyHandlerWA = this._keyHandler;
		masking = true;
		this.oInt.onkeypress = function(){
			var chr = String.fromCharCode(self.event.keyCode);
			chr =(self.event.shiftKey ? chr.toUpperCase():chr.toLowerCase());
			
			if(setCharacter(chr))setPosition(lastPos + 1);
			return false;
		};
		this.oInt.onmouseup = function(){
			var pos = Math.min(calcPosFromCursor(),myvalue.length);
			setPosition(pos);
			return false;
		};
		this.oInt.onpaste = function(){
			event.returnValue = false;
			this.host.setValue(window.clipboardData.getData("Text")|| "");
			setTimeout(function(){setPosition(lastPos);
			}
			,1);
		};
		this.getValue = function(){
			if(this.includeNonTypedChars)return initial == this.oInt.value ? "":this.oInt.value.replace(new RegExp(replaceChar,"g"),"");
			else return myvalue.join("");
		};
		this.setValue = function(value){
			if(this.includeNonTypedChars){
				for(var data = "",i = 0;i < initial.length;i ++){
					if(initial.substr(i,1)!= value.substr(i,1))data += value.substr(i,1);
				}
			};
			this.__insertData(data);
		}
	};
	this.setMask = function(m){
		if(! masking)this.__initMasking();
		var m = m.split(";");
		replaceChar = m.pop();
		this.includeNonTypedChars = parseInt(m.pop())!== 0,mask = m.join("");
		var validation = "",visual = "",mode_case = "-",strmode = false,startRight = false,chr;
		pos =[],format = "",fcase = "";
		
		for(var looppos = - 1,i = 0;i < mask.length;i ++){
			chr = mask.substr(i,1);
			
			if(! chr.match(/[\!\'\"\>\<\\]/))looppos ++;
			else{
				if(chr == "!")startRight = true;
				else 
				if(chr == "<" || chr == ">")mode_case = chr;
				else 
				if(chr == "'" || chr == "\"")strmode = ! strmode;
				continue;
			};
			
			if(! strmode && _REF[chr]){
				pos.push(looppos);
				visual += replaceChar;
				format += chr;
				fcase += mode_case;
				validation += _REF[chr];
			}
			else visual += chr;
		};
		this.oInt.value = visual;
		initial = visual;
		myvalue =[];
		replaceChar = replaceChar;
	};
	function checkChar(chr,p){
		var f = format.substr(p,1);
		var c = fcase.substr(p,1);
		
		if(chr.match(new RegExp(_REF[f]))== null)return _FALSE_;
		
		if(c == ">")return chr.toUpperCase();
		
		if(c == "<")return chr.toLowerCase();
		return chr;
	};
	function setPosition(p){
		if(p < 0)p = 0;
		var range = oExt.createTextRange();
		range.expand("textedit");
		range.select();
		
		if(pos[p]== null){
			range.collapse(false);
			range.select();
			lastPos = pos.length;
			return false;
		};
		range.collapse();
		range.moveStart("character",pos[p]);
		range.moveEnd("character",1);
		range.select();
		lastPos = p;
	};
	function setCharacter(chr){
		if(pos[lastPos]== null)return false;
		var chr = checkChar(chr,lastPos);
		
		if(chr == _FALSE_)return false;
		var range = oExt.createTextRange();
		range.expand("textedit");
		range.collapse();
		range.moveStart("character",pos[lastPos]);
		range.moveEnd("character",1);
		range.text = chr;
		
		if(jpf.window.getFocussedObject == this)range.select();
		myvalue[lastPos]= chr;
		return true;
	};
	function deletePosition(p){
		if(pos[p]== null)return false;
		var range = oExt.createTextRange();
		range.expand("textedit");
		range.collapse();
		range.moveStart("character",pos[p]);
		range.moveEnd("character",1);
		range.text = replaceChar;
		range.select();
		myvalue[p]= " ";
	};
	this.__insertData = function(str){
		if(str == this.getValue())return;
		str = this.dispatchEvent("oninsert",{data:str}
	)|| str;
		
		if(! str){
			if(! this.getValue())return;
			
			for(var i = this.getValue().length - 1;i >= 0;i --)deletePosition(i);
			setPosition(0);
			return;
		};
		
		for(var i = 0;i < str.length;i ++){
			lastPos = i;
			setCharacter(str.substr(i,1));
		};
		
		if(str.length)lastPos ++;
	};
	function calcPosFromCursor(){
		var range = document.selection.createRange();
		r2 = range.duplicate();
		r2.expand("textedit");
		r2.setEndPoint("EndToStart",range);
		var lt = r2.text.length;
		
		for(var i = 0;i < pos.length;i ++)
		if(pos[i]> lt)return i == 0 ? 0:i - 1;
	}

};

jpf.TextboxAutocomplete = function(){
	var autocomplete ={
	};
	this.initAutocomplete = function(ac){
		ac.parentNode.removeChild(ac);
		autocomplete.nodeset = ac.getAttribute("nodeset").split(":");
		autocomplete.method = ac.getAttribute("method");
		autocomplete.value = ac.getAttribute("value");
		autocomplete.count = parseInt(ac.getAttribute("count"))|| 5;
		autocomplete.sort = ac.getAttribute("sort");
		autocomplete.lastStart = - 1;
		this.oContainer = jpf.XMLDatabase.htmlImport(this.__getLayoutNode("Container"),this.oExt.parentNode,this.oExt.nextSibling);
	};
	this.fillAutocomplete = function(keyCode){
		if(keyCode){
			switch(keyCode){
				case 9:case 27:case 13:return this.oContainer.style.display = "none";
				case 40:
				if(autocomplete.suggestData && autocomplete.lastStart < autocomplete.suggestData.length){
					this.clear();
					var value = autocomplete.suggestData[autocomplete.lastStart ++];
					this.oInt.value = value;
					this.change(value);
					this.oContainer.style.display = "none";
					return;
				};
				break;
				case 38:
				if(autocomplete.lastStart > 0){
					if(autocomplete.lastStart >= autocomplete.suggestData.length)autocomplete.lastStart = autocomplete.suggestData.length - 1;
					this.clear();
					var value = autocomplete.suggestData[autocomplete.lastStart --];
					this.oInt.value = value;
					this.change(value);
					this.oContainer.style.display = "none";
					return;
				};
				break;
			};
			
			if(keyCode > 10 && keyCode < 20)return;
		};
		
		if(autocomplete.method){
			var start = 0,suggestData = self[autocomplete.method]();
			autocomplete.count = suggestData.length;
		}
		else{
			if(this.oInt.value.length == 0){
				this.oContainer.style.display = "none";
				return;
			};
			
			if(! autocomplete.suggestData){
				var nodes = self[autocomplete.nodeset[0]].data.selectNodes(autocomplete.nodeset[1]);
				
				for(var value,suggestData =[],i = 0;i < nodes.length;i ++){
					value = jpf.getXmlValue(nodes[i],autocomplete.value);
					
					if(value)suggestData.push(value.toLowerCase());
				};
				
				if(autocomplete.sort)suggestData.sort();
				autocomplete.suggestData = suggestData;
			}
			else{
				suggestData = autocomplete.suggestData;
			};
			var value = this.oInt.value.toUpperCase();
			
			for(var start = suggestData.length - autocomplete.count,i = 0;i < suggestData.length;i ++){
				if(value <= suggestData[i].toUpperCase()){
					start = i;
					break;
				}
			};
			autocomplete.lastStart = start;
		};
		this.oContainer.innerHTML = "";
		
		for(var arr =[],j = start;j < Math.min(start + autocomplete.count,suggestData.length);j ++){
			this.__getNewContext("Item");
			var oItem = this.__getLayoutNode("Item");
			jpf.XMLDatabase.setNodeValue(this.__getLayoutNode("Item","caption"),suggestData[j]);
			oItem.setAttribute("onmouseover",'this.className = "hover"');
			oItem.setAttribute("onmouseout",'this.className = ""');
			oItem.setAttribute("onmousedown",'event.cancelBubble = true');
			oItem.setAttribute("onclick",'var o = jpf.lookup(' + this.uniqueId + ');o.oInt.value = this.innerHTML;o.change(this.innerHTML);o.oInt.select();o.oInt.focus();o.oContainer.style.display = "none";');
			arr.push(this.__getLayoutNode("Item"));
		};
		jpf.XMLDatabase.htmlImport(arr,this.oContainer);
		this.oContainer.style.display = "block";
	};
	this.setAutocomplete = function(model,traverse,value){
		autocomplete.lastStart = - 1;
		autocomplete.suggestData = null;
		autocomplete.nodeset =[model,traverse];
		autocomplete.value = value;
		this.oContainer.style.display = "none";
	}

}

/*FILEHEAD(/in/Library/Components/Tinymce.js)SIZE(3890)TIME(1203724026696)*/

/*FILEHEAD(/in/Library/Components/Toc.js)SIZE(6071)TIME(1205331783796)*/

/*FILEHEAD(/in/Library/Components/Toolbar.js)SIZE(7071)TIME(1205789920500)*/
jpf.toolbar = function(pHtmlNode){
	jpf.register(this,"toolbar",GUI_NODE);
	this.pHtmlNode = pHtmlNode || document.body;
	this.pHtmlDoc = this.pHtmlNode.ownerDocument;
	var lastbars = null,bars =[];
	this.inherit(jpf.Presentation);
	this.addDivider = function(elBar){
		elBar.children.push({tagName:"Divider",oExt:jpf.XMLDatabase.htmlImport(this.__getLayoutNode("Divider"),elBar.oInt),hide:function(){
				this.oExt.style.display = "none";
			}
			,show:function(){
				this.oExt.style.display = "block";
			}
			,getElementsByTagName:function(){
				return[];
			}
		}
	);
	};
	this.addBar = function(xmlNode){
		this.__getNewContext("Bar");
		var p = this.__getLayoutNode("Bar");
		
		if(xmlNode.getAttribute("css"))p.setAttribute("style",xmlNode.getAttribute("css"));
		var elBar = jpf.XMLDatabase.htmlImport(p,this.oInt);
		var elBarInt = this.__getLayoutNode("Bar","container",elBar);
		var isMenu = xmlNode.getAttribute("type")== "menu";
		
		if(isMenu)this.__setStyleClass(elBar,"menubar");
		var oBar ={
			jml:xmlNode,oExt:elBar,oInt:elBarInt,isMenu:isMenu,children:[]};
		oBar.inherit = jpf.inherit;
		oBar.inherit(jpf.JmlDomAPI);
		oBar.childNodes = oBar.children;
		this.childNodes.push(oBar);
		
		if(xmlNode.getAttribute("height"))oBar.oExt.style.height = xmlNode.getAttribute("height")+ "px";
		var id = bars.push(oBar)- 1;
		
		if(lastbars){
			var childs = lastbars[id].children;
			
			for(var i = 0;i < childs.length;i ++){
				if(childs[i].tagName == "divider")this.addDivider(oBar);
				else{
					childs[i].parentNode = oBar;
					elBarInt.appendChild(childs[i].oExt);
					oBar.children.push(childs[i]);
				}
			};
			oBar.childNodes = lastbars[id].childNodes;
		}
		else{
			var nodes = xmlNode.childNodes;
			
			for(var i = 0;i < nodes.length;i ++){
				if(nodes[i].nodeType != 1)continue;
				var tagName = nodes[i][jpf.TAGNAME];
				
				if(tagName == "divider")this.addDivider(oBar);
				else{
					var o = jpf.document.createElement(null,nodes[i],elBarInt,oBar);
					this.__setStyleClass(o.oExt,"toolbar_item");
					
					if(tagName == "button"){
						if(nodes[i].getAttribute("submenu"))this.setMenuButton(o,nodes[i],xmlNode,oBar);
						o.focussable = false;
					};
					o.barId = oBar.children.push(o)- 1;
					var toolbar = this;
					o.addEventListener("onclick",function(){toolbar.dispatchEvent("onitemclick",{value:this.sValue}
					);
					}
				);
				}
			}
		};
		return oBar;
	};
	this.setMenuButton = function(o,node,xmlNode,oBar){
		o.submenu = node.getAttribute("submenu");
		o.bar = this;
		o.subbar = oBar;
		o.__setStateBehaviour();
		o.__blurhook = function(){
			if(this.value){
				this.__setState("Down",{}
			,"onmousedown");
				this.hideMenu()}
		};
		o.addEventListener("onmousedown",function(e){if(! e)e = event;
			
			if(this.value){
				self[this.submenu].hideMenu();
				this.__setState("Over",{}
			,"ontbover");
				
				if(this.bar.hasMoved)this.value = false;
				this.bar.menuIsPressed = false;
				return;
			};
			this.bar.menuIsPressed = this;
			var pos = jpf.compat.getAbsolutePosition(this.oExt,self[this.submenu].oExt.offsetParent || self[this.submenu].oExt.parentNode);
			self[this.submenu].oExt.style.left = pos[0]+ "px";
			self[this.submenu].oExt.style.top =(pos[1]+ this.oExt.offsetHeight)+ "px";
			self[this.submenu].showMenu();
			e.cancelBubble = true;
			this.bar.hasMoved = false;
		}
	);
		o.addEventListener("onmouseover",function(){if(this.bar.menuIsPressed && this.bar.menuIsPressed != this){
				this.bar.menuIsPressed.setValue(false);
				self[this.bar.menuIsPressed.submenu].hideMenu();
				this.setValue(true);
				this.bar.menuIsPressed = this;
				var pos = jpf.compat.getAbsolutePosition(this.oExt,self[this.submenu].oExt.offsetParent || self[this.submenu].oExt.parentNode);
				self[this.submenu].display(pos[0],pos[1]+ this.oExt.offsetHeight,true,this);
				jpf.window.__focus(this);
				this.bar.hasMoved = true;
			}
		}
	);
		o.addEventListener("onkeydown",function(key){switch(key){
				case 37:var id = this.barId == 0 ? this.subbar.children.length - 1:this.barId - 1;
				this.subbar.children[id].dispatchEvent("onmouseover");
				break;
				case 39:var id = this.barId >= this.subbar.children.length - 1 ? 0:this.barId + 1;
				this.subbar.children[id].dispatchEvent("onmouseover");
				break;
			}
		}
	);
		o.hideMenu = function(){
			this.setValue(false);
			this.__setState("Out",{}
		,"onmouseout");
			this.bar.menuIsPressed = false;
		}
	};
	this.inherit(jpf.JmlNode);
	this.draw = function(){
		this.oExt = this.__getExternal();
		this.oInt = this.__getLayoutNode("Main","container",this.oExt);
	};
	this.__loadJML = function(x){
		if(bars.length){
			lastbars = bars;
			bars =[];
			this.childNodes =[];
		};
		lastpages = null;
		var nodes = this.jml.childNodes;
		
		for(var i = 0;i < nodes.length;i ++){
			if(nodes[i].nodeType != 1)continue;
			var tagName = nodes[i][jpf.TAGNAME];
			
			if(tagName == "bar"){
				var p = this.addBar(nodes[i]);
				
				if(i == 0)this.__setStyleClass(p.oExt,"first");
				
				if(i == nodes.length - 2)this.__setStyleClass(p.oExt,"last");
			}
		};
		lastbars = null;
	}

}

/*FILEHEAD(/in/Library/Components/Tree.js)SIZE(33122)TIME(1213626727537)*/

/*FILEHEAD(/in/Library/Components/Workarea.js)SIZE(10032)TIME(1203724831181)*/

/*FILEHEAD(/in/Library/Components/Xslt.js)SIZE(3613)TIME(1203724026712)*/

/*FILEHEAD(/in/Library/Components/_base/BaseButton.js)SIZE(4087)TIME(1203724843524)*/
jpf.BaseButton = function(pHtmlNode){
	this.refKeyDown = 0;
	this.refMouseDown = 0;
	this.mouseOver = false;
	this.mouseLeft = false;
	this.keyHandler = function(key,ctrlKey,shiftKey,altKey,evnt){
		switch(key){
			case 32:case 13:
			if(! evnt.repeat){
				this.refKeyDown ++;
				return this.__updateState(evnt);
			}
			else return false;
		}
	};
	this.keyUpHandler = function(key,ctrlKey,shiftKey,altKey,evnt){
		switch(key){
			case 32:case 13:this.refKeyDown --;
			
			if(this.refKeyDown + this.refMouseDown == 0 && ! this.disabled){
				this.oExt.onmouseup(evnt,true);
			};
			return this.__updateState(evnt);
		}
	};
	this.states ={
		"Out":1,"Over":2,"Down":3};
	this.__updateState = function(e,strEvent){
		if(this.disabled){
			this.refKeyDown = 0;
			this.refMouseDown = 0;
			this.mouseOver = false;
			return false;
		}
		else{
			if(this.refKeyDown > 0 ||(this.refMouseDown > 0 && this.mouseOver)||(this.isBoolean && this.value))this.__setState("Down",e,strEvent);
			else 
			if(this.mouseOver)this.__setState("Over",e,strEvent);
			else this.__setState("Out",e,strEvent);
		}
	};
	this.__setupEvents = function(){
		this.oExt.onmousedown = function(e){
			this.host.refMouseDown = 1;
			this.host.mouseLeft = false;
			this.host.__updateState(e || event,"onmousedown");
		};
		this.oExt.onmouseup = function(e,force){
			if(! e)e = event;
			
			if(e)e.cancelBubble = true;
			
			if(! force &&(! this.host.mouseOver || ! this.host.refMouseDown))return;
			this.host.refMouseDown = 0;
			this.host.__updateState(e,"onmouseup");
			
			if(this.host.disabled ||(e && e.type == "click" && this.host.mouseLeft == true))return false;
			
			if(this.host.refMouseDown + this.host.refKeyDown)return false;
			
			if(this.host.__clickHandler && this.host.__clickHandler())this.host.__updateState(e || event,"onclick");
			else this.host.dispatchEvent("onclick",{htmlEvent:e}
		);
			return false;
		};
		this.oExt.onmousemove = function(e){
			this.host.mouseOver = true;
			this.host.__updateState(e || event,"onmouseover");
		};
		this.oExt.onmouseout = function(e){
			if(! e)e = event;
			var tEl = e.explicitOriginalTarget || e.toElement;
			
			if(this == tEl || jpf.XMLDatabase.isChildOf(this,tEl))return;
			this.host.mouseOver = false;
			this.host.refMouseDown = 0;
			this.host.mouseLeft = true;
			this.host.__updateState(e || event,"onmouseout");
		};
		
		if(jpf.hasClickFastBug)this.oExt.ondblclick = this.oExt.onmouseup;
	};
	this.__destroy = function(){
		this.oExt.onmousedown = null;
		this.oExt.onmouseup = null;
		this.oExt.onmouseover = null;
		this.oExt.onmouseout = null;
		this.oExt.onclick = null;
		this.oExt.ondblclick = null;
	};
	this.__focus = function(){
		if(! this.oExt)return;
		this.__setStyleClass(this.oExt,this.baseCSSname + "Focus");
	};
	this.__blur = function(e){
		if(! this.oExt)return;
		
		if(! e)e = event;
		this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Focus"]);
		this.refKeyDown = 0;
		this.refMouseDown = 0;
		this.mouseLeft = true;
		
		if(e)this.__updateState(e,"onblur");
	}

}

/*FILEHEAD(/in/Library/Components/_base/BaseFastList.js)SIZE(16716)TIME(1203724875743)*/

/*FILEHEAD(/in/Library/Components/_base/BaseList.js)SIZE(20298)TIME(1213479942927)*/
jpf.BaseList = function(){
	this.focussable = true;
	this.multiselect = true;
	this.__deInitNode = function(xmlNode,htmlNode){
		if(! htmlNode)return;
		htmlNode.parentNode.removeChild(htmlNode);
	};
	this.__updateNode = function(xmlNode,htmlNode,noModifier){
		var elIcon = this.__getLayoutNode("Item","icon",htmlNode);
		
		if(elIcon){
			if(elIcon.nodeType == 1)elIcon.style.backgroundImage = "url(" + this.iconPath + this.applyRuleSetOnNode("icon",xmlNode)+ ")";
			else elIcon.nodeValue = this.iconPath + this.applyRuleSetOnNode("icon",xmlNode);
		}
		else{
			var elImage = this.__getLayoutNode("Item","image",htmlNode);
			
			if(elImage){
				if(elImage.nodeType == 1)elImage.style.backgroundImage = "url(" + this.mediaPath + this.applyRuleSetOnNode("image",xmlNode)+ ")";
				else elImage.nodeValue = this.mediaPath + this.applyRuleSetOnNode("image",xmlNode);
			}
		};
		var elCaption = this.__getLayoutNode("Item","caption",htmlNode);
		
		if(elCaption){
			if(elCaption.nodeType == 1)elCaption.innerHTML = this.applyRuleSetOnNode("caption",xmlNode);
			else elCaption.nodeValue = this.applyRuleSetOnNode("caption",xmlNode);
		};
		htmlNode.title = this.applyRuleSetOnNode("title",xmlNode)|| "";
		
		if(! noModifier && this.__updateModifier)this.__updateModifier(xmlNode,htmlNode);
	};
	this.__moveNode = function(xmlNode,htmlNode){
		if(! htmlNode)return;
		var oPHtmlNode = htmlNode.parentNode;
		var beforeNode = xmlNode.nextSibling ? jpf.XMLDatabase.findHTMLNode(this.getNextTraverse(xmlNode),this):null;
		oPHtmlNode.insertBefore(htmlNode,beforeNode);
	};
	this.__keyHandler = function(key,ctrlKey,shiftKey,altKey){
		if(! this.selected)return;
		switch(key){
			case 13:this.select(this.indicator,true);
			this.choose(this.selected);
			break;
			case 32:this.select(this.indicator,true);
			break;
			case 109:case 46:
			if(this.disableremove)return;
			this.remove(null,this.mode != "check");
			break;
			case 37:var margin = jpf.compat.getBox(jpf.getStyle(this.selected,"margin"));
			
			if(! this.value && ! this.indicator)return;
			var node = this.getNextTraverseSelected(this.indicator || this.value,false);
			
			if(node){
				if(ctrlKey || this.ctrlSelect)this.setIndicator(node);
				else this.select(node,null,shiftKey);
			};
			
			if(this.selected.offsetTop < this.oExt.scrollTop)this.oExt.scrollTop = this.selected.offsetTop - margin[0];
			break;
			case 38:var margin = jpf.compat.getBox(jpf.getStyle(this.selected,"margin"));
			
			if(! this.value && ! this.indicator)return;
			var hasScroll = this.oExt.scrollHeight > this.oExt.offsetHeight;
			var items = Math.floor((this.oExt.offsetWidth -(hasScroll ? 15:0))/(this.selected.offsetWidth + margin[1]+ margin[3]));
			var node = this.getNextTraverseSelected(this.indicator || this.value,false,items);
			
			if(node){
				if(ctrlKey || this.ctrlSelect)this.setIndicator(node);
				else this.select(node,null,shiftKey);
			};
			
			if(this.selected.offsetTop < this.oExt.scrollTop)this.oExt.scrollTop = this.selected.offsetTop - margin[0];
			break;
			case 39:var margin = jpf.compat.getBox(jpf.getStyle(this.selected,"margin"));
			
			if(! this.value && ! this.indicator)return;
			var node = this.getNextTraverseSelected(this.indicator || this.value,true);
			
			if(node){
				if(ctrlKey || this.ctrlSelect)this.setIndicator(node);
				else this.select(node,null,shiftKey);
			};
			
			if(this.selected.offsetTop + this.selected.offsetHeight > this.oExt.scrollTop + this.oExt.offsetHeight)this.oExt.scrollTop = this.selected.offsetTop - this.oExt.offsetHeight + this.selected.offsetHeight + margin[0];
			break;
			case 40:var margin = jpf.compat.getBox(jpf.getStyle(this.selected,"margin"));
			
			if(! this.value && ! this.indicator)return;
			var hasScroll = this.oExt.scrollHeight > this.oExt.offsetHeight;
			var items = Math.floor((this.oExt.offsetWidth -(hasScroll ? 15:0))/(this.selected.offsetWidth + margin[1]+ margin[3]));
			var node = this.getNextTraverseSelected(this.indicator || this.value,true,items);
			
			if(node){
				if(ctrlKey || this.ctrlSelect)this.setIndicator(node);
				else this.select(node,null,shiftKey);
			};
			
			if(this.selected.offsetTop + this.selected.offsetHeight > this.oExt.scrollTop + this.oExt.offsetHeight -(hasScroll ? 10:0))this.oExt.scrollTop = this.selected.offsetTop - this.oExt.offsetHeight + this.selected.offsetHeight + 10 +(hasScroll ? 10:0);
			break;
			case 33:var margin = jpf.compat.getBox(jpf.getStyle(this.selected,"margin"));
			
			if(! this.value && ! this.indicator)return;
			var hasScrollY = this.oExt.scrollHeight > this.oExt.offsetHeight;
			var hasScrollX = this.oExt.scrollWidth > this.oExt.offsetWidth;
			var items = Math.floor((this.oExt.offsetWidth -(hasScrollY ? 15:0))/(this.selected.offsetWidth + margin[1]+ margin[3]));
			var lines = Math.floor((this.oExt.offsetHeight -(hasScrollX ? 15:0))/(this.selected.offsetHeight + margin[0]+ margin[2]));
			var node = this.getNextTraverseSelected(this.indicator || this.value,false,items * lines);
			
			if(! node)node = this.getFirstTraverseNode();
			
			if(node){
				if(ctrlKey || this.ctrlSelect)this.setIndicator(node);
				else this.select(node,null,shiftKey);
			};
			
			if(this.selected.offsetTop < this.oExt.scrollTop)this.oExt.scrollTop = this.selected.offsetTop - margin[0];
			break;
			case 34:var margin = jpf.compat.getBox(jpf.getStyle(this.selected,"margin"));
			
			if(! this.value && ! this.indicator)return;
			var hasScrollY = this.oExt.scrollHeight > this.oExt.offsetHeight;
			var hasScrollX = this.oExt.scrollWidth > this.oExt.offsetWidth;
			var items = Math.floor((this.oExt.offsetWidth -(hasScrollY ? 15:0))/(this.selected.offsetWidth + margin[1]+ margin[3]));
			var lines = Math.floor((this.oExt.offsetHeight -(hasScrollX ? 15:0))/(this.selected.offsetHeight + margin[0]+ margin[2]));
			var node = this.getNextTraverseSelected(this.indicator || this.value,true,items * lines);
			
			if(! node)node = this.getLastTraverseNode();
			
			if(node){
				if(ctrlKey || this.ctrlSelect)this.setIndicator(node);
				else this.select(node,null,shiftKey);
			};
			
			if(this.selected.offsetTop + this.selected.offsetHeight > this.oExt.scrollTop + this.oExt.offsetHeight -(hasScrollY ? 10:0))this.oExt.scrollTop = this.selected.offsetTop - this.oExt.offsetHeight + this.selected.offsetHeight + 10 +(hasScrollY ? 10:0);
			break;
			case 36:this.select(this.getFirstTraverseNode(),false,shiftKey);
			this.oInt.scrollTop = 0;
			break;
			case 35:this.select(this.getLastTraverseNode(),false,shiftKey);
			this.oInt.scrollTop = this.oInt.scrollHeight;
			break;
			case 107:
			if(this.more)this.startMore();
			break;
			default:
			if(key == 65 && ctrlKey){
				this.selectAll();
			}
			else 
			if(this.bindingRules["caption"]){
				if(! this.lookup || new Date().getTime()- this.lookup.date.getTime()> 300)this.lookup ={
					str:"",date:new Date()};
				this.lookup.str += String.fromCharCode(key);
				var nodes = this.getTraverseNodes();
				
				for(var v,i = 0;i < nodes.length;i ++){
					v = this.applyRuleSetOnNode("caption",nodes[i]);
					
					if(v && v.substr(0,this.lookup.str.length).toUpperCase()== this.lookup.str){
						if(! this.isSelected(nodes[i]))this.select(nodes[i]);
						
						if(this.selected)this.oInt.scrollTop = this.selected.offsetTop -(this.oInt.offsetHeight - this.selected.offsetHeight)/ 2;
						return;
					}
				};
				return;
			};
			break;
		};
		this.lookup = null;
		return false;
	};
	this.nodes =[];
	this.__add = function(xmlNode,Lid,xmlParentNode,htmlParentNode,beforeNode){
		this.__getNewContext("Item");
		var Item = this.__getLayoutNode("Item");
		var elSelect = this.__getLayoutNode("Item","select");
		var elIcon = this.__getLayoutNode("Item","icon");
		var elImage = this.__getLayoutNode("Item","image");
		var elCheckbox = this.__getLayoutNode("Item","checkbox");
		var elCaption = this.__getLayoutNode("Item","caption");
		Item.setAttribute("id",Lid);
		elSelect.setAttribute("onmouseover",'jpf.lookup(' + this.uniqueId + ').__setStyleClass(this, "hover");');
		elSelect.setAttribute("onmouseout",'jpf.lookup(' + this.uniqueId + ').__setStyleClass(this, "", ["hover"]);');
		
		if(this.hasFeature(__RENAME__)){
			elSelect.setAttribute("ondblclick",'var o = jpf.lookup(' + this.uniqueId + '); ' + 'o.cancelRename();' + ' o.choose()');
			elSelect.setAttribute(this.itemSelectEvent || "onmousedown",'var o = jpf.lookup(' + this.uniqueId + ');if(!o.renaming && o.isFocussed() && jpf.XMLDatabase.isChildOf(o.selected, this, true) && o.value) this.dorename = true;o.select(this, event.ctrlKey, event.shiftKey)');
			elSelect.setAttribute("onmouseup",'if(this.dorename) jpf.lookup(' + this.uniqueId + ').startDelayedRename(event); this.dorename = false;');
		}
		else{
			elSelect.setAttribute("ondblclick",'var o = jpf.lookup(' + this.uniqueId + '); o.choose()');
			elSelect.setAttribute(this.itemSelectEvent || "onmousedown",'var o = jpf.lookup(' + this.uniqueId + '); o.select(this, event.ctrlKey, event.shiftKey)');
		};
		
		if(elIcon){
			if(elIcon.nodeType == 1)elIcon.setAttribute("style","background-image:url(" + this.iconPath + this.applyRuleSetOnNode("icon",xmlNode)+ ")");
			else elIcon.nodeValue = this.iconPath + this.applyRuleSetOnNode("icon",xmlNode);
		}
		else 
		if(elImage){
			if(elImage.nodeType == 1)elImage.setAttribute("style","background-image:url(" + this.mediaPath + this.applyRuleSetOnNode("image",xmlNode)+ ")");
			else{
				if(jpf.isSafariOld){
					var p = elImage.ownerElement.parentNode;
					var img = p.appendChild(p.ownerDocument.createElement("img"));
					img.setAttribute("src",this.mediaPath + this.applyRuleSetOnNode("image",xmlNode));
				}
				else{
					elImage.nodeValue = this.mediaPath + this.applyRuleSetOnNode("image",xmlNode);
				}
			}
		};
		
		if(elCaption){
			jpf.XMLDatabase.setNodeValue(elCaption,this.applyRuleSetOnNode("caption",xmlNode));
		};
		Item.setAttribute("title",this.applyRuleSetOnNode("title",xmlNode)|| "");
		
		if(this.__addModifier)this.__addModifier(xmlNode,Item);
		
		if(htmlParentNode)jpf.XMLDatabase.htmlImport(Item,htmlParentNode,beforeNode);
		else this.nodes.push(Item);
	};
	this.__fill = function(){
		if(this.more && ! this.moreItem){
			this.__getNewContext("Item");
			var Item = this.__getLayoutNode("Item");
			var elCaption = this.__getLayoutNode("Item","caption");
			var elSelect = this.__getLayoutNode("Item","select");
			Item.setAttribute("class","more");
			elSelect.setAttribute("onmousedown",'jpf.lookup(' + this.uniqueId + ').__setStyleClass(this, "more_down");');
			elSelect.setAttribute("onmouseout",'jpf.lookup(' + this.uniqueId + ').__setStyleClass(this, "", ["more_down"]);');
			elSelect.setAttribute("onmouseup",'jpf.lookup(' + this.uniqueId + ').startMore(this)');
			
			if(elCaption)jpf.XMLDatabase.setNodeValue(elCaption,this.jml.getAttribute("more").match(/Caption:(.*)(;|$)/)[1]);
			this.nodes.push(Item);
		};
		jpf.XMLDatabase.htmlImport(this.nodes,this.oInt);
		this.nodes.length = 0;
		
		if(this.more && ! this.moreItem){
			this.moreItem = this.oInt.lastChild;
		}
	};
	var lastAddedMore;
	this.startMore = function(o){
		this.__setStyleClass(o,"",["more_down"]);
		var addedNode = this.add();
		this.select(addedNode,null,null,null,null,true);
		this.oInt.appendChild(this.moreItem);
		var undoLastAction = function(){
			this.getActionTracker().undo(this.autoselect ? 2:1);
			this.removeEventListener("oncancelrename",undoLastAction);
			this.removeEventListener("onbeforerename",removeSetRenameEvent);
			this.removeEventListener("onafterrename",afterRename);
		};
		var afterRename = function(){
			this.removeEventListener("onafterrename",afterRename);
		};
		var removeSetRenameEvent = function(e){
			this.removeEventListener("oncancelrename",undoLastAction);
			this.removeEventListener("onbeforerename",removeSetRenameEvent);
			var xmlNode = this.findXmlNodeByValue(e.arguments[1]);
			
			if(xmlNode || ! e.arguments[1]){
				this.getActionTracker().undo(this.autoselect ? 2:1);
				
				if(! this.isSelected(xmlNode))this.select(xmlNode);
				this.removeEventListener("onafterrename",afterRename);
				return false;
			}
		};
		this.addEventListener("oncancelrename",undoLastAction);
		this.addEventListener("onbeforerename",removeSetRenameEvent);
		this.addEventListener("onafterrename",afterRename);
		
		if(this.mode == "radio"){
			this.moreItem.style.display = "none";
			
			if(lastAddedMore)this.removeEventListener("onxmlupdate",lastAddedMore);
			lastAddedMore = function(){
				this.moreItem.style.display = addedNode.parentNode ? "none":"block";
			};
			this.addEventListener("onxmlupdate",lastAddedMore);
		};
		this.startDelayedRename({}
	,1);
	};
	this.__calcSelectRange = function(xmlStartNode,xmlEndNode){
		var r =[];
		var nodes = this.getTraverseNodes();
		
		for(var f = false,i = 0;i < nodes.length;i ++){
			if(nodes[i]== xmlStartNode)f = true;
			
			if(f)r.push(nodes[i]);
			
			if(nodes[i]== xmlEndNode)f = false;
		};
		
		if(! r.length || f){
			r =[];
			
			for(var f = false,i = nodes.length - 1;i >= 0;i --){
				if(nodes[i]== xmlStartNode)f = true;
				
				if(f)r.push(nodes[i]);
				
				if(nodes[i]== xmlEndNode)f = false;
			}
		};
		return r;
	};
	this.__selectDefault = function(XMLRoot){
		this.select(this.getTraverseNodes()[0]);
	};
	this.inherit(jpf.MultiSelect);
	this.inherit(jpf.Cache);
	this.inherit(jpf.Presentation);
	this.inherit(jpf.DataBinding);
	this.loadInlineData = function(x){
		var value,caption,hasImage,hasIcon,strData =[],nodes =($xmlns(x,"choices",jpf.ns.jpf)[0]|| x).childNodes;
		
		for(var i = nodes.length - 1;i >= 0;i --){
			if(nodes[i].nodeType != 1)continue;
			
			if(nodes[i][jpf.TAGNAME]!= "item")continue;
			hasIcon = nodes[i].getAttribute("icon")|| "icoAnything.gif";
			hasImage = nodes[i].getAttribute("image");
			caption = jpf.getXmlValue(nodes[i],"label/text()|text()");
			value = jpf.getXmlValue(nodes[i],"value/text()|@value|text()").replace(/'/g,"");
			strData.unshift("<item " +(hasImage ? "image='" + hasImage + "'":(hasIcon ? "icon='" + hasIcon + "'":""))+ " value='" + value + "'>" + caption + "</item>");
			nodes[i].parentNode.removeChild(nodes[i]);
		};
		
		if(strData.length){
			var sNode = new jpf.SmartBinding(null,jpf.getObject("XMLDOM","<smartbindings xmlns='" + jpf.ns.jpf + "'><bindings><caption select='text()' />" +(hasImage ? "<image select='@image' />":(hasIcon ? "<icon select='@icon'/>":""))+ "<value select='@value'/><traverse select='item' /></bindings><model><items>" + strData.join("")+ "</items></model></smartbindings>").documentElement);
			jpf.JMLParser.addToSbStack(this.uniqueId,sNode);
		};
		
		if(x.childNodes.length)jpf.JMLParser.parseChildren(x,null,this);
	};
	this.loadFillData = function(str){
		var parts = str.split("-");
		var start = parseInt(parts[0]);
		var end = parseInt(parts[1]);
		strData =[];
		
		for(var i = start;i < end + 1;i ++){
			strData.push("<item>" +(i + "").pad(Math.max(parts[0].length,parts[1].length),"0")+ "</item>");
		};
		
		if(strData.length){
			var sNode = new jpf.SmartBinding(null,jpf.getObject("XMLDOM","<smartbindings xmlns='" + jpf.ns.jpf + "'><bindings><caption select='text()' /><value select='text()'/><traverse select='item' /></bindings><model><items>" + strData.join("")+ "</items></model></smartbindings>").documentElement);
			jpf.JMLParser.addToSbStack(this.uniqueId,sNode);
		}
	}

}

/*FILEHEAD(/in/Library/Components/_base/BaseSimple.js)SIZE(2765)TIME(1203724861118)*/

/*FILEHEAD(/in/Library/Components/_base/BaseTab.js)SIZE(11923)TIME(1213198605722)*/

/*FILEHEAD(/in/Library/Core/TelePort.js)SIZE(4040)TIME(1203724986243)*/
__HTTP_SUCCESS__ = 1;

__HTTP_TIMEOUT__ = 2;

__HTTP_ERROR__ = 3;

__RPC_SUCCESS__ = 1;

__RPC_TIMEOUT__ = 2;

__RPC_ERROR__ = 3;

jpf.Teleport ={
	modules:new Array(),named:{
	}

,register:function(obj){
		var id = false,data ={
			obj:obj};
		return this.modules.push(data)- 1;
	}
	,getModules:function(){
		return this.modules;
	}
	,getModuleByName:function(defname){
		return this.named[defname]}
	,Init:function(){
		this.inited = true;
		var comdef = document.documentElement.getElementsByTagName("head")[0].getElementsByTagName(IS_IE ? "teleport":"j:teleport")[0];
		
		if(! comdef && document.documentElement.getElementsByTagNameNS)comdef = document.documentElement.getElementsByTagNameNS("http://javeline.nl/j","j:teleport")[0];
		
		if(! comdef){
			this.isInited = true;
			return issueWarning(1006,"Could not find Javeline TelePort Definition")};
		
		if(comdef.getAttribute("src")){
			new HTTP().getXml(HOST_PATH + comdef.getAttribute("src"),function(xmlNode,state,extra){if(state != __RPC_SUCCESS__){
					if(extra.retries < MAX_RETRIES)return HTTP.retry(extra.id);
					else throw new Error(1021,jpf.formErrrorString(1021,null,"Application","Could not load Javeline TelePort Definition:\n\n" + extra.message));
				};
				jpf.TelePort.xml = xmlNode;
				jpf.TelePort.isInited = true;
			}
			,true);
		}
		else{
			var xmlNode = comdef.firstChild ? XMLDatabase.getDataIsland(comdef.firstChild):null;
			jpf.TelePort.xml = xmlNode;
			jpf.TelePort.isInited = true;
		}
	}
	,loadJML:function(x){
		if(x)this.jml = x;
		
		if(! x)return;
		var nodes = this.jml.childNodes;
		
		if(! nodes.length)return;
		
		for(var i = 0;i < nodes.length;i ++){
			if(nodes[i].nodeType != 1)continue;
			
			if(nodes[i][jpf.TAGNAME]== "socket")jpf.setReference(nodes[i].getAttribute("id"),new jpf.socket()).load(nodes[i]);
			else 
			if(nodes[i][jpf.TAGNAME]== "poll")jpf.setReference(nodes[i].getAttribute("id"),new jpf.poll().load(nodes[i]));
			else jpf.setReference(nodes[i].getAttribute("id"),new jpf.BaseComm(nodes[i]));
		};
		this.loaded = true;
		
		if(this.onload)this.onload();
	}

};

jpf.BaseComm = function(x){
	jpf.makeClass(this);
	this.uniqueId = jpf.all.push(this)- 1;
	this.jml = x;
	this.toString = function(){
		return "[Javeline TelePort Component : " +(this.name || "")+ " (" + this.type + ")]";
	};
	
	if(this.jml){
		this.name = x.getAttribute("id");
		this.type = x[jpf.TAGNAME];
		
		if(! jpf[this.type])throw new Error(1023,jpf.formErrorString(1023,null,"TelePort baseclass","Could not find Javeline TelePort Component '" + this.type + "'",this.jml));
		this.inherit(jpf[this.type]);
		
		if(this.useHTTP){
			if(! jpf.http)throw new Error(1024,jpf.formErrorString(1024,null,"Teleport baseclass","Could not find Javeline TelePort HTTP Component",this.jml));
			this.inherit(jpf.http);
		};
		
		if(this.jml.getAttribute("protocol")){
			if(! jpf[this.jml.getAttribute("protocol").toLowerCase()])throw new Error(1025,jpf.formErrorString(1025,null,"Teleport baseclass","Could not find Javeline TelePort RPC Component '" + this.jml.getAttribute("protocol")+ "'",this.jml));
			this.inherit(jpf[this.jml.getAttribute("protocol").toLowerCase()]);
		}
	};
	
	if(this.jml)this.load(this.jml);
};

jpf.Init.run('TelePort');

/*FILEHEAD(/in/Library/Core/Window.js)SIZE(10600)TIME(1213479979021)*/
jpf.windowManager ={
	destroy:function(frm){
	}

,root:self,userdata:[],forms:new Array(),addForm:function(xmlFormNode){
		var x ={
			jml:xmlFormNode,show:function(){
				alert("not implemented");
			}
		};
		this.forms.push(jpf.setReference(x.name,x,true));
		return x;
	}
	,getForm:function(value){
		for(var i = 0;i < this.forms.length;i ++)
		if(this.forms[i].name == value)return this.forms[i];
		return this.forms.length ? this.forms[0]:false;
	}
	,closeAll:function(){
		for(var i = 0;i < this.forms.length;i ++)
		if(this.forms[i].name != "main" && this.forms[i].type != "modal")this.forms[i].hide();
	}

};

jpf.WindowImplementation = function(){
	jpf.register(this,"window",NOGUI_NODE);
	this.jpf = jpf;
	this.toString = function(){
		return "[Javeline Component : " +(this.name || "")+ " (jpf.window)]";
	};
	this.getActionTracker = function(){
		return this.__ActionTracker};
	this.loadCodeFile = function(url){
		if(self[url])jpf.importClass(self[url],true,this.win);
		else jpf.include(url);
	};
	this.flash = function(){
		if(jpf.hasDeskRun)jdwin.Flash();
	};
	this.show = function(){
		if(jpf.hasDeskRun)jdwin.Show();
	};
	this.hide = function(){
		if(jpf.hasDeskRun)jdwin.Hide();
		else{
			this.loaded = false;
			
			if(this.win)this.win.close();
		}
	};
	this.focus = function(){
		if(jpf.hasDeskRun)jdwin.SetFocus();
		else this.win.focus();
	};
	this.isActive = function(){
		var root = jpf.getRoot();
		return(root ? root.activeWindow == self:false);
	};
	this.setIcon = function(url){
		if(jpf.hasDeskRun)jdwin.icon = parseInt(url)== url ? parseInt(url):url;
	};
	this.setTitle = function(value){
		this.title = value || "";
		
		if(jpf.hasDeskRun)jdwin.caption = value;
		else 
		if(this.win && this.win.document)this.win.document.title =(value || "");
	};
	this.loadJML = function(x){
		if(x[jpf.TAGNAME]== "deskrun")this.loadDeskRun(x);
		else{
		}

};
	this.__f = Array();
	this.__focus = function(o,norun){
		if(this.__fObject == o)return;
		
		if(this.__fObject)this.__fObject.blur(true);
		(this.__fObject = o).focus(true);
		
		if(this.onmovefocus)this.onmovefocus(this.__fObject);
		jpf.status("Focus given to " + this.__fObject.name + " [" + this.__fObject.tagName + "]");
	};
	this.__blur = function(o){
		if(this.__fObject == o)this.__fObject = null;
		
		if(this.onmovefocus)this.onmovefocus(this.__fObject);
	};
	this.isFocussed = function(o){
		return this.__fObject == o;
	};
	this.getFocussedObject = function(){
		return this.__fObject;
	};
	this.__removeFocus = function(o){
		this.__f[o.tabIndex]= null;
		delete this.__f[o.tabIndex];
	};
	this.__addFocus = function(o,tabIndex){
		if(o.__FID == null)o.__FID = tabIndex !== null ? tabIndex:this.__f.length;
		var cComp = this.__f[o.__FID];
		
		if(cComp && cComp.jml && ! cComp.jml.getAttribute("tabseq")){
			this.__f[o.__FID]= null;
			cComp.__FID = this.__f.push(cComp)- 1;
		};
		
		if(this.__f[o.__FID]&& this.__f[o.__FID]!= o)throw new Error(1027,jpf.formErrorString(1027,null,"Tab switching","TabIndex Already in use: '" + o.__FID + "' for " + o.toString()+ ".\n It's in use by " + cComp.toString()));
		this.__f[o.__FID]= o;
		o.tabIndex = tabIndex;
	};
	this.moveNext = function(shiftKey,relObject){
		var next = null,o = relObject || jpf.window.__fObject,start = o ? o.__FID:jpf.window.__f.length;
		
		if(jpf.window.__fObject && jpf.window.__f.length < 2)return;
		do{
			next =(o ? parseInt(o.__FID)+(shiftKey ? - 1:1):(next != null ? next +(shiftKey ? - 1:1):0));
			
			if(start == next)return;
			
			if(next >= jpf.window.__f.length)next = 0;
			else 
			if(next < 0)next = jpf.window.__f.length - 1;
			o = jpf.window.__f[next];
		}
		
		while(! o || o.disabled || o == jpf.window.__fObject ||(o.oExt && ! o.oExt.offsetHeight)|| ! o.focussable);
		jpf.window.__focus(o);
	};
	this.destroy = function(){
		ActionTracker = this.ActionTracker = null;
		jpf.destroy(this);
		jpf.windowManager.destroy(this);
		jpf = this.win = this.window = this.document = null;
		window.onfocus = null;
		window.onerror = null;
		window.onunload = null;
		window.onbeforeunload = null;
		window.onblur = null;
		document.body.innerHTML = "";
	}

};

jpf.DocumentImplementation = function(){
	jpf.makeClass(this);
	this.inherit(jpf.JmlDomAPI);
	this.nodeType = DOC_NODE;
	this.createElement = function(tagName,jmlNode,parentHtmlNode,pJmlNode){
		jpf.status("Creating Element " + tagName);
		
		if(! tagName)tagName = jmlNode[jpf.TAGNAME];
		
		if(! jpf[tagName]|| typeof jpf[tagName]!= "function")throw new Error(1017,jpf.formErrorString(1017,null,"Initialization","Could not find Class Definition '" + tagName + "'.",x));
		
		if(! jpf[tagName])throw new Error(0,"Could not find class " + tagName);
		
		if(! jpf.JMLParser.jml)throw new Error(0,"Unspecified error");
		var x = jmlNode || jpf.JMLParser.jml.ownerDocument.createElement(tagName);
		var o = new jpf[tagName](parentHtmlNode,tagName,x);
		
		if(o.loadJML)o.loadJML(x,pJmlNode);
		
		if(x.getAttribute("id"))jpf.setReference(x.getAttribute("id"),o);
		return o;
	}

}

/*FILEHEAD(/in/Library/Core/JmlNode.js)SIZE(21830)TIME(1213624207568)*/
__JMLNODE__ = 1 << 15;

__VALIDATION__ = 1 << 6;

jpf.JmlNode = function(){
	this.toString = function(){
		return "[Javeline Component : " +(this.name || "")+ " (" + this.tagName + ")]";
	};
	this.__regbase = this.__regbase | __JMLNODE__;
	this.setWidth = function(value,diff){
		this.oExt.style.width = Math.max(0,(value -(! diff && diff !== 0 ? jpf.compat.getWidthDiff(this.oExt):diff)))+ "px";
	};
	this.setHeight = function(value,diff){
		this.oExt.style.height = Math.max(0,(value -(! diff && diff !== 0 ? jpf.compat.getHeightDiff(this.oExt):diff)))+ "px";
	};
	this.setLeft = function(value){
		this.oExt.style.position = "absolute";
		this.oExt.style.left = value + "px"};
	this.setTop = function(value){
		this.oExt.style.position = "absolute";
		this.oExt.style.top = value + "px"};
	this.setZIndex = function(value){
		this.setProperty("zindex",value);
	};
	this.enable = function(){
		this.setProperty("disabled",false);
	};
	this.disable = function(){
		this.setProperty("disabled",true);
	};
	var noAlignUpdate = false;
	
	if(! this.show)this.show = function(s){
		noAlignUpdate = s;
		this.setProperty("visible",true);
		noAlignUpdate = false;
	};
	
	if(! this.hide)this.hide = function(s){
		noAlignUpdate = s;
		this.setProperty("visible",false);
		noAlignUpdate = false;
	};
	this.getWidth = function(){
		return this.oExt ? this.oExt.offsetWidth:null};
	this.getHeight = function(){
		return this.oExt ? this.oExt.offsetHeight:null};
	this.getLeft = function(){
		return this.oExt ? this.oExt.offsetLeft:null};
	this.getTop = function(){
		return this.oExt ? this.oExt.offsetTop:null};
	this.getZIndex = function(){
		return this.oExt ? jpf.compat.getStyle(this.oExt,"zIndex"):null};
	this.isVisible = function(value){
		return this.oExt ? this.oExt.style.display != "none":null;
	};
	this.loadJML = function(x,pJmlNode,ignoreBindclass,id){
		this.name = x.getAttribute("id");
		
		if(x){
			if(! this.parentNode)this.parentNode = pJmlNode;
			this.jml = x;
		}
		else x = this.jml;
		var attr = x.attributes;
		
		for(var i = 0;i < attr.length;i ++){
			if(attr[i].nodeName.substr(0,2)== "on")this.addEventListener(attr[i].nodeName,new Function(attr[i].nodeValue));
		};
		
		if(this.nodeType != NOGUI_NODE){
			this.inherit(jpf.JmlDomAPI);
			
			if(this.loadSkin)this.loadSkin();
			this.draw();
			
			if(id)this.oExt.setAttribute("id",id);
			this.drawed = true;
			this.dispatchEvent("ondraw");
		};
		
		if(! ignoreBindclass){
			if(! this.hasFeature(__DATABINDING__)&& x.getAttribute("smartbinding")){
				this.inherit(jpf.DataBinding);
				this.__xmlUpdate = this.__load = function(){
				}
		}
		};
		
		if(x.getAttribute("actiontracker")){
			this.__ActionTracker = self[x.getAttribute("actiontracker")]? jpf.JMLParser.getActionTracker(x.getAttribute("actiontracker")):jpf.setReference(x.getAttribute("actiontracker"),jpf.NameServer.register("actiontracker",x.getAttribute("actiontracker"),new jpf.ActionTracker(this)));
		};
		
		if(x.getAttribute("jml")){
			this.insertJML(x.getAttribute("jml"));
			x.removeAttribute("jml");
		}
		else 
		if(this.__loadJML)this.__loadJML(x);
		this.dispatchEvent("onloadjml");
		
		if(this.nodeType == GUI_NODE){
			this.inherit(jpf.Alignment);
			this.inherit(jpf.Anchoring);
			
			if(x.getAttribute("align")|| x.parentNode[jpf.TAGNAME].match(/^(?:vbox|hbox)$/))this.enableAlignment();
			else 
			if(x.getAttribute("left")|| x.getAttribute("right")|| x.getAttribute("top")|| x.getAttribute("bottom"))this.enableAnchoring();
			else{
				var diff = jpf.compat.getDiff(this.oExt);
				
				if(x.getAttribute("left"))this.setLeft(x.getAttribute("left"));
				
				if(x.getAttribute("top"))this.setTop(x.getAttribute("top"));
				
				if(x.getAttribute("width"))this.setWidth(x.getAttribute("width"),diff[0]);
				
				if(x.getAttribute("height"))this.setHeight(x.getAttribute("height"),diff[1]);
			}
		};
		
		if(jpf.isTrue(x.getAttribute("autosize"))){
			this.oExt.style.overflow = "visible";
			this.oExt.style.height = "auto";
		};
		
		for(var i = this.__jmlLoaders.length - 1;i >= 0;i --)this.__jmlLoaders[i].call(this,x);
		
		if(! this.__supportedProperties)this.__supportedProperties =[];
		
		if(this.nodeType != NOGUI_NODE){
			this.__supportedProperties.push("focussable","zindex","visible","disabled","disable-keyboard","contextmenu");
			
			if(this.visible === null)this.visible = true;
			
			if(jpf.isFalse(x.getAttribute("visible"))){
				this.oExt.style.display = "none";
				this.visible = false;
			}
		};
		
		for(var i = this.__supportedProperties.length - 1;i >= 0;-- i){
			var pValue = x.getAttribute(this.__supportedProperties[i]);
			
			if(! pValue)continue;
			jpf.JMLParser.stateStack.push([this,this.__supportedProperties[i],pValue]);
		};
		
		if(this.focussable)this.handlePropSet("focussable",true);
	};
	var jmlNode = this;
	this.handlePropSet = function(prop,value,force){
		if(! force && this.XMLRoot && this.bindingRules && this.bindingRules[prop.uCaseFirst()])return jpf.XMLDatabase.setNodeValue(this.getNodeFromRule(prop.toLowerCase(),this.XMLRoot,null,null,true),value,true);
		this[prop]= value;
		switch(prop){
			case "focussable":this.focussable = ! jpf.isFalse(value);
			
			if(this.focussable)jpf.window.__addFocus(this,this.tabIndex || this.jml.getAttribute("tabseq"));
			else jpf.window.__removeFocus(this);
			break;
			case "zindex":this.oExt.style.zIndex = value;
			break;
			case "visible":
			if(jpf.isFalse(value)){
				if(! noAlignUpdate && this.hasFeature(__ALIGNMENT__)&& this.aData){
					this.disableAlignment(true);
				}
				else this.oExt.style.display = "none";
				
				if(jpf.window.isFocussed(this))jpf.window.moveNext();
				this.visible = false;
			}
			else 
			if(jpf.isTrue(value)){
				if(! noAlignUpdate && this.hasFeature(__ALIGNMENT__)&& this.aData){
					this.enableAlignment(true);
				}
				else this.oExt.style.display = "block";
				this.visible = true;
			};
			break;
			case "disabled":
			if(jpf.isTrue(value)){
				this.disabled = false;
				
				if(this.hasFeature(__PRESENTATION__))this.__setStyleClass(this.oExt,this.baseCSSname + "Disabled");
				
				if(this.__disable)this.__disable();
				this.disabled = true;
			}
			else{
				if(this.hasFeature(__DATABINDING__)&& jpf.appsettings.autoDisable & ! this.isBoundComplete())return false;
				this.disabled = false;
				
				if(this.hasFeature(__PRESENTATION__))this.__setStyleClass(this.oExt,null,[this.baseCSSname + "Disabled"]);
				
				if(this.__enable)this.__enable();
			};
			break;
			case "disable-keyboard":this.disableKeyboard = jpf.isTrue(value);
			break;
			case "width":this.setWidth(value);
			break;
			case "height":this.setHeight(value);
			break;
			case "contextmenu":this.contextmenus =[value];
			break;
		};
		
		if(this.__handlePropSet){
			return this.__handlePropSet(prop,value);
		}
	};
	this.replaceJML = function(jmlDefNode,oInt,oIntJML,isHidden){
		jpf.status("Remove all jml from element");
		
		for(var i = 0;i < this.childNodes.length;i ++){
			var oItem = this.childNodes[i];
			var nodes = oItem.childNodes;
			
			for(var k = 0;k < nodes.length;k ++)nodes[k].destroySelf();
			jpf.removeNode(oItem.oExt);
		};
		this.childNodes.length = 0;
		this.insertJML(jmlDefNode,oInt,oIntJML,isHidden);
	};
	this.insertJML = function(jmlDefNode,oInt,oIntJML,isHidden){
		jpf.status("Loading sub jml from external source");
		var jmlNode = this;
		var callback = function(data,state,extra){
			if(state != __HTTP_SUCCESS__){
				if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
				else{
					var commError = new Error(1019,jpf.formErrorString(1019,jmlNode,"Loading extra jml from datasource","Could not load JML from remote resource \n\n" + extra.message));
					
					if(jmlNode.dispatchEvent("onerror",jpf.extend({error:commError,state:status}
					,extra))!== false)throw commError;
					return;
				}
			};
			jpf.status("Runtime inserting jml");
			var JML = oIntJML || jmlNode.jml;
			
			if(JML.insertAdjacentHTML)JML.insertAdjacentHTML(JML.getAttribute("insert")|| "beforeend",typeof data != "string" && data.length ? data[0]:data);
			else{
				if(typeof data == "string")data = jpf.XMLDatabase.getXml("<j:jml xmlns:j='" + jpf.ns.jpf + "'>" + data + "</j:jml>");
				
				for(var i = data.childNodes.length - 1;i >= 0;i --)JML.appendChild(data.childNodes[i]);
			};
			jpf.JMLParser.parseFirstPass(JML);
			jpf.JMLParser.parseChildren(JML,oInt || jmlNode.oInt,this,null,isHidden &&(oInt || jmlNode.oInt).style.offsetHeight ? true:false);
			jpf.layoutServer.activateGrid();
			jpf.layoutServer.activateRules();
			jpf.JMLParser.parseLastPass();
		};
		
		if(typeof jmlDefNode == "string"){
			if(jmlDefNode.match(/^(?:url|url.post|rpc|call|eval|cookie|gears):/))return jpf.getData(jmlDefNode,null,callback);
			else jmlDefNode = XMLDatabase.getXml(jmlDefNode);
		};
		return callback(jmlDefNode,__HTTP_SUCCESS__);
	};
	this.setTabIndex = function(tabIndex){
		jpf.window.__removeFocus(this);
		jpf.window.__addFocus(this,tabIndex);
	};
	
	if(this.focussable){
		this.focus = function(noset){
			this.__focus(this);
			
			if(! noset)jpf.window.__focus(this);
			this.dispatchEvent("onfocus");
		};
		this.blur = function(noset){
			this.__blur(this);
			
			if(! noset)jpf.window.__blur(this);
			this.dispatchEvent("onblur");
		};
		this.isFocussed = function(){
			return jpf.window.isFocussed(this);
		}
	}
	else this.focussable = false;
	
	if(this.hasFeature(__DATABINDING__)&& ! this.hasFeature(__MULTISELECT__)&& ! this.change){
		this.change = function(value){
			if((! this.createModel || ! this.jml.getAttribute("ref"))&& ! this.XMLRoot){
				if(this.dispatchEvent("onbeforechange",{value:value}
			)=== false)return;
				this.setProperty("value",value);
				return this.dispatchEvent("onafterchange",{value:value}
			);
			};
			this.executeActionByRuleSet("change",this.mainBind,this.XMLRoot,value);
		}
	};
	
	if(this.setValue && ! this.clear)this.clear = function(nomsg){
		if(this.__setClearMessage){
			if(! nomsg)this.__setClearMessage(this.msg);
			else 
			if(this.__removeClearMessage)this.__removeClearMessage();
		};
		this.value = - 99999;
		this.__handlePropSet ? this.__handlePropSet("value",""):this.setValue("");
	};
	this.addEventListener("oncontextmenu",function(e){if(! this.contextmenus)return;
		var contextmenu,xmlNode = this.hasFeature(__MULTISELECT__)? this.value:this.XMLRoot;
		
		for(var i = 0;i < this.contextmenus.length;i ++){
			var isRef = typeof this.contextmenus[i]== "string";
			
			if(! isRef)var sel = this.contextmenus[i].getAttribute("select");
			
			if(isRef || xmlNode && xmlNode.selectSingleNode(sel || ".")|| ! xmlNode && ! sel){
				var menuId = isRef ? this.contextmenus[i]:this.contextmenus[i].getAttribute("menu");
				self[menuId].display(e.htmlEvent.clientX + document.documentElement.scrollLeft,e.htmlEvent.clientY + document.documentElement.scrollTop,null,null,xmlNode);
				e.htmlEvent.returnValue = false;
				break;
			}
		};
		
		if(! jpf.appsettings.disableRightClick){
			document.oncontextmenu = function(){
				document.oncontextmenu = null;
				return false;
			}
		}
	}

);
};

window.onbeforeunload = function(){
	if(! jpf.window)return;
	var returnValue;
	
	if(jpf.hasDeskRun)window.external.shell.RegSet(jpf.appsettings.drRegName + "/window",window.external.left + "," + window.external.top + "," + window.external.width + "," + window.external.height);
	
	if(jpf.window.onexit)returnValue = jpf.window.onexit();
	
	if(jpf.window.isActive())jpf.getRoot().activeWindow = null;
	return returnValue;
};


if(jpf.hasDeskRun)window.external.onbeforeunload = window.onbeforeunload;

window.onunload = function(){
	if(! jpf.window)return;
	jpf.window.isExiting = true;
	jpf.window.destroy();
};

window.onfocus = function(){
	if(! jpf.window)return;
	
	if(jpf.window.onfocus)jpf.window.onfocus();
};

window.onblur = function(){
	if(! jpf.window)return;
	
	if(jpf.window.onblur)jpf.window.onblur();
};

document.oncontextmenu = function(){
	if(jpf.appsettings.disableRightClick)return false;
};

document.onmousedown = function(e){
	if(! e)e = event;
	var o = jpf.findHost(jpf.hasEventSrcElement ? e.srcElement:e.target);
	
	if(jpf.window && jpf.window.__f.contains(o)&& ! o.disabled && o.focussable)jpf.window.__focus(o);
	else 
	if(jpf.window && jpf.window.__fObject){
		jpf.window.__fObject.blur(true);
		jpf.window.__fObject = null;
	};
	
	if(e.button == 2 && jpf.window.getFocussedObject())jpf.window.getFocussedObject().dispatchEvent("oncontextmenu",{htmlEvent:e}

);
	
	if(self.jpf.JMLParser && ! self.jpf.appsettings.allowSelect || jpf.DragMode.mode)return false};

document.onselectstart = function(){
	if(self.jpf.JMLParser && ! self.jpf.appsettings.allowSelect || jpf.DragMode.mode)return false};

document.onkeyup = function(e){
	if(! e)e = event;
	
	if(jpf.window && jpf.window.__fObject && ! jpf.window.__fObject.disableKeyboard && jpf.window.__fObject.keyUpHandler && jpf.window.__fObject.keyUpHandler(e.keyCode,e.ctrlKey,e.shiftKey,e.altkey,e)== false){
		return false;
	}

};

document.onkeydown = function(e){
	if(! e)e = event;
	
	if(jpf.currentMenu && e.keyCode == "27")jpf.currentMenu.hideMenu(true);
	
	if(e.keyCode == 93 && jpf.window.getFocussedObject()){
		var pos,o = jpf.window.getFocussedObject();
		
		if(o.value)pos = jpf.compat.getAbsolutePosition(o.selected);
		else pos = jpf.compat.getAbsolutePosition(o.oExt);
		o.dispatchEvent("oncontextmenu",{htmlEvent:{
				clientX:pos[0]+ 10 - document.documentElement.scrollLeft,clientY:pos[1]+ 10 - document.documentElement.scrollTop}
		}
	);
	};
	
	if(jpf.onhotkey && jpf.onhotkey(e.keyCode,e.ctrlKey,e.shiftKey,e.altKey,e)=== false){
		e.returnValue = false;
		e.cancelBubble = true;
		
		if(jpf.canDisableKeyCodes)
		try{
			e.keyCode = 0;
		}
		catch(e){
		};
		return false;
	};
	
	if(jpf.ondebugkey && jpf.ondebugkey(e.keyCode,e.ctrlKey,e.shiftKey,e.altKey,e)=== false){
		e.returnValue = false;
		e.cancelBubble = true;
		
		if(jpf.canDisableKeyCodes)
		try{
			e.keyCode = 0;
		}
		catch(e){
		};
		return false;
	};
	
	if(! jpf.window)return;
	
	if(jpf.window.dragging && e.keyCode == 27){
		if(document.body.lastHost && document.body.lastHost.dragOut)document.body.lastHost.dragOut(jpf.dragHost);
		return jpf.DragServer.stopdrag();
	};
	
	if(jpf.window && jpf.window.__fObject && ! jpf.window.__fObject.disableKeyboard && jpf.window.__fObject.keyHandler && jpf.window.__fObject.keyHandler(e.keyCode,e.ctrlKey,e.shiftKey,e.altkey,e)=== false){
		e.returnValue = false;
		e.cancelBubble = true;
		
		if(jpf.canDisableKeyCodes)
		try{
			e.keyCode = 0;
		}
		catch(e){
		};
		return false;
	}
	else 
	if(e.keyCode == 9 && jpf.window.__f.length > 1){
		if(! jpf.currentMenu)jpf.window.moveNext(e.shiftKey);
		e.returnValue = false;
		return false;
	};
	
	if(jpf.appsettings.disableBackspace && e.keyCode == 8){
		e.keyCode = 0;
	};
	
	if(jpf.appsettings.disableF5 && e.keyCode == 116){
		e.keyCode = 0;
	};
	
	if(e.keyCode == 27){
		e.returnValue = false;
	}

}

/*FILEHEAD(/in/Library/Core/JMLParser.js)SIZE(26846)TIME(1213623722630)*/
jpf.JMLParser ={
	sbInit:{
	}

,stateStack:[],modelInit:[],parse:function(x){
		this.jml = x;
		
		for(var docs =[x],i = 0;i < jpf.IncludeStack.length;i ++)
		if(jpf.IncludeStack[i].nodeType)docs.push(jpf.IncludeStack[i]);
		this.parseFirstPass(docs);
		jpf.window = new jpf.WindowImplementation();
		jpf.document = new jpf.DocumentImplementation();
		jpf.window.document = jpf.document;
		jpf.window.__ActionTracker = new jpf.ActionTracker();
		jpf.JMLParser.parseChildren(x,document.body,jpf.document);
		var loc = location.href.split("?")[0].split("#")[1];
		
		if(loc && jpf.StateServer.locs[loc])jpf.StateServer.locs[loc].activate();
		
		if(jpf.appsettings.layout){
			jpf.setModel(jpf.appsettings.layout,{load:function(xmlNode){
					if(! xmlNode || this.isLoaded)return;
					
					if(! xmlNode)throw new Error(0,jpf.formErrorString(0,null,"Loading default layout","Could not find default layout using processing instruction: '" + jpf.appsettings.layout + "'"));
					jpf.layoutServer.loadXml(xmlNode);
					this.isLoaded = true;
				}
				,setModel:function(model,xpath){
					if(typeof model == "string")model = jpf.NameServer.get("model",model);
					model.register(this,xpath);
				}
			}
		);
		};
		jpf.layoutServer.activateGrid();
		jpf.layoutServer.activateRules();
		setTimeout('jpf.JMLParser.parseLastPass();',1);
		this.inited = true;
	}
	,parseFirstPass:function(xmlDocs){
		for(var i = 0;i < xmlDocs.length;i ++)this.preLoadRef(xmlDocs[i],["teleport","presentation","settings","skin","bindings[@id]","actions[@id]","dragdrop[@id]"]);
		
		for(var i = 0;i < xmlDocs.length;i ++)this.preLoadRef(xmlDocs[i],["style","model[@id]","smartbinding[@id]"]);
	}
	,preLoadRef:function(xmlNode,sel){
		var prefix = jpf.findPrefix(xmlNode,jpf.ns.jpf);
		
		if(prefix)prefix += ":";
		var nodes = jpf.XMLDatabase.selectNodes("//" + prefix + sel.join("|//" + prefix),xmlNode);
		
		for(var i = 0;i < nodes.length;i ++){
			if(jpf.XMLDatabase.getInheritedAttribute(nodes[i],"render")== "runtime")continue;
			
			if(this.handler[nodes[i][jpf.TAGNAME]]){
				jpf.status("Processing [preload] '" + nodes[i][jpf.TAGNAME]+ "' node");
				this.handler[nodes[i][jpf.TAGNAME]](nodes[i]);
			};
			
			if(nodes[i][jpf.TAGNAME]!= "presentation" && nodes[i].parentNode)nodes[i].parentNode.removeChild(nodes[i]);
		}
	}
	,reWhitespaces:/[\t\n\r]+/g,
	parseChildren : function(x, pHtmlNode, jmlParent, checkRender, noImpliedParent){
		
		// 
	if(! pHtmlNode)pHtmlNode = document.body;
	
	if(checkRender && jmlParent.hasFeature(__DELAYEDRENDER__)&& jmlParent.__checkDelay(x)){
		return pHtmlNode;
	};
	
	if(jmlParent)jmlParent.isRendered = true;
	
	if(x.namespaceURI == jpf.ns.jpf)this.lastNsPrefix = x.prefix || x.scopeName;
	
	for(var oCount = 0,i = 0;i < x.childNodes.length;i ++){
		var q = x.childNodes[i];
		
		if(q.nodeType == 8)continue;
		
		if(q.nodeType != 1){
			if(! pHtmlNode)continue;
			
			if(q.nodeType == 3 || pHtmlNode.style && q.nodeType == 4){
				pHtmlNode.appendChild(pHtmlNode.ownerDocument.createTextNode(! jpf.hasTextNodeWhiteSpaceBug ? q.nodeValue:q.nodeValue.replace(this.reWhitespaces," ")));
			}
			else 
			if(q.nodeType == 4)pHtmlNode.appendChild(pHtmlNode.ownerDocument.createCDataSection(q.nodeValue));
			continue;
		};
		
		if(! this.nsHandler[q.namespaceURI || jpf.ns.xhtml])continue;
		this.nsHandler[q.namespaceURI || jpf.ns.xhtml].call(this,q,pHtmlNode,jmlParent,noImpliedParent);
	};
	
	if(pHtmlNode){
		var gridCols = x.getAttribute("grid");
		
		if(gridCols)jpf.layoutServer.addGrid("var o = jpf.lookup(" + jmlParent.uniqueId + ");if(o.oExt.offsetHeight) jpf.compat.gridPlace(o)",pHtmlNode);
		
		if(jmlParent.vbox)jmlParent.vbox.compileAlignment();
	};
	return pHtmlNode;
}

,addNamespaceHandler:function(xmlns,func){
	this.nsHandler[xmlns]= func;
}

,nsHandler:{
	"http://www.javeline.com/2005/PlatForm":function(x,pHtmlNode,jmlParent,noImpliedParent){
		var tagName = x[jpf.TAGNAME];
		
		if(tagName == "include"){
			var xmlNode = jpf.IncludeStack[x.getAttribute("iid")];
			this.parseChildren(xmlNode,pHtmlNode,jmlParent,null,true);
		}
		else 
		if(this.handler[tagName]){
			this.handler[tagName](x,noImpliedParent ? null:jmlParent);
		}
		else 
		if(pHtmlNode){
			if(! jpf[tagName])throw new Error(0,"Could not find class " + tagName);
			var objName = tagName;
			var o = new jpf[objName](pHtmlNode,tagName,x);
			
			if(x.getAttribute("id"))jpf.setReference(x.getAttribute("id"),o);
			
			if(o.loadJML)o.loadJML(x,jmlParent);
		};
		return o;
	}
	,"http://www.w3.org/1999/xhtml":function(x,pHtmlNode,jmlParent,noImpliedParent){
		var parseWhole = x.tagName.match(/table|object|embed/i)? true:false;
		
		if(x.tagName == "option"){
			var o = pHtmlNode.appendChild(pHtmlNode.ownerDocument.createElement("option"));
			
			if(x.getAttribute("value"))o.setAttribute("value",x.getAttribute("value"));
		}
		else 
		if(jpf.isIE){
			var o = x.ownerDocument == pHtmlNode.ownerDocument ? pHtmlNode.appendChild(x.cloneNode(false)):jpf.XMLDatabase.htmlImport(x.cloneNode(parseWhole),pHtmlNode);
		}
		else 
		if(jpf.isSafari){
			var o = x.ownerDocument == pHtmlNode.ownerDocument ? pHtmlNode.appendChild(x):jpf.XMLDatabase.htmlImport(x.cloneNode(parseWhole),pHtmlNode);
		}
		else{
			var o = x.ownerDocument == pHtmlNode.ownerDocument ? pHtmlNode.appendChild(x.cloneNode(false)):jpf.XMLDatabase.htmlImport(x.cloneNode(false),pHtmlNode);
		};
		var tagName,prefix = this.lastNsPrefix || jpf.findPrefix(x.parentNode,jpf.ns.jpf)|| "";
		
		if(prefix){
			if(! jpf.supportNamespaces)x.ownerDocument.setProperty("SelectionNamespaces","xmlns:" + prefix + "='" + jpf.ns.jpf + "'");
			prefix += ":";
		};
		var done ={
		}
	,aNodes = x.selectNodes("@" + prefix + "*");
		
		for(var i = 0;i < aNodes.length;i ++){
			tagName = aNodes[i][jpf.TAGNAME];
			
			if(tagName.match(/^(left|top|right|bottom|width|height|align)$/)){
				if(done["position"])continue;
				done["position"]= true;
				var html = new jpf.HtmlWrapper(pHtmlNode,o,prefix);
				
				if(x.getAttribute(prefix + "align")|| x.getAttribute(prefix + "align-position")){
					html.enableAlignment()}
				else 
				if(x.getAttribute(prefix + "width")|| x.getAttribute(prefix + "height")|| x.getAttribute(prefix + "left")|| x.getAttribute(prefix + "top")|| x.getAttribute(prefix + "right")|| x.getAttribute(prefix + "bottom")|| x.getAttribute(prefix + "anchoring")== "true"){
					html.getDiff();
					html.setHorizontal(x.getAttribute(prefix + "left"),x.getAttribute(prefix + "right"),x.getAttribute(prefix + "width"));
					html.setVertical(x.getAttribute(prefix + "top"),x.getAttribute(prefix + "bottom"),x.getAttribute(prefix + "height"));
				}
			}
			else 
			if(tagName.match(/^repeat-/)){
				if(done["repeat"])continue;
				done["repeat"]= true;
			}
		};
		
		if(jpf.canUseInnerHtmlWithTables || ! parseWhole)this.parseChildren(x,o,jmlParent);
		else{
		};
		return o;
	}

}

,handler:{
	"script":function(q){
		if(q.getAttribute("src")){
			if(jpf.isOpera)setTimeout(function(){jpf.window.loadCodeFile(jpf.hostPath + q.getAttribute("src"));
			}
			,1000);
			else jpf.window.loadCodeFile(jpf.hostPath + q.getAttribute("src"));
		}
		else 
		if(q.firstChild){
			var scode = q.firstChild.nodeValue;
			
			if(jpf.hasExecScript)window.execScript(scode);
			else eval(scode);
		}
	}
	,"style":function(q){
		jpf.importCssString(document,q.firstChild.nodeValue);
	}
	,"comment":function(q){
	}

,"presentation":function(q){
		var name = "skin" + Math.round(Math.random()* 100000);
		q.parentNode.setAttribute("skin",name);
		jpf.PresentationServer.skins[name]={
			name:name,templates:{
			}
	};
		var t = q.parentNode[jpf.TAGNAME];
		var skin = q.ownerDocument.createElement("skin");
		skin.appendChild(q);
		jpf.PresentationServer.skins[name].templates[t]= skin;
	}
	,"skin":function(q,jmlParent){
		if(jmlParent){
			var name = "skin" + Math.round(Math.random()* 100000);
			q.parentNode.setAttribute("skin",name);
			jpf.PresentationServer.skins[name]={
				name:name,templates:{
				}
		};
			jpf.PresentationServer.skins[name].templates[q.parentNode[jpf.TAGNAME]]= q;
		}
		else 
		if(q.childNodes.length){
			jpf.PresentationServer.Init(q);
		}
		else{
			var path = q.getAttribute("src")? jpf.getAbsolutePath(jpf.hostPath,q.getAttribute("src")):jpf.getAbsolutePath(jpf.hostPath,q.getAttribute("name"))+ "/index.xml";
			jpf.loadJMLInclude(q,new jpf.http(),true,path);
		}
	}
	,"model":function(q,jmlParent){
		if(jmlParent && ! jmlParent.hasFeature(__DATABINDING__))jmlParent = null;
		var modelId,m = new jpf.Model().register(jmlParent).loadJML(q);
		
		if(jmlParent){
			modelId = "model" + this.uniqueId;
			jmlParent.jml.setAttribute("model",modelId);
		}
		else modelId = q.getAttribute("id");
		return modelId ? jpf.setReference(modelId,jpf.NameServer.register("model",modelId,m)):m;
	}
	,"smartbinding":function(q,jmlParent){
		var bc = new jpf.SmartBinding(q.getAttribute("id"),q);
		
		if(q.getAttribute("id"))jpf.NameServer.register("smartbinding",q.getAttribute("id"),bc);
		
		if(jmlParent && jmlParent.hasFeature(__DATABINDING__))jpf.JMLParser.addToSbStack(jmlParent.uniqueId,bc);
	}
	,"ref":function(q,jmlParent){
		var bc = jpf.JMLParser.getFromSbStack(jmlParent.uniqueId)|| jpf.JMLParser.addToSbStack(jmlParent.uniqueId,new jpf.SmartBinding());
		bc.addBindRule(q,jmlParent);
	}
	,"bindings":function(q,jmlParent){
		var rules = jpf.getRules(q);
		
		if(q.getAttribute("id"))jpf.NameServer.register("bindings",q.getAttribute("id"),rules);
		
		if(jmlParent && jmlParent.hasFeature(__DATABINDING__)){
			var bc = jpf.JMLParser.getFromSbStack(jmlParent.uniqueId)|| jpf.JMLParser.addToSbStack(jmlParent.uniqueId,new jpf.SmartBinding());
			bc.addBindings(rules,q);
		}
	}
	,"action":function(q,jmlParent){
		var bc = jpf.JMLParser.getFromSbStack(jmlParent.uniqueId)|| jpf.JMLParser.addToSbStack(jmlParent.uniqueId,new jpf.SmartBinding());
		bc.addActionRule(q,jmlParent);
	}
	,"actions":function(q,jmlParent){
		var rules = jpf.getRules(q);
		
		if(q.getAttribute("id"))jpf.NameServer.register("actions",q.getAttribute("id"),rules);
		
		if(jmlParent && jmlParent.hasFeature(__DATABINDING__)){
			var bc = jpf.JMLParser.getFromSbStack(jmlParent.uniqueId)|| jpf.JMLParser.addToSbStack(jmlParent.uniqueId,new jpf.SmartBinding());
			bc.addActions(rules,q);
		}
	}
	,"actiontracker":function(q,jmlParent){
		var at;
		
		if(q.getAttribute("id"))at = jpf.setReference(q.getAttribute("id"),jpf.NameServer.register("actiontracker",q.getAttribute("id"),new jpf.ActionTracker()));
		
		if(jmlParent)jmlParent.__ActionTracker = at || new jpf.ActionTracker(jmlParent);
		
		if(! q.getAttribute("id")&& ! jmlParent){
		}

}
	,"contextmenu":function(q,jmlParent){
		if(! jmlParent)return;
		
		if(! jmlParent.contextmenus)jmlParent.contextmenus =[];
		jmlParent.contextmenus.push(q);
	}
	,"teleport":function(q){
		jpf.Teleport.loadJML(q);
	}
	,"remotesmartbindings":function(q){
		jpf.XMLDatabase.loadRDB(q);
	}
	,"appsettings":function(q,jmlParent){
		this.foundSettings = true;
		this.lastSettings = q;
		jpf.appsettings.loadJML(q);
	}
	,"window":function(q){
		jpf.windowManager.addForm(q);
	}
	,"loader":function(q){
	}
}

,getSmartBinding:function(id){
	return jpf.NameServer.get("smartbinding",id)}

,getActionTracker:function(id){
	var at = jpf.NameServer.get("actiontracker",id);
	
	if(at)return at;
	
	if(self[id])return self[id].getActionTracker();
}

,replaceNode:function(newNode,oldNode){
	var nodes = oldNode.childNodes;
	
	for(var i = nodes.length - 1;i >= 0;i --)newNode.insertBefore(nodes[i],newNode.firstChild);
	newNode.onresize = oldNode.onresize;
	return newNode;
}

,parseLastPass:function(){
	while(this.hasNewSbStackItems){
		var sbInit = this.sbInit;
		this.sbInit ={
		};
		this.hasNewSbStackItems = false;
		
		for(var uniqueId in sbInit){
			if(parseInt(uniqueId)!= uniqueId)continue;
			var jNode = jpf.lookup(uniqueId);
			
			if(sbInit[uniqueId][0])jNode.setSmartBinding(sbInit[uniqueId][0]);
			
			if(sbInit[uniqueId][1])jNode.setSelectionSmartBinding(sbInit[uniqueId][1]);
		}
	};
	
	for(var i = 0;i < this.stateStack.length;i ++){
		if(this.stateStack[i][1]== "visible" &&(jpf.isFalse(this.stateStack[i][2])|| jpf.isTrue(this.stateStack[i][2])))continue;
		this.stateStack[i][0].setDynamicProperty(this.stateStack[i][1],this.stateStack[i][2]);
	}
	
	while(this.hasNewModelStackItems){
		var jmlNode,modelInit = this.modelInit;
		this.modelInit ={
		};
		this.hasNewModelStackItems = false;
		
		for(var data,i = 0;i < modelInit.length;i ++){
			data = modelInit[i][1];
			data[0]= data[0].substr(1);
			jmlNode = eval(data[0]);
			
			if(jmlNode.connect)jmlNode.connect(modelInit[i][0],null,data[2],data[1]|| "select");
			else jmlNode.setModel(new jpf.Model().loadFrom(data.join(":")));
		}
	};
	
	if(jpf.onload){
		jpf.onload();
		jpf.onload = null;
	};
	
	if(! this.loaded){
		jpf.window.moveNext();
		this.loaded = true;
	};
	this.sbInit ={
	};
	this.modelInit =[];
	this.stateStack =[];
}

,addToSbStack:function(uniqueId,sNode,nr){
	this.hasNewSbStackItems = true;
	
	if(! this.sbInit[uniqueId])this.sbInit[uniqueId]=[];
	this.sbInit[uniqueId][nr || 0]= sNode;
	return sNode;
}

,getFromSbStack:function(uniqueId,nr){
	return this.sbInit[uniqueId]? this.sbInit[uniqueId][nr || 0]:null;
}

,stackHasBindings:function(uniqueId){
	return this.sbInit[uniqueId]&& this.sbInit[uniqueId][0]&& this.sbInit[uniqueId][0].bindings;
}

,modelInit:[],addToModelStack:function(o,data){
	this.hasNewModelStackItems = true;
	this.modelInit.push([o,data]);
}

}

jpf.Init.run('jpf.JMLParser');

/*FILEHEAD(/in/Library/Core/Highlighter/shCore.uncompressed.js)SIZE(19068)TIME(1182781511531)*/

/*FILEHEAD(/in/Library/Core/Highlighter/shBrushJScript.js)SIZE(1316)TIME(1166374443937)*/

/*FILEHEAD(/in/Library/Core/Highlighter/SyntaxHighlighter.css.js)SIZE(4449)TIME(1166374446421)*/

/*FILEHEAD(/in/Library/Core/Kernel/Animation.js)SIZE(3311)TIME(1203725318274)*/
jpf.Animate ={
	sequences:[],register:function(o){
		return this.sequences.push(o)- 1;
	}
	,destroy:function(id){
		this.sequences[id]= null;
	}
	,findSeq:function(id){
		return this.sequences[id];
	}
	,left:function(oHTML,value){
		oHTML.style.left = value + "px";
	}
	,right:function(oHTML,value){
		oHTML.style.right = value + "px";
	}
	,top:function(oHTML,value){
		oHTML.style.top = value + "px";
	}
	,width:function(oHTML,value,center){
		oHTML.style.width = value + "px";
	}
	,height:function(oHTML,value,center){
		oHTML.style.height = value + "px";
	}
	,scrollTop:function(oHTML,value,center){
		oHTML.scrollTop = value;
	}
	,"height-rsz":function(oHTML,value,center){
		oHTML.style.height = value + "px";
		
		if(jpf.hasSingleResizeEvent)window.onresize();
	}
	,mleft:function(oHTML,value){
		oHTML.style.marginLeft = value + "px";
	}
	,scrollwidth:function(oHTML,value){
		oHTML.style.width = value + "px";
		oHTML.scrollLeft = oHTML.scrollWidth;
	}
	,scrollheight_old:function(oHTML,value){
		try{
			oHTML.style.height = value + "px";
			oHTML.scrollTop = oHTML.scrollHeight;
		}
		catch(e){
			alert(value)}
	}
	,scrollheight:function(oHTML,value){
		oHTML.style.height = value + "px";
		oHTML.scrollTop = oHTML.scrollHeight - oHTML.offsetHeight;
	}
	,scrolltop:function(oHTML,value){
		oHTML.style.height = value + "px";
		oHTML.style.top =(- 1 * value - 2)+ "px";
		oHTML.scrollTop = 0;
	}
	,clipright:function(oHTML,value,center){
		oHTML.style.clip = "rect(auto, auto, auto, " + value + "px)";
		oHTML.style.marginLeft =(- 1 * value)+ "px";
	}
	,fade:function(oHTML,value){
		if(jpf.hasStyleFilters)oHTML.style.filter = "alpha(opacity=" + parseInt(value * 100)+ ")";
		else oHTML.style.opacity = value;
	}

};

jpf.GuiAnimation = function(oHTML,type,fromValue,toValue,animtype,frames,interval,onfinish,userdata){
	this.uniqueId = jpf.Animate.register(this);
	this.method = jpf.Animate[type];
	this.oHTML = oHTML;
	this.onfinish = onfinish;
	this.userdata = userdata;
	this.interval = interval;
	this.frames = frames;
	this.steps =[fromValue];
	this.step = 0;
	var steps = parseInt(frames);
	var scalex =(toValue - fromValue)/((Math.pow(steps,2)+ 2 * steps + 1)/(4 * steps));
	
	for(var i = 0;i < frames;i ++){
		if(animtype == 0 && ! value)var value =(toValue - fromValue)/ frames;
		else 
		if(animtype == 1)var value = scalex * Math.pow(((steps - i))/ steps,3);
		else 
		if(animtype == 2)var value = scalex * Math.pow(i / frames,3);
		this.steps.push(Math.max(0,this.steps[this.steps.length - 1]+ value -(i == 0 ? 1:0)));
	};
	this.steps[this.steps.length - 1]= Math.max(1,toValue - 1);
	this.stop = function(){
		clearTimeout(this.timer);
		jpf.Animate.destroy(this.uniqueId);
	};
	jpf.AnimateStep(0,this.uniqueId);
};

jpf.AnimateStep = function(step,uniqueId){
	var o = jpf.Animate.findSeq(uniqueId);
	
	if(! o)return;
	
	try{
		o.method(o.oHTML,o.steps[step]);
	}
	catch(e){
	};
	
	if(step < o.frames)o.timer = setTimeout('jpf.AnimateStep(' +(step + 1)+ ', ' + uniqueId + ')',o.interval);
	else 
	if(o.onfinish)o.onfinish(o.oHTML,o.userdata);
}

/*FILEHEAD(/in/Library/Core/Kernel/browsers/isGecko.js)SIZE(4856)TIME(1205332261250)*/
function runGecko(){
	jpf.importClass(runNonIe,true,self);
	DocumentFragment.prototype.getElementById = function(id){
		return this.childNodes.length ? this.childNodes[0].ownerDocument.getElementById(id):null;
	};
	XMLDocument.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this);
	}

);
	XMLDocument.prototype.__defineSetter__("xml",function(){throw new Error(1042,jpf.formErrorString(1042,null,"XML serializer","Invalid assignment on read-only property 'xml'."));
	}

);
	Node.prototype.__defineGetter__("xml",function(){if(this.nodeType == 3 || this.nodeType == 4 || this.nodeType == 2)return this.nodeValue;
		return(new XMLSerializer()).serializeToString(this);
	}

);
	Element.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this);
	}

);
	HTMLDocument.prototype.selectNodes = XMLDocument.prototype.selectNodes = function(sExpr,contextNode){
		var oResult = this.evaluate(sExpr,(contextNode ? contextNode:this),this.createNSResolver(this.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
		var nodeList = new Array(oResult.snapshotLength);
		nodeList.expr = sExpr;
		
		for(var i = 0;i < nodeList.length;i ++)nodeList[i]= oResult.snapshotItem(i);
		return nodeList;
	};
	Element.prototype.selectNodes = function(sExpr){
		var doc = this.ownerDocument;
		
		if(doc.selectNodes)return doc.selectNodes(sExpr,this);
		else throw new Error(1047,jpf.formErrorString(1047,null,"xPath selection","Method selectNodes is only supported by XML Nodes"));
	};
	HTMLDocument.prototype.selectSingleNode = XMLDocument.prototype.selectSingleNode = function(sExpr,contextNode){
		var nodeList = this.selectNodes(sExpr + "[1]",contextNode ? contextNode:null);
		return nodeList.length > 0 ? nodeList[0]:null;
	};
	Element.prototype.selectSingleNode = function(sExpr){
		var doc = this.ownerDocument;
		
		if(doc.selectSingleNode)return doc.selectSingleNode(sExpr,this);
		else throw new Error(1048,jpf.formErrorString(1048,null,"XPath Selection","Method selectSingleNode is only supported by XML Nodes. \nInfo : " + e));
	};
	function Error(nr,msg){
		this.message = msg;
		this.nr = nr;
	};
	
	if(jpf.XMLDatabaseImplementation){
		jpf.XMLDatabaseImplementation.prototype.htmlImport = function(xmlNode,htmlNode,beforeNode,test){
			if(! htmlNode)alert(this.htmlImport.caller);
			
			if(xmlNode.length != null && ! xmlNode.nodeType){
				for(var str = '',i = 0;i < xmlNode.length;i ++)str += xmlNode[i].xml;
				var str = str.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/<([^>]+)\/>/g,"<$1></$1>");
				(beforeNode || htmlNode).insertAdjacentHTML(beforeNode ? "beforebegin":"beforeend",str);
				return;
			};
			
			if(htmlNode.ownerDocument != document)return htmlNode.insertBefore(xmlNode,beforeNode);
			var strHTML =(xmlNode.outerHTML ||(xmlNode.nodeType == 1 ? xmlNode.xml:xmlNode.nodeValue)).replace(/&lt;/g,"<").replace(/&gt;/g,">");
			var pNode =(beforeNode || htmlNode);
			
			if(pNode.nodeType == 11){
				var id = xmlNode.getAttribute("id");
				
				if(! id)throw new Error(1049,jpf.formErrorString(1049,null,"XMLDatabase","Inserting Cache Item in Document Fragment without an ID"));
				document.body.insertAdjacentHTML(beforeNode ? "beforebegin":"beforeend",strHTML);
				pNode.appendChild(document.getElementById(id));
			}
			else{
				if(xmlNode.tagName.match(/tbody|td|tr/))pNode.insertBefore(pNode.ownerDocument.createElement(xmlNode.tagName.toLowerCase()),beforeNode || null);
				else pNode.insertAdjacentHTML(beforeNode ? "beforebegin":"beforeend",strHTML);
			};
			return beforeNode ? beforeNode.previousSibling:htmlNode.lastChild;
		}
	}

}

/*FILEHEAD(/in/Library/Core/Kernel/browsers/isIE.js)SIZE(8551)TIME(1203729187790)*/
function runIE(){
	var hasIE7Security = hasIESecurity = false;
	
	if(self.XLMHttpRequest)
	try{
		new XLMHttpRequest()}
	catch(e){
		hasIE7Security = true};
	
	try{
		new ActiveXObject("microsoft.XMLHTTP")}
	catch(e){
		hasIESecurity = true};
	
	if(hasIESecurity)jpf.importClass(function(){__CONTENT_IFRAME}
	,true,self);
	jpf.getObject = hasIESecurity ? function(type,message,no_error,isDataIsland){
		if(type == "HTTP"){
			if(jpf.availHTTP.length)return jpf.availHTTP.pop();
			return new XMLHttpRequest();
		}
		else 
		if(type == "XMLDOM"){
			var xmlParser = getDOMParser(message,no_error);
			return xmlParser;
		}
	}
	:function(type,message,no_error,isDataIsland){
		if(type == "HTTP"){
			if(jpf.availHTTP.length)return jpf.availHTTP.pop();
			return new ActiveXObject("microsoft.XMLHTTP");
		}
		else 
		if(type == "XMLDOM"){
			var xmlParser = new ActiveXObject("microsoft.XMLDOM");
			xmlParser.setProperty("SelectionLanguage","XPath");
			
			if(message){
				if(jpf.cantParseXmlDefinition)message = message.replace(/\] \]/g,"] ]").replace(/^<\?[^>]*\?>/,"");
				xmlParser.loadXML(message);
			};
			
			if(! no_error)this.xmlParseError(xmlParser);
			return xmlParser;
		}
	};
	jpf.xmlParseError = function(xml){
		var xmlParseError = xml.parseError;
		
		if(xmlParseError != 0){
			throw new Error(1050,jpf.formErrorString(1050,null,"XML Parse error on line " + xmlParseError.line,xmlParseError.reason + "Source Text:\n" + xmlParseError.srcText.replace(/\t/gi," ")));
		};
		return xml;
	};
	
	if(jpf.XMLDatabaseImplementation){
		jpf.XMLDatabaseImplementation.prototype.htmlImport = function(xmlNode,htmlNode,beforeNode){
			if(xmlNode.length != null && ! xmlNode.nodeType){
				for(var str = '',i = 0;i < xmlNode.length;i ++)str += xmlNode[i].xml;
				var str = jpf.html_entity_decode(str).replace(/style="background-image:([^"]*)"/g,"find='$1' style='background-image:$1'");
				
				try{
					(beforeNode || htmlNode).insertAdjacentHTML(beforeNode ? "beforebegin":"beforeend",str);
				}
				catch(e){
					document.body.insertAdjacentHTML("beforeend","<table><tr>" + str + "</tr></table>");
					var x = document.body.lastChild.firstChild.firstChild;
					
					for(var i = x.childNodes.length - 1;i >= 0;i --)htmlNode.appendChild(x.childNodes[jpf.hasDynamicItemList ? 0:i]);
				};
				
				if(! this.nodes)this.nodes =[];
				var id = this.nodes.push(htmlNode.getElementsByTagName("*"))- 1;
				setTimeout('jpf.XMLDatabase.doNodes(' + id + ')');
				return;
			};
			
			if(htmlNode.ownerDocument && htmlNode.ownerDocument != document && xmlNode.ownerDocument == htmlNode.ownerDocument)return htmlNode.insertBefore(xmlNode,beforeNode);
			var strHTML = jpf.html_entity_decode(xmlNode.outerHTML || xmlNode.xml || xmlNode.nodeValue);
			var pNode =(beforeNode || htmlNode);
			
			if(pNode.nodeType == 11){
				var id = xmlNode.getAttribute("id");
				
				if(! id)throw new Error(1049,jpf.formErrorString(1049,null,"XMLDatabase","Inserting Cache Item in Document Fragment without an ID"));
				document.body.insertAdjacentHTML(beforeNode ? "beforebegin":"beforeend",strHTML);
				pNode.appendChild(document.getElementById(id));
			}
			else pNode.insertAdjacentHTML(beforeNode ? "beforebegin":"beforeend",strHTML);
			return beforeNode ? beforeNode.previousSibling:htmlNode.lastChild;
		};
		jpf.XMLDatabaseImplementation.prototype.doNodes = function(id){
			var nodes = this.nodes[id];
			
			for(var i = 0;i < nodes.length;i ++){
				if(nodes[i].getAttribute("find"))nodes[i].style.backgroundImage = nodes[i].getAttribute("find");
			};
			this.nodes[id]= null;
		};
		jpf.XMLDatabase = new jpf.XMLDatabaseImplementation();
	};
	
	if(! hasIESecurity)jpf.Init.run('XMLDatabase');
	jpf.importClass(runXpath,true,self);
}

/*FILEHEAD(/in/Library/Core/Kernel/browsers/isOpera.js)SIZE(5247)TIME(1203724026978)*/
function runOpera(){
	setTimeoutOpera = setTimeout;
	lookupOperaCall =[];
	setTimeout = function(call,time){
		if(typeof call == "string")return setTimeoutOpera(call,time);
		return setTimeoutOpera("lookupOperaCall[" +(lookupOperaCall.push(call)- 1)+ "]()",time);
	};
	var x = new DOMParser();
	XMLDocument = DOMParser.constructor;
	x = null;
	Node.prototype.serialize = XMLDocument.prototype.serialize = Element.prototype.serialize = function(){
		return(new XMLSerializer()).serializeToString(this);
	};
	Document.prototype.selectNodes = XMLDocument.prototype.selectNodes = HTMLDocument.prototype.selectNodes = function(sExpr,contextNode){
		var oResult = this.evaluate(sExpr,(contextNode ? contextNode:this),this.createNSResolver(this.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
		var nodeList = new Array(oResult.snapshotLength);
		nodeList.expr = sExpr;
		
		for(var i = 0;i < nodeList.length;i ++)nodeList[i]= oResult.snapshotItem(i);
		return nodeList;
	};
	Element.prototype.selectNodes = function(sExpr){
		var doc = this.ownerDocument;
		
		if(! doc.selectSingleNode){
			doc.selectSingleNode = HTMLDocument.prototype.selectSingleNode;
			doc.selectNodes = HTMLDocument.prototype.selectNodes;
		};
		
		if(doc.selectNodes)return doc.selectNodes(sExpr,this);
		else throw new Error(1047,jpf.formErrorString(1047,null,"XPath Selection","Method selectNodes is only supported by XML Nodes"));
	};
	Document.prototype.selectSingleNode = XMLDocument.prototype.selectSingleNode = HTMLDocument.prototype.selectSingleNode = function(sExpr,contextNode){
		var nodeList = this.selectNodes(sExpr + "[1]",contextNode ? contextNode:null);
		return nodeList.length > 0 ? nodeList[0]:null;
	};
	Element.prototype.selectSingleNode = function(sExpr){
		var doc = this.ownerDocument;
		
		if(! doc.selectSingleNode){
			doc.selectSingleNode = HTMLDocument.prototype.selectSingleNode;
			doc.selectNodes = HTMLDocument.prototype.selectNodes;
		};
		
		if(doc.selectSingleNode)return doc.selectSingleNode(sExpr,this);
		else throw new Error(1048,jpf.formErrorString(1048,null,"XPath Selection","Method selectSingleNode is only supported by XML Nodes. \nInfo : " + e));
	};
	jpf.compat.getWidthDiff = function(oHtml){
		return Math.max(0,(parseInt(jpf.compat.getStyle(oHtml,"padding-left"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"padding-right"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"border-left-width"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"border-right-width"))|| 0));
	};
	jpf.compat.getHeightDiff = function(oHtml){
		return Math.max(0,(parseInt(jpf.compat.getStyle(oHtml,"padding-top"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"padding-bottom"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"border-top-width"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"border-bottom-width"))|| 0));
	};
	jpf.compat.getDiff = function(oHtml){
		var pNode = oHtml.parentNode;
		var nSibling = oHtml.nextSibling;
		
		if(! oHtml.offsetHeight)document.body.appendChild(oHtml);
		var diff =[Math.max(0,parseInt(jpf.compat.getStyle(oHtml,"padding-left"))+ parseInt(oHtml.currentStyle.paddingRight)+ parseInt(jpf.compat.getStyle(oHtml,"border-left-width"))+ parseInt(jpf.compat.getStyle(oHtml,"border-right-width"))|| 0),Math.max(0,parseInt(jpf.compat.getStyle(oHtml,"padding-top"))+ parseInt(oHtml.currentStyle.paddingBottom)+ parseInt(jpf.compat.getStyle(oHtml,"border-top-width"))+ parseInt(jpf.compat.getStyle(oHtml,"border-bottom-width"))|| 0)];
		
		if(oHtml.tagName.match(/frame/i))alert(diff);
		pNode.insertBefore(oHtml,nSibling);
		return diff;
	};
	jpf.importClass(runNonIe,true,self);
}

/*FILEHEAD(/in/Library/Core/Kernel/browsers/isSafari.js)SIZE(3632)TIME(1203724026993)*/
function runSafari(){
	setTimeoutSafari = setTimeout;
	lookupSafariCall =[];
	setTimeout = function(call,time){
		if(typeof call == "string")return setTimeoutSafari(call,time);
		return setTimeoutSafari("lookupSafariCall[" +(lookupSafariCall.push(call)- 1)+ "]()",time);
	};
	
	if(jpf.isSafariOld){
		HTMLHtmlElement = document.createElement("html").constructor;
		Node = HTMLElement ={
		};
		HTMLElement.prototype = HTMLHtmlElement.__proto__.__proto__;
		HTMLDocument = Document = document.constructor;
		var x = new DOMParser();
		XMLDocument = x.constructor;
		Element = x.parseFromString("<Single />","text/xml").documentElement.constructor;
		x = null;
	};
	Document.prototype.serialize = Node.prototype.serialize = XMLDocument.prototype.serialize = function(){
		return(new XMLSerializer()).serializeToString(this);
	};
	
	if(jpf.isSafariOld || jpf.isSafari){
		HTMLDocument.prototype.selectNodes = XMLDocument.prototype.selectNodes = function(sExpr,contextNode){
			return jpf.XPath.selectNodes(sExpr,contextNode || this);
		};
		Element.prototype.selectNodes = function(sExpr,contextNode){
			return jpf.XPath.selectNodes(sExpr,contextNode || this);
		};
		HTMLDocument.prototype.selectSingleNode = XMLDocument.prototype.selectSingleNode = function(sExpr,contextNode){
			return jpf.XPath.selectNodes(sExpr,contextNode || this)[0];
		};
		Element.prototype.selectSingleNode = function(sExpr,contextNode){
			return jpf.XPath.selectNodes(sExpr,contextNode || this)[0];
		};
		jpf.importClass(runXpath,true,self);
		jpf.importClass(runXslt,true,self);
	};
	jpf.importClass(runNonIe,true,self);
}

/*FILEHEAD(/in/Library/Core/Kernel/browsers/JS.js)SIZE(3831)TIME(1203723714931)*/

/*FILEHEAD(/in/Library/Core/Kernel/browsers/JSLT.js)SIZE(18695)TIME(1213201790071)*/
jpf.JsltImplementation = function(){
	function isString(){
		if(typeof arguments[0]== 'string')return true;
		
		if(typeof arguments[0]== 'object' && arguments[0].constructor)return(arguments[0].constructor.toString().match(/string/i)!= null);
		return false;
	};
	function jesc(s,esc){
		if(! esc)return s;
		
		if(! s)return '';
		
		if(esc.toLowerCase()== 'q')return s.replace(/&/g,"&amp;").replace(/\'/g,"\\&squot").replace(/\"/g,"\\&quot").replace(/\r?\n/g,"\\n");
		return s;
	};
	function jcpy(s,n,p){
		if(! n)return;
		
		if(p){
			var t = n.selectNodes(p);
			
			if(! t || t.length == 0)return;
			
			for(var i = 0;i < t.length;i ++)s[s.length]= t[i].xml;
		}
		else s[s.length]= n.xml;
	};
	function jxml(n,p){
		if(! n)return;
		
		if(p){
			var o =[];
			var t = n.selectNodes(p);
			
			if(! t || t.length == 0)return;
			
			for(var i = 0;i < t.length;i ++)o[o.length]= t[i].xml;
		}
		else return n.xml;
		return o.join('');
	};
	function jval(n,p){
		if(! n)return '';
		
		if(p)n = n.selectSingleNode(p);
		
		if(! n)return '';
		
		if(n.nodeType == 1)n = n.firstChild;
		return n ? n.nodeValue:'';
	};
	function jloc(n,f,p){
		if(! n)return;
		n = isString(p)? n.selectSingleNode(p):p;
		
		if(! n)return;
		f(n);
	};
	function jdbg(a){
		jpf.status(a)};
	function jnod(n,p){
		if(! n)return '';
		
		if(p)n = n.selectSingleNode(p);
		
		if(! n)return null;
		return n;
	};
	function jnds(n,p){
		if(! n)return '';
		
		if(p)n = n.selectNodes(p);
		
		if(! n)return null;
		return n;
	};
	function jexs(n,p){
		if(! n)return false;
		
		if(p)n = n.selectSingleNode(p);
		return n != null;
	};
	function jemp(n,p){
		if(! n)return false;
		
		if(p)n = n.selectSingleNode(p);
		
		if(! n)return true;
		
		if(n.nodeType == 1)n = n.firstChild;
		return(n ? n.nodeValue:'').match(/^[\s\r\n\t]*$/)!= null;
	};
	function jcnt(n,p){
		if(! n)return 0;
		var t = n.selectNodes(p);
		return t ? t.length:0;
	};
	function jpak(n,f,p){
		var s =[];
		f(s,n);
		return s.join('');
	};
	function jstore(n,pk,f,p){
		if(! p)p = 'def';
		
		if(! pk[p])pk[p]=[];
		f(pk[p],n);
		return;
	};
	function jfetch(pk,p){
		if(! p)p = 'def';
		
		if(pk[p])return pk[p].join('');
		return '';
	};
	function jfra(f,t,sp,ep){
		if(! t)return;
		var end = ep == null ? t.length:Math.min(t.length,(sp + ep));
		
		for(var i =(sp == null)? 0:sp;i < end;i ++)f(i,end,t[i]);
	};
	function jvls(n,p){
		var r =[];
		
		if(! n)return r;
		var t = n.selectNodes(p);
		
		if(! t)return r;
		
		for(var i = 0;i < t.length;i ++){
			n = t[i];
			
			if(n.nodeType == 1)n = n.firstChild;
			r[i]= n ? n.nodeValue:'';
		};
		return r;
	};
	function jpar(f,str){
		var n = parseXML(str).documentElement;
		f(n);
	};
	function jfor(n,f,p,sp,ep){
		if(! n)return;
		var t = n.selectNodes(p);
		var end = ep == null ? t.length:Math.min(t.length,(sp + ep));
		
		for(var i =(sp == null)? 0:sp;i < end;i ++)f(i,end,t[i]);
	};
	var sort_intmask =["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000"];
	var sort_dateFmtStr;
	var sort_dateFormat;
	var sort_dateReplace;
	function sort_dateFmt(str){
		sort_dateFmtStr = str;
		var result = str.match(/(D+|Y+|M+|h+|m+|s+)/g);
		
		if(! result)return;
		
		for(var pos ={}
	,i = 0;i < result.length;i ++)pos[result[i].substr(0,1)]= i + 1;
		sort_dateFormat = new RegExp(str.replace(/[^\sDYMhms]/g,'\\$1').replace(/YYYY/,"(\\d\\d\\d\\d)").replace(/(DD|YY|MM|hh|mm|ss)/g,"(\\d\\d)"));
		sort_dateReplace = "$" + pos["M"]+ "/$" + pos["D"]+ "/$" + pos["Y"];
		
		if(pos["h"])sort_dateReplace += " - $" + pos["h"]+ ":$" + pos["m"]+ ":$" + pos["s"];
	};
	function sort_alpha(n){
		if(! n)return '';
		
		if(n.nodeType == 1)n = n.firstChild;
		return n ? n.nodeValue:'';
	};
	function sort_number(n){
		var t = sort_alpha(n);
		return(t.length < sort_intmask.length ? sort_intmask[sort_intmask.length - t.length]:"")+ t;
	};
	function sort_date(n,args){
		if(! sort_dateFormat ||(args && sort_dateFmtStr != args[0]))sort_dateFmt(args ? args[0]:"*");
		var t = sort_alpha(n),d;
		
		if(sort_dateFmtStr == '*')d = Date.parse(t);
		else d =(new Date(t.replace(sort_dateFormat,sort_dateReplace))).getTime();
		t = "" + parseInt(d);
		
		if(t == "NaN")t = "0";
		return(t.length < sort_intmask.length ? sort_intmask[sort_intmask.length - t.length]:"")+ t;
	};
	function jsort(n,f,p,ps,sm,desc,sp,ep){
		sm = sm ? sm:sort_alpha;
		var sa =[],t = n.selectNodes(p),i = t.length,args = null;
		
		if(typeof sm != "function"){
			var m = sm.shift();
			args = sm;
			sm = m;
		}
		
		while(i --){
			var n = t[i].selectSingleNode(ps);
			
			if(n)sa[sa.length]={
				toString:function(){
					return this.v;
				}
				,pn:t[i],v:sm(n,args)};
			else sa[sa.length]={
				toString:function(){
					return this.v;
				}
				,pn:t[i],v:''};
		};
		sa.sort();
		var end = ep == null ? sa.length:Math.min(sa.length,(sp + ep));
		var start =(sp == null)? 0:sp;
		
		if(desc){
			for(var i = end - 1;i >= start;i --)f(end - i - 1,end,sa[i].pn,sa[i].v);
		}
		else{
			for(var i = start;i < end;i ++)f(i,end,sa[i].pn,sa[i].v);
		}
	};
	function japl(s,n,ma,p){
		if(! n)return;
		var m = n.selectNodes(p || 'node()');
		
		for(var i = 0;i < m.length;i ++){
			var n = m[i];
			var f = ma[0][n.tagName];
			
			if(f)f(s,n);
			else{
				for(var k = 1;k < ma.length;k ++){
					var sn = n.selectSingleNode(ma[k][0]);
					
					if(sn){
						ma[k][1](s,sn);
						break;
					}
				}
			}
		}
	};
	function jmat(ma,f,p){
		var s = p.split(/\|/),all = true;
		
		for(var i = 0;i < s.length;i ++){
			if(! s[i].match(/^[\w_]+$/))all = false;
			ma[0][s[i]]= f;
		};
		
		if(! all){
			p = "self::" + p.replace(/\|/g,"|self::");
			ma[ma.length]=[p,f];
		}
	};
	var types =['[','{','(','text','xpath','word','sep','ws','semi','sh','op','col','str','regex'];
	var closes =[']','}',')'];
	var func ={
		'last':[0,'(i==len-1)'],'first':[0,'(i==0)'],'out':[0,'s[s.length]'],'apply':[1,';japl(s,n,ma,',');'],'copy':[1,';jcpy(s,n,',');'],'xml':[1,'jxml(n,',')'],'value':[1,'jval(n,',')'],'exists':[1,'jexs(n,',')'],'empty':[1,'jemp(n,',')'],'values':[1,'jvls(n,',')'],'node':[1,'jnod(n,',')'],'nodes':[1,'jnds(n,',')'],'count':[1,'jcnt(n,',')'],'context':[1,'(n=n.selectSingleNode(','))'],'foreach':[2,';jfor(n,function(i,len,n){','},',');'],'sort':[2,';jsort(n,function(i,len,n,sv){','},',');'],'local':[2,';jloc(n,function(n){','},',');'],'match':[2,';jmat(ma,function(s,n){','},',');'],'pack':[2,'jpak(n,function(s,n){','},',')'],'store':[2,'jstore(n,os,function(s,n){','},',');'],'fetch':[1,'jfetch(os,',')'],'parse':[2,'jpar(function(n){','},',');'],'forarray':[3],'macro':[4],'pragma':[5],'_':[6]};
	var short_0 ={
		'%':'s[s.length]='};
	var short_1 ={
		'$':['jval(n,',')'],'&':['jnod(n,',')'],'@':['(n=n.selectSingleNode(','))'],'~':['jexs(n,',')'],'!':['!jexs(n,',')'],'#':['jcnt(n,',')'],'^':[';japl(s,n,ma,',');']};
	var short_2 ={
		'*':[';jfor(n,function(i,len,n){','},',')']};
	function dump_tree(n,s,w){
		for(var i = 0;i < n.length;i ++){
			var m = n[i],t = m[0];
			
			if(t < 3){
				s.push(w + types[t]);
				dump_tree(m[1],s,'&nbsp;&nbsp;' + w);
				s.push(closes[t]);
				s.push('\n');
			}
			else{
				s.push(w + types[t]+ ': ' + m[1]+ '\n');
			}
		}
	};
	this.compile = function(str,trim_startspace){
		if(str.match(/^var s\=\[\]/)){
			try{
				eval("var f = function(n){" + str + "};");
			}
			catch(e){
				jpf.status(jpf.formatJS(str));
				throw new Error(0,"Could not parse Precompiled JSLT with: " + e.message);
			};
			return[f,str];
		};
		var err =[];
		var tree =[];
		var stack =[];
		var node = tree;
		var blevel = 0,tpos = 0;
		var istr = 0,icc = 0;
		var lm = 0;
		var macros ={
		};
		str = str.replace(/\/\*[\s\S]*?\*\//gm,"");
		str.replace(/([\w_\.]+)|([\s]*,[\s]*)|([\s]*;[\s]*)|((?:[\s]*)[\$\@\#\%\^\&\*\?\!](?:[\s]*))|([\s]*[\+\-\<\>\|\=]+[\s]*)|(\s*\:\s*)|(\s+)|(\\[\\\{\}\[\]\"\'\/])|(\[)|(\])|([\s]*\([\s]*)|([\s]*\)[\s]*)|([\s]*\{[\s]*)|([\s]*\}[\s]*)|(\')|(\")|(\/)/g,function(m,word,sep,semi,sh,op,col,ws,bs1,bo,bc,po,pc,co,cc,q1,q2,re,pos){function add_track(t){
				var txt = trim_startspace ? str.substr(tpos,pos - tpos).replace(/[\r\n]\s*/,'').replace(/^\s*[\r\n]/,'').replace(/\\s/g,' ').replace(/[\r\n\t]/g,''):str.substr(tpos,pos - tpos).replace(/[\r\n\t]/g,'');
				
				if(txt.length > 0){
					node[node.length]=[t,txt,tpos,pos];
				}
			};
			function add_node(t,data){
				node[node.length]=[t,data,pos];
			};
			function add_sub(t){
				var n =[];
				node[node.length]=[t,n,pos];
				stack[stack.length]= node;
				node = n;
			};
			function pop_sub(t){
				if(stack.length == 0){
					err[err.length]=["extra " + closes[t],pos];
				}
				else{
					node = stack.pop();
					var ot = node[node.length - 1][0];
					
					if(ot != t){
						err[err.length]=["scope mismatch " + types[ot]+ " with " + types[t],pos];
					}
				}
			};
			
			if(blevel == 0 ||(bc && blevel == 1 && ! istr)){
				if(icc == 0){
					if(bo){
						add_track(3);
						blevel ++;
					};
					
					if(bc){
						if(blevel == 0)err[err.length]=["extra ]",pos];
						else{
							blevel --;
							tpos = pos + 1;
						}
					}
				};
				
				if(co){
					add_track(3);
					tpos = pos + 1;
					icc ++;
				};
				
				if(cc){
					add_track(4);
					tpos = pos + 1;
					icc --;
					
					if(icc < 0)err[err.length]=["extra }",pos];
				}
			}
			else{
				if(! istr){
					if(word){
						add_node(5,m);
						
						if(m == 'macro')lm = 1;
						else 
						if(lm)macros[m]= 1,lm = 0;
					};
					
					if(sep)add_node(6,',');
					
					if(ws)add_node(7,m);
					
					if(semi)add_node(8,m);
					
					if(sh)add_node(9,m);
					
					if(op)add_node(10,m);
					
					if(col)add_node(11,m);
					
					if(bo){
						blevel ++;
						add_sub(0);
					};
					
					if(bc){
						blevel --;
						pop_sub(0);
					};
					
					if(co)add_sub(1);
					
					if(cc)pop_sub(1);
					
					if(po)add_sub(2);
					
					if(pc)pop_sub(2);
				};
				
				if(q1){
					if(istr == 0){
						istr = 1;
						tpos = pos;
					}
					else 
					if(istr == 1){
						istr = 0;
						pos += 1;
						add_track(12);
					}
				};
				
				if(q2){
					if(istr == 0){
						istr = 2;
						tpos = pos;
					}
					else 
					if(istr == 2){
						istr = 0;
						pos += 1;
						add_track(12);
					}
				};
				
				if(re){
					if(istr == 0){
						if(node.length == 0 || node[node.length - 1][0]== 6){
							istr = 3;
							tpos = pos;
						}
						else add_node(10,m);
					}
					else 
					if(istr == 3){
						istr = 0;
						pos += 1;
						add_track(13);
					}
				}
			};
			return m;
		}
	);
		
		if(blevel == 0){
			var txt = str.substr(tpos,str.length - tpos).replace(/[\r\n\t]/g,'');
			
			if(txt.length > 0){
				node[node.length]=[3,txt,tpos,str.length];
			}
		};
		
		if(stack.length > 0)
		for(var i = stack.length - 1;i >= 0;i --){
			var j = stack[i][stack[i].length - 1];
			err[err.length]=["unclosed tag " + types[j[0]],j[2]];
		};
		var s =['var s=[],ma=[{}],os={};'];
		var pragma_trace = 0;
		function line_pos(cpos){
			var l = 0;
			str.replace(/\n/g,function(m,pos){if(pos < cpos)l ++;
				return m;
			}
		);
			return l;
		};
		function compile_recur(s,n,offset){
			var k = n.length;
			var d,e;
			
			for(var i =((offset == null)? 0:offset);i < k;i ++){
				var t = n[i][0];
				
				if(t == 5){
					var nt1 =(i < k - 1)? n[i + 1][0]:- 1,nt2 =(i < k - 2)? n[i + 2][0]:- 1;
					var m = n[i][1];
					var d = func[m];
					
					if(d){
						switch(d[0]){
							case 0:s[s.length]= d[1];
							break;
							case 1:
							if(nt1 != 2){
								err[err.length]=["Function " + m + " syntax error",n[i][2]];
							}
							else{
								s[s.length]= d[1];
								
								if(! compile_recur(s,n[i + 1][1]))s[s.length]= 'null';
								s[s.length]= d[2];
								i ++;
							};
							break;
							case 2:
							if(nt1 != 2 || nt2 != 1){
								err[err.length]=["Function " + m + " syntax error",n[i][2]];
							}
							else{
								s[s.length]= d[1];
								compile_recur(s,n[i + 2][1]);
								s[s.length]= d[2];
								
								if(! compile_recur(s,n[i + 1][1]))s[s.length]= 'null';
								s[s.length]= d[3];
								i += 2;
							};
							break;
							case 3:var o,ok;
							
							if(i > k - 3 || n[i + 1][0]!= 2 || n[i + 2][0]!= 1 ||(o = n[i + 1][1])[0][0]!= 5 ||(ok = o.length)< 5 || o[1][0]!= 7 || o[2][0]!= 5 || o[2][1]!= 'in'){
								err[err.length]=["forarray syntax error",n[i][2]];
							}
							else{
								s[s.length]= ';jfra(function(i,len,' + o[0][1]+ '){';
								compile_recur(s,n[i + 2][1]);
								s[s.length]= '},';
								compile_recur(s,o,3);
								s[s.length]= ');';
								i += 2;
							};
							break;
							case 4:
							if(i >= k - 4 || n[i + 1][0]!= 7 || n[i + 2][0]!= 5 || n[i + 3][0]!= 2 || n[i + 4][0]!= 1){
								err[err.length]=["macro syntax error at",n[0][2]];
							}
							else{
								s[s.length]= 'function ' + n[i + 2][1]+ '(s,n,';
								
								if(! compile_recur(s,n[i + 3][1]))s[s.length]= 'null';
								s[s.length]= '){';
								compile_recur(s,n[i + 4][1]);
								s[s.length]= '}';
								i += 4;
							};
							break;
							case 5:{
								if(i >= k - 3 || n[i + 1][0]!= 7 || n[i + 2][0]!= 5 || n[i + 3][0]!= 2){
									err[err.length]=["macro syntax error at",n[0][2]];
								}
								else{
									switch(n[i + 2][1]){
										case 'trace':{
											var ts =[];
											compile_recur(ts,n[i + 3][1]);
											pragma_trace = eval(ts.join(''));
										};
										break;
									}
								};
								i += 3;
							};
							case 6:{
								s[s.length]= ';alert("Trace: ' + line_pos(n[i][2])+ '");';
							}
						}
					}
					else{
						if(macros[m]&& nt1 == 2){
							s[s.length]= m + '(s,n,';
							
							if(! compile_recur(s,n[i + 1][1]))s[s.length]= 'null';
							s[s.length]= ')';
							i ++;
						}
						else s[s.length]= m;
					}
				}
				else 
				if(t == 9){
					var nt1 =(i < k - 1)? n[i + 1][0]:- 1,nt2 =(i < k - 2)? n[i + 2][0]:- 1;
					var m = n[i][1];
					
					if(nt1 == 12){
						if(nt2 == 1){
							if(d = short_2[m]){
								s[s.length]= d[0];
								compile_recur(s,n[i + 2][1]);
								s[s.length]= d[1]+ n[i + 1][1]+ d[2];
								i += 2;
								lt = 1;
							}
							else s[s.length]= m;
						}
						else{
							if(d = short_1[m]){
								if(nt2 == 11)s[s.length]= m;
								else{
									s[s.length]= d[0]+ n[i + 1][1]+ d[1];
									i ++;
								}
							}
							else{
								if(d = short_0[m])s[s.length]= d;
								else s[s.length]= m;
							}
						}
					}
					else{
						if(d = short_0[m])s[s.length]= d;
						else s[s.length]= m;
					}
				}
				else{
					if(t < 3){
						s[s.length]= types[t];
						compile_recur(s,n[i][1]);
						s[s.length]= closes[t];
						
						if((t == 1 && i < k - 1 && n[i + 1][0]== 5 && n[i + 1][1]!= 'else')||(t == 2 && i < k - 1 && n[i + 1][0]== 5 && ! n[i + 1][1].match(/^\./)&&(i == 0 || n[i - 1][0]!= 5 || ! n[i - 1][1].match(/^(if|for)$/)))){
							s[s.length]= ';';
						}
					}
					else{
						if(t == 3)s[s.length]= ';s[s.length]="' + n[i][1].replace(/\"/g,"\\\"").replace(/\n/g,"\\n")+ '";';
						else 
						if(t == 4){
							var m = n[i][1].match(/^\^([\w])\s?/);
							
							if(m){
								s[s.length]= ';s[s.length]=jesc(jval(n,"' + n[i][1].substr(2).replace(/"/g,"\\\"")+ '"),"' + m[1]+ '");';
							}
							else{
								s[s.length]= ';s[s.length]=jval(n,"' + n[i][1].replace(/"/g,"\\\"")+ '");';
							}
						}
						else s[s.length]= n[i][1];
					}
				}
			};
			return k;
		};
		
		if(err.length == 0)compile_recur(s,tree);
		
		if(err.length > 0){
			var e =[];
			
			for(var i = 0;i < err.length;i ++){
				e[e.length]= 'Parse error(' + line_pos(err[i][1])+ '): ' + err[i][0]+ '\n';
			};
			throw new Error(0,"Could not parse JSLT with: " + e.join('')+ "\n");
		};
		s[s.length]= ";return s.join('');";
		var strJS = s.join('');
		
		try{
			eval("var f = function(n){" + strJS + "};");
		}
		catch(e){
			jpf.status(jpf.formatJS(strJS));
			throw new Error(0,"Could not parse JSLT with: " + e.message);
		};
		return[f,strJS];
	};
	this.cache =[];
	this.apply = function(jsltNode,xmlNode){
		var jsltFunc,cacheId,jsltStr,doTest;
		var xmlNode = jpf.XMLDatabase.getBindXmlNode(xmlNode);
		
		if(typeof jsltNode == "object"){
			cacheId = jsltNode.getAttribute("cache");
			jsltFunc = this.cache[cacheId];
			
			if(! jsltFunc)jsltStr = jsltNode.selectSingleNode('text()').nodeValue}
		else{
			cacheId = jsltNode;
			jsltFunc = this.cache[cacheId];
			
			if(! jsltFunc)jsltStr = jsltNode;
		};
		
		if(! jsltFunc)jsltFunc = this.compile(jsltStr);
		this.lastJslt = jsltStr;
		this.lastJs = jsltFunc[0];
		
		if(! jsltFunc[0])return false;
		
		if(! cacheId){
			if(typeof jsltNode == "object"){
				cacheId = this.cache.push(jsltFunc)- 1;
				jsltNode.setAttribute("cache",cacheId);
			}
			else this.cache[jsltStr]= jsltFunc;
		};
		
		try{
			if(! xmlNode)return '';
			return jsltFunc[0](xmlNode);
		}
		catch(e){
			jpf.status(jpf.formatJS(jsltFunc[1]));
			throw new Error(0,jpf.formErrorString(0,null,"JSLT parsing","Could not execute JSLT with: " + e.message));
		}
	}

};

jpf.JsltInstance = new jpf.JsltImplementation();

/*FILEHEAD(/in/Library/Core/Kernel/browsers/nonIE.js)SIZE(17832)TIME(1205331874875)*/
function runNonIe(){
	if(typeof HTMLElement != "undefined"){
		if(! HTMLElement.prototype.insertAdjacentElement){
			HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode){
				switch(where.toLowerCase()){
					case "beforebegin":this.parentNode.insertBefore(parsedNode,this);
					break;
					case "afterbegin":this.insertBefore(parsedNode,this.firstChild);
					break;
					case "beforeend":this.appendChild(parsedNode);
					break;
					case "afterend":
					if(this.nextSibling)this.parentNode.insertBefore(parsedNode,this.nextSibling);
					else this.parentNode.appendChild(parsedNode);
					break;
				}
			};
		};
		
		if(! HTMLElement.prototype.insertAdjacentHTML){
			HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr){
				var r = this.ownerDocument.createRange();
				r.setStartBefore(jpf.isSafari ? document.body:this);
				var parsedHTML = r.createContextualFragment(htmlStr);
				this.insertAdjacentElement(where,parsedHTML);
			}
		};
		
		if(! HTMLElement.prototype.insertAdjacentText){
			HTMLElement.prototype.insertAdjacentText = function(where,txtStr){
				var parsedText = document.createTextNode(txtStr);
				this.insertAdjacentElement(where,parsedText);
			}
		};
		HTMLElement.prototype.removeNode = function(){
			if(! this.parentNode)return;
			this.parentNode.removeChild(this);
		};
		
		if(HTMLElement.prototype.__defineSetter__){
			HTMLElement.prototype.__defineSetter__("innerText",function(sText){var s = "" + sText;
				this.innerHTML = s.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
			}
		);
			HTMLElement.prototype.__defineGetter__("innerText",function(){return this.innerHTML.replace(/<[^>]+>/g,"").replace(/\s\s+/g," ").replace(/^\s*|\s*$/g," ")}
		);
			HTMLElement.prototype.__defineGetter__("outerHTML",function(){return(new XMLSerializer()).serializeToString(this);
			}
		);
		}
	};
	var IEPREFIX4XSLPARAM = "";
	var ASYNCNOTSUPPORTED = false;
	
	try{
		XMLDocument.prototype.async = true;
		ASYNCNOTSUPPORTED = true;
	}
	catch(e){
	};
	Document.prototype.onreadystatechange = null;
	Document.prototype.parseError = 0;
	Array.prototype.item = function(i){
		return this[i];
	};
	Array.prototype.expr = "";
	XMLDocument.prototype.readyState = 0;
	XMLDocument.prototype.__clearDOM = function(){
		while(this.hasChildNodes())this.removeChild(this.firstChild);
	};
	XMLDocument.prototype.__copyDOM = function(oDoc){
		this.__clearDOM();
		
		if(oDoc.nodeType == 9 || oDoc.nodeType == 11){
			var oNodes = oDoc.childNodes;
			
			for(var i = 0;i < oNodes.length;i ++)this.appendChild(this.importNode(oNodes[i],true));
		}
		else 
		if(oDoc.nodeType == 1)this.appendChild(this.importNode(oDoc,true));
	};
	XMLDocument.prototype.loadXML = function(strXML){
		jpf.XMLDatabase.setReadyState(this,1);
		var sOldXML = this.xml || this.serialize();
		var oDoc =(new DOMParser()).parseFromString(strXML,"text/xml");
		jpf.XMLDatabase.setReadyState(this,2);
		this.__copyDOM(oDoc);
		jpf.XMLDatabase.setReadyState(this,3);
		jpf.XMLDatabase.loadHandler(this);
		return sOldXML;
	};
	Node.prototype.getElementById = function(id){
	};
	HTMLElement.prototype.replaceNode = Element.prototype.replaceNode = function(xmlNode){
		if(! this.parentNode)return;
		this.parentNode.insertBefore(xmlNode,this);
		this.parentNode.removeChild(this);
	};
	XMLDocument.prototype.__load = XMLDocument.prototype.load;
	XMLDocument.prototype.load = function(sURI){
		var oDoc = document.implementation.createDocument("","",null);
		oDoc.__copyDOM(this);
		this.parseError = 0;
		jpf.XMLDatabase.setReadyState(this,1);
		
		try{
			if(this.async == false && ASYNCNOTSUPPORTED){
				var tmp = new XMLHttpRequest();
				tmp.open("GET",sURI,false);
				tmp.overrideMimeType("text/xml");
				tmp.send(null);
				jpf.XMLDatabase.setReadyState(this,2);
				this.__copyDOM(tmp.responseXML);
				jpf.XMLDatabase.setReadyState(this,3);
			}
			else this.__load(sURI);
		}
		catch(objException){
			this.parseError = - 1;
		}
		finally{
			jpf.XMLDatabase.loadHandler(this);
		};
		return oDoc;
	};
	HTMLDocument.prototype.setProperty = XMLDocument.prototype.setProperty = function(x,y){
	};
	jpf.getObject = function(type,message,no_error){
		if(type == "HTTP"){
			if(jpf.availHTTP.length)return jpf.availHTTP.pop();
			return new XMLHttpRequest();
		}
		else 
		if(type == "XMLDOM"){
			if(message){
				var xmlParser = new DOMParser();
				xmlParser = xmlParser.parseFromString(message,"text/xml");
				
				if(! no_error)this.xmlParseError(xmlParser);
			}
			else{
				var xmlParser = document.implementation.createDocument("","",null);
			};
			return xmlParser;
		}
	};
	jpf.xmlParseError = function(xml){
		if(xml.documentElement.tagName == "parsererror"){
			var str = xml.documentElement.firstChild.nodeValue.split("\n");
			var linenr = str[2].match(/\w+ (\d+)/)[1];
			var message = str[0].replace(/\w+ \w+ \w+: (.*)/,"$1");
			var srcText = xml.documentElement.lastChild.firstChild.nodeValue.split("\n")[0];
			throw new Error(1050,jpf.formErrorString(1050,null,"XML Parse Error on line " + linenr,message + "\nSource Text : " + srcText.replace(/\t/gi," ")));
		};
		return xml;
	};
	
	if(jpf.XMLDatabaseImplementation){
		jpf.XMLDatabaseImplementation.prototype.htmlImport = function(xmlNode,htmlNode,beforeNode,test){
			if(! htmlNode)alert("No HTML node given in htmlImport:" + this.htmlImport.caller);
			
			if(xmlNode.length != null && ! xmlNode.nodeType){
				for(var str = '',i = 0;i < xmlNode.length;i ++)str += xmlNode[i].serialize();
				var str = str.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/<([^>]+)\/>/g,"<$1></$1>");
				(beforeNode || htmlNode).insertAdjacentHTML(beforeNode ? "beforebegin":"beforeend",str);
				return;
			};
			
			if(htmlNode.ownerDocument != document)return htmlNode.insertBefore(xmlNode,beforeNode);
			var strHTML =(xmlNode.outerHTML ||(xmlNode.nodeType == 1 ? xmlNode.serialize():xmlNode.nodeValue)).replace(/&lt;/g,"<").replace(/&gt;/g,">");
			var pNode =(beforeNode || htmlNode);
			
			if(pNode.nodeType == 11){
				var id = xmlNode.getAttribute("id");
				
				if(! id)throw new Error(1049,jpf.formErrorString(1049,null,"XMLDatabase","Inserting Cache Item in Document Fragment without an ID"));
				document.body.insertAdjacentHTML(beforeNode ? "beforebegin":"beforeend",strHTML);
				pNode.appendChild(document.getElementById(id));
			}
			else{
				if(xmlNode.tagName.match(/tbody|td|tr/))pNode.insertBefore(pNode.ownerDocument.createElement(xmlNode.tagName.toLowerCase()),beforeNode || null);
				else pNode.insertAdjacentHTML(beforeNode ? "beforebegin":"beforeend",strHTML);
			};
			return beforeNode ? beforeNode.previousSibling:htmlNode.lastChild;
		};
		jpf.XMLDatabaseImplementation.prototype.setReadyState = function(oDoc,iReadyState){
			oDoc.readyState = iReadyState;
			
			if(oDoc.onreadystatechange != null && typeof oDoc.onreadystatechange == "function")oDoc.onreadystatechange();
		};
		jpf.XMLDatabaseImplementation.prototype.loadHandler = function(oDoc){
			if(! oDoc.documentElement || oDoc.documentElement.tagName == "parsererror")oDoc.parseError = - 1;
			jpf.XMLDatabase.setReadyState(oDoc,4);
		};
		jpf.XMLDatabase = new jpf.XMLDatabaseImplementation();
	};
	jpf.Init.add(function(){var nodes = document.getElementsByTagName("form");
		
		for(var i = 0;i < nodes.length;i ++)nodes[i].removeNode();
		var nodes = document.getElementsByTagName("xml");
		
		for(var i = 0;i < nodes.length;i ++)nodes[i].removeNode();
		nodes = null;
	}

);
	MAXMSG = 3;
	ERROR_COUNT = 0;
	
	if(document.body)document.body.focus = function(){
	};
	
	if(! document.elementFromPoint){
		Document.prototype.elementFromPointRemove = function(el){
			if(! this.RegElements)return;
			this.RegElements.remove(el);
		};
		Document.prototype.elementFromPointAdd = function(el){
			if(! this.RegElements)this.RegElements =[];
			this.RegElements.push(el);
		};
		Document.prototype.elementFromPointReset = function(RegElements){
			FoundValue =[];
			FoundNode = null;
			LastFoundAbs = document.documentElement;
		};
		Document.prototype.elementFromPoint = function(x,y){
			document.elementFromPointReset();
			
			if(this.RegElements){
				for(var calc_z = - 1,calc,i = 0;i < this.RegElements.length;i ++){
					var n = this.RegElements[i];
					
					if(getStyle(n,"display")== "none")continue;
					var sx = getElementPosX(n);
					var sy = getElementPosY(n);
					var ex = sx + n.offsetWidth;
					var ey = sy + n.offsetHeight;
					
					if(x > sx && x < ex && y > sy && y < ey){
						var z = getElementZindex(n);
						
						if(z > calc_z){
							calc =[n,x,y,sx,sy];
							calc_z = z;
						}
					}
				};
				
				if(calc){
					efpi(calc[0],calc[1],calc[2],0,FoundValue,calc[3],calc[4]);
					
					if(! FoundNode){
						FoundNode = calc[0];
						LastFoundAbs = calc[0];
						FoundValue =[calc_z];
					}
				}
			};
			
			if(! this.RegElements || ! this.RegElements.length)efpi(document.body,x,y,0,[],getElementPosX(document.body),getElementPosY(document.body));
			return FoundNode;
		};
		function getStyle(el,prop){
			return document.defaultView.getComputedStyle(el,'').getPropertyValue(prop);
		};
		function efpi(from,x,y,CurIndex,CurValue,px,py){
			var StartValue = CurValue;
			var StartIndex = CurIndex;
			var nodes = from.childNodes;
			
			for(var n,i = 0;i < from.childNodes.length;i ++){
				n = from.childNodes[i];
				
				if(n.nodeType == 1 && getStyle(n,'display')!= 'none' && n.offsetParent){
					var sx = px + n.offsetLeft - n.offsetParent.scrollLeft;
					var sy = py + n.offsetTop - n.offsetParent.scrollTop;
					var ex = sx + n.offsetWidth;
					var ey = sy + n.offsetHeight;
					var isAbs = getStyle(n,"position");
					isAbs = isAbs == "absolute" || isAbs == "relative";
					var isHidden = getStyle(n,"overflow")== "hidden";
					var inSpace =(x > sx && x < ex && y > sy && y < ey);
					
					if(isAbs && isHidden && ! inSpace)continue;
					CurIndex = StartIndex;
					CurValue = StartValue.copy();
					var z = parseInt(getStyle(n,"z-index"))|| 0;
					
					if(isAbs &&(z || z == 0)|| isHidden){
						if(! isAbs)z = 0;
						
						if(z >=(FoundValue[CurIndex]|| 0)){
							if(z >(CurValue[CurIndex]|| 0)){
								CurValue[CurIndex]= z;
							};
							CurIndex ++;
							
							if(inSpace && CurIndex >= FoundValue.length){
								FoundNode = n;
								FoundValue = CurValue;
								LastFoundAbs = n;
							}
						}
						else continue;
					}
					else 
					if(inSpace && CurIndex >= FoundValue.length){
						FoundNode = n;
						FoundValue = CurValue;
					};
					efpi(n,x,y,CurIndex,CurValue,isAbs ? sx:px,isAbs ? sy:py)}
			}
		};
		function getElementPosY(myObj){
			return myObj.offsetTop + parseInt(jpf.compat.getStyle(myObj,"border-top-width"))+(myObj.offsetParent ? getElementPosY(myObj.offsetParent):0)};
		function getElementPosX(myObj){
			return myObj.offsetLeft + parseInt(jpf.compat.getStyle(myObj,"border-left-width"))+(myObj.offsetParent ? getElementPosX(myObj.offsetParent):0)};
		function getElementZindex(myObj){
			var z = 0,n,p = myObj;
			
			while(p && p.nodeType == 1){
				z = Math.max(z,parseInt(getStyle(p,"z-index"))|| - 1);
				p = p.parentNode;
			};
			return z;
		}
	};
	jpf.Init.run('XMLDatabase');
}

/*FILEHEAD(/in/Library/Core/Kernel/browsers/XPath.js)SIZE(14342)TIME(1203729515931)*/
function runXpath(){
	jpf.XPath ={
		cache:{
		}
	,getChildNode:function(htmlNode,tagName,info,count,num,sResult){
			var numfound = 0,result = null,data = info[count];
			var nodes = htmlNode.childNodes;
			
			if(! nodes)return;
			
			for(var i = 0;i < nodes.length;i ++){
				if(tagName &&(tagName != nodes[i].tagName)&&(nodes[i].style ? nodes[i].tagName.toLowerCase():nodes[i].tagName)!= tagName)continue;
				
				if(data)data[0](nodes[i],data[1],info,count + 1,numfound ++,sResult);
				else sResult.push(nodes[i]);
			}
		}
		,doQuery:function(htmlNode,qData,info,count,num,sResult){
			var result = null,data = info[count];
			var query = qData[0];
			var returnResult = qData[1];
			
			try{
				var qResult = eval(query);
			}
			catch(e){
				return;
			};
			
			if(returnResult)return sResult.push(qResult);
			
			if(! qResult)return;
			
			if(data)data[0](htmlNode,data[1],info,count + 1,0,sResult);
			else sResult.push(htmlNode);
		}
		,getTextNode:function(htmlNode,empty,info,count,num,sResult){
			var result = null,data = info[count];
			var nodes = htmlNode.childNodes;
			
			for(var i = 0;i < nodes.length;i ++){
				if(nodes[i].nodeType != 3 && nodes[i].nodeType != 4)continue;
				
				if(data)data[0](nodes[i],data[1],info,count + 1,i,sResult);
				else sResult.push(nodes[i]);
			}
		}
		,getAnyNode:function(htmlNode,empty,info,count,num,sResult){
			var result = null,data = info[count];
			var sel =[],nodes = htmlNode.childNodes;
			
			for(var i = 0;i < nodes.length;i ++){
				if(data)data[0](nodes[i],data[1],info,count + 1,i,sResult);
				else sResult.push(nodes[i]);
			}
		}
		,getAttributeNode:function(htmlNode,attrName,info,count,num,sResult){
			if(! htmlNode || htmlNode.nodeType != 1)return;
			var result = null,data = info[count];
			var value = htmlNode.getAttributeNode(attrName);
			
			if(data)data[0](value,data[1],info,count + 1,0,sResult);
			else 
			if(value)sResult.push(value);
		}
		,getAllNodes:function(htmlNode,x,info,count,num,sResult){
			var result = null,data = info[count];
			var tagName = x[0];
			var inclSelf = x[1];
			var prefix = x[2];
			
			if(inclSelf &&(htmlNode.tagName == tagName || tagName == "*")){
				if(data)data[0](htmlNode,data[1],info,count + 1,0,sResult);
				else sResult.push(htmlNode);
			};
			var nodes = $(tagName,htmlNode,tagName == prefix ? "":prefix);
			
			for(var i = 0;i < nodes.length;i ++){
				if(data)data[0](nodes[i],data[1],info,count + 1,i,sResult);
				else sResult.push(nodes[i]);
			}
		}
		,getAllAncestorNodes:function(htmlNode,x,info,count,num,sResult){
			var result = null,data = info[count];
			var tagName = x[0];
			var inclSelf = x[1];
			var prefix = x[2];
			var i = 0,s = inclSelf ? htmlNode:htmlNode.parentNode;
			
			while(s && s.nodeType == 1){
				if(s.tagName == tagName || tagName == "*" || tagName == "node()"){
					if(data)data[0](s,data[1],info,count + 1,++ i,sResult);
					else sResult.push(s);
				};
				s = s.parentNode}
		}
		,getParentNode:function(htmlNode,empty,info,count,num,sResult){
			var result = null,data = info[count];
			var node = htmlNode.parentNode;
			
			if(data)data[0](node,data[1],info,count + 1,0,sResult);
			else 
			if(node)sResult.push(node);
		}
		,getPrecedingSibling:function(htmlNode,tagName,info,count,num,sResult){
			var result = null,data = info[count];
			var node = htmlNode.previousSibling;
			
			while(node){
				if(tagName != "node()" &&(node.style ? node.tagName.toLowerCase():node.tagName)!= tagName){
					node = node.previousSibling;
					continue;
				};
				
				if(data)data[0](node,data[1],info,count + 1,0,sResult);
				else 
				if(node){
					sResult.push(node);
					break;
				}
			}
		}
		,getFollowingSibling:function(htmlNode,tagName,info,count,num,sResult){
			var result = null,data = info[count];
			var node = htmlNode.nextSibling;
			
			while(node){
				if(tagName != "node()" &&(node.style ? node.tagName.toLowerCase():node.tagName)!= tagName){
					node = node.nextSibling;
					continue;
				};
				
				if(data)data[0](node,data[1],info,count + 1,0,sResult);
				else 
				if(node){
					sResult.push(node);
					break;
				}
			}
		}
		,multiXpaths:function(contextNode,list,info,count,num,sResult){
			for(var i = 0;i < list.length;i ++){
				var info = list[i][0];
				var rootNode =(info[3]? contextNode.ownerDocument.documentElement:contextNode);
				info[0](rootNode,info[1],list[i],1,0,sResult);
			};
			sResult.makeUnique();
		}
		,compile:function(sExpr){
			sExpr = sExpr.replace(/\[(\d+)\]/g,"/##$1");
			sExpr = sExpr.replace(/\|\|(\d+)\|\|\d+/g,"##$1");
			sExpr = sExpr.replace(/\.\|\|\d+/g,".");
			sExpr = sExpr.replace(/\[([^\]]*)\]/g,function(match,m1){return "/##" + m1.replace(/\|/g,"_@_");
			}
		);
			
			if(sExpr == "/" || sExpr == ".")return sExpr;
			sExpr = sExpr.replace(/\/\//g,"descendant::");
			return this.processXpath(sExpr);
		}
		,processXpath:function(sExpr){
			var results = new Array();
			sExpr = sExpr.replace(/('[^']*)\|([^']*')/g,"$1_@_$2");
			sExpr = sExpr.split("\|");
			
			for(var i = 0;i < sExpr.length;i ++)sExpr[i]= sExpr[i].replace(/_\@\_/g,"|");
			
			if(sExpr.length == 1)sExpr = sExpr[0];
			else{
				for(var i = 0;i < sExpr.length;i ++)sExpr[i]= this.processXpath(sExpr[i]);
				results.push([this.multiXpaths,sExpr]);
				return results;
			};
			var isAbsolute = sExpr.match(/^\/[^\/]/);
			var sections = sExpr.split("/");
			
			for(var i = 0;i < sections.length;i ++){
				if(sections[i]== "." || sections[i]== "")continue;
				else 
				if(sections[i].match(/^[\w-_\.]+(?:\:[\w-_\.]+){0,1}$/))results.push([this.getChildNode,sections[i]]);
				else 
				if(sections[i].match(/^\#\#(\d+)$/))results.push([this.doQuery,["num+1 == " + parseInt(RegExp.$1)]]);
				else 
				if(sections[i].match(/^\#\#(.*)$/)){
					var query = RegExp.$1;
					var m =[query.match(/\(/g),query.match(/\)/g)];
					
					if(m[0]|| m[1]){
						while(! m[0]&& m[1]|| m[0]&& ! m[1]|| m[0].length != m[1].length){
							if(! sections[++ i])break;
							query += "/" + sections[i];
							m =[query.match(/\(/g),query.match(/\)/g)];
						}
					};
					results.push([this.doQuery,[this.compileQuery(query)]]);
				}
				else 
				if(sections[i]== "*")results.push([this.getChildNode,null]);
				else 
				if(sections[i].substr(0,2)== "[]")results.push([this.getAllNodes,["*",false]]);
				else 
				if(sections[i].match(/descendant-or-self::node\(\)$/))results.push([this.getAllNodes,["*",true]]);
				else 
				if(sections[i].match(/descendant-or-self::([^\:]*)(?:\:(.*)){0,1}$/))results.push([this.getAllNodes,[RegExp.$2 || RegExp.$1,true,RegExp.$1]]);
				else 
				if(sections[i].match(/descendant::([^\:]*)(?:\:(.*)){0,1}$/))results.push([this.getAllNodes,[RegExp.$2 || RegExp.$1,false,RegExp.$1]]);
				else 
				if(sections[i].match(/ancestor-or-self::([^\:]*)(?:\:(.*)){0,1}$/))results.push([this.getAllAncestorNodes,[RegExp.$2 || RegExp.$1,true,RegExp.$1]]);
				else 
				if(sections[i].match(/ancestor::([^\:]*)(?:\:(.*)){0,1}$/))results.push([this.getAllAncestorNodes,[RegExp.$2 || RegExp.$1,false,RegExp.$1]]);
				else 
				if(sections[i].match(/^\@(.*)$/))results.push([this.getAttributeNode,RegExp.$1]);
				else 
				if(sections[i]== "text()")results.push([this.getTextNode,null]);
				else 
				if(sections[i]== "node()")results.push([this.getAnyNode,null]);
				else 
				if(sections[i]== "..")results.push([this.getParentNode,null]);
				else 
				if(sections[i].match(/following-sibling::(.*)$/))results.push([this.getFollowingSibling,RegExp.$1.toLowerCase()]);
				else 
				if(sections[i].match(/preceding-sibling::(.*)$/))results.push([this.getPrecedingSibling,RegExp.$1.toLowerCase()]);
				else 
				if(sections[i].match(/self::(.*)$/))results.push([this.doQuery,["jpf.XPath.doXpathFunc('local-name', htmlNode) == '" + RegExp.$1 + "'"]]);
				else{
					var query = sections[i];
					var m =[query.match(/\(/g),query.match(/\)/g)];
					
					if(m[0]|| m[1]){
						while(! m[0]&& m[1]|| m[0]&& ! m[1]|| m[0].length != m[1].length){
							if(! sections[++ i])break;
							query += "/" + sections[i];
							m =[query.match(/\(/g),query.match(/\)/g)];
						}
					};
					results.push([this.doQuery,[this.compileQuery(query),true]])}
			};
			results[0][3]= isAbsolute;
			return results;
		}
		,compileQuery:function(code){
			var c = new jpf.CodeCompilation(code);
			return c.compile();
		}
		,doXpathFunc:function(type,arg1,arg2,arg3){
			switch(type){
				case "not":return ! arg1;
				case "position()":return num == arg1;
				case "format-number":return jpf.formatNumber(arg1);
				case "floor":return Math.floor(arg1);
				case "ceiling":return Math.ceil(arg1);
				case "starts-with":return arg1 ? arg1.substr(0,arg2.length)== arg2:false;
				case "string-length":return arg1 ? arg1.length:0;
				case "count":return arg1 ? arg1.length:0;
				case "last":return arg1 ? arg1[arg1.length - 1]:null;
				case "local-name":return arg1 ? arg1.tagName:"";
				case "substring":return arg1 && arg2 ? arg1.substring(arg2,arg3 || 0):"";
				case "contains":return arg1 && arg2 ? arg1.indexOf(arg2)> - 1:false;
				case "concat":
				for(var str = "",i = 1;i < arguments.length;i ++){
					if(typeof arguments[i]== "object"){
						str += getNodeValue(arguments[i][0]);
						continue;
					};
					str += arguments[i];
				};
				return str;
			}
		}
		,selectNodeExtended:function(sExpr,contextNode,match){
			var sResult = this.selectNodes(sExpr,contextNode);
			
			if(sResult.length == 0)return null;
			
			if(! match)return sResult[0];
			
			for(var i = 0;i < sResult.length;i ++){
				if(getNodeValue(sResult[i])== match)return sResult[i];
			};
			return null;
		}
		,selectNodes:function(sExpr,contextNode){
			if(! this.cache[sExpr])this.cache[sExpr]= this.compile(sExpr);
			
			if(typeof this.cache[sExpr]== "string"){
				if(this.cache[sExpr]== ".")return[contextNode];
				
				if(this.cache[sExpr]== "/")return[contextNode.nodeType == 9 ? contextNode:contextNode.ownerDocument.documentElement];
			};
			
			if(typeof this.cache[sExpr]== "string" && this.cache[sExpr]== ".")return[contextNode];
			var info = this.cache[sExpr][0];
			var rootNode =(info[3]&& ! contextNode.nodeType == 9 ? contextNode.ownerDocument.documentElement:contextNode);
			var sResult =[];
			info[0](rootNode,info[1],this.cache[sExpr],1,0,sResult);
			return sResult;
		}
	};
	function getNodeValue(sResult){
		if(sResult.nodeType == 1)return sResult.firstChild ? sResult.firstChild.nodeValue:"";
		
		if(sResult.nodeType > 1 || sResult.nodeType < 5)return sResult.nodeValue;
		return sResult;
	};
	jpf.CodeCompilation = function(code){
		this.data ={
			F:[],S:[],I:[],X:[]};
		this.compile = function(){
			code = code.replace(/ or /g," || ");
			code = code.replace(/ and /g," && ");
			code = code.replace(/!=/g,"{}");
			code = code.replace(/=/g,"==");
			code = code.replace(/\{\}/g,"!=");
			this.tokenize();
			this.insert();
			return code;
		};
		this.tokenize = function(){
			var data = this.data.F;
			code = code.replace(/(format-number|contains|substring|local-name|last|node|position|round|starts-with|string|string-length|sum|floor|ceiling|concat|count|not)\s*\(/g,function(d,match){return(data.push(match)- 1)+ "F_";
			}
		);
			var data = this.data.S;
			code = code.replace(/'([^']*)'/g,function(d,match){return(data.push(match)- 1)+ "S_";
			}
		);
			code = code.replace(/"([^"]*)"/g,function(d,match){return(data.push(match)- 1)+ "S_";
			}
		);
			var data = this.data.X;
			code = code.replace(/(^|\W|\_)([\@\.\/A-Za-z][\.\@\/\w]*(?:\(\)){0,1})/g,function(d,m1,m2){return m1 +(data.push(m2)- 1)+ "X_";
			}
		);
			code = code.replace(/(\.[\.\@\/\w]*)/g,function(d,m1,m2){return(data.push(m1)- 1)+ "X_";
			}
		);
			var data = this.data.I;
			code = code.replace(/(\d+)(\W)/g,function(d,m1,m2){return(data.push(m1)- 1)+ "I_" + m2;
			}
		);
		};
		this.insert = function(){
			var data = this.data;
			code = code.replace(/(\d+)X_\s*==\s*(\d+S_)/g,function(d,nr,str){return "jpf.XPath.selectNodeExtended('" + data.X[nr].replace(/'/g,"\\'")+ "', htmlNode, " + str + ")";
			}
		);
			code = code.replace(/(\d+)([FISX])_/g,function(d,nr,type){var value = data[type][nr];
				
				if(type == "F"){
					return "jpf.XPath.doXpathFunc('" + value + "', ";
				}
				else 
				if(type == "S"){
					return "'" + value + "'";
				}
				else 
				if(type == "I"){
					return value;
				}
				else 
				if(type == "X"){
					return "jpf.XPath.selectNodeExtended('" + value.replace(/'/g,"\\'")+ "', htmlNode)";
				}
			}
		);
		}
	}

}

/*FILEHEAD(/in/Library/Core/Kernel/browsers/XSLT.js)SIZE(8100)TIME(1203729557368)*/
function runXslt(){
	jpf.XSLTProcessor = function(){
		this.templates ={
		};
		this.p ={
			"value-of":function(context,xslNode,childStack,result){
				var xmlNode = jpf.XPath.selectNodes(xslNode.getAttribute("select"),context)[0];
				
				if(! xmlNode)value = "";
				else 
				if(xmlNode.nodeType == 1)value = xmlNode.firstChild ? xmlNode.firstChild.nodeValue:"";
				else value = typeof xmlNode == "object" ? xmlNode.nodeValue:xmlNode;
				result.appendChild(this.xmlDoc.createTextNode(value));
			}
			,"copy-of":function(context,xslNode,childStack,result){
				var xmlNode = jpf.XPath.selectNodes(xslNode.getAttribute("select"),context)[0];
				
				if(xmlNode)result.appendChild(jpf.canImportNode ? result.ownerDocument.importNode(xmlNode,true):xmlNode.cloneNode(true));
			}
			,"if":function(context,xslNode,childStack,result){
				if(jpf.XPath.selectNodes(xslNode.getAttribute("test"),context)[0]){
					this.parseChildren(context,xslNode,childStack,result);
				}
			}
			,"for-each":function(context,xslNode,childStack,result){
				var nodes = jpf.XPath.selectNodes(xslNode.getAttribute("select"),context);
				
				for(var i = 0;i < nodes.length;i ++){
					this.parseChildren(nodes[i],xslNode,childStack,result);
				}
			}
			,"choose":function(context,xslNode,childStack,result){
				var nodes = xslNode.childNodes;
				
				for(var i = 0;i < nodes.length;i ++){
					if(! nodes[i].tagName)continue;
					
					if(nodes[i][jpf.TAGNAME]== "otherwise" || nodes[i][jpf.TAGNAME]== "when" && jpf.XPath.selectNodes(nodes[i].getAttribute("test"),context)[0])return this.parseChildren(context,nodes[i],childStack[i][2],result);
				}
			}
			,"output":function(context,xslNode,childStack,result){
			}
		,"param":function(context,xslNode,childStack,result){
			}
		,"attribute":function(context,xslNode,childStack,result){
				var nres = this.xmlDoc.createDocumentFragment();
				this.parseChildren(context,xslNode,childStack,nres);
				result.setAttribute(xslNode.getAttribute("name"),nres.xml);
			}
			,"apply-templates":function(context,xslNode,childStack,result){
				if(! xslNode){
					var t = this.templates["/"]|| this.templates[context.tagName];
					
					if(t)this.parseChildren(t == this.templates["/"]? context.ownerDocument:context,t[0],t[1],result);
				}
				else 
				if(xslNode.getAttribute("select")){
					var t = this.templates[xslNode.getAttribute("select")];
					
					if(t){
						if(xslNode.getAttribute("select")== "/")return alert("Something went wrong. The / template was executed as a normal template");
						var nodes = context.selectNodes(xslNode.getAttribute("select"));
						
						for(var i = 0;i < nodes.length;i ++){
							this.parseChildren(nodes[i],t[0],t[1],result);
						}
					}
				}
				else 
				if(xslNode.getAttribute("name")){
					var t = this.templates[xslNode.getAttribute("name")];
					
					if(t)this.parseChildren(context,t[0],t[1],result);
				}
				else{
					var ncontext = context.cloneNode(true);
					var nres = this.xmlDoc.createDocumentFragment();
					var nodes = ncontext.childNodes;
					
					for(var tName,i = nodes.length - 1;i >= 0;i --){
						if(nodes[i].nodeType == 3 || nodes[i].nodeType == 4){
							continue;
						};
						
						if(! nodes[i].nodeType == 1)continue;
						var n = nodes[i];
						
						for(tName in this.templates){
							if(tName == "/")continue;
							var t = this.templates[tName];
							var snodes = n.selectNodes("self::" + tName);
							
							for(var j = snodes.length - 1;j >= 0;j --){
								var s = snodes[j],p = s.parentNode;
								this.parseChildren(s,t[0],t[1],nres);
								
								if(nres.childNodes){
									for(var k = nres.childNodes.length - 1;k >= 0;k --){
										p.insertBefore(nres.childNodes[k],s);
									}
								};
								p.removeChild(s);
							}
						};
						
						if(n.parentNode){
							var p = n.parentNode;
							this.p["apply-templates"].call(this,n,xslNode,childStack,nres);
							
							if(nres.childNodes){
								for(var k = nres.childNodes.length - 1;k >= 0;k --){
									p.insertBefore(nres.childNodes[k],n);
								}
							};
							p.removeChild(n);
						}
					};
					
					for(var i = ncontext.childNodes.length - 1;i >= 0;i --){
						result.insertBefore(ncontext.childNodes[i],result.firstChild);
					}
				}
			}
			,cache:{
			}
		,"import":function(context,xslNode,childStack,result){
				var file = xslNode.getAttribute("href");
				
				if(! this.cache[file]){
					var data = new jpf.http().get(file,false,true);
					this.cache[file]= data;
				}
			}
			,"include":function(context,xslNode,childStack,result){
			}
		,"when":function(){
			}
		,"otherwise":function(){
			}
		,"copy-clone":function(context,xslNode,childStack,result){
				result = result.appendChild(jpf.canImportNode ? result.ownerDocument.importNode(xslNode,false):xslNode.cloneNode(false));
				
				if(result.nodeType == 1){
					for(var i = 0;i < result.attributes.length;i ++){
						var blah = result.attributes[i].nodeValue;
						
						if(! jpf.isSafariOld && result.attributes[i].nodeName.match(/^xmlns/))continue;
						result.attributes[i].nodeValue = result.attributes[i].nodeValue.replace(/\{([^\}]+)\}/g,function(m,xpath){var xmlNode = jpf.XPath.selectNodes(xpath,context)[0];
							
							if(! xmlNode)value = "";
							else 
							if(xmlNode.nodeType == 1)value = xmlNode.firstChild ? xmlNode.firstChild.nodeValue:"";
							else value = typeof xmlNode == "object" ? xmlNode.nodeValue:xmlNode;
							return value;
						}
					);
						result.attributes[i].nodeValue;
					}
				};
				this.parseChildren(context,xslNode,childStack,result);
			}
		};
		this.parseChildren = function(context,xslNode,childStack,result){
			if(! childStack)return;
			
			for(var i = 0;i < childStack.length;i ++){
				childStack[i][0].call(this,context,childStack[i][1],childStack[i][2],result);
			}
		};
		this.compile = function(xslNode){
			var nodes = xslNode.childNodes;
			
			for(var stack =[],i = 0;i < nodes.length;i ++){
				if(nodes[i].nodeType != 1 && nodes[i].nodeType != 3 && nodes[i].nodeType != 4)continue;
				
				if(nodes[i][jpf.TAGNAME]== "template"){
					this.templates[nodes[i].getAttribute("match")|| nodes[i].getAttribute("name")]=[nodes[i],this.compile(nodes[i])];
				}
				else 
				if(nodes[i][jpf.TAGNAME]== "stylesheet"){
					this.compile(nodes[i])}
				else 
				if(nodes[i].prefix == "xsl"){
					var func = this.p[nodes[i][jpf.TAGNAME]];
					
					if(! func)alert("xsl:" + nodes[i][jpf.TAGNAME]+ " is not supported at this time on this platform");
					else stack.push([func,nodes[i],this.compile(nodes[i])]);
				}
				else{
					stack.push([this.p["copy-clone"],nodes[i],this.compile(nodes[i])]);
				}
			};
			return stack;
		};
		this.importStylesheet = function(xslDoc){
			this.xslDoc = xslDoc.nodeType == 9 ? xslDoc.documentElement:xslDoc;
			xslStack = this.compile(xslDoc);
			this.xslStack =[[this.p["apply-templates"],null]];
		};
		this.transformToFragment = function(doc,newDoc){
			this.xmlDoc = newDoc.nodeType != 9 ? newDoc.ownerDocument:newDoc;
			var docfrag = this.xmlDoc.createDocumentFragment();
			
			if(! jpf.isSafariOld && doc.nodeType == 9)doc = doc.documentElement;
			var result = this.parseChildren(doc,this.xslDoc,this.xslStack,docfrag);
			return docfrag;
		}
	};
	self.XSLTProcessor = jpf.XSLTProcessor;
}

/*FILEHEAD(/in/Library/Core/Kernel/Class.js)SIZE(14232)TIME(1203729580556)*/
jpf.Class = function(){
	this.__jmlLoaders =[];
	this.__addJmlLoader = function(func){
		if(! this.__jmlLoaders)func.call(this,this.jml);
		else this.__jmlLoaders.push(func);
	};
	this.__jmlDestroyers =[];
	this.__addJmlDestroyer = function(func){
		this.__jmlDestroyers.push(func);
	};
	this.__regbase = 0;
	this.hasFeature = function(test){
		return this.__regbase & test};
	var boundObjects ={
	};
	var myBoundPlaces ={
	};
	this.bindProperty = function(myProp,bObject,bProp,strDynamicProp){
		if(! boundObjects[myProp])boundObjects[myProp]={
		};
		
		if(! boundObjects[myProp][bObject.uniqueId])boundObjects[myProp][bObject.uniqueId]=[];
		
		if(boundObjects[myProp][bObject.uniqueId].contains(bProp)){
			throw new Error(0,jpf.formErrorString(0,this,"Property-binding","Already bound " + bObject.name + "." + bProp + " to " + myProp));
		};
		
		if(strDynamicProp)boundObjects[myProp][bObject.uniqueId].push([bProp,strDynamicProp]);
		else boundObjects[myProp][bObject.uniqueId].pushUnique([bProp]);
		bObject.handlePropSet(bProp,strDynamicProp ? eval(strDynamicProp):this[myProp]);
	};
	this.unbindProperty = function(myProp,bObject,bProp){
		boundObjects[myProp][bObject.uniqueId].remove(bProp);
	};
	this.unbindAllProperties = function(){
		var prop;
		
		for(prop in myBoundPlaces){
			if(myBoundPlaces[prop]&& typeof myBoundPlaces[prop]!= "function"){
				for(var i = 0;i < myBoundPlaces[prop].length;i ++){
					if(! self[myBoundPlaces[prop][i][0]])continue;
					self[myBoundPlaces[prop][i][0]].unbindProperty(myBoundPlaces[prop][i][1],this,prop);
				}
			}
		}
	};
	this.getAvailableProperties = function(){
		return this.__supportedProperties.copy();
	};
	this.setDynamicProperty = function(prop,pValue){
		var pStart = pValue.substr(0,1);
		
		if(myBoundPlaces[prop]){
			for(var i = 0;i < myBoundPlaces[prop].length;i ++){
				self[myBoundPlaces[prop][i][0]].unbindProperty(myBoundPlaces[prop][i][1],this,prop);
			}
		};
		
		if(pStart == "["){
			var p = pValue.substr(1,pValue.length - 2).split(".");
			
			if(! self[p[0]])return;
			
			if(! p[1])p[1]= self[p[0]].__supportedProperties[0];
			self[p[0]].bindProperty(p[1],this,prop);
			myBoundPlaces[prop]=[p];
			this.bindProperty(prop,self[p[0]],p[1]);
		}
		else 
		if(pStart == "{"){
			var p,matches ={
			}
		,pValue = pValue.substr(1,pValue.length - 2);
			pValue.replace(/["'](?:\\.|[^"']+)*["']|\/(?:\\.|[^\/\\]+)*\/|(?:\W|^)([a-z]\w+\.\w+)(?!\()(?:\W|$)/g,function(m,m1){if(m1)matches[m1]= true;
			}
		);
			pValue = pValue.replace(/\Wand\W/g,"&&").replace(/\Wor\W/g,"||");
			myBoundPlaces[prop]=[];
			
			for(p in matches){
				if(typeof matches[p]== "function")continue;
				var o = p.split(".");
				
				if(! self[o[0]]|| ! self[o[0]].bindProperty)continue;
				self[o[0]].bindProperty(o[1],this,prop,pValue);
				myBoundPlaces[prop].push(o);
			}
		}
		else this.handlePropSet(prop,pValue);
	};
	this.setProperty = function(prop,value,reqValue,forceOnMe){
		if(reqValue && ! value)return;
		
		if(this[prop]!== value){
			var oldvalue = this[prop];
			
			if(this.handlePropSet(prop,value,forceOnMe)=== false){
				this[prop]= oldvalue;
				return false;
			}
		};
		var nodes = boundObjects[prop];
		
		if(! nodes)return;
		var id,ovalue = value;
		
		for(id in nodes){
			if(jpf.isSafari &&(typeof nodes[id]!= "object" || ! nodes[id]))continue;
			
			for(var o = jpf.lookup(id),i = nodes[id].length - 1;i >= 0;-- i){
				try{
					value = nodes[id][i][1]? eval(nodes[id][i][1]):ovalue;
				}
				catch(e){
					throw new Error(0,jpf.formErrorString(0,this,"Property-binding","Could not execute binding test: " + nodes[id][i][1]));
				};
				
				if(o[nodes[id][i][0]]!= value)o.setProperty(nodes[id][i][0],value);
			}
		}
	};
	this.getProperty = function(prop){
		return this[prop];
	};
	var events_stack ={
	};
	this.dispatchEvent = function(eventName,data,e){
		var result,retValue;
		
		if(! e)e = new jpf.Event(eventName,data);
		
		if(! eventName)eventName = e.name;
		
		if(this.disabled)result = false;
		else{
			var arr = events_stack[eventName];
			
			if(arr && arr.length || this[eventName]){
				if(this[eventName])result = this[eventName].call(this,e);
				
				if(arr){
					for(var i = 0;i < arr.length;i ++){
						retValue = arr[i].call(this,e);
						
						if(retValue != undefined)result = retValue;
					}
				}
			}
		};
		
		if(e.canBubble()){
			var el = this.parentNode || jpf.document;
			retValue = el.dispatchEvent(eventName,null,e);
			
			if(retValue != undefined)result = retValue;
		};
		return e.returnValue !== undefined ? e.returnValue:result;
	};
	this.addEventListener = function(eventName,func){
		if(! events_stack[eventName])events_stack[eventName]=[];
		events_stack[eventName].pushUnique(func);
	};
	this.removeEventListener = function(eventName,func){
		if(events_stack[eventName])events_stack[eventName].remove(func);
	};
	this.hasEventListener = function(eventName){
		return events_stack[eventName]&& events_stack[eventName].length > 0;
	};
	this.destroy = function(){
		if(! this.uniqueId)return;
		
		if(this.__destroy)this.__destroy();
		
		for(var i = this.__jmlDestroyers.length - 1;i >= 0;i --)this.__jmlDestroyers[i].call(this);
		this.__jmlDestroyers = undefined;
		
		if(this.oExt && ! this.oExt.isNative && this.oExt.nodeType == 1){
			this.oExt.oncontextmenu = null;
			this.oExt.host = null;
		};
		
		if(this.oInt && ! this.oExt.isNative && this.oInt.nodeType == 1)this.oInt.host = null;
		this.jml = null;
		jpf.all[this.uniqueId]= null;
		this.uniqueId = null;
	};
	this.destroySelf = function(){
		if(! this.hasFeature)return;
		
		if(this.name)self[this.name]= null;
		
		if(this.hasFeature(__ANCHORING__))this.disableAnchoring();
		
		if(this.hasFeature(__ALIGNMENT__))this.disableAlignment();
		this.unbindAllProperties();
		
		if(this.dataParent)this.dataParent.parent.disconnect(this);
		
		if(this.hasFeature(__DATABINDING__)){
			this.unloadBindings();
			this.unloadActions();
		};
		
		if(this.hasFeature(__DRAGDROP__))this.unloadDragDrop();
		
		if(this.focussable)jpf.window.__removeFocus(this);
		
		if(this.hasFeature(__MULTILANG__))this.__removeEditable();
		
		if(this.hasFeature(__CACHE__))this.clearAllCache();
		
		if(this.childNodes){
			for(var i = 0;i < this.childNodes.length;i ++){
				if(this.childNodes[i].destroySelf)this.childNodes[i].destroySelf();
				else jpf.removeNode(this.childNodes[i].oExt);
			}
		};
		
		if(this.destroy)this.destroy();
	}

};

jpf.Event = function(name,data){
	this.name = name;
	jpf.extend(this,data);
	this.cancelBubble = false;
	this.canBubble = function(){
		return ! this.cancelBubble && this.bubbleEvents[this.name];
	}

};

jpf.Event.prototype.bubbleEvents ={
	"onerror":true};

/*FILEHEAD(/in/Library/Core/Kernel/Debug.js)SIZE(18960)TIME(1213630714271)*/

/*FILEHEAD(/in/Library/Core/Kernel/ECMAext.js)SIZE(8156)TIME(1203724026962)*/
jpf.parseUri = function(sourceUri){
	var uriPartNames =["source","protocol","authority","domain","port","path","directoryPath","fileName","query","anchor"];
	var uriParts = new RegExp("^(?:([^:/?#.]+):)?(?://)?(([^:/?#]*)(?::(\\d*))?)?((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[\\?#]|$)))*/?)?([^?#/]*))?(?:\\?([^#]*))?(?:#(.*))?").exec(sourceUri);
	var uri ={
	};
	
	for(var i = 0;i < 10;i ++){
		uri[uriPartNames[i]]=(uriParts[i]? uriParts[i]:"");
	};
	
	if(uri.directoryPath.length > 0){
		uri.directoryPath = uri.directoryPath.replace(/\/?$/,"/");
	};
	return uri;
};

jpf.extend = function(dest){
	for(var i = 1;i < arguments.length;i ++){
		var src = arguments[i];
		
		for(var prop in src)dest[prop]= src[prop];
	};
	return dest;
};

jpf.formatNumber = function(nr){
	var str = new String(Math.round(parseFloat(nr)* 100)/ 100).replace(/(\.\d?\d?)$/,function(m1){return m1.pad(3,"0",PAD_RIGHT)}

);
	
	if(str.indexOf(".")== - 1)str += ".00";
	return str;
};

jpf.unserialize = function(str){
	if(! str)return str;
	eval("var data = " + str);
	return data;
};

jpf.isNull = function(value){
	if(value)return false;
	return(value == null || ! String(value).length);
};

jpf.isArray = function(o){
	return(o && typeof o == "object" && o.length);
};

jpf.isTrue = function(c){
	return c === true || c === "true" || c === "on" || typeof c == "number" && c > 0 || c === "1";
};

jpf.isFalse = function(c){
	return c === false || c === "false" || c === "off" || c === 0 || c === "0";
};

jpf.isNot = function(c){
	return(! c && typeof c != "string" && c !== 0 ||(typeof c == "number" && ! isFinite(c)));
};

jpf.copyObject = function(o){
	var rv = new Object();
	
	for(prop in o)rv[prop]= o[prop];
	return rv;
};

jpf.copyArray = function(ar,Type){
	if(! ar)return ar;
	
	for(var car =[],i = 0;i < ar.length;i ++)car[i]= Type ? new Type(ar[i]):ar[i];
	return car;
};

jpf.getAbsolutePath = function(base,src){
	return src.match(/^\w+\:\/\//)? src:base + src;
};

jpf.removePathContext = function(base,src){
	if(! src)return "";
	
	if(src.indexOf(base)> - 1)return src.substr(base.length);
	return src;
};


if(! self.isFinite){
	function isFinite(val){
		return val + 1 != val;
	}

};

Array.prototype.copy = function(){
	var ar = new Array();
	
	for(var i = 0;i < this.length;i ++)ar[i]= this[i]&& this[i].copy ? this[i].copy():this[i];
	return ar;
};

Array.prototype.arrayAdd = function(){
	var s = this.copy();
	
	for(var i = 0;i < arguments.length;i ++){
		for(var j = 0;j < s.length;j ++){
			s[j]+= arguments[i][j];
		}
	};
	return s;
};

Array.prototype.equals = function(obj){
	for(var i = 0;i < this.length;i ++)
	if(this[i]!= obj[i])return false;
	return true;
};

Array.prototype.makeUnique = function(){
	var newArr =[];
	
	for(var i = 0;i < this.length;i ++)
	if(! newArr.contains(this[i]))newArr.push(this[i]);
	this.length = 0;
	
	for(var i = 0;i < newArr.length;i ++)this.push(newArr[i]);
};

Array.prototype.contains = function(obj){
	for(var i = 0;i < this.length;i ++)
	if(this[i]== obj)return true;
	return false;
};

Array.prototype.indexOf = function(obj){
	for(var i = 0;i < this.length;i ++)
	if(this[i]== obj)return i;
	return - 1;
};

Array.prototype.pushUnique = function(item){
	if(! this.contains(item))this.push(item);
};

Array.prototype.search = function(){
	for(var i = 0;i < arguments.length;i ++){
		if(typeof this[i]!= "array")continue;
		
		for(var j = 0;j < arguments.length;j ++){
			if(this[i][j]!= arguments[j])break;
			else 
			if(j == arguments.length - 1)return this[i];
		}
	}

};


if(! Function.prototype.call){
	Function.prototype.call = function(obj,arg1,arg2,arg3){
		obj.tf = this;
		var rv = obj.tf(arg1,arg2,arg3);
		obj.tf = null;
		return rv;
	}

};

Array.prototype.remove = function(obj){
	for(var i = 0;i < this.length;i ++){
		if(this[i]!= obj)continue;
		
		for(var j = i;j < this.length;j ++)this[j]= this[j + 1];
		this.length --;
		i --;
	}

};

Array.prototype.removeIndex = function(i){
	if(! this.length)return;
	
	for(var j = i;j < this.length;j ++)this[j]= this[j + 1];
	this.length --;
};

Array.prototype.insertIndex = function(obj,i){
	for(var j = this.length;j >= i;j --)this[j]= this[j - 1];
	this[i]= obj;
};

Array.prototype.invert = function(){
	var l = this.length - 1;
	
	for(var temp,i = 0;i < Math.ceil(0.5 * l);i ++){
		temp = this[i];
		this[i]= this[l - i];
		this[l - i]= temp;
	};
	return this;
};


if(! Array.prototype.push){
	Array.prototype.push = function(item){
		this[this.length]= item;
		return this.length;
	}

};


if(! Array.prototype.pop){
	Array.prototype.pop = function(item){
		var item = this[this.length - 1];
		delete this[this.length - 1];
		this.length --;
		return item;
	}

};


if(! Array.prototype.shift){
	Array.prototype.shift = function(){
		var item = this[0];
		
		for(var i = 0;i < this.length;i ++)this[i]= this[i + 1];
		this.length --;
		return item;
	}

};


if(! Array.prototype.join){
	Array.prototype.join = function(connect){
		for(var str = "",i = 0;i < this.length;i ++)str += this[i]+(i < this.length - 1 ? connect:"");
		return str;
	}

};

Math.hexlist = "0123456789ABCDEF";

Math.decToHex = function(value){
	var hex = this.floor(value / 16);
	hex =(hex > 15 ? this.decToHex(hex):this.hexlist.charAt(hex));
	return hex + "" + this.hexlist.charAt(this.floor(value % 16));
};

Math.hexToDec = function(value){
	if(!/(.)(.)/.exec(value.toUpperCase()))return false;
	return this.hexlist.indexOf(RegExp.$1)* 16 + this.hexlist.indexOf(RegExp.$2);
};

String.prototype.uCaseFirst = function(str){
	return this.substr(0,1).toUpperCase()+ this.substr(1)};

String.prototype.trim = function(){
	return this.replace(/\s*$/,"").replace(/^\s*/,"");
};

String.prototype.repeat = function(times){
	for(var out = "",i = 0;i < times;i ++)out += this;
	return out;
};

String.prototype.count = function(str){
	return this.split(str).length - 1;
};

String.prototype.pad = function(l,s,t){
	return s ||(s = " "),(l -= this.length)> 0 ?(s = new Array(Math.ceil(l / s.length)+ 1).join(s)).substr(0,t = ! t ? l:t == 1 ? 0:Math.ceil(l / 2))+ this + s.substr(0,l - t):this;
};

PAD_LEFT = 0;

PAD_RIGHT = 1;

PAD_BOTH = 2;

jpf.formatXML = function(output){
	output = output.trim();
	var lines = output.split("\n");
	
	for(var i = 0;i < lines.length;i ++)lines[i]= lines[i].trim();
	lines = lines.join("\n").replace(/\>\r\n/g,">").replace(/\>/g,">\n").replace(/\n\</g,"<").replace(/\</g,"\n<").split("\n");
	lines.removeIndex(0);
	lines.removeIndex(lines.length);
	
	for(var depth = 0,i = 0;i < lines.length;i ++)lines[i]= "\t".repeat((lines[i].match(/^\s*\<\//)? -- depth:(lines[i].match(/^\s*\<[^\?][^>]+[^\/]\>/)? depth ++:depth)))+ lines[i];
	return lines.join("\n");
};

jpf.formatJS = function(x){
	var d = 0;
	return x.replace(/;+/g,';').replace(/;}/g,'}').replace(/{;/g,'{').replace(/({)|(})|(;)/g,function(m,a,b,c){if(a)d ++;
		
		if(b)d --;
		var o = '';
		
		for(var i = 0;i < d;i ++)o += '\t\t';
		
		if(a)return '{\n' + o;
		
		if(b)return '\n' + o + '}';
		
		if(c)return ';\n' + o;
	}

).replace(/\>/g,'&gt;').replace(/\</g,'&lt;');
};

jpf.pasteWindow = function(str){
	var win = window.open("about:blank");
	win.document.write(str);
};

jpf.htmlentities = function(str){
	return str.replace(/</g,"&lt;");
};

jpf.html_entity_decode = function(str){
	return str.replace(/\&\#38;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&nbsp;/g," ");
}

/*FILEHEAD(/in/Library/Core/Kernel/History.js)SIZE(2905)TIME(1213534746630)*/
jpf.History ={
	inited:false,page:null,init:function(name){
		this.inited = true;
		this.hasChanged(name);
		
		if(jpf.isIE){
			var str = "<style>BODY, HTML{margin : 0;}h1{height : 100px;margin : 0;padding : 0;}</style><body><h1 id='" + name + "'>0</h1></body><script>var lastURL = -1;if(document.all){document.body.onscroll = checkUrl;}else{setInterval('checkUrl()', 200);}function checkUrl(){var nr=Math.round((document.all ? document.body : document.documentElement).scrollTop/100);top.jpf.History.hasChanged(document.getElementsByTagName('h1')[nr].id);lastURL = document.body.scrollTop;}checkUrl();</script>";
			
			if(top == self){
				document.body.insertAdjacentHTML("beforeend","<iframe name='nav' style2='position:absolute;left:10px;top:10px;height:100px;width:100px;z-index:1000' style='width:1px;height:1px;' src='about:blank'></iframe>");
				document.frames["nav"].document.open();
				document.frames["nav"].document.write(str);
				document.frames["nav"].document.close();
			};
			this.iframe = document.frames["nav"];
			this.timer = setInterval(function(){status = jpf.History.changingHash;
				
				if(! jpf.History.changingHash && location.hash != "#" + jpf.History.page){
					jpf.History.hasChanged(location.hash.replace(/^#/,""));
				}
			}
			,200);
		}
		else{
			jpf.History.lastUrl = location.href;
			this.timer = setInterval(function(){if(jpf.History.lastUrl == location.href)return;
				jpf.History.lastUrl = location.href;
				var page = location.href.replace(/^.*#(.*)$/,"$1");
				jpf.History.hasChanged(page);
			}
			,20);
		}
	}
	,addPoint:function(name,timed){
		if(this.changing || this.page == name || location.hash == "#" + name)return;
		
		if(jpf.isIE && ! timed)setTimeout(function(){jpf.History.addPoint(name,true);
		}
		,300);
		this.changePage(name);
		
		if(! this.inited)return this.init(name);
		
		if(jpf.isIE){
			var h = this.iframe.document.body.appendChild(this.iframe.document.createElement('h1'));
			h.id = name;
			h.innerHTML = this.length;
		};
		(jpf.isIE ? this.iframe:window).location.href = "#" + name;
		
		if(! jpf.isIE)History.lastUrl = location.href;
	}
	,changePage:function(page){
		if(jpf.isIE){
			this.page = page;
			this.changingHash = true;
			setTimeout(function(){location.hash = page;
				jpf.History.changingHash = false;
			}
			,300);
		}
	}
	,hasChanged:function(page){
		if(page == this.page)return;
		this.changePage(page);
		this.changing = true;
		
		if(this.onchange)this.onchange(page);
		this.changing = false;
	}

}

/*FILEHEAD(/in/Library/Core/Kernel/Patches.js)SIZE(16592)TIME(1203724557899)*/
jpf.compat ={
	maxWidth:0,maxHeight:0,getNumber:function(pos){
		return(/^\d+/.exec(pos)? parseInt(RegExp.$1):0)}
	,getBox:function(value){
		if(value == null ||(! parseInt(value)&& parseInt(value)!= 0))return[0,0,0,0];
		var x = value.split(" ");
		
		for(var i = 0;i < x.length;i ++)x[i]= parseInt(x[i])|| 0;
		switch(x.length){
			case 1:x[1]= x[0];
			x[2]= x[0];
			x[3]= x[0];
			break;
			case 2:x[2]= x[0];
			x[3]= x[1];
			break;
			case 3:x[3]= x[1];
			break;
		};
		return x;
	}
	,getNode:function(data,tree){
		var nc = 0;
		
		if(data != null){
			for(var i = 0;i < data.childNodes.length;i ++){
				if(data.childNodes[i].nodeType == 1){
					if(nc == tree[0]){
						data = data.childNodes[i];
						
						if(tree.length > 1){
							tree.shift();
							data = this.getNode(data,tree);
						};
						return data;
					};
					nc ++}
			}
		};
		return false;
	}
	,getFirstElement:function(xmlNode){
		return xmlNode.firstChild.nodeType == 1 ? xmlNode.firstChild:xmlNode.firstChild.nextSibling;
	}
	,getLastElement:function(xmlNode){
		return xmlNode.lastChild.nodeType == 1 ? xmlNode.lastChild:xmlNode.lastChild.previousSibling;
	}
	,getStyle:function(el,prop){
		if(typeof document.defaultView != "undefined" && typeof document.defaultView.getComputedStyle != "undefined"){
			var cStyle = document.defaultView.getComputedStyle(el,'');
			return ! cStyle ? "":cStyle.getPropertyValue(prop);
		};
		return el.currentStyle[prop];
	}
	,isInRect:function(oHtml,x,y){
		var pos = this.getAbsolutePosition(oHtml);
		
		if(x < pos[0]|| y < pos[1]|| x > oHtml.offsetWidth + pos[0]- 10 || y > oHtml.offsetHeight + pos[1]- 10)return false;
		return true;
	}
	,getWidthDiff:function(oHtml){
		return jpf.isIE ? Math.max(0,(parseInt(jpf.compat.getStyle(oHtml,"paddingLeft"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"paddingRight"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"borderLeftWidth"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"borderRightWidth"))|| 0)):Math.max(0,oHtml.offsetWidth - parseInt(jpf.compat.getStyle(oHtml,"width")));
	}
	,getHeightDiff:function(oHtml){
		return jpf.isIE ? Math.max(0,(parseInt(jpf.compat.getStyle(oHtml,"paddingTop"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"paddingBottom"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"borderTopWidth"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"borderBottomWidth"))|| 0)):Math.max(0,oHtml.offsetHeight - parseInt(jpf.compat.getStyle(oHtml,"height")));
	}
	,getDiff:function(oHtml){
		if(! jpf.isIE && oHtml.tagName == "INPUT")return[6,6];
		var pNode;
		
		if(! oHtml.offsetHeight){
			pNode = oHtml.parentNode;
			var nSibling = oHtml.nextSibling;
			document.body.appendChild(oHtml);
		};
		var diff = jpf.isIE ?[Math.max(0,(parseInt(jpf.compat.getStyle(oHtml,"paddingLeft"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"paddingRight"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"borderLeftWidth"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"borderRightWidth"))|| 0)),Math.max(0,(parseInt(jpf.compat.getStyle(oHtml,"paddingTop"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"paddingBottom"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"borderTopWidth"))|| 0)+(parseInt(jpf.compat.getStyle(oHtml,"borderBottomWidth"))|| 0))]:[Math.max(0,oHtml.offsetWidth - parseInt(jpf.compat.getStyle(oHtml,"width"))),Math.max(0,oHtml.offsetHeight - parseInt(jpf.compat.getStyle(oHtml,"height")))];
		
		if(pNode)pNode.insertBefore(oHtml,nSibling);
		return diff;
	}
	,getOverflowParent:function(o){
		var o = o.offsetParent;
		
		while(o &&(this.getStyle(o,"overflow")!= "hidden" || "absolute|relative".indexOf(this.getStyle(o,"position"))== - 1)){
			o = o.offsetParent;
		};
		return o || document.documentElement;
	}
	,getPositionedParent:function(o){
		var o = o.offsetParent;
		
		while(o && o.tagName.toLowerCase()!= "body" && "absolute|relative".indexOf(this.getStyle(o,"position"))== - 1){
			o = o.offsetParent;
		};
		return o || document.documentElement;
	}
	,getAbsolutePosition:function(o,refParent,inclSelf){
		var s,wt = inclSelf ? 0:o.offsetLeft,ht = inclSelf ? 0:o.offsetTop;
		var o = inclSelf ? o:o.offsetParent;
		
		while(o && o.tagName.toLowerCase()!= "body" && o != refParent){
			wt +=(jpf.isOpera ? 0:parseInt(this.getStyle(o,jpf.descPropJs ? "borderLeftWidth":"border-left-width"))|| 0)+ o.offsetLeft;
			ht +=(jpf.isOpera ? 0:parseInt(this.getStyle(o,jpf.descPropJs ? "borderTopWidth":"border-top-width"))|| 0)+ o.offsetTop;
			
			if(o.tagName.toLowerCase()== "table"){
				ht -= parseInt(o.border || 0)+ parseInt(o.cellSpacing || 0);
				wt -= parseInt(o.border || 0)+ parseInt(o.cellSpacing || 0)* 2;
			}
			else 
			if(o.tagName.toLowerCase()== "tr"){
				ht -=(cp = parseInt(o.parentNode.parentNode.cellSpacing));
				
				while(o.previousSibling)ht -=(o = o.previousSibling).offsetHeight + cp;
			};
			o = o.offsetParent;
		};
		return[wt,ht];
	}
	,gridPlace:function(jmlNode){
		var jNodes = jmlNode.childNodes;
		
		for(var nodes =[],i = 0;i < jNodes.length;i ++){
			if(jNodes[i].jml.getAttribute("left")|| jNodes[i].jml.getAttribute("top")|| jNodes[i].jml.getAttribute("right")|| jNodes[i].jml.getAttribute("bottom"))continue;
			nodes.push(jNodes[i].oExt);
		};
		
		if(nodes.length == 0)return;
		var parentnode = jmlNode.jml;
		var rowheight = parseInt(parentnode.getAttribute("cellheight"))|| 22;
		var between = parseInt(parentnode.getAttribute("cellpadding"))|| 2;
		var columns = parentnode.getAttribute("grid").split(/\s*,\s*/);
		var margin = parentnode.getAttribute("margin")? parentnode.getAttribute("margin").split(","):[0,0,0,0];
		
		for(var i = 0;i < margin.length;i ++)
		if(typeof margin[i]== "string")margin[i]= parseInt(margin[i]);
		var parentWidth = nodes[0].parentNode.offsetWidth;
		
		if(! parentWidth)return;
		var colWidths = new Array();
		var nColumns = columns.length;
		var totalWidth = 0;
		var assignedColumns = 0;
		var clientWidth = parentWidth -((nColumns - 1)* between + margin[3]+ margin[1]);
		
		for(var x = 0;x < nColumns;x ++){
			if(typeof columns[x]== "number")colWidths[x]= columns[x];
			else 
			if(typeof columns[x]== "string"){
				if(columns[x].indexOf("%")> - 1){
					colWidths[x]= Math.floor((parseInt(columns[x])* clientWidth)/ 100);
				}
				else colWidths[x]= parseInt(columns[x]);
			};
			
			if(colWidths[x]){
				assignedColumns ++;
				totalWidth += colWidths[x];
			}
		};
		
		if(assignedColumns < nColumns){
			var leftOver = Math.floor((parentWidth - totalWidth -((nColumns - 1)* between + margin[1]+ margin[3]))/(nColumns - assignedColumns));
			
			for(var x = 0;x < nColumns;x ++)
			if(! colWidths[x]&& colWidths[x]!== 0)colWidths[x]= leftOver;
		};
		var nTop = margin[0];
		var iNode = 0;
		
		for(var y = 0;y < nodes.length;y += nColumns){
			if(y)nTop += between;
			var maxHeight = rowheight;
			var oldHeight = maxHeight;
			var nLeft = margin[3];
			
			for(var x = 0;x < nColumns;x ++){
				if(! nodes[iNode])break;
				nodes[iNode].style.position = "absolute";
				nodes[iNode].style.top = nTop + "px";
				nodes[iNode].style.left = nLeft + "px";
				
				if(jNodes[iNode].jml.getAttribute("width")== null)nodes[iNode].style.width = Math.max(colWidths[x]-(jpf.compat.getWidthDiff(nodes[iNode])|| 0),0)+ "px";
				maxHeight = Math.max(jNodes[iNode].jml.getAttribute("autosize")!= "true" && ! jNodes[iNode].nonSizingHeight ? maxHeight:0,nodes[iNode].offsetHeight,jpf.compat.getStyle(nodes[iNode],"overflow")== "visible" ? nodes[iNode].scrollHeight:0);
				nLeft += Math.max(colWidths[x],0)+ between;
				iNode ++;
			};
			
			for(var x = 0;x < nColumns;x ++){
				var j = jNodes[iNode - x - 1];
				var h = nodes[iNode - x - 1];
				
				if(! j.nonSizingHeight && j.jml.getAttribute("autosize")!= "true" && j.jml.getAttribute("height")== null){
					h.style.height = Math.max(0,(maxHeight -(jpf.compat.getHeightDiff(h)|| 0)))+ "px";
				}
			};
			nTop += maxHeight;
		};
		
		if(jmlNode.jml.getAttribute("height")== null && jmlNode.jml.getAttribute("autosize")!= "false")jmlNode.oExt.style.height = Math.max(nTop + margin[2],0)+ "px";
	}
	,disable:function(o){
		o.innerHTML = "<span style='background: buttonshadow; filter: chroma(color=red) dropshadow(color=buttonhighlight, offx=1, offy=1); width: 100%; height: 100%;'>" + "<span style='filter: mask(color=red); width: 100%; height: 100%;'>" + o.innerHTML + "</span>" + "</span>";
	}
	,enable:function(o){
		o.innerHTML = o.innerHTML.replace(/^<.*?><.*?>(.*)<.*?><.*?>$/,"$1");
	}
	,initializeIframe:function(id,strInit){
		var doc = self.frames[id].document;
		doc.open();
		doc.write(strInit || "<html><head><style>BODY{margin:0px;border:thin;} DIV{display : inline;} *{-moz-box-sizing: border-box;}</style></head><body></body></html>");
		doc.close();
		
		if(! jpf.isIE)jpf.importClass(MozillaCompat,true,self.frames[id]);
		doc.body.obj = D.getElementById(id);
		doc.body.win = doc.win = self.frames[id];
		
		if(! jpf.isIE50)doc.body.obj.doc = doc;
		doc.body.obj.onresize = function(){
			this.doc.body.ll = null;
		};
		doc.onkeydown = function(e){
			if(! e)e = this.win.event;
			
			if(! this.ll)this.ll = jpf.compat.getAbsolutePosition(this.obj);
			return false;
		};
		doc.onmousedown = function(e){
			if(! e)e = this.win.event;
			
			if(document.body.onmousedown)D.body.onmousedown(e);
			
			if(document.onmousedown)D.onmousedown(e);
		};
		doc.onmouseup = function(e){
			if(! e)e = this.win.event;
			
			if(document.body.onmouseup)D.body.onmouseup(e);
			
			if(document.onmouseup)D.onmouseup(e);
		};
		doc.onclick = function(e){
			if(! e)e = this.win.event;
			
			if(document.body.onclick)D.body.onclick(e);
			
			if(document.onclick)D.onclick(e);
		};
		doc.body.oncontextmenu = function(e){
			if(! e)e = this.win.event;
			
			if(! this.ll)this.ll = jpf.compat.getAbsolutePosition(this.obj);
			var s = this.ll;
			q ={
				offsetX:e.offsetX,offsetY:e.offsetY,x:e.x + s[0],y:e.y + s[1],button:e.button,clientX:e.x + s[0],clientY:e.y + s[1],srcElement:e.srcElement,target:e.target,targetElement:e.targetElement};
			
			if(this.host && this.host.oncontextmenu)this.host.oncontextmenu(q);
			
			if(document.body.oncontextmenu)D.body.oncontextmenu(q);
			
			if(document.oncontextmenu)D.oncontextmenu(q);
			return false;
		};
		doc.body.onmouseover = function(e){
			this.ll = jpf.compat.getAbsolutePosition(this.obj);
		};
		doc.body.onmousemove = function(e){
			if(! e)e = this.win.event;
			
			if(! this.ll)this.ll = jpf.compat.getAbsolutePosition(this.obj);
			var s = this.ll;
			q ={
				offsetX:e.offsetX,offsetY:e.offsetY,x:e.x + s[0]- 4,y:e.y + s[1]- 4,button:e.button,clientX:e.x + s[0]- 4,clientY:e.y + s[1]- 4,srcElement:e.srcElement,target:e.target,targetElement:e.targetElement};
			
			if(this.obj.onmousemove)this.obj.onmousemove(q);
			
			if(document.body.onmousemove)D.body.onmousemove(q);
			
			if(document.onmousemove)D.onmousemove(q);
			return e.returnValue;
		};
		return self.frames[id];
	}

}

/*FILEHEAD(/in/Library/Core/Kernel/Print.js)SIZE(2505)TIME(1201631616203)*/
jpf.printServer ={
	lastContent:"",inited:false,init:function(){
		this.inited = true;
		this.contentShower = document.body.appendChild(document.createElement("DIV"));
		this.contentShower.id = "print_content";
		with(this.contentShower.style){
			width = "100%";
			height = "100%";
			backgroundColor = "white";
			zIndex = 100000000;
		};
		jpf.importCssString(document,"#print_content{display:none}");
		jpf.importCssString(document,"body #print_content, body #print_content *{display:block} body *{display:none}","print");
	}
	,printContent:function(v){
		this.setContent(v);
		this.print();
	}
	,setContent:function(v){
		if(! this.inited)this.init();
		this.lastContent = v;
		this.contentShower.innerHTML = v;
	}
	,print:function(){
		window.print();
	}

}

/*FILEHEAD(/in/Library/Core/Kernel/Sort.js)SIZE(6670)TIME(1202834161578)*/
jpf.Sort = function(xmlNode){
	var sort_intmask =["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000"];
	var isAscending,xpath,type,method,getNodes,dateFormat,dateReplace,sort_dateFmtStr,getValue;
	this.parseXml = function(xmlNode){
		isAscending = xmlNode.getAttribute("order")!= "descending";
		xpath = xmlNode.getAttribute("sort");
		getNodes = self[xmlNode.getAttribute("nodesmethod")];
		getValue = function(item){
			return jpf.getXmlValue(item,xpath);
		};
		
		if(xmlNode.getAttribute("type"))method = eval("sort_" + xmlNode.getAttribute("type"));
		
		if(xmlNode.getAttribute("sortmethod"))method = self[xmlNode.getAttribute("sortmethod")];
		
		if(! method)method = sort_alpha;
		var str = xmlNode.getAttribute("dateformat");
		
		if(str){
			sort_dateFmtStr = str;
			var result = str.match(/(D+|Y+|M+|h+|m+|s+)/g);
			
			if(result){
				for(var pos ={}
			,i = 0;i < result.length;i ++)pos[result[i].substr(0,1)]= i + 1;
				dateFormat = new RegExp(str.replace(/[^\sDYMhms]/g,'\\$1').replace(/YYYY/,"(\\d\\d\\d\\d)").replace(/(DD|YY|MM|hh|mm|ss)/g,"(\\d\\d)"));
				dateReplace = "$" + pos["M"]+ "/$" + pos["D"]+ "/$" + pos["Y"];
				
				if(pos["h"])dateReplace += " - $" + pos["h"]+ ":$" + pos["m"]+ ":$" + pos["s"];
			}
		}
	};
	
	if(xmlNode)this.parseXml(xmlNode);
	this.set = function(struct){
		var prop,x;
		
		for(prop in struct){
			x = struct[prop];
			eval(prop + " = x;");
		};
		
		if(struct["type"])method = eval("sort_" + struct["type"]);
		
		if(struct["method"])method = struct["method"];
		
		if(! method)method = sort_alpha;
	};
	this.findSortSibling = function(pNode,xmlNode){
		var nodes = getNodes ? getNodes(pNode,xmlNode):this.getTraverseNodes(pNode);
		
		for(var i = 0;i < nodes.length;i ++)
		if(! compare(xmlNode,nodes[i],true,sortSettings))return nodes[i];
		return null;
	};
	function sort_alpha(n){
		return n.toString().toLowerCase()};
	function sort_number(t){
		return(t.length < sort_intmask.length ? sort_intmask[sort_intmask.length - t.length]:"")+ t;
	};
	function sort_date(t,args){
		if(! sort_dateFormat ||(args && sort_dateFmtStr != args[0]))sort_dateFmt(args ? args[0]:"*");
		var d;
		
		if(sort_dateFmtStr == '*')d = Date.parse(t);
		else d =(new Date(t.replace(sort_dateFormat,sort_dateReplace))).getTime();
		t = "" + parseInt(d);
		
		if(t == "NaN")t = "0";
		return(t.length < sort_intmask.length ? sort_intmask[sort_intmask.length - t.length]:"")+ t;
	};
	this.apply = function(n,args,func,start,len){
		var sa =[],i = n.length;
		
		while(i --){
			var v = getValue(n[i]);
			
			if(n)sa[sa.length]={
				toString:function(){
					return this.v;
				}
				,pn:n[i],v:method(v,args,n[i])};
		};
		sa.sort();
		end = len ? Math.min(sa.length,start + len):sa.length;
		
		if(! start)start = 0;
		
		if(func){
			if(isAscending)
			for(i = start;i < end;i ++)f(i,end,sa[i].pn,sa[i].v);
			else 
			for(i = end - 1;i >= start;i --)f(end - i - 1,end,sa[i].pn,sa[i].v);
		}
		else{
			var res =[];
			
			if(isAscending)
			for(i = start;i < end;i ++)res[res.length]= sa[i].pn;
			else 
			for(i = end - 1;i >= start;i --)res[res.length]= sa[i].pn;
			return res;
		}
	}

}

/*FILEHEAD(/in/Library/Core/Node/Alignment.js)SIZE(2954)TIME(1213480425709)*/
__ALIGNMENT__ = 1 << 12;

jpf.Alignment = function(){
	this.__regbase = this.__regbase | __ALIGNMENT__;
	this.setAlignProperty = function(prop,value,purge){
		this.aData[prop]= value;
		
		if(purge)this.purgeAlignment();
	};
	var lastPosition,jmlNode = this;
	this.disableAlignment = function(purge){
		this.aData.prehide();
		
		if(purge)this.purgeAlignment();
	};
	this.aData = null;
	this.enableAlignment = function(purge){
		var x = this.jml;
		
		if(! this.aData){
			var pNode;
			
			if(x.getAttribute("align")){
				if(! this.parentNode.vbox){
					var vbox = this.parentNode.vbox = new jpf.vbox(this.pHtmlNode,"vbox");
					vbox.parentNode = this.parentNode;
					vbox.loadJML(jpf.XMLDatabase.getXml("<vbox margin='" +(this.pHtmlNode.getAttribute("margin")|| "0,0,0,0")+ "' />"),this.parentNode);
				}
			};
			var l = jpf.layoutServer.get(this.pHtmlNode);
			this.aData = jpf.layoutServer.parseXml(x,l,this);
			
			if(x.getAttribute("align"))this.parentNode.vbox.addAlignNode(this);
			else{
				this.aData.stackId = this.parentNode.aData.children.push(this.aData)- 1;
				this.aData.parent = this.parentNode.aData;
			}
		}
		else{
			this.aData.preshow();
		};
		
		if(purge)this.purgeAlignment();
	};
	this.purgeAlignment = function(){
		jpf.layoutServer.queue(this.pHtmlNode,true);
	};
	this.__addJmlLoader(function(x){this.dock = ! jpf.isFalse(x.getAttribute("dock"));
	}

);
}

/*FILEHEAD(/in/Library/Core/Node/Anchoring.js)SIZE(7241)TIME(1213480447662)*/
__ANCHORING__ = 1 << 13;

jpf.Anchoring = function(){
	this.__regbase = this.__regbase | __ANCHORING__;
	
	if(! this.oExt.getAttribute("id"))jpf.setUniqueHtmlId(this.oExt);
	var oHtmlDiff;
	this.disableAnchoring = function(activate){
		jpf.layoutServer.removeRule(this.pHtmlNode,this.uniqueId + "h");
		jpf.layoutServer.removeRule(this.pHtmlNode,this.uniqueId + "v");
		
		if(activate)this.purgeAnchoring();
	};
	this.enableAnchoring = function(activate){
		this.getDiff();
		var x = this.jml;
		this.setHorizontal(x.getAttribute("left"),x.getAttribute("right"),x.getAttribute("width"));
		this.setVertical(x.getAttribute("top"),x.getAttribute("bottom"),x.getAttribute("height"));
		
		if(activate)this.purgeAnchoring();
	};
	this.getDiff = function(){
		oHtmlDiff = jpf.compat.getDiff(this.oExt);
	};
	this.moveAnchoringRules = function(newPNode,updateNow){
		var rules =[jpf.layoutServer.getRules(this.pHtmlNode,this.uniqueId + "h"),jpf.layoutServer.getRules(this.pHtmlNode,this.uniqueId + "v")];
		this.disableAnchoring();
		
		if(updateNow)jpf.layoutServer.activateRules(this.pHtmlNode);
		jpf.layoutServer.setRules(newPNode,this.uniqueId + "h",rules[0]);
		jpf.layoutServer.setRules(newPNode,this.uniqueId + "v",rules[1]);
		
		if(updateNow)jpf.layoutServer.activateRules(newPNode);
	};
	function setPercentage(value,pValue){
		return(typeof value == "string" ? value.replace(/(\d+)\%/g,"((" + pValue + " * $1)/100)"):value);
	};
	this.setHorizontal = function(left,right,width,apply){
		var rules =[];
		var id = this.oExt.getAttribute("id");
		
		if(jpf.isGecko)id = "document.getElementById('" + id + "')";
		var pWidth =(this.oExt.parentNode == this.pHtmlDoc.body ?(jpf.isIE ? "document.documentElement.offsetWidth":"window.innerWidth"):id + ".parentNode.offsetWidth");
		var hordiff = oHtmlDiff[0];
		left = setPercentage(left,pWidth);
		right = setPercentage(right,pWidth);
		width = setPercentage(width,pWidth);
		
		if(left){
			if(parseInt(left)!= left)rules.push(id + ".style.left = (" + left + ") + 'px'");
			else this.oExt.style.left = left + "px";
		};
		
		if(! left && right){
			if(parseInt(right)!= right)rules.push(id + ".style.right = (" + right + ") + 'px'");
			else this.oExt.style.right = right + "px";
		};
		
		if(width){
			if(parseInt(width)!= width)rules.push(id + ".style.width = (" + width + " - " + hordiff + ") + 'px'");
			else this.oExt.style.width =(width - hordiff)+ "px";
		};
		
		if(right != null && left != null)rules.push(id + ".style.width = (" + pWidth + " - (" + right + ") - (" + left + ") - " + hordiff + ") + 'px'");
		else 
		if(right == null && left == null)rules.push(id + ".style.left = ((" + pWidth + " - " +(width || id + ".offsetWidth")+ ")/2) + 'px'");
		else 
		if(right != null)rules.push(id + ".style.left = (" + pWidth + " - " + right + " - " +(width || id + ".offsetWidth")+ ") + 'px'");
		this.oExt.style.position = "absolute";
		rules = 'try{' + rules.join(';}catch(e){};try{')+ ';}catch(e){};';
		jpf.layoutServer.setRules(this.pHtmlNode,this.uniqueId + "h",rules,true);
		
		if(apply){
			eval(rules);
			jpf.layoutServer.activateRules(this.pHtmlNode,true);
		}
	};
	this.setVertical = function(top,bottom,height,apply){
		var rules =[];
		var id = this.oExt.getAttribute("id");
		
		if(jpf.isGecko)id = "document.getElementById('" + id + "')";
		var pHeight =(this.oExt.parentNode == this.pHtmlDoc.body ?(jpf.isIE ? "document.documentElement.offsetHeight":"window.innerHeight"):id + ".parentNode.offsetHeight");
		var verdiff = oHtmlDiff[1];
		top = setPercentage(top,pHeight);
		bottom = setPercentage(bottom,pHeight);
		height = setPercentage(height,pHeight);
		
		if(top){
			if(parseInt(top)!= top)rules.push(id + ".style.top = (" + top + ") + 'px'");
			else this.oExt.style.top = top + "px";
		};
		
		if(! top && bottom){
			if(parseInt(bottom)!= bottom)rules.push(id + ".style.bottom = (" + bottom + ") + 'px'");
			else this.oExt.style.bottom = bottom + "px";
		};
		
		if(height){
			if(parseInt(height)!= height)rules.push(id + ".style.height = (" + height + " - " + verdiff + ") + 'px'");
			else this.oExt.style.height =(height - verdiff)+ "px";
		};
		
		if(bottom != null && top != null)rules.push(id + ".style.height = (" + pHeight + " - (" + bottom + ") - (" + top + ") - " + verdiff + ") + 'px'");
		else 
		if(bottom == null && top == null)rules.push(id + ".style.top = ((" + pHeight + " - " +(height || id + ".offsetHeight")+ ")/2) + 'px'");
		else 
		if(bottom != null)rules.push(id + ".style.top = (" + pHeight + " - " + bottom + " - " +(height || id + ".offsetHeight")+ ") + 'px'");
		this.oExt.style.position = "absolute";
		var rules = 'try{' + rules.join(';}catch(e){};try{')+ ';}catch(e){};';
		jpf.layoutServer.setRules(this.pHtmlNode,this.uniqueId + "v",rules,true);
		
		if(apply){
			eval(rules);
			jpf.layoutServer.activateRules(this.pHtmlNode,true);
		}
	};
	this.purgeAnchoring = function(){
		jpf.layoutServer.queue(this.pHtmlNode);
	}

}

/*FILEHEAD(/in/Library/Core/Node/Cache.js)SIZE(7285)TIME(1203729677149)*/
__CACHE__ = 1 << 2;

jpf.Cache = function(){
	var cache ={
	};
	this.caching = true;
	this.__regbase = this.__regbase | __CACHE__;
	this.getCache = function(id){
		if(id == this.cacheID)return false;
		
		if(! cache[id])return false;
		
		if(this.cacheID)this.clear(true);
		var fragment = cache[id];
		this.documentId = fragment.documentId;
		this.cacheID = id;
		this.XMLRoot = fragment.XMLRoot;
		this.clearCacheItem(id);
		this.__setCurrentFragment(fragment);
		return true;
	};
	this.setCache = function(id,fragment){
		if(! this.caching)return;
		cache[id]= fragment;
	};
	this.getNodeFromCache = function(id){
		var node = this.__findNode(null,id);
		
		if(node)return node;
		
		for(prop in cache){
			if(cache[prop]&& cache[prop].nodeType){
				var node = this.__findNode(cache[prop],id);
				
				if(node)return node;
			}
		};
		return null;
	};
	this.getCacheItemByHtmlId = function(id){
		var node = this.__findNode(null,id);
		
		if(node)return this.oInt;
		
		for(prop in cache){
			if(cache[prop]&& cache[prop].nodeType){
				var node = this.__findNode(cache[prop],id);
				
				if(node)return cache[prop];
			}
		};
		return null;
	};
	this.clear = function(nomsg,do_event){
		if(this.clearSelection)this.clearSelection(null,! do_event);
		
		if(this.caching){
			var fragment = this.__getCurrentFragment();
			
			if(! fragment)return;
			fragment.documentId = this.documentId;
			fragment.XMLRoot = this.XMLRoot;
		}
		else this.oInt.innerHTML = "";
		
		if(! nomsg)this.__setClearMessage(this.msg);
		else 
		if(this.__removeClearMessage)this.__removeClearMessage();
		
		if(this.caching &&(this.cacheID || this.XMLRoot))this.setCache(this.cacheID || this.XMLRoot.getAttribute(jpf.XMLDatabase.xmlIdTag)|| "doc" + this.XMLRoot.getAttribute(jpf.XMLDatabase.xmlDocTag),fragment);
		this.documentId = null;
		this.XMLRoot = null;
		this.cacheID = null;
		this.dataset ={
			set:{
			}
		,seq:[]};
	};
	this.clearAllTraverse = function(){
		if(this.clearSelection)this.clearSelection(null,true);
		this.oInt.innerHTML = "";
		this.__setClearMessage(this.msg);
		this.dataset ={
			set:{
			}
		,seq:[]};
	};
	this.clearCacheItem = function(id,remove){
		cache[id].documentId = null;
		cache[id].cacheID = null;
		cache[id].XMLRoot = null;
		
		if(remove)jpf.removeNode(cache[id]);
		cache[id]= null;
	};
	this.clearAllCache = function(){
		for(prop in cache){
			if(cache[prop])this.clearCacheItem(prop,true);
		}
	};
	this.getCacheItem = function(id){
		return cache[id];
	};
	this.__addJmlLoader(function(x){this.caching = x.getAttribute("caching")!= "false";
	}

);
	
	if(this.hasFeature(__MULTISELECT__))this.inherit(jpf.MultiselectCache);
};

jpf.MultiselectCache = function(){
	this.__getCurrentFragment = function(){
		var fragment = jpf.hasDocumentFragment ? document.createDocumentFragment():new DocumentFragment();
		
		while(this.oInt.childNodes.length){
			fragment.appendChild(this.oInt.childNodes[0]);
		};
		fragment.dataset = this.dataset;
		return fragment;
	};
	this.__setCurrentFragment = function(fragment){
		jpf.hasDocumentFragment ? this.oInt.appendChild(fragment):fragment.reinsert(this.oInt);
		this.dataset = fragment.dataset;
		
		if(! jpf.window.isFocussed(this))this.blur();
	};
	this.__findNode = function(cacheNode,id){
		if(! cacheNode)return this.pHtmlDoc.getElementById(id);
		return cacheNode.getElementById(id);
	};
	this.__setClearMessage = function(msg){
		var xmlEmpty = this.__getLayoutNode("Empty");
		
		if(! xmlEmpty)return;
		var oEmpty = jpf.XMLDatabase.htmlImport(xmlEmpty,this.oInt);
		var empty = this.__getLayoutNode("Empty","caption",oEmpty);
		
		if(empty)jpf.XMLDatabase.setNodeValue(empty,msg || "");
		
		if(oEmpty)oEmpty.setAttribute("id","empty" + this.uniqueId);
	};
	this.__removeClearMessage = function(){
		var oEmpty = document.getElementById("empty" + this.uniqueId);
		
		if(oEmpty)oEmpty.parentNode.removeChild(oEmpty);
	}

}

/*FILEHEAD(/in/Library/Core/Node/DataBinding.js)SIZE(71109)TIME(1213631986427)*/
__DATABINDING__ = 1 << 1;

jpf.DataBinding = function(){
	var loadqueue;
	var __XMLOnload =[];
	var __XMLSelect =[];
	var __XMLChoice =[];
	this.__regbase = this.__regbase | __DATABINDING__;
	this.mainBind = "value";
	var sortObj;
	this.parseTraverse = function(xmlNode){
		this.ruleTraverse = xmlNode.getAttribute("select");
		sortObj = xmlNode.getAttribute("sort")? new jpf.Sort(xmlNode):null;
	};
	this.setTraverseRule = function(str){
		var tNode = this.bindingRules["traverse"][0];
		tNode.setAttribute("select",str);
		this.parseTraverse(tNode);
		this.reload();
	};
	this.getTraverseNodes = function(xmlNode){
		if(sortObj){
			var nodes = jpf.XMLDatabase.getArrayFromNodelist((xmlNode || this.XMLRoot).selectNodes(this.ruleTraverse));
			return sortObj.apply(nodes);
		};
		return(xmlNode || this.XMLRoot).selectNodes(this.ruleTraverse);
	};
	this.getFirstTraverseNode = function(xmlNode){
		return(xmlNode || this.XMLRoot).selectSingleNode(this.ruleTraverse);
	};
	this.getLastTraverseNode = function(xmlNode){
		var nodes = this.getTraverseNodes(xmlNode || this.XMLRoot);
		return nodes[nodes.length - 1];
	};
	this.isTraverseNode = function(xmlNode){
		var nodes = this.getTraverseNodes(this.getTraverseParent(xmlNode)|| this.XMLRoot);
		
		for(var i = 0;i < nodes.length;i ++){
			if(nodes[i]== xmlNode)return true;
		};
		return false;
	};
	this.getNextTraverseSelected = function(xmlNode,up,count){
		if(! xmlNode)var xmlNode = this.value;
		
		if(! count)count = 1;
		var i = 0,nodes = this.getTraverseNodes(this.getTraverseParent(xmlNode)|| this.XMLRoot);
		
		while(nodes[i]&& nodes[i]!= xmlNode)i ++;
		var node = up == null ? nodes[i + count]|| nodes[i - count]:(up ? nodes[i + count]:nodes[i - count]);
		return node || arguments[2]&&(i < count ||(i + 1)> Math.floor(nodes.length / count)* count)? node:(up ? nodes[nodes.length - 1]:nodes[0]);
	};
	this.getNextTraverse = function(xmlNode,up,count){
		if(! count)count = 1;
		
		if(! xmlNode)xmlNode = this.value;
		var i = 0,nodes = this.getTraverseNodes(this.getTraverseParent(xmlNode)|| this.XMLRoot);
		
		while(nodes[i]&& nodes[i]!= xmlNode)i ++;
		return nodes[i +(up ? - 1 * count:count)];
	};
	this.getTraverseParent = function(xmlNode){
		if(! xmlNode.parentNode || xmlNode == this.XMLRoot)return false;
		var x,id = xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag);
		
		if(! id){
			xmlNode.setAttribute(jpf.XMLDatabase.xmlIdTag,"temp");
			id = "temp";
		};
		
		if(jpf.isSafari){
			var y = this.ruleTraverse.split("\|");
			
			for(var i = 0;i < y.length;i ++){
				x = xmlNode.selectSingleNode("ancestor::node()[(" + y[i]+ "/@" + jpf.XMLDatabase.xmlIdTag + "='" + id + "')]");
				break;
			}
		}
		else{
			x = xmlNode.selectSingleNode("ancestor::node()[((" + this.ruleTraverse + ")/@" + jpf.XMLDatabase.xmlIdTag + ")='" + id + "']");
		};
		
		if(id == "temp")xmlNode.removeAttribute(jpf.XMLDatabase.xmlIdTag);
		return x;
	};
	this.getMainBindXpath = function(){
		if(this.hasFeature(__MULTIBINDING__))return this.getSelectionSmartBinding().getMainBindXpath();
		var m = this.getModel(true);
		return(m && m.connect ? m.connect.select + "/":(this.dataParent ? this.dataParent.xpath + "/":""))+ this.smartBinding.bindings[this.mainBind][0].getAttribute("select");
	};
	this.isBoundComplete = function(){
		if(! this.smartBinding)return true;
		
		if(! this.XMLRoot)return false;
		
		if(this.hasFeature(__MULTIBINDING__)&& ! this.getSelectionSmartBinding().XMLRoot)return false;
		return true;
	};
	this.query = function(xpath){
		return jpf.getXmlValue(this.XMLRoot,xpath);
	};
	this.queryArray = function(xpath){
		return jpf.getXmlValues(this.XMLRoot,xpath);
	};
	this.traverseNode = function(node){
		var nodes = node.parentNode.selectNodes(this.ruleTraverse);
		
		for(var i = 0;i < nodes.length;i ++)
		if(nodes[i]== node)return true;
		return false;
	};
	this.loadBindings = function(rules,node){
		if(this.bindingRules)this.unloadBindings();
		this.bindingRules = rules;
		
		if(this.bindingRules["traverse"])this.parseTraverse(this.bindingRules["traverse"][0]);
		
		if(this.__loaddatabinding)this.__loaddatabinding();
		
		if(loadqueue){
			this.load(loadqueue[0],loadqueue[1]);
			loadqueue = null;
		}
	};
	this.unloadBindings = function(){
		if(this.__unloaddatabinding)this.__unloaddatabinding();
		var node = this.xmlBindings;
		
		if(! node || ! node.getAttribute("connect"))return;
		
		try{
			var o = eval(node.getAttribute("connect"));
			o.disconnect(this,node.getAttribute("type"));
		}
		catch(e){
		};
		this.bindingRules = null;
		return this.uniqueId;
	};
	this.loadActions = function(rules,node){
		if(this.actionRules)this.unloadActions();
		this.actionRules = rules;
		
		if(node &&(jpf.isTrue(node.getAttribute("transaction"))|| node.selectSingleNode("starttransaction|rollback|update"))){
			if(! this.hasFeature(__TRANSACTION__))this.inherit(jpf.Transaction);
			
			if(! this.__ActionTracker)this.__ActionTracker = new jpf.ActionTracker(this);
			this.__ActionTracker.realtime = isTrue(node.getAttribute("realtime"));
			this.defaultMode = node.getAttribute("mode")|| "update";
			this.caching = false;
		}
	};
	this.getActionTracker = function(ignoreMe){
		if(! jpf.JmlDomAPI)return jpf.window.__ActionTracker;
		var pNode = this,tracker = ignoreMe ? null:this.__ActionTracker;
		
		if(! tracker && this.connectId)tracker = self[this.connectId].__ActionTracker;
		
		while(! tracker){
			if(! pNode.parentNode)return jpf.window.__ActionTracker;
			tracker =(pNode = pNode.parentNode).__ActionTracker;
		};
		return tracker;
	};
	this.unloadActions = function(){
		this.xmlActions = null;
		this.actionRules = null;
		
		if(this.__ActionTracker){
			this.__ActionTracker = null;
		}
	};
	this.executeAction = function(atAction,args,action,xmlNode,noevent,contextNode){
		if(this.disabled)return;
		var id,rules = this.actionRules ? this.actionRules[action]:(! action.match(/Change|Select/)&& jpf.appsettings.autoDisableActions ? false:[]);
		
		if(! rules)return false;
		
		for(var node = null,i = 0;i <(rules.length || 1);i ++){
			if(! rules[i]|| ! rules[i].getAttribute("select")|| xmlNode.selectSingleNode(rules[i].getAttribute("select"))){
				if(! noevent){
					var eventres;
					
					if((evntres = this.dispatchEvent("onbefore" + action.toLowerCase(),{arguments:args}
				))=== false)return false;
					
					if(typeof evntres == "object" || typeof evntres == "array"){
						atAction = evntres[0];
						args = evntres[1];
					}
				};
				
				if(typeof atAction == "string")id = this.getActionTracker().execute(atAction,args,rules[i],this,contextNode);
				else 
				if(rules[i]){
					if(typeof atAction == "function")atAction.call(this);
					
					if(rules[i])new jpf.UndoData("",rules[i],args,this,contextNode).saveChange(false,this.getActionTracker());
				};
				this.dispatchEvent("onafter" + action.toLowerCase());
				return id;
			}
		};
		return false;
	};
	this.executeActionByRuleSet = function(atName,setName,xmlNode,value){
		var xpath,selInfo = this.getSelectFromRule(setName,xmlNode);
		var node = selInfo[1];
		
		if(node){
			if(jpf.XMLDatabase.getNodeValue(node)== value)return;
			var atAction = node.nodeType == 1 || node.nodeType == 3 || node.nodeType == 4 ? "setTextNode":"setAttribute";
			var args = node.nodeType == 1 ?[node,value]:(node.nodeType == 3 || node.nodeType == 4 ?[node.parentNode,value]:[node.ownerElement || node.selectSingleNode(".."),node.nodeName,value]);
		}
		else{
			if(! this.createModel)return false;
			var atAction = "setValueByXpath";
			var xpath = selInfo[0];
			
			if(! xmlNode){
				var model = this.getModel();
				
				if(! model || ! model.data)return false;
				var xpath =(model.getXpathByJmlNode(this)|| ".")+(xpath && xpath != "." ? "/" + xpath:"");
				var xmlNode = model.data;
			};
			var args =[xmlNode,value,xpath];
		};
		this.executeAction(atAction,args,atName,xmlNode);
	};
	this.connect = function(o,dataOnly,xpath,type,noselect){
		if(o.dataParent)o.dataParent.parent.disconnect(o);
		
		if(! this.signalXmlUpdate)this.signalXmlUpdate ={
		};
		o.dataParent ={
			parent:this,xpath:xpath};
		
		if(dataOnly){
			if(__XMLOnload)return __XMLOnload.push([o,xpath]);
			else return o.load(xpath ? this.XMLRoot.selectSingleNode(xpath):this.value);
		};
		
		if(! dataOnly)! type || type == "select" ? __XMLSelect.push({o:o,xpath:xpath}
	):__XMLChoice.push({o:o,xpath:xpath}
	);
		
		if(type != "choice" && ! noselect){
			if(this.value || ! this.ruleTraverse && this.XMLRoot){
				var xmlNode = this.value || this.XMLRoot;
				
				if(xpath){
					xmlNode = xmlNode.selectSingleNode(xpath);
					
					if(! xmlNode){
						this.addEventListener("onxmlupdate",function(){this.connect(o,false,xpath,type);
							this.removeEventListener("onxmlupdate",arguments.callee);
						}
					);
					}
				};
				
				if(xmlNode)o.load(xmlNode);
			}
			else{
				if(o.clear && ! o.hasFeature(__MULTIBINDING__))o.clear();
				
				if(o.disable)o.disable();
			}
		}
	};
	this.disconnect = function(o,type){
		var ar = ! type || type == "select" ? __XMLSelect:__XMLChoice;
		this.signalXmlUpdate[o.uniqueId]= null;
		delete this.signalXmlUpdate[o.uniqueId];
		o.dataParent = null;
		
		for(var i = 0;i < ar.length;i ++){
			if(ar[i].o != o)continue;
			
			for(var j = i;j < ar.length;j ++)ar[j]= ar[j + 1];
			ar.length --;
			i --;
		}
	};
	this.setConnections = function(xmlNode,type){
		var a = type == "both" ? __XMLChoice.concat(__XMLSelect):(type == "choice" ? __XMLChoice:__XMLSelect);
		
		for(var i = 0;i < a.length;i ++){
			a[i].o.load(a[i].xpath && xmlNode ? xmlNode.selectSingleNode(a[i].xpath):xmlNode);
		};
		
		if(! __XMLOnload)return;
		
		for(var i = 0;i < __XMLOnload.length;i ++)__XMLOnload[i][0].load(__XMLOnload[i][1]? this.XMLRoot.selectSingleNode(__XMLOnload[i][1]):this.value);
		__XMLOnload = null;
	};
	this.importConnections = function(x){
		__XMLSelect = x;
	};
	this.getConnections = function(){
		return __XMLSelect;
	};
	this.removeConnections = function(){
		__XMLSelect =[];
	};
	this.applyRuleSetOnNode = function(setname,cnode,def){
		if(! cnode)return "";
		var ruleset = this.bindingRules;
		
		if(ruleset)var rules = ruleset[setname];
		
		if(! rules)return def ? cnode.selectSingleNode(def):false;
		
		for(var node = null,i = 0;i < rules.length;i ++){
			var sel =(rules[i].getAttribute("select-eval")? eval(rules[i].getAttribute("select-eval")):rules[i].getAttribute("select"))|| ".";
			var o = cnode.selectSingleNode(sel);
			
			if(o){
				this.lastRule = rules[i];
				
				if(rules[i].getAttribute("rpc"))return rules[i];
				else 
				if(rules[i].getAttribute("value"))return rules[i].getAttribute("value");
				else 
				if(rules[i].childNodes.length){
					var xsltNode;
					
					if(rules[i].getAttribute("cacheId")){
						xsltNode = jpf.NameServer.get("xslt",rules[i].getAttribute("cacheId"));
					}
					else{
						var prefix = jpf.findPrefix(rules[i],jpf.ns.xslt);
						var xsltNode;
						
						if(rules[i].getElementsByTagNameNS){
							xsltNode = rules[i].getElementsByTagNameNS(jpf.ns.xslt,"*")[0];
						}
						else{
							var prefix = jpf.findPrefix(rules[i],jpf.ns.xslt,true);
							
							if(prefix){
								if(! jpf.supportNamespaces)rules[i].ownerDocument.setProperty("SelectionNamespaces","xmlns:" + prefix + "='" + jpf.ns.xslt + "'");
								xsltNode = rules[i].selectSingleNode(prefix + ":*");
							}
						};
						
						if(xsltNode){
							if(xsltNode[jpf.TAGNAME]!= "stylesheet"){
								var baseXslt = jpf.NameServer.get("base","xslt");
								
								if(! baseXslt){
									baseXslt = jpf.getObject("XMLDOM",'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="node()"></xsl:template></xsl:stylesheet>').documentElement;
									jpf.NameServer.register("base","xslt",xsltNode);
								};
								var xsltNode = baseXslt.cloneNode(true);
								
								for(var j = rules[i].childNodes.length;j >= 0;j ++)xsltNode.firstChild.appendChild(rules[i].childNodes[j]);
								rules[i].setAttribute("cacheId",jpf.NameServer.add("xslt",xsltNode));
							}
						}
					};
					
					if(xsltNode){
						var x = o.transformNode(xsltNode).replace(/^<\?xml version="1\.0" encoding="UTF-16"\?>/,"").replace(/\&lt\;/g,"<").replace(/\&gt\;/g,">").replace(/\&amp\;/g,"&");
					}
					else{
						var x = jpf.JsltInstance.apply(rules[i],o);
					};
					return rules[i].getAttribute("method")? self[rules[i].getAttribute("method")](x,this):x;
				}
				else 
				if(rules[i].getAttribute("method")){
					return self[rules[i].getAttribute("method")](o,this);
				}
				else 
				if(rules[i].getAttribute("eval")){
					var func = new Function('xmlNode','control',"return " + rules[i].getAttribute("eval"));
					var value = func.call(this,o,this);
					
					if(! value)continue;
					return value;
				}
				else{
					if(o.nodeType == 1){
						if(! o.firstChild || o.firstChild.nodeType == 1 || o.firstChild.nodeType > 4)return "";
						o = o.firstChild;
					};
					var value;
					
					if(o.nodeType == 2){
						try{
							value = decodeURI(o.nodeValue);
						}
						catch(e){
							value = o.nodeValue};
						value = unescape(value);
					}
					else value = o.nodeValue;
					
					if(rules[i].getAttribute("mask")){
						if(value.match(/^(?:true|false)$/))value = value == "true" ? 1:0;
						return rules[i].getAttribute("mask").split(";")[value];
					}
					else return value;
				}
			}
		};
		return false;
	};
	this.setSmartBinding = function(sb,part){
		if(typeof sb == "string")sb = jpf.JMLParser.getSmartBinding(sb);
		
		if(! sb)throw new Error(1059,jpf.formErrorString(1059,this,"setSmartBinding Method","No SmartBinding was found."));
		this.smartBinding = sb;
		this.smartBinding.initialize(this);
		this.dispatchEvent("onsetsmartbinding");
	};
	this.removeSmartBinding = function(){
		if(this.smartBinding)this.smartBinding.deinitialize(this);
	};
	this.getSmartBinding = function(){
		return this.smartBinding;
	};
	this.setRef = function(bindXPath){
		var sb = new jpf.SmartBinding();
		var sModelId = refHandler.call(this,this.jml,bindXPath,this.hasFeature(__MULTISELECT__),sb);
		
		if(sModelId)jpf.setModel(sModelId,this,this.hasFeature(__MULTISELECT__));
		var o = this.hasFeature(__MULTISELECT__)? this.getSelectionSmartBinding():this;
		o.removeSmartBinding();
		o.setSmartBinding(sb);
	};
	this.getModel = function(do_recur){
		if(do_recur && ! this.model)return this.dataParent ? this.dataParent.parent.getModel(true):null;
		return this.model;
	};
	this.setModel = function(model,xpath){
		if(typeof model == "string")model = jpf.NameServer.get("model",model);
		model.register(this,xpath);
	};
	this.getNodeFromRule = function(setname,cnode,isAction,getRule,createNode){
		var ruleset = isAction ? this.actionRules:this.bindingRules;
		
		if(ruleset)var rules = ruleset[setname];
		
		if(! rules)return false;
		
		for(var i = 0;i < rules.length;i ++){
			if(! rules[i])continue;
			var sel =(rules[i].getAttribute("select-eval")? eval(rules[i].getAttribute("select-eval")):rules[i].getAttribute("select"))|| ".";
			
			if(! sel)return getRule ? rules[i]:false;
			
			if(! cnode)return false;
			var o = cnode.selectSingleNode(sel);
			
			if(o)return getRule ? rules[i]:o;
			
			if(createNode || rules[i].getAttribute("create")== "true"){
				var o = jpf.XMLDatabase.createNodeFromXpath(cnode,sel);
				return getRule ? rules[i]:o;
			}
		};
		return false;
	};
	this.getSelectFromRule = function(setname,cnode){
		var rules = this.bindingRules[setname];
		
		if(! rules || ! rules.length)return["."];
		
		for(var first,i = 0;i < rules.length;i ++){
			var sel =(rules[i].getAttribute("select-eval")? eval(rules[i].getAttribute("select-eval")):rules[i].getAttribute("select"))|| ".";
			
			if(! cnode)return[sel];
			
			if(i == 0)first = sel;
			var o = cnode.selectSingleNode(sel);
			
			if(o)return[sel,o];
		};
		return[first];
	};
	this.getBindRule = function(setname,id){
		var rule = false,rules = this.bindingRules ? this.bindingRules[setname]:null;
		
		if(! rules)return false;
		
		if(setname == "traverse")return rules[0];
		
		if(typeof id == "number")rule = rules[id];
		else 
		if(typeof id == "object")rule = id;
		else{
			for(var i = 0;i < rules.length;i ++){
				if(rules[i].getAttribute("id")== id){
					rule = rules[i];
					break;
				}
			}
		};
		return rule;
	};
	this.setBindRule = function(type,id,attributes){
		var el;
		
		if(id || type == "traverse"){
			var rules = this.bindingRules ? this.bindingRules[type]:null;
			
			for(var i = 0;rules && i < rules.length;i ++){
				if(rules[i].getAttribute("id")== id){
					el = rules[i];
					break;
				}
			}
		};
		
		if(! el)el = this.xmlBindings.appendChild(this.xmlBindings.ownerDocument.createElement(type));
		
		for(prop in attributes)
		if(typeof attributes[prop]== "string")el.setAttribute(prop,attributes[prop]);
		
		if(type == "traverse")this.parseTraverse(el);
	};
	this.removeBindRule = function(setname,id){
		var rule = this.getBindRule(setname,id);
		
		if(! rule)return false;
		rule.parentNode.removeChild(rule);
	};
	this.reload = function(){
		this.load(this.XMLRoot,this.cacheID,true);
	};
	this.load = function(xmlRootNode,cacheID,forceNoCache){
		jpf.Popup.forceHide();
		
		if(! this.bindingRules && this.jml &&(! this.smartBinding || jpf.JMLParser.stackHasBindings(this.uniqueId)))return loadqueue =[xmlRootNode,cacheID];
		
		if(xmlRootNode)xmlRootNode = jpf.XMLDatabase.getBindXmlNode(xmlRootNode);
		
		if(this.dataParent && this.dataParent.xpath)this.dataParent.parent.signalXmlUpdate[this.uniqueId]= ! xmlRootNode;
		
		if(! xmlRootNode){
			this.clear(null,true);
			
			if(jpf.appsettings.autoDisable && ! this.createModel)this.disable();
			this.setConnections();
			return;
		};
		this.disabled = false;
		
		if(this.listenRoot){
			jpf.XMLDatabase.removeNodeListener(this.listenRoot,this);
			this.listenRoot = null;
		};
		
		if(this.dispatchEvent("onbeforeload",{xmlNode:xmlRootNode}
	)=== false)return false;
		
		if(this.caching && ! forceNoCache && xmlRootNode == this.XMLRoot)return;
		
		if(! cacheID){
			cacheID = xmlRootNode.getAttribute(jpf.XMLDatabase.xmlIdTag)|| jpf.XMLDatabase.nodeConnect(jpf.XMLDatabase.getXmlDocId(xmlRootNode),xmlRootNode);
		};
		
		if(this.__removeClearMessage)this.__removeClearMessage();
		
		if(this.caching && ! forceNoCache && this.getCache(cacheID)){
			if(! this.hasFeature(__MULTISELECT__))this.setConnections(this.XMLRoot,"select");
			else{
				var nodes = this.getTraverseNodes();
				
				if(nodes.length && this.autoselect)this.select(nodes[0],null,null,null,true);
				else this.setConnections();
			};
			this.dispatchEvent('onafterload',{XMLRoot:xmlRootNode}
		);
			return;
		}
		else this.clear(true);
		this.documentId = jpf.XMLDatabase.getXmlDocId(xmlRootNode);
		this.cacheID = cacheID;
		this.XMLRoot = xmlRootNode;
		this.__load(xmlRootNode);
		this.__loadSubData(xmlRootNode);
		this.disabled = true;
		this.enable();
		
		if(! this.hasFeature(__MULTISELECT__))this.setConnections(this.XMLRoot);
		this.dispatchEvent('onafterload',{XMLRoot:xmlRootNode}
	);
	};
	this.__loadSubData = function(xmlRootNode){
		if(this.hasLoadStatus(xmlRootNode))return;
		var loadNode,rule = this.getNodeFromRule("load",xmlRootNode,false,true);
		var sel = rule && rule.getAttribute("select")? rule.getAttribute("select"):".";
		
		if(rule &&(loadNode = xmlRootNode.selectSingleNode(sel))){
			this.setLoadStatus(xmlRootNode,"loading");
			var mdl = this.getModel(true);
			var jmlNode = this;
			
			if(mdl.insertFrom(rule.getAttribute("get"),loadNode,this.XMLRoot,this,function(){jmlNode.setConnections(jmlNode.XMLRoot);
			}
		)=== false){
				this.clear(true);
				
				if(jpf.appsettings.autoDisable)this.disable();
				this.setConnections(null,"select");
			}
		}
	};
	this.setLoadStatus = function(xmlNode,state,remove){
		var ostatus = xmlNode.getAttribute("j_loaded");
		ostatus = ostatus ? ostatus.replace(new RegExp("\\|\\w+\\:" + this.uniqueId + "\\|","g"),""):"";
		
		if(! remove)ostatus += "|" + state + ":" + this.uniqueId + "|";
		xmlNode.setAttribute("j_loaded",ostatus);
	};
	this.removeLoadStatus = function(xmlNode){
		this.setLoadStatus(xmlNode,null,true);
	};
	this.hasLoadStatus = function(xmlNode,state){
		var ostatus = xmlNode.getAttribute("j_loaded");
		
		if(! ostatus)return false;
		return(ostatus.indexOf((state || "")+ ":" + this.uniqueId + "|")!= - 1)};
	this.insert = function(XMLRoot,parentXMLNode,clearContents){
		if(typeof XMLRoot != "object")XMLRoot = jpf.getObject("XMLDOM",XMLRoot).documentElement;
		
		if(! parentXMLNode)parentXMLNode = this.XMLRoot;
		
		if(this.dispatchEvent("onbeforeinsert",{xmlParentNode:parentXMLNode}
	)=== false)return false;
		
		if(clearContents){
			var nodes = parentXMLNode.childNodes;
			
			for(var i = nodes.length - 1;i >= 0;i --)parentXMLNode.removeChild(nodes[i]);
		};
		var newNode = jpf.XMLDatabase.integrate(XMLRoot,parentXMLNode,true);
		jpf.XMLDatabase.applyChanges("insert",parentXMLNode);
		
		if(this.selectable && this.autoselect){
			if(this.XMLRoot == newNode)newNode = this.XMLRoot.selectSingleNode(this.ruleTraverse);
			
			if(newNode)this.select(newNode);
		}
		else 
		if(this.XMLRoot == newNode)this.setConnections(this.XMLRoot,"select");
		
		if(this.hasLoadStatus(XMLRoot,"loading"))this.setLoadStatus(XMLRoot,"loaded");
		this.dispatchEvent("onafterinsert");
	};
	this.inherit(this.hasFeature(__MULTISELECT__)? jpf.MultiselectBinding:jpf.StandardBinding);
	function findModel(x,isSelection){
		return x.getAttribute((isSelection ? "select":"")+ "model")|| jpf.XMLDatabase.getInheritedAttribute(x,null,function(xmlNode){if(isSelection && x == xmlNode)return false;
			
			if(xmlNode.getAttribute("model")){
				return xmlNode.getAttribute("model");
			};
			
			if(xmlNode.getAttribute("smartbinding")){
				var bclass = x.getAttribute("smartbinding").split(" ")[0];
				
				if(jpf.NameServer.get("model",bclass))return bclass + ":select";
			};
			return false}
	);
	};
	function refHandler(x,strBindRef,isSelection,sb){
		var strBind =[];
		
		if(! strBindRef && x.getAttribute("ref"))strBindRef = x.getAttribute("ref");
		var modelId = findModel(x,isSelection);
		var xsltURL = x.getAttribute("xslt"),bindRoot,bindMethod = x.getAttribute("ref-method");
		var bindWay = this.createModel || isSelection ? "root":(jpf.XMLDatabase.getInheritedAttribute(x,"ref-attach")|| "value");
		
		if(bindWay == "value"){
			strBindRef.match(/^(.*?)((?:\@[\w-_\:]+|text\(\))(\[.*?\])?|[\w-_\:]+\[.*?\])?$/);
			var valuePath = RegExp.$1;
			
			if(! valuePath && valuePath !== "")throw new Error(1063,jpf.formErrorString(1063,this,"init SmartBindings","Could not find xpath to determine XMLRoot: " + strBindRef,x));
			var modelIdParts = modelId.split(":",3);
			var valueSelect = RegExp.$2 || ".";
			modelId = modelIdParts.shift();
			
			if(modelId.substr(0,1)== "#")modelId +=(modelIdParts[0]? ":" + modelIdParts.shift():":select");
			
			if(modelIdParts[0]|| valuePath)modelId += ":" +((modelIdParts[0]? modelIdParts[0]+ "/":"")+(valuePath || ".")).replace(/\/$/,"").replace(/\/\/+/,"/");
		};
		strBind.push("<bindings>");
		strBind.push("<" +(this.mainBind || "value")+ " select=\"" +(bindWay == "value" ? valueSelect + "\" ":strBindRef.replace(/\"/g,'\\"')+ "\" ")+ "create=\"true\" ");
		
		if(bindMethod)strBind.push("method='" + bindMethod + "'");
		
		if(xsltURL)strBind.push("/><include src='" + xsltURL + "' ");
		
		if(isSelection && x.getAttribute("selectcaption"))strBind.push("/><caption select='" + x.getAttribute("selectcaption")+ "' ");
		strBind.push("/></bindings>");
		var sb;
		
		if(strBind.length){
			strBind.unshift("<smartbinding>");
			strBind.push("</smartbinding>");
			var sNode = jpf.getObject("XMLDOM",strBind.join("")).documentElement;
			jpf.loadJMLIncludes(sNode,new jpf.http(),true);
			
			if(sb)sb.loadJML(sNode);
			else jpf.JMLParser.addToSbStack(this.uniqueId,new jpf.SmartBinding(null,sNode),isSelection ? 1:0);
		};
		return modelId;
	};
	this.__addJmlLoader(function(x){var modelId,bclasses;
		
		if(x.getAttribute("smartbinding")){
			bclasses = x.getAttribute("smartbinding").split(" ");
			
			for(var i = 0;i < Math.min(2,bclasses.length);i ++){
				var sNode = jpf.JMLParser.getSmartBinding(bclasses[i]);
				jpf.JMLParser.addToSbStack(this.uniqueId,sNode);
			}
		};
		this.createModel = jpf.isTrue(jpf.XMLDatabase.getInheritedAttribute(this.jml,"create-model"));
		
		if((x.getAttribute("ref")|| x.getAttribute("bind"))&& this.hasFeature(__MULTISELECT__)){
			var sModelId = refHandler.call(this,x,null,true);
			
			if(sModelId)jpf.setModel(sModelId,this,true);
		};
		var strBind =[];
		
		if(this.hasFeature(__DRAGDROP__)&&(x.getAttribute("dragEnabled")|| x.getAttribute("dropEnabled"))){
			strBind =["<dragdrop>"];
			
			if(x.getAttribute("dragEnabled")== "true")strBind.push('<allow-drag select="." copy-condition="' +(x.getAttribute("dragMoveEnabled")== "true" ? "event.ctrlKey":"true")+ '"/>');
			
			if(x.getAttribute("dropEnabled")){
				var sel = x.getAttribute("dropEnabled")!= "true" ? "select='" + x.getAttribute("dropEnabled")+ "'":(this.hasFeature(__MULTISELECT__)? "select-eval=\"'self::' + this.ruleTraverse.split('|').join('|self::')\"":"select='.'");
				strBind.push('<allow-drop ' + sel + ' operation="list-append" copy-condition="' +(x.getAttribute("dragMoveEnabled")== "true" ? "event.ctrlKey":"true")+ '"/>','<allow-drop ' + sel + ' target="." operation="insert-before" copy-condition="' +(x.getAttribute("dragMoveEnabled")== "true" ? "event.ctrlKey":"true")+ '"/>');
			};
			strBind.push("</dragdrop>");
			var sNode = jpf.getObject("XMLDOM",strBind.join("")).documentElement;
			(jpf.JMLParser.getFromSbStack(this.uniqueId)|| jpf.JMLParser.addToSbStack(this.uniqueId,new jpf.SmartBinding())).addDragDrop(jpf.getRules(sNode));
		};
		
		if(x.getAttribute("bindings")){
			var sb = jpf.JMLParser.getFromSbStack(this.uniqueId)|| jpf.JMLParser.addToSbStack(this.uniqueId,new jpf.SmartBinding());
			sb.addBindings(jpf.NameServer.get("bindings",x.getAttribute("bindings")));
		};
		
		if(x.getAttribute("actions")){
			var sb = jpf.JMLParser.getFromSbStack(this.uniqueId)|| jpf.JMLParser.addToSbStack(this.uniqueId,new jpf.SmartBinding());
			sb.addActions(jpf.NameServer.get("actions",x.getAttribute("actions")));
		};
		
		if(x.getAttribute("dragdrop")&& typeof x.getAttribute("dragdrop")== "string"){
			var sb = jpf.JMLParser.getFromSbStack(this.uniqueId)|| jpf.JMLParser.addToSbStack(this.uniqueId,new jpf.SmartBinding());
			sb.addDragDrop(jpf.NameServer.get("dragdrop",x.getAttribute("dragdrop")));
		};
		
		if((x.getAttribute("ref")|| x.getAttribute("bind"))&& ! this.hasFeature(__MULTISELECT__)){
			modelId = refHandler.call(this,x,null,false);
		}
		else{
			var sb = jpf.JMLParser.getFromSbStack(this.uniqueId);
			
			if(sb && ! sb.model)modelId = findModel(x);
		};
		
		if(x.getAttribute("empty"))this.msg = x.getAttribute("empty");
		
		if(! this.model && modelId)jpf.setModel(modelId,this,false);
	}

);
	this.addEventListener("onbeforeselect",function(e){var combinedvalue = null;
		
		if(this.indicator == this.value || e.list && e.list.length > 1 && this.getConnections().length){
			if(e.list && e.list.length > 1 && this.getConnections().length){
				var oEl = this.XMLRoot.ownerDocument.createElement(this.value.tagName);
				var attr ={
				};
				var nodes = e.list[0].attributes;
				
				for(var j = 0;j < nodes.length;j ++)attr[nodes[j].nodeName]= nodes[j].nodeValue;
				
				for(var i = 1;i < e.list.length;i ++){
					for(prop in attr){
						if(typeof attr[prop]!= "string")continue;
						
						if(! e.list[i].getAttributeNode(prop))attr[prop]= undefined;
						else 
						if(e.list[i].getAttribute(prop)!= attr[prop])attr[prop]= "";
					}
				};
				
				for(prop in attr){
					if(typeof attr[prop]!= "string")continue;
					oEl.setAttribute(prop,attr[prop]);
				};
				oEl.setAttribute(jpf.XMLDatabase.xmlIdTag,this.uniqueId);
				jpf.MultiSelectServer.register(oEl.getAttribute(jpf.XMLDatabase.xmlIdTag),oEl,e.list,this);
				jpf.XMLDatabase.addNodeListener(oEl,jpf.MultiSelectServer);
				combinedvalue = oEl;
			}
		};
		var jNode = this;
		setTimeout(function(){jNode.setConnections(combinedvalue || jNode.value);
		}
		,10);
	}

);
	this.addEventListener("onafterdeselect",function(){setTimeout('var o = jpf.lookup(' + this.uniqueId + ');o.setConnections(null);',10);
	}

);
};

jpf.StandardBinding = function(){
	if(! this.defaultValue)this.defaultValue = "";
	this.__load = function(XMLRoot){
		jpf.XMLDatabase.addNodeListener(XMLRoot,this);
		this.setProperty("value",this.applyRuleSetOnNode(this.mainBind,this.XMLRoot)|| this.defaultValue,null,true);
		
		if(this.errBox && this.isValid())this.clearError();
	};
	this.__xmlUpdate = function(action,xmlNode,listenNode,UndoObj){
		if(action == "redo-remove"){
			var testNode = this.XMLRoot;
			
			while(testNode && testNode.nodeType != 9)testNode = testNode.parentNode;
			
			if(! testNode){
				var model = this.getModel();
				return model.loadInJmlNode(this,model.getXpathByJmlNode(this));
			}
		};
		
		if(UndoObj)UndoObj.xmlNode = this.XMLRoot;
		var value = this.applyRuleSetOnNode(this.mainBind,this.XMLRoot)|| this.defaultValue;
		
		if(this.value != value)this.setProperty("value",value,null,true);
		
		if(this.errBox && this.isValid())this.clearError();
	};
	
	if(! this.clear){
		this.clear = function(nomsg,do_event){
			this.documentId = null;
			this.XMLRoot = null;
			this.cacheID = null;
			
			if(this.__clear)this.__clear(nomsg,do_event);
		}
	}

};

jpf.MultiselectBinding = function(){
	this.__load = function(XMLRoot){
		jpf.XMLDatabase.addNodeListener(XMLRoot,this);
		
		if(! this.getTraverseNodes(XMLRoot).length)return this.clearAllTraverse();
		var nodes = this.__addNodes(XMLRoot);
		this.__fill(nodes);
		
		if(this.selectable){
			if(this.autoselect){
				if(nodes.length)this.__selectDefault(XMLRoot);
				else this.setConnections();
			}
			else{
				this.clearSelection(null,true);
				var xmlNode = this.getFirstTraverseNode();
				
				if(xmlNode)this.setIndicator(xmlNode);
				this.setConnections(null,"both");
			}
		};
		
		if(this.focussable)jpf.window.isFocussed(this)? this.__focus():this.__blur();
	};
	this.__xmlUpdate = function(action,xmlNode,listenNode,UndoObj,lastParent){
		var result,startNode = xmlNode;
		
		if(! listenNode)listenNode = this.XMLRoot;
		do{
			if(action == "add" && this.isTraverseNode(xmlNode))break;
			
			if(xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag)){
				var htmlNode = this.getNodeFromCache(xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
				
				if(startNode != xmlNode && action.match(/add|remove|insert|synchronize|add/))action = "update";
				
				if(xmlNode == listenNode)break;
				
				if(htmlNode && ! action.match(/insert|add|remove|synchronize/)&& ! this.isTraverseNode(xmlNode))action = "remove";
				
				if(! htmlNode && ! action.match(/insert|remove|synchronize|move/)&& this.isTraverseNode(xmlNode)){
					action = "add";
					break;
				};
				
				if(htmlNode || action == "move")break;
			}
			else 
			if(! action.match(/insert|add|remove|synchronize|move-away|move/)&& this.isTraverseNode(xmlNode)){
				action = "add";
				break;
			};
			
			if(xmlNode == listenNode)break;
			xmlNode = xmlNode.parentNode;
		}
		
		while(xmlNode && xmlNode.nodeType != 9)var foundNode = xmlNode;
		
		if(xmlNode && xmlNode.nodeType == 9)xmlNode = startNode;
		
		if(action == "replacechild" &&(UndoObj ? UndoObj.args[0]== this.XMLRoot:! this.XMLRoot.parentNode)){
			return this.load(UndoObj ? UndoObj.args[1]:listenNode);
		};
		
		if(UndoObj && xmlNode && ! UndoObj.xmlNode)UndoObj.xmlNode = xmlNode;
		
		if(action == "move" && foundNode == startNode){
			var isInThis = jpf.XMLDatabase.isChildOf(this.XMLRoot,xmlNode.parentNode,true);
			var wasInThis = jpf.XMLDatabase.isChildOf(this.XMLRoot,UndoObj.pNode,true);
			
			if(isInThis && wasInThis)this.__moveNode(xmlNode,htmlNode);
			else 
			if(isInThis)action = "add";
			else 
			if(wasInThis)action = "remove";
		}
		else 
		if(action == "move-away"){
			var goesToThis = jpf.XMLDatabase.isChildOf(this.XMLRoot,UndoObj.toPnode,true);
			
			if(! goesToThis)action = "remove";
		};
		
		if(this.__removeClearMessage && this.__setClearMessage){
			if(this.getFirstTraverseNode())this.__removeClearMessage();
			else this.__setClearMessage(this.msg)};
		
		if(action == "insert" &&(this.isTreeArch || xmlNode == this.XMLRoot)){
			if(this.hasLoadStatus(xmlNode)&& this.__removeLoading)this.__removeLoading(htmlNode);
			result = this.__addNodes(xmlNode,(this.__getParentNode ? this.__getParentNode(htmlNode):htmlNode),true,false);
			this.__fill(result);
			
			if(this.selectable && ! this.XMLRoot.selectSingleNode(this.ruleTraverse))return;
			
			if(this.selectable){
				if(this.autoselect)this.select(this.value || this.XMLRoot.selectSingleNode(this.ruleTraverse));
				else this.setIndicator(this.XMLRoot.selectSingleNode(this.ruleTraverse));
			}
		}
		else 
		if(action == "add"){
			var parentHTMLNode = xmlNode.parentNode == this.XMLRoot ? this.oInt:this.getCacheItem(xmlNode.parentNode.getAttribute(jpf.XMLDatabase.xmlIdTag))|| this.getNodeFromCache(xmlNode.parentNode.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
			
			if(! parentHTMLNode)parentHTMLNode = this.getCacheItem(xmlNode.parentNode.getAttribute(jpf.XMLDatabase.xmlIdTag)||(xmlNode.parentNode.getAttribute(jpf.XMLDatabase.xmlDocTag)? "doc" + xmlNode.parentNode.getAttribute(jpf.XMLDatabase.xmlDocTag):false))|| this.oInt;
			
			if(parentHTMLNode || jpf.XMLDatabase.isChildOf(this.XMLRoot,xmlNode)){
				parentHTMLNode =(this.__findContainer && parentHTMLNode ? this.__findContainer(parentHTMLNode):parentHTMLNode)|| this.oInt;
				var beforeXMLNode = this.getNextTraverse(xmlNode);
				var beforeHTMLNode = beforeXMLNode ? this.getNodeFromCache(beforeXMLNode.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId):null;
				result = this.__addNodes(xmlNode,parentHTMLNode,true,true,beforeHTMLNode);
				
				if(parentHTMLNode)this.__fill(result);
			}
		}
		else 
		if((action == "remove")&& foundNode == xmlNode && xmlNode.parentNode){
			if(htmlNode)this.__deInitNode(xmlNode,htmlNode);
			else 
			if(xmlNode == this.XMLRoot)return this.load(null);
		}
		else 
		if(htmlNode){
			this.__updateNode(xmlNode,htmlNode);
			
			if(action == "replacechild" && this.hasFeature(__MULTISELECT__)&& this.value && xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag)== this.value.getAttribute(jpf.XMLDatabase.xmlIdTag)){
				this.value = xmlNode;
			}
		}
		else 
		if(action == "redo-remove"){
			var testNode = this.XMLRoot;
			
			while(testNode && testNode.nodeType != 9)testNode = testNode.parentNode;
			
			if(! testNode){
				var model = this.getModel();
				return model.loadInJmlNode(this,model.getXpathByJmlNode(this));
			}
		};
		var pNode = xmlNode ? xmlNode.parentNode:lastParent;
		
		if(pNode && pNode.nodeType == 1 && this.isTreeArch){
			do{
				var htmlNode = this.getNodeFromCache(pNode.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
				
				if(htmlNode)this.__updateNode(pNode,htmlNode);
			}
			
			while(pNode = this.getTraverseParent(pNode));
		};
		
		if(this.signalXmlUpdate && action.match(/^(?:synchronize|add|insert)$/)){
			var uniqueId;
			
			for(uniqueId in this.signalXmlUpdate){
				if(parseInt(uniqueId)!= uniqueId)continue;
				var o = jpf.lookup(uniqueId);
				
				if(! this.value)continue;
				var xmlNode = this.value.selectSingleNode(o.dataParent.xpath);
				
				if(! xmlNode)continue;
				o.load(xmlNode);
			}
		};
		this.dispatchEvent("onxmlupdate",{action:action,xmlNode:xmlNode,result:result}
	);
	};
	this.__addNodes = function(xmlNode,parent,checkChildren,isChild,insertBefore){
		var isChild = isChild && this.isTraverseNode(xmlNode);
		var htmlNode,lastNode,nodes = isChild ?[xmlNode]:this.getTraverseNodes(xmlNode);
		var loadChildren = nodes.length && this.bindingRules["insert"]? this.applyRuleSetOnNode("insert",xmlNode):false;
		
		for(var i = 0;i < nodes.length;i ++){
			if(nodes[i].nodeType != 1)continue;
			
			if(checkChildren)htmlNode = this.getNodeFromCache(nodes[i].getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
			
			if(! htmlNode){
				var Lid = jpf.XMLDatabase.nodeConnect(this.documentId,nodes[i],null,this);
				var beforeNode = isChild ? insertBefore:(lastNode ? lastNode.nextSibling:null);
				var parentNode = this.__add(nodes[i],Lid,isChild ? xmlNode.parentNode:xmlNode,beforeNode ? parent || this.oInt:parent,beforeNode,! beforeNode && i == nodes.length - 1);
				
				if(parentNode === false){
					for(var i = i;i < nodes.length;i ++)jpf.XMLDatabase.nodeConnect(this.documentId,nodes[i],null,this);
					break;
				}
			};
			
			if(checkChildren)lastNode = htmlNode;
		};
		return nodes;
	}

}

/*FILEHEAD(/in/Library/Core/Node/DelayedRender.js)SIZE(3495)TIME(1203729731399)*/
__DELAYEDRENDER__ = 1 << 11
/*FILEHEAD(/in/Library/Core/Node/Docking.js)SIZE(10472)TIME(1213554918677)*/
__DOCKING__ = 1 << 18;

jpf.Docking = function(){
	this.__regbase = this.__regbase | __DRAGDROP__;
	this.startDocking = function(e){
		jpf.DockServer.start(this.aData,this,e);
	}

};

jpf.DockServer ={
	edge:30,inited:false,init:function(){
		if(this.inited)return;
		this.inited = true;
		jpf.DragMode.defineMode("dockobject",this);
		
		if(! this.nextPositionMarker){
			this.nextPositionMarker = document.body.appendChild(document.createElement("div"));
			this.nextPositionMarker.style.border = "4px solid #555";
			this.nextPositionMarker.style.position = "absolute";
			this.nextPositionMarker.style.zIndex = 10000;
			this.nextPositionMarker.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50);";
			this.nextPositionMarker.style.opacity = 0.5;
			jpf.setUniqueHtmlId(this.nextPositionMarker);
		}
	}
	,start:function(oItem,jmlNode,e){
		if(! this.inited)jpf.DockServer.init();
		this.dragdata ={
			item:oItem,jmlNode:jmlNode,x:e.offsetX || e.layerX,y:e.offsetY || e.layerY};
		jpf.DragMode.setMode("dockobject");
		jpf.Plane.show(this.nextPositionMarker);
		var pos = jpf.compat.getAbsolutePosition(oItem.oHtml);
		var diff = jpf.compat.getDiff(this.nextPositionMarker);
		this.nextPositionMarker.style.left = pos[0]+ "px";
		this.nextPositionMarker.style.top = pos[1]+ "px";
		this.nextPositionMarker.style.width =(oItem.oHtml.offsetWidth - diff[0])+ "px";
		this.nextPositionMarker.style.height =(oItem.oHtml.offsetHeight - diff[1])+ "px";
		this.nextPositionMarker.style.display = "block";
		jpf.layoutServer.pause(oItem.oHtml.parentNode);
	}
	,floatElement:function(e){
		this.dragdata.item.setPosition(e.clientX - this.dragdata.x,e.clientY - this.dragdata.y);
		
		if(this.dragdata.item.hidden != 3){
			this.dragdata.item.setFloat();
			this.dragdata.jmlNode.purgeAlignment();
		}
		else jpf.layoutServer.play(this.dragdata.item.oHtml.parentNode);
	}
	,setPosition:function(e){
		var diff = jpf.compat.getDiff(this.nextPositionMarker);
		this.nextPositionMarker.style.left =(e.clientX - this.dragdata.x)+ "px";
		this.nextPositionMarker.style.top =(e.clientY - this.dragdata.y)+ "px";
		this.nextPositionMarker.style.width =(this.dragdata.item.size[0]- diff[0])+ "px";
		this.nextPositionMarker.style.height =((this.dragdata.item.state < 0 ? this.dragdata.item.size[1]:this.dragdata.item.fheight)- diff[1])+ "px";
		document.body.style.cursor = "default";
	}
	,onmousemove:function(e){
		if(! e)e = event;
		
		if(jpf.isIE && e.button < 1)return false;
		jpf.Plane.hide();
		jpf.DockServer.nextPositionMarker.style.top = "10000px";
		var el = document.elementFromPoint(e.clientX + document.documentElement.scrollLeft,e.clientY + document.documentElement.scrollTop);
		jpf.Plane.show(jpf.DockServer.nextPositionMarker);
		var o = el;
		
		while(o && ! o.host && o.parentNode)o = o.parentNode;
		var jmlNode = o && o.host ? o.host:false;
		var htmlNode = jmlNode.oExt;
		
		if(! jmlNode.aData || ! jmlNode.dock){
			document.body.style.cursor = "";
			jpf.setStyleClass(document.body,"same",["south","east","north","west"]);
			return jpf.DockServer.setPosition(e);
		};
		
		if(jpf.DockServer.dragdata.item == jmlNode.aData && jmlNode.aData.hidden == 3)return jpf.DockServer.setPosition(e);
		var calcData = jmlNode.aData.calcData;
		var pos = jpf.compat.getAbsolutePosition(htmlNode);
		var l = e.clientX - pos[0];
		var t = e.clientY - pos[1];
		var diff = jpf.compat.getDiff(jpf.DockServer.nextPositionMarker);
		var verdiff = diff[1];
		var hordiff = diff[0];
		var region;
		var vEdge = Math.min(jpf.DockServer.edge,htmlNode.offsetHeight / 2);
		var hEdge = Math.min(jpf.DockServer.edge,htmlNode.offsetWidth / 2);
		var r = htmlNode.offsetWidth - l;
		var b = htmlNode.offsetHeight - t;
		var p = b / vEdge,q = l / hEdge,z = t / vEdge,w = r / hEdge;
		
		if(p < Math.min(q,w,z)){
			if(b <= vEdge)region = "south";
		}
		else 
		if(w < Math.min(p,z,q)){
			if(r <= hEdge)region = "east";
		}
		else 
		if(q < Math.min(p,z,w)){
			if(l <= hEdge)region = "west";
		}
		else 
		if(z < Math.min(q,w,p)){
			if(t <= vEdge)region = "north";
		};
		
		if(jpf.DockServer.dragdata.item == jmlNode.aData)region = "same";
		
		if(! region)return jpf.DockServer.setPosition(e);
		var nextPositionMarker = jpf.DockServer.nextPositionMarker;
		
		if(region == "west"){
			nextPositionMarker.style.left = pos[0]+ "px";
			nextPositionMarker.style.top = pos[1]+ "px";
			nextPositionMarker.style.width =((htmlNode.offsetWidth / 2)- hordiff)+ "px";
			nextPositionMarker.style.height =(htmlNode.offsetHeight - verdiff)+ "px";
		}
		else 
		if(region == "north"){
			nextPositionMarker.style.left = pos[0]+ "px";
			nextPositionMarker.style.top = pos[1]+ "px";
			nextPositionMarker.style.width =(htmlNode.offsetWidth - hordiff)+ "px";
			nextPositionMarker.style.height =(Math.ceil(htmlNode.offsetHeight / 2)- verdiff)+ "px";
		}
		else 
		if(region == "east"){
			nextPositionMarker.style.left =(pos[0]+ Math.ceil(htmlNode.offsetWidth / 2))+ "px";
			nextPositionMarker.style.top = pos[1]+ "px";
			nextPositionMarker.style.width =((htmlNode.offsetWidth / 2)- hordiff)+ "px";
			nextPositionMarker.style.height =(htmlNode.offsetHeight - verdiff)+ "px";
		}
		else 
		if(region == "south"){
			nextPositionMarker.style.left = pos[0]+ "px";
			nextPositionMarker.style.top =(pos[1]+ Math.ceil(htmlNode.offsetHeight / 2))+ "px";
			nextPositionMarker.style.width =(htmlNode.offsetWidth - hordiff)+ "px";
			nextPositionMarker.style.height =(Math.ceil(htmlNode.offsetHeight / 2)- verdiff)+ "px";
		}
		else 
		if(region == "same"){
			nextPositionMarker.style.left = pos[0]+ "px";
			nextPositionMarker.style.top = pos[1]+ "px";
			nextPositionMarker.style.width =(htmlNode.offsetWidth - hordiff)+ "px";
			nextPositionMarker.style.height =(htmlNode.offsetHeight - verdiff)+ "px";
		};
		document.body.style.cursor = "";
		jpf.setStyleClass(document.body,region,["same","south","east","north","west"]);
	}
	,onmouseup:function(e){
		if(! e)e = event;
		
		if(jpf.isIE && e.button < 1)return false;
		jpf.Plane.hide();
		jpf.DragMode.clear();
		jpf.DockServer.nextPositionMarker.style.display = "none";
		document.body.className = "";
		var el = document.elementFromPoint(e.clientX + document.documentElement.scrollLeft,e.clientY + document.documentElement.scrollTop);
		var o = el;
		
		while(o && ! o.host && o.parentNode)o = o.parentNode;
		var jmlNode = o && o.host ? o.host:false;
		var htmlNode = jmlNode.oExt;
		var aData = jmlNode.aData;
		
		if(! jmlNode.aData || ! jmlNode.dock || jpf.DockServer.dragdata.item == jmlNode.aData && jmlNode.aData.hidden == 3){
			return jpf.DockServer.floatElement(e);
		};
		
		if(jpf.DockServer.dragdata.item == jmlNode.aData)return jpf.layoutServer.play(htmlNode.parentNode);
		var pos = jpf.compat.getAbsolutePosition(htmlNode);
		var l = e.clientX - pos[0];
		var t = e.clientY - pos[1];
		var diff = jpf.compat.getDiff(jpf.DockServer.nextPositionMarker);
		var verdiff = diff[1];
		var hordiff = diff[0];
		var region;
		var vEdge = Math.min(jpf.DockServer.edge,htmlNode.offsetHeight / 2);
		var hEdge = Math.min(jpf.DockServer.edge,htmlNode.offsetWidth / 2);
		var r = htmlNode.offsetWidth - l;
		var b = htmlNode.offsetHeight - t;
		var p = b / vEdge,q = l / hEdge,z = t / vEdge,w = r / hEdge;
		
		if(p < Math.min(q,w,z)){
			if(b <= vEdge)region = "b";
		}
		else 
		if(w < Math.min(p,z,q)){
			if(r <= hEdge)region = "r";
		}
		else 
		if(q < Math.min(p,z,w)){
			if(l <= hEdge)region = "l";
		}
		else 
		if(z < Math.min(q,w,p)){
			if(t <= vEdge)region = "t";
		};
		
		if(! region)return jpf.DockServer.floatElement(e);
		var pHtmlNode = htmlNode.parentNode;
		var l = jpf.layoutServer.layouts[pHtmlNode.getAttribute("id")];
		
		if(! l)return false;
		var root = l.root;
		var current = aData;
		
		if(jpf.DockServer.dragdata.item.hidden == 3)jpf.DockServer.dragdata.item.unfloat();
		var newItem = jpf.DockServer.dragdata.item;
		var pItem = newItem.parent;
		
		if(pItem.children.length == 2){
			var fixItem = pItem.children[newItem.stackId == 0 ? 1:0];
			fixItem.parent = pItem.parent;
			fixItem.stackId = pItem.stackId;
			fixItem.parent.children[fixItem.stackId]= fixItem;
			fixItem.weight = pItem.weight;
			fixItem.fwidth = pItem.fwidth;
			fixItem.fheight = pItem.fheight;
		}
		else{
			var nodes = pItem.children;
			
			for(var j = newItem.stackId;j < nodes.length;j ++){
				nodes[j]= nodes[j + 1];
				
				if(nodes[j])nodes[j].stackId = j;
			};
			nodes.length --;
		};
		var type = region == "l" || region == "r" ? "hbox":"vbox";
		var parent = current.parent;
		var newBox = jpf.layoutServer.getData(type,l.layout);
		newBox.splitter = current.splitter;
		newBox.edgeMargin = current.edgeMargin;
		newBox.id = jpf.layoutServer.metadata.push(newBox)- 1;
		newBox.parent = parent;
		parent.children[current.stackId]= newBox;
		newBox.stackId = current.stackId;
		newBox.children = region == "b" || region == "r" ?[current,newItem]:[newItem,current];
		current.parent = newItem.parent = newBox;
		current.stackId = region == "b" || region == "r" ? 0:1;
		newItem.stackId = region == "b" || region == "r" ? 1:0;
		newBox.fwidth = current.fwidth;
		newBox.fheight = current.fheight;
		newItem.weight = current.weight = 1;
		current.fwidth = current.fheight = null;
		var root = root.copy();
		l.layout.compile(root);
		l.layout.reset();
		jpf.layoutServer.activateRules(l.layout.parentNode);
	}

}

/*FILEHEAD(/in/Library/Core/Node/DragDrop.js)SIZE(15106)TIME(1205789642078)*/
__DRAGDROP__ = 1 << 5;

/*FILEHEAD(/in/Library/Core/Node/EditMode.js)SIZE(9953)TIME(1204029157937)*/
__EDITMODE__ = 1 << 15;

__MULTILANG__ = 1 << 16;

/*FILEHEAD(/in/Library/Core/Node/JmlDom.js)SIZE(5308)TIME(1203729817259)*/
__JMLDOM__ = 1 << 14;

jpf.JmlDomAPI = function(){
	this.__regbase = this.__regbase | __JMLDOM__;
	this.childNodes =[];
	this.appendChild = function(jmlNode,noAlignUpdate){
		jmlNode.removeNode(true);
		
		if(jmlNode.hasFeature(__ALIGNMENT__)){
			var isDisabled = jmlNode.disableAlignment();
			
			if(isDisabled && ! noAlignUpdate)jmlNode.purgeAlignment();
		};
		
		if(jmlNode.hasFeature(__ANCHORING__))jmlNode.moveAnchoringRules(this.oInt,! noAlignUpdate);
		this.childNodes.push(jmlNode);
		jmlNode.parentNode = this;
		
		if(! this.oInt)return;
		this.oInt.appendChild(jmlNode.oExt);
		jmlNode.pHtmlNode = this.oInt;
		
		if(jmlNode.hasFeature(__ALIGNMENT__)&& isDisabled){
			jmlNode.enableAlignment();
			
			if(! noAlignUpdate)jmlNode.purgeAlignment();
		};
		return jmlNode;
	};
	this.insertBefore = function(jmlNode,beforeNode,noAlignUpdate){
		jmlNode.removeNode(true);
		
		if(jmlNode.hasFeature(__ALIGNMENT__)){
			var isDisabled = jmlNode.disableAlignment();
			
			if(isDisabled && ! noAlignUpdate)jmlNode.purgeAlignment();
		};
		var index = this.childNodes.indexOf(beforeNode);
		
		if(index < 0)throw new Error(1072,jpf.formErrorString(1072,this,"Insert before DOM operation","could not insert jmlNode, beforeNode could not be found"));
		
		if(jmlNode.hasFeature(__ANCHORING__))this.moveAnchoringRules(this.oInt,! noAlignUpdate);
		this.childNodes = this.childNodes.slice(0,index).concat(jmlNode,this.childNodes.slice(index));
		jmlNode.parentNode = this;
		
		if(! this.oInt)return;
		this.oInt.insertBefore(jmlNode.oExt,beforeNode.oExt);
		jmlNode.pHtmlNode = this.oInt;
		
		if(jmlNode.hasFeature(__ALIGNMENT__)&& isDisabled){
			jmlNode.enableAlignment();
			
			if(! noAlignUpdate)jmlNode.purgeAlignment();
		}
	};
	this.removeNode = function(isAdmin){
		if(! this.parentNode)return;
		this.parentNode.childNodes.remove(this);
		this.oExt.parentNode.removeChild(this.oExt);
		
		if(isAdmin)return;
		this.destroy();
		
		if(this.hasFeature(__ANCHORING__))this.disableAnchoring(this.oInt);
	};
	this.getElementsByTagName = function(tagName,norecur){
		tagName = tagName.toLowerCase();
		
		for(var result =[],i = 0;i < this.childNodes.length;i ++){
			if(this.childNodes[i].tagName == tagName)result.push(this.childNodes[i]);
			
			if(! norecur)result = result.concat(this.childNodes[i].getElementsByTagName(tagName));
		};
		return result;
	};
	this.attributes ={
		length:function(){
		}
	,item:function(){
		}

};
	this.nodeValue = "";
	this.firstChild = this.lastChild = this.nextSibling = this.previousSibling = null;
	this.namespaceURI = jpf.ns.jpf;
	this.cloneNode = function(deep){
	};
	this.serialize = function(){
	};
	this.setAttribute = function(attrName,attrValue){
	};
	this.getAttribute = function(attrName){
		return this.jml.getAttribute(attrName);
	};
	
	if(this.parentNode && this.parentNode.hasFeature && this.parentNode.hasFeature(__JMLNODE__)){
		this.parentNode.childNodes.push(this);
	}

}

/*FILEHEAD(/in/Library/Core/Node/MultiLevelBinding.js)SIZE(8677)TIME(1203729827665)*/
__MULTIBINDING__ = 1 << 7;

/*FILEHEAD(/in/Library/Core/Node/MultiSelect.js)SIZE(27983)TIME(1203729875196)*/
__MULTISELECT__ = 1 << 8;

jpf.MultiSelect = function(){
	this.value = null;
	this.selected = null;
	this.indicator = null;
	var selSmartBinding;
	var valueList =[];
	var selectedList =[];
	this.__regbase = this.__regbase | __MULTISELECT__;
	this.autoselect = true;
	this.selectable = true;
	this.multiselect = true;
	this.useindicator = true;
	this.remove = function(xmlNode,do_select){
		if(! xmlNode)xmlNode = valueList;
		
		if(! xmlNode)return;
		
		if(! xmlNode.nodeType){
			sel = xmlNode;
			xmlNode = null;
		};
		var rValue;
		
		if(do_select){
			var i = 0,nextNode = xmlNode || this.value,ln = this.getSelectCount();
			do{
				nextNode = this.getDefaultNext(nextNode);
				i ++}
			
			while(nextNode && this.isSelected(nextNode)&& i < ln);
		};
		
		if(xmlNode && xmlNode.nodeType){
			rValue = this.executeAction("removeNode",[xmlNode],"remove",xmlNode);
		}
		else{
			if(this.actionRules && this.actionRules["RemoveGroup"])rValue = this.executeAction("removeNodeList",[sel],"removegroup",sel);
			else{
				for(var i = 0;i < sel.length;i ++){
					this.executeAction("removeNode",[sel[i]],"remove",sel[i]);
				}
			}
		};
		
		for(var lst =[],i = 0;i < valueList.length;i ++)
		if(valueList[i].parentNode)lst.push(valueList[i]);
		valueList = lst;
		
		if(do_select){
			if(nextNode && rValue !== false)this.select(nextNode);
		}
		else{
			if(valueList.length)this.setIndicator(valueList[0]);
			else{
				var xmlNode = this.getFirstTraverseNode();
				
				if(xmlNode)this.setIndicator(xmlNode);
			}
		};
		return rValue;
	};
	this.removeGroup = this.remove;
	this.add = function(xmlNode,beforeNode,pNode){
		var node = this.actionRules["add"][0];
		
		if(! node)throw new Error(0,jpf.formErrorString(0,this,"Add Action","Could not find Add Node"));
		var jmlNode = this;
		var callback = function(addXmlNode,state,extra){
			if(state != __HTTP_SUCCESS__){
				if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
				else{
					var commError = new Error(1032,jpf.formErrorString(1032,jmlNode,"Loading xml data","Could not add data for control " + jmlNode.name + "[" + jmlNode.tagName + "] \nUrl: " + extra.url + "\nInfo: " + extra.message + "\n\n" + xmlNode));
					
					if(jmlNode.dispatchEvent("onerror",jpf.extend({error:commError,state:status}
					,extra))!== false)throw commError;
					return;
				}
			};
			
			if(typeof addXmlNode != "object")addXmlNode = jpf.getObject("XMLDOM",addXmlNode).documentElement;
			
			if(addXmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag))addXmlNode.setAttribute(jpf.XMLDatabase.xmlIdTag,"");
			var actionNode = jmlNode.getNodeFromRule("add",jmlNode.isTreeArch ? jmlNode.value:jmlNode.XMLRoot,true,true);
			
			if(! pNode && actionNode && actionNode.getAttribute("parent"))pNode = jmlNode.XMLRoot.selectSingleNode(actionNode.getAttribute("parent"));
			
			if(jmlNode.executeAction("appendChildNode",[pNode || jmlNode.XMLRoot,addXmlNode,beforeNode],"add",addXmlNode)!== false && jmlNode.autoselect)jmlNode.select(addXmlNode);
			return addXmlNode;
		};
		
		if(xmlNode)return callback(xmlNode,__HTTP_SUCCESS__);
		else 
		if(node.getAttribute("get"))return jpf.getData(node.getAttribute("get"),node,callback);
		else 
		if(node.firstChild)return callback(jpf.compat.getNode(node,[0]).cloneNode(true),__HTTP_SUCCESS__);
		return addXmlNode;
	};
	
	if(! this.setValue){
		this.setValue = function(value,no_event){
			if(! this.bindingRules || ! this.XMLRoot)return;
			
			if(jpf.isNot(value))return this.clearSelection(null,no_event);
			var xmlNode = this.findXmlNodeByValue(value);
			
			if(xmlNode)this.select(xmlNode,null,null,null,null,no_event);
			else return this.clearSelection(null,no_event);
		}
	};
	this.findXmlNodeByValue = function(value){
		var nodes = this.getTraverseNodes();
		
		for(var i = 0;i < nodes.length;i ++){
			if(this.applyRuleSetOnNode(this.mainBind,nodes[i])== value){
				return nodes[i];
			}
		}
	};
	
	if(! this.getValue){
		this.getValue = function(){
			if(! this.bindingRules)return false;
			return this.applyRuleSetOnNode(this.mainBind,this.value,null,true);
		}
	};
	this.setSelectionSmartBinding = function(smartbinding,part){
		if(! selSmartBinding)selSmartBinding = new jpf.MultiLevelBinding(this);
		selSmartBinding.setSmartBinding(smartbinding,part);
		this.dispatchEvent("oninitselbind",{smartbinding:selSmartBinding}
	);
	};
	this.getSelectionSmartBinding = function(){
		return selSmartBinding;
	};
	this.reselect = function(){
		if(this.value)this.select(this.value,null,this.ctrlSelect,null,true);
	};
	var buffered = null;
	this.select = function(xmlNode,ctrlKey,shiftKey,fakeselect,force,no_event){
		if(! this.selectable || this.disabled)return;
		
		if(this.ctrlSelect && ! shiftKey)ctrlKey = true;
		
		if(! this.XMLRoot){
			buffered =[arguments,this.autoselect];
			this.autoselect = true;
			return;
		};
		
		if(buffered){
			var x = buffered;
			buffered = null;
			
			if(this.autoselect)this.autoselect = x[1];
			return this.select.apply(this,x[0]);
		};
		var htmlNode;
		
		if(! xmlNode)throw new Error(1075,jpf.formErrorString(1075,this,"select Method","Missing xmlNode reference"));
		
		if(typeof xmlNode != "object"){
			var str = xmlNode;
			xmlNode = jpf.XMLDatabase.getNodeById(xmlNode);
			
			if(! xmlNode){
				var sel = str.split("\|");
				var rule =(this.getBindRule("value")|| this.getBindRule("caption"));
				
				if(! rule)throw new Error(0,jpf.formErrorString(0,this,"select Method","Could not find rule to select by string with"));
				rule = rule.getAttribute("select");
				
				for(var i = 0;i <(this.multiselect ? 1:sel.length);i ++){
					sel[i]= "node()[" + rule + "='" + sel[i].replace(/'/g,"\\'")+ "']";
				};
				var xpath = sel.join("\|");
				var nodes = this.XMLRoot.selectNodes(xpath);
				
				for(var i = 0;i < nodes.length;i ++)this.select(nodes[i]);
				return;
			}
		};
		
		if(! xmlNode.style)htmlNode = this.caching ? this.getNodeFromCache(xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId):document.getElementById(xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
		else{
			var id =(htmlNode = xmlNode).getAttribute(jpf.XMLDatabase.htmlIdTag);
			
			while(! id && htmlNode.parentNode)var id =(htmlNode = htmlNode.parentNode).getAttribute(jpf.XMLDatabase.htmlIdTag);
			xmlNode = jpf.XMLDatabase.getNodeById(id,this.XMLRoot);
		};
		
		if(! no_event && this.dispatchEvent('onbeforeselect',{xmlNode:xmlNode,htmlNode:htmlNode}
	)=== false)return false;
		var lastIndicator = this.indicator;
		this.indicator = xmlNode;
		
		if(shiftKey && this.multiselect){
			var range = this.__calcSelectRange(valueList[0]|| lastIndicator,xmlNode);
			this.selectList(range);
			
			if(this.selected)this.__deindicate(this.selected);
			this.selected = this.__indicate(htmlNode);
		}
		else 
		if(ctrlKey && this.multiselect){
			if(valueList.contains(xmlNode)){
				if(! fakeselect){
					selectedList.remove(htmlNode);
					valueList.remove(xmlNode);
				};
				
				if(this.value == xmlNode){
					this.clearSelection(true,true);
					
					if(valueList.length && ! fakeselect){
						this.value = valueList[0];
					}
				}
				else this.__deselect(htmlNode,xmlNode);
				
				if(this.selected)this.__deindicate(this.selected);
				this.selected = this.__indicate(htmlNode);
				
				if(htmlNode != this.selindicator){
					this.__deindicate(this.selindicator);
					this.selindicator = htmlNode;
				}
			}
			else{
				if(this.selindicator)this.__deindicate(this.selindicator);
				this.__indicate(htmlNode);
				this.selindicator = htmlNode;
				
				if(this.selected)this.__deindicate(this.selected);
				this.selected = this.__select(htmlNode);
				this.value = xmlNode;
				
				if(! fakeselect){
					selectedList.push(htmlNode);
					valueList.push(xmlNode);
				}
			}
		}
		else 
		if(htmlNode && selectedList.contains(htmlNode)&& fakeselect)return;
		else{
			if(! force && htmlNode && this.selected == htmlNode && valueList.length <= 1 && ! this.reselectable && selectedList.contains(htmlNode))return;
			
			if(this.value)this.clearSelection(null,true);
			
			if(this.selected)this.__deindicate(this.selected);
			this.selected = this.__indicate(htmlNode,xmlNode);
			this.selected = this.__select(htmlNode,xmlNode);
			this.value = xmlNode;
			selectedList.push(htmlNode);
			valueList.push(xmlNode);
		};
		
		if(! no_event){
			if(this.delayedSelect){
				var jNode = this;
				setTimeout(function(){jNode.dispatchEvent("onafterselect",{list:valueList,xmlNode:xmlNode}
				);
				}
				,10);
			}
			else this.dispatchEvent("onafterselect",{list:valueList,xmlNode:xmlNode}
		);
		};
		return true;
	};
	this.choose = function(xmlNode){
		if(! this.selectable || this.disabled)return;
		
		if(this.dispatchEvent("onbeforechoose",{xmlNode:xmlNode}
	)=== false)return false;
		
		if(xmlNode && ! xmlNode.style)this.select(xmlNode);
		
		if(this.hasFeature(__DATABINDING__)&& this.dispatchEvent("onafterchoose",{xmlNode:this.value}
	)!== false)this.setConnections(this.value,"choice");
	};
	this.clearSelection = function(singleNode,no_event){
		if(! this.selectable || this.disabled)return;
		var clSel = singleNode ? this.value:valueList;
		
		if(! no_event && this.dispatchEvent("onbeforedeselect",{xmlNode:clSel}
	)=== false)return false;
		
		if(this.value){
			var htmlNode = this.caching ? this.getNodeFromCache(this.value.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId):document.getElementById(this.value.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
			this.__deselect(htmlNode);
		};
		this.selected = this.value = null;
		
		if(! singleNode){
			for(var i = valueList.length - 1;i >= 0;i --){
				var htmlNode = this.caching ? this.getNodeFromCache(valueList[i].getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId):document.getElementById(valueList[i].getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
				this.__deselect(htmlNode);
			};
			selectedList =[];
			valueList =[];
		};
		
		if(this.indicator){
			var htmlNode = this.caching ? this.getNodeFromCache(this.indicator.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId):document.getElementById(this.indicator.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
			this.selected = this.__indicate(htmlNode);
		};
		
		if(! no_event)this.dispatchEvent("onafterdeselect",{xmlNode:clSel}
	);
	};
	this.selectList = function(xmlNodeList){
		if(! this.selectable || this.disabled)return;
		this.clearSelection(null,true);
		
		for(var i = 0;i < xmlNodeList.length;i ++){
			if(xmlNodeList[i].nodeType != 1)continue;
			var xmlNode = xmlNodeList[i];
			
			if(typeof xmlNode != "object")xmlNode = jpf.XMLDatabase.getNodeById(xmlNode);
			
			if(! xmlNode.style)htmlNode = this.__findNode(null,xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
			else{
				htmlNode = xmlNode;
				xmlNode = jpf.XMLDatabase.getNodeById(htmlNode.getAttribute(jpf.XMLDatabase.htmlIdTag));
			};
			
			if(! xmlNode){
				continue;
			};
			
			if(htmlNode){
				this.__select(htmlNode);
				selectedList.push(htmlNode);
			};
			valueList.push(xmlNode);
		};
		this.selected = selectedList[0];
		this.value = valueList[0];
	};
	this.setIndicator = function(xmlNode){
		if(typeof xmlNode != "object")xmlNode = jpf.XMLDatabase.getNodeById(xmlNode);
		
		if(! xmlNode.style)htmlNode = this.caching ? this.getNodeFromCache(xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId):document.getElementById(xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag)+ "|" + this.uniqueId);
		else{
			var id =(htmlNode = xmlNode).getAttribute(jpf.XMLDatabase.htmlIdTag);
			
			while(! id && htmlNode.parentNode)var id =(htmlNode = htmlNode.parentNode).getAttribute(jpf.XMLDatabase.htmlIdTag);
			xmlNode = jpf.XMLDatabase.getNodeById(id);
		};
		
		if(this.selected)this.__deindicate(this.selected);
		this.indicator = xmlNode;
		this.selected = this.__indicate(htmlNode);
	};
	this.selectAll = function(){
		if(! this.multiselect || ! this.selectable || this.disabled || ! this.selected)return;
		var nodes = this.getTraverseNodes();
		this.selectList(nodes);
	};
	this.getSelection = function(xmldoc){
		if(xmldoc){
			var r = this.XMLRoot ? this.XMLRoot.ownerDocument.createDocumentFragment():jpf.getObject("XMLDOM").createDocumentFragment();
			
			for(var i = 0;i < valueList.length;i ++)jpf.XMLDatabase.clearConnections(r.appendChild(valueList[i].cloneNode(true)));
		}
		else 
		for(var r =[],i = 0;i < valueList.length;i ++)r.push(valueList[i]);
		return r;
	};
	this.getSelectedNodes = function(){
		return valueList;
	};
	this.defaultSelectNext = function(xmlNode,isTree){
		var next = this.getNextTraverseSelected(xmlNode);
		
		if(next || ! isTree)this.select(next ? next:this.getTraverseParent(xmlNode));
		else this.clearSelection(null,true);
	};
	this.selectNext = function(){
		var xmlNode = this.getNextTraverse();
		
		if(xmlNode)this.select(xmlNode);
	};
	this.selectPrevious = function(){
		var xmlNode = this.getNextTraverse(null,- 1);
		
		if(xmlNode)this.select(xmlNode);
	};
	this.getDefaultNext = function(xmlNode,isTree){
		var next = this.getNextTraverseSelected(xmlNode);
		return next && next != xmlNode ? next:(isTree ? this.getTraverseParent(xmlNode):false);
	};
	this.getSelectCount = function(){
		return valueList.length;
	};
	this.isSelected = function(xmlNode){
		if(! xmlNode)return false;
		
		for(var i = 0;i < valueList.length;i ++){
			if(valueList[i]== xmlNode)return true;
		};
		return false;
	};
	this.__addJmlLoader(function(x){if(x.getAttribute("multiselect"))this.multiselect = x.getAttribute("multiselect")!= "false";
		
		if(x.getAttribute("autoselect"))this.autoselect = x.getAttribute("autoselect")!= "false";
		
		if(x.getAttribute("selectable"))this.selectable = x.getAttribute("selectable")!= "false";
		
		if(x.getAttribute("ctrlselect"))this.ctrlSelect = x.getAttribute("ctrlselect")== "true";
		
		if(x.getAttribute("allowdeselect")|| this.allowDeselect === undefined)this.allowDeselect = x.getAttribute("allowdeselect")!= "false";
		
		if(x.getAttribute("delayedselect")|| this.delayedSelect === undefined)this.delayedSelect = x.getAttribute("delayedselect")!= "false";
		this.allowDeselect = x.getAttribute("allow-deselect")!= "false";
		this.reselectable = x.getAttribute("reselectable")!= "true";
		
		if(x.getAttribute("autoselect")== "all" && this.multiselect){
			this.addEventListener("onafterload",function(){this.selectAll();
			}
		);
		};
		
		if(x.getAttributeNode("selected")){
			this.autoselect = true;
			this.selectXpath(x.getAttribute("selected"));
		}
	}

);
	this.addEventListener("onbeforeselect",function(e){if(this.applyRuleSetOnNode("select",e.xmlNode,".")=== false)return false;
	}

);
};

jpf.MultiSelectServer ={
	objects:{
	}

,register:function(xmlId,xmlNode,selList,jNode){
		if(! this.uniqueId)this.uniqueId = jpf.all.push(this)- 1;
		this.objects[xmlId]={
			xml:xmlNode,list:selList,jNode:jNode}
	}
	,__xmlUpdate:function(action,xmlNode,listenNode,UndoObj){
		if(action != "attribute")return;
		var data = this.objects[xmlNode.getAttribute(jpf.XMLDatabase.xmlIdTag)];
		
		if(! data)return;
		var nodes = xmlNode.attributes;
		
		for(var j = 0;j < data.list.length;j ++){
			jpf.XMLDatabase.setAttribute(data.list[j],UndoObj.name,xmlNode.getAttribute(UndoObj.name));
		}
	}

}

/*FILEHEAD(/in/Library/Core/Node/Presentation.js)SIZE(12169)TIME(1213480603380)*/
__PRESENTATION__ = 1 << 9;

jpf.PresentationServer ={
	skins:{
	}

,css:[],Init:function(xmlNode,refNode,path){
		var name =(refNode ? refNode.getAttribute("name"):null)|| xmlNode.getAttribute("name");
		var base =(refNode && refNode.getAttribute("src").match(/\//)|| path)?(path || refNode.getAttribute("src")).replace(/\/[^\/]*$/,"")+ "/":"";
		var mediaPath =(xmlNode.getAttribute("media-path")? jpf.getAbsolutePath(base || jpf.hostPath,xmlNode.getAttribute("media-path")):(refNode ? refNode.getAttribute("media-path"):null));
		var iconPath =(xmlNode.getAttribute("icon-path")? jpf.getAbsolutePath(base || jpf.hostPath,xmlNode.getAttribute("icon-path")):(refNode ? refNode.getAttribute("icon-path"):null));
		
		if(! name)name = "default";
		
		if(xmlNode.getAttribute("name"))document.body.className += " " + xmlNode.getAttribute("name");
		
		if(! this.skins[name]){
			this.skins[name]={
				base:base,name:name,iconPath:iconPath === null ? "icons/":iconPath,mediaPath:mediaPath === null ? "images/":mediaPath,templates:{
				}
		}
		};
		
		if(! this.skins["default"])this.skins["default"]= this.skins[name];
		var nodes = xmlNode.childNodes;
		
		for(var i = nodes.length - 1;i >= 0;i --){
			if(nodes[i].nodeType != 1)continue;
			this.skins[name].templates[nodes[i][jpf.TAGNAME].toLowerCase()]= nodes[i];
			
			if(nodes[i].ownerDocument)this.importSkinDef(nodes[i],base,name);
		};
		this.purgeCSS(mediaPath || base + "images/",iconPath || base + "icons/");
	}
	,importSkinDef:function(xmlNode,basepath,name){
		var nodes = xmlNode.selectNodes("style");
		
		for(var i = 0;i < nodes.length;i ++){
			if(nodes[i].getAttribute("src"))jpf.loadStylesheet(nodes[i].getAttribute("src").replace(/src/,basepath + "/src"));
			else 
			if(nodes[i].getAttribute("condition")){
				try{
					var test = eval(nodes[i].getAttribute("condition"));
				}
				catch(e){
					test = false;
				};
				
				if(test)this.css.push(nodes[i].firstChild.nodeValue);
			}
			else 
			if(nodes[i].firstChild)this.css.push(nodes[i].firstChild.nodeValue);
		};
		var nodes = xmlNode.selectNodes("alias");
		
		for(var i = 0;i < nodes.length;i ++){
			if(! nodes[i].firstChild)continue;
			this.skins[name].templates[nodes[i].firstChild.nodeValue.toLowerCase()]= xmlNode;
		}
	}
	,purgeCSS:function(imagepath,iconpath){
		if(! this.css.length)return;
		var cssString = this.css.join("\n").replace(/images\//g,imagepath).replace(/icons\//g,iconpath);
		jpf.importCssString(document,cssString);
		this.css =[];
	}
	,setSkinPaths:function(skinName,jmlNode){
		skinName = skinName.split(":");
		var name = skinName[0],type = skinName[1];
		jmlNode.iconPath = this.skins[name].iconPath;
		jmlNode.mediaPath = this.skins[name].mediaPath;
	}
	,getTemplate:function(skinName,cJml){
		skinName = skinName.split(":");
		var name = skinName[0],type = skinName[1];
		
		if(this.skins[name].templates[type])return this.skins[name].templates[type];
	}

};

jpf.Presentation = function(){
	var pNodes;
	this.__regbase = this.__regbase | __PRESENTATION__;
	this.skinName = null;
	this.changeSkin = function(skinName){
		if(this.skinName == skinName)return;
		
		if(this.selectable)var valueList = this.getSelection();
		this.baseCSSname = null;
		this.skinName =(skinName.indexOf(":")> - 1 ? skinName:skinName + ":" + this.tagName).toLowerCase();
		this.pHtmlNode = this.oExt.parentNode;
		var beforeNode = this.oExt.nextSibling;
		this.oExt.parentNode.removeChild(this.oExt);
		var id = this.oExt.getAttribute("id");
		
		if(this.loadSkin)this.loadSkin();
		this.draw();
		
		if(id)this.oExt.setAttribute("id",id);
		
		if(beforeNode)this.oExt.parentNode.insertBefore(this.oExt,beforeNode);
		
		if(this.aData)this.aData.oHtml = this.oExt;
		
		if(this.__loadJML)this.__loadJML(this.jml);
		jpf.JMLParser.parseLastPass();
		
		if(this.hasFeature(__DATABINDING__)&& this.XMLRoot)this.load(this.XMLRoot,this.cacheID,true);
		this.dispatchEvent("onskinchange");
		
		if(this.hasFeature(__DRAGDROP__))this.loadDragDrop();
		
		if(this.selectable)this.selectList(valueList);
		
		if(this.disabled)this.disable();
		
		if(this.focussable && this.isFocussed())this.focus();
		
		for(var i = this.__supportedProperties.length - 1;i >= 0;-- i){
			var pValue = this[this.__supportedProperties[i]];
			
			if(! pValue)continue;
			this.handlePropSet(this.__supportedProperties[i],pValue,true);
		};
		
		if(this.hasFeature(__ANCHORING__))this.purgeAnchoring();
		jpf.layoutServer.activateRules(this.oExt.parentNode);
		jpf.layoutServer.forceResize(this.oExt.parentNode);
	};
	this.loadSkin = function(skinName){
		if(! skinName && this.jml)skinName = this.jml.getAttribute("skin");
		
		if(skinName)skinName = skinName.toLowerCase();
		
		if(! this.baseSkin)this.baseSkin =(skinName ?(skinName.indexOf(":")> - 1 ? skinName:skinName + ":" + this.tagName):null)||(jpf.PresentationServer.defaultSkin || "default")+ ":" + this.tagName;
		
		if(! this.skinName)this.skinName = this.baseSkin;
		this.skin = jpf.PresentationServer.getTemplate(this.skinName,this.jml);
		
		if(! this.skin){
			this.baseName = this.skinName = "default:" + this.tagName;
			this.skin = jpf.PresentationServer.getTemplate(this.skinName,this.jml);
			
			if(! this.skin)throw new Error(1077,jpf.formErrorString(1077,this,"Presentation","Could not load skin: " + this.skinName,this.jml));
		};
		
		if(this.skin)jpf.PresentationServer.setSkinPaths(this.skinName,this);
		pNodes ={
		};
		var nodes = this.skin.selectNodes("Presentation/node()");
		
		for(var i = 0;i < nodes.length;i ++){
			if(nodes[i].nodeType != 1)continue;
			pNodes[nodes[i].tagName]= nodes[i];
		}
	};
	this.__getNewContext = function(type,jmlNode){
		pNodes[type]= this.skin.selectSingleNode("node()/" + type).cloneNode(true);
	};
	this.__hasLayoutNode = function(type){
		return pNodes[type]? true:false;
	};
	this.__getLayoutNode = function(type,section,htmlNode){
		var node = pNodes[type];
		
		if(! node)return false;
		
		if(! section)return jpf.compat.getFirstElement(node);
		var textNode = node.selectSingleNode("@" + section);
		
		if(! textNode)return null;
		return(htmlNode ? jpf.XMLDatabase.selectSingleNode(textNode.nodeValue,htmlNode):jpf.compat.getFirstElement(node).selectSingleNode(textNode.nodeValue));
	};
	this.__getOption = function(type,section){
		var node = pNodes[type];
		
		if(! section)return jpf.compat.getFirstElement(node);
		var option = node.selectSingleNode("@" + section);
		return option ? option.nodeValue:"";
	};
	this.__getExternal = function(tag,pNode,func,jml){
		if(! pNode)pNode = this.pHtmlNode;
		
		if(! tag)tag = "Main";
		
		if(! jml)jml = this.jml;
		this.__getNewContext(tag);
		var oExt = this.__getLayoutNode(tag);
		
		if(jml && jml.getAttributeNode("css"))oExt.setAttribute("style",jml.getAttribute("css"));
		
		if(jml && jml.getAttributeNode("cssclass"))this.__setStyleClass(oExt,jml.getAttribute("cssclass"));
		
		if(func)func.call(this,oExt);
		oExt = jpf.XMLDatabase.htmlImport(oExt,pNode);
		oExt.host = this;
		
		if(jml && jml.getAttribute("bgimage"))oExt.style.backgroundImage = "url(" + jpf.getAbsolutePath(this.mediaPath,jml.getAttribute("bgimage"))+ ")";
		
		if(! this.baseCSSname)this.baseCSSname = oExt.className.trim().split(" ")[0];
		return oExt;
	};
	this.__focus = function(){
		if(! this.oExt)return;
		this.__setStyleClass(this.oExt,this.baseCSSname + "Focus");
	};
	this.__blur = function(){
		if(! this.oExt)return;
		this.__setStyleClass(this.oExt,"",[this.baseCSSname + "Focus"]);
	};
	
	if(this.hasFeature(__MULTISELECT__)){
		this.__select = function(o){
			if(! o || ! o.style)return;
			return this.__setStyleClass(o,"selected");
		};
		this.__deselect = function(o){
			if(! o)return;
			return this.__setStyleClass(o,"",["selected","indicate"]);
		};
		this.__indicate = function(o){
			if(! o)return;
			return this.__setStyleClass(o,"indicate");
		};
		this.__deindicate = function(o){
			if(! o)return;
			return this.__setStyleClass(o,"",["indicate"]);
		}
	};
	this.__setEmptyMessage = function(msg){
	};
	this.__removeEmptyMessage = function(){
	};
	this.__setStyleClass = jpf.setStyleClass;
}

/*FILEHEAD(/in/Library/Core/Node/Rename.js)SIZE(6995)TIME(1203729916212)*/
__RENAME__ = 1 << 10;

jpf.Rename = function(){
	this.__regbase = this.__regbase | __RENAME__;
	this.canrename = true;
	this.rename = function(xmlNode,value){
		if(! xmlNode)xmlNode = this.indicator || this.value;
		
		if(! xmlNode)return;
		this.executeActionByRuleSet("rename","caption",xmlNode,value);
	};
	this.startDelayedRename = function(e,time){
		if(e.button == 2)return;
		clearTimeout(this.renameTimer);
		this.renameTimer = setTimeout('jpf.lookup(' + this.uniqueId + ').startRename()',time || 400);
	};
	var renameSubject = null;
	this.startRename = function(force){
		if(! force &&(this.actionRules && ! this.getNodeFromRule("rename",this.indicator || this.value,true)|| this.disabled || ! this.canrename))return false;
		this.focus();
		clearTimeout(this.renameTimer);
		
		if(this.dispatchEvent("onrenamestart")=== false)return false;
		this.renaming = true;
		renameSubject = this.indicator || this.value;
		var o = this.__getCaptionElement ? this.__getCaptionElement():this.selected;
		
		if(! o)return;
		o.style.cursor = "text";
		var p = o.parentNode;
		o.parentNode.replaceChild(this.oTxt,o);
		this.replacedNode = o;
		var xmlNode = this.getNodeFromRule("caption",this.indicator || this.value);
		this.oTxt[jpf.hasContentEditable ? "innerHTML":"value"]=(xmlNode.nodeType == 2 ? unescape(decodeURI(xmlNode.nodeValue)):jpf.XMLDatabase.getNodeValue(xmlNode))|| "";
		this.oTxt.unselectable = "Off";
		this.oTxt.host = this;
		this.oTxt.select();
	};
	this.cancelRename = function(no_event){
		clearTimeout(this.renameTimer);
		
		if(! this.renaming)return;
		this.renaming = false;
		var o = this.oTxt;
		
		if(o.parentNode)o.parentNode.replaceChild(this.replacedNode,o);
		this.replacedNode.style.cursor = "default";
		
		if(! no_event)this.dispatchEvent("oncancelrename");
		return true;
	};
	this.stopRename = function(){
		this.rename(renameSubject,this.oTxt[jpf.hasContentEditable ? "innerHTML":"value"].replace(/<.*?nobr>/gi,""));
		return false;
	};
	
	if(this.__deselect)this.__rdeselect = this.__deselect;
	
	if(this.__blur)this.__rdblur = this.__blur;
	
	if(this.__select)this.__rselect = this.__select;
	this.__select = function(o){
		if(this.renaming){
			this.cancelRename(true);
			this.stopRename();
		};
		return this.__rselect ? this.__rselect(o):o;
	};
	this.__deselect = function(o){
		if(this.renaming){
			this.cancelRename(true);
			this.stopRename();
			
			if(this.ctrlSelect)return false;
		};
		return this.__rdeselect ? this.__rdeselect(o):o;
	};
	this.__blur = function(){
		if(this.renaming){
			this.cancelRename(true);
			this.stopRename();
		};
		
		if(this.__rdblur)this.__rdblur();
	};
	
	if(this.keyHandler)this.__keyHandler = this.keyHandler;
	this.keyHandler = function(key,ctrlKey,shiftKey,altKey){
		if(this.renaming){
			if(key == 27 || key == 13){
				this.cancelRename(key == 13);
				
				if(key == 13)this.stopRename();
			};
			return;
		};
		
		if(key == 113){
			this.startRename();
			return false;
		}
		else 
		if(this.__keyHandler)return this.__keyHandler(key,ctrlKey,shiftKey,altKey);
	};
	
	if(!(this.oTxt = this.pHtmlDoc.getElementsByTagName("txt_rename")[0])){
		if(jpf.hasContentEditable){
			this.oTxt = document.createElement("DIV");
			this.oTxt.contentEditable = true;
			
			if(jpf.isIE6)this.oTxt.style.width = "1px";
		}
		else{
			this.oTxt = document.createElement("INPUT");
			this.oTxt.setAttribute("id","txt_rename");
			this.oTxt.autocomplete = false;
		};
		this.oTxt.id = "txt_rename";
		this.oTxt.style.whiteSpace = "nowrap";
		this.oTxt.onselectstart = function(e){
			(e || event).cancelBubble = true};
		this.oTxt.onmouseover = this.oTxt.onmouseout = this.oTxt.oncontextmenu = this.oTxt.onmousedown = function(e){
			(e || event).cancelBubble = true};
		this.oTxt.select = function(){
			if(! jpf.hasMsRangeObject)return this.focus();
			var r = document.selection.createRange();
			
			try{
				r.moveToElementText(this);
			}
			catch(e){
			};
			r.select();
		};
		this.oTxt.onblur = function(){
			if(jpf.isGecko)return;
			this.host.cancelRename(true);
			this.host.stopRename();
		};
		this.__addJmlDestroyer(function(){this.oTxt.host = null;
			this.oTxt.onmouseover = null;
			this.oTxt.onmousedown = null;
			this.oTxt.select = null;
		}
	);
	};
	this.__addJmlLoader(function(x){this.canrename = x.getAttribute("canrename")!= "false";
	}

);
}

/*FILEHEAD(/in/Library/Core/Node/Transaction.js)SIZE(9338)TIME(1203729941587)*/
__TRANSACTION__ = 1 << 3;

/*FILEHEAD(/in/Library/Core/Node/Validation.js)SIZE(13715)TIME(1203729962728)*/
__VALIDATION__ = 1 << 6;

/*FILEHEAD(/in/Library/Core/Node/XForms.js)SIZE(6202)TIME(1202834161609)*/
__XFORMS__ = 1 << 17;

/*FILEHEAD(/in/Library/Core/Application/ActionTracker.js)SIZE(15511)TIME(1213632644740)*/
jpf.ActionTracker = function(context){
	jpf.makeClass(this);
	this.realtime = true;
	this.hasChanged = false;
	this.getParentAT = function(){
		if(context)return context.getActionTracker(true);
		else return self.ActionTracker && self.ActionTracker != this ? self.ActionTracker:null;
	};
	this.actions ={
	};
	this.stackDone = new Array();
	this.stackUndone = new Array();
	this.stackRPC = new Array();
	this.define = function(action,func){
		this.actions[action]= func;
	};
	this.execute = function(action,args,xmlActionNode,jmlNode,selNode){
		this.hasChanged = true;
		
		if(this.onchange && this.onchange()=== false)return;
		var UndoObj = new jpf.UndoData(action,xmlActionNode,args,jmlNode,selNode);
		
		if(action)(typeof action == "function" ? action:this.actions[action])(UndoObj,false,this);
		var id = UndoObj.id = this.stackDone.push(UndoObj)- 1;
		this.lastId = id;
		UndoObj.saveChange(null,this);
		this.stackUndone.length = 0;
		return id;
	};
	this.addActionGroup = function(done,rpc){
		var UndoObj = new jpf.UndoData("group",null,[jpf.copyArray(done,UndoData),jpf.copyArray(rpc,UndoData)]);
		this.stackDone.push(UndoObj);
		this.hasChanged = true;
		
		if(this.onchange)this.onchange();
	};
	this.purge = function(nogrouping,forcegrouping){
		var prnt = this.getParentAT();
		
		if(nogrouping && prnt){
			var hash ={
			}
		,ids =[];
			
			for(var i = 0;i < this.stackRPC.length;i ++){
				var o = this.stackRPC[i].saveChange(null,this,true);
				hash[o.uniqueId]= o;
				ids.push(this.stackRPC[i].id);
			};
			
			for(prop in hash){
				if(typeof prop == "number"){
					hash[prop].purge(receive,ids);
					hash[prop].force_multicall = false;
				}
			};
			
			if(jpf.XMLDatabase.socket)jpf.XMLDatabase.socket.purge();
		}
		else 
		if(prnt){
			prnt.addActionGroup(this.stackDone,this.stackRPC);
		};
		this.reset();
	};
	this.reset = function(){
		this.stackDone.length = 0;
		this.stackUndone.length = 0;
		this.stackRPC.length = 0;
		this.hasChanged = false;
		
		if(this.onchange)this.onchange(true);
	};
	this.undo = function(id,single,stackDone,stackUndone,rollBack){
		if(! stackDone)stackDone = this.stackDone;
		
		if(! stackUndone)stackUndone = this.stackUndone;
		
		if(! stackDone.length)return;
		
		if(single){
			var UndoObj = stackDone[id];
			
			if(! UndoObj)return;
			
			if(id == stackDone.length - 1)stackDone.length --;
			else stackDone[id]= null;
			
			if(UndoObj.action)(typeof UndoObj.action == "function" ? UndoObj.action:this.actions[UndoObj.action])(UndoObj,true,this);
			
			if(! rollBack)UndoObj.saveChange(true,this);
			
			if(! stackDone.length)this.hasChanged = false;
			return UndoObj;
		};
		var i = 0;
		
		if(id == - 1)id = stackDone.length;
		
		if(! id)id = 1;
		
		while(i < id && stackDone.length > 0){
			if(! stackDone[stackDone.length - 1])stackDone.length --;
			else{
				stackUndone.push(this.undo(stackDone.length - 1,true,stackDone,stackUndone));
				i ++;
			}
		};
		
		if(this.onchange)this.onchange(true);
	};
	this.redo = function(id,single,stackDone,stackUndone,rollBack){
		if(! stackDone)stackDone = this.stackDone;
		
		if(! stackUndone)stackUndone = this.stackUndone;
		
		if(! stackUndone.length)return;
		
		if(single){
			var UndoObj = stackUndone[id];
			
			if(! UndoObj)return;
			
			if(id == stackUndone.length - 1)stackUndone.length --;
			else stackUndone[id]= null;
			
			if(UndoObj.action)(typeof UndoObj.action == "function" ? UndoObj.action:this.actions[UndoObj.action])(UndoObj,false,this);
			
			if(! rollBack)UndoObj.saveChange(false,this);
			this.hasChanged = true;
			return UndoObj;
		};
		var i = 0;
		
		if(id == - 1)id = stackUndone.length;
		
		if(! id)id = 1;
		
		while(i < id && stackUndone.length > 0){
			if(! stackUndone[stackUndone.length - 1])stackUndone.length --;
			else{
				stackDone.push(this.redo(stackUndone.length - 1,true,stackDone,stackUndone));
				i ++;
			}
		};
		
		if(this.onchange)this.onchange();
	};
	this.receive = function(data,state,extra,ids){
		if(state != __HTTP_SUCCESS__){
			if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
			else{
				var commError = new Error(1028,jpf.formErrorString(1028,null,"ActionTracker","Could not sent Action RPC request for control " + this.name + "[" + this.tagName + "] \n\n" + extra.message));
				
				if(this.dispatchEvent("onerror",jpf.extend({error:commError,state:status}
				,extra))!== false)throw commError;
				return;
			}
		};
		
		if(data && data.nodeType && data.selectSingleNode("//undo")){
			var msg = jpf.getXmlValue(data,"//undo/reason")+ "\n";
			var nodes = data.selectNodes("//undo/object");
			
			for(var i = 0;i < nodes.length;i ++){
				msg += "- " + nodes[i].getAttribute("name")+ "\n";
			};
			data = msg;
		}
		else return;
		
		if(typeof ids == "number")return this.doError(data,ids);
		
		for(var i = 0;i < ids.length;i ++)this.doError(data[i],ids[i]);
	};
	this.doError = function(data,id){
		if(data)alert(data);
		this.undo(id,true,null,null,true);
	};
	this.define("setTextNode",function(UndoObj,undo){var q = UndoObj.args;
		
		if(! undo)jpf.XMLDatabase.setTextNode(q[0],q[1],q[2],UndoObj);
		else jpf.XMLDatabase.setTextNode(q[0],UndoObj.oldValue,q[2]);
	}

);
	this.define("setAttribute",function(UndoObj,undo){var q = UndoObj.args;
		
		if(! undo){
			UndoObj.name = q[1];
			UndoObj.oldValue = q[0].getAttribute(q[1]);
			jpf.XMLDatabase.setAttribute(q[0],q[1],q[2],q[3],UndoObj);
		}
		else jpf.XMLDatabase.setAttribute(q[0],q[1],UndoObj.oldValue,q[3]);
	}

);
	this.define("setAttributes",function(UndoObj,undo){var prop,q = UndoObj.args;
		
		if(! undo){
			var oldValues ={
			};
			
			for(prop in q[1]){
				oldValues[prop]= q[0].getAttribute(prop);
				q[0].setAttribute(prop,q[1][prop]);
			};
			UndoObj.oldValues = oldValues;
			jpf.XMLDatabase.applyChanges("attribute",q[0],UndoObj);
		}
		else{
			for(prop in UndoObj.oldValues){
				if(! UndoObj.oldValues[prop])q[0].removeAttribute(prop);
				else q[0].setAttribute(prop,UndoObj.oldValues[prop]);
			};
			jpf.XMLDatabase.applyChanges("attribute",q[0],UndoObj);
		}
	}

);
	this.define("replaceNode",function(UndoObj,undo){var q = UndoObj.args;
		
		if(! undo)jpf.XMLDatabase.replaceNode(q[0],q[1],q[2],UndoObj);
		else jpf.XMLDatabase.replaceNode(q[1],q[0],q[2]);
	}

);
	this.define("addChildNode",function(UndoObj,undo){var q = UndoObj.args;
		
		if(! undo)jpf.XMLDatabase.addChildNode(q[0],q[1],q[2],q[3],q[4],UndoObj);
		else jpf.XMLDatabase.removeNode(UndoObj.addedNode);
	}

);
	this.define("appendChildNode",function(UndoObj,undo){var q = UndoObj.args;
		
		if(! undo)jpf.XMLDatabase.appendChildNode(q[0],q[1],q[2],q[3],q[4],UndoObj);
		else jpf.XMLDatabase.removeNode(q[1]);
	}

);
	this.define("moveNode",function(UndoObj,undo){var q = UndoObj.args;
		
		if(! undo)jpf.XMLDatabase.moveNode(q[0],q[1],q[2],q[3],UndoObj);
		else jpf.XMLDatabase.moveNode(UndoObj.pNode,q[1],UndoObj.beforeNode,q[3]);
	}

);
	this.define("removeNode",function(UndoObj,undo){var q = UndoObj.args;
		
		if(! undo)jpf.XMLDatabase.removeNode(q[0],q[1],UndoObj);
		else jpf.XMLDatabase.appendChildNode(UndoObj.pNode,UndoObj.removedNode,UndoObj.beforeNode);
	}

);
	this.define("removeNodeList",function(UndoObj,undo){if(undo){
			var d = UndoObj.rData;
			
			for(var i = 0;i < d.length;i ++){
				jpf.XMLDatabase.appendChildNode(d[i].pNode,d[i].removedNode,d[i].beforeNode,UndoObj);
			}
		}
		else jpf.XMLDatabase.removeNodeList(UndoObj.args);
	}

);
	this.define("setUndoObject",function(UndoObj,undo){var q = UndoObj.args;
		UndoObj.xmlNode = q[0];
	}

);
	this.define("group",function(UndoObj,undo,at){if(! UndoObj.stackDone){
			var done = UndoObj.args[0];
			UndoObj.stackDone = done;
			UndoObj.stackUndone =[];
		};
		at[undo ? "undo":"redo"](UndoObj.stackDone.length,false,UndoObj.stackDone,UndoObj.stackUndone);
	}

);
	this.define("setValueByXpath",function(UndoObj,undo){var q = UndoObj.args;
		
		if(! undo){
			if(UndoObj.newNode){
				var xmlNode = q[0].appendChild(UndoObj.newNode);
			}
			else{
				var newNodes =[];
				var xmlNode = jpf.XMLDatabase.createNodeFromXpath(q[0],q[2],newNodes);
				var node = newNodes[0]|| xmlNode;
				UndoObj.newNode = node.nodeType == 1 ? node:null;
				
				if(UndoObj.newNode == q[0])UndoObj.newNode = null;
				UndoObj.oldValue = jpf.getXmlValue(q[0],q[2]);
			};
			jpf.XMLDatabase.setNodeValue(xmlNode,q[1],true);
		}
		else{
			if(UndoObj.newNode)jpf.XMLDatabase.removeNode(UndoObj.newNode);
			else jpf.XMLDatabase.setNodeValue(q[0],UndoObj.oldValue,true);
		}
	}

);
	this.define("addRemoveNodes",function(UndoObj,undo){var q = UndoObj.args;
		
		if(! undo){
			for(var i = 0;i < q[1].length;i ++)jpf.XMLDatabase.appendChildNode(q[0],q[1][i],null,null,null,UndoObj);
			
			for(var i = 0;i < q[2].length;i ++)jpf.XMLDatabase.removeNode(q[2][i],null,UndoObj);
		}
		else{
			for(var i = 0;i < q[2].length;i ++)jpf.XMLDatabase.appendChildNode(q[0],q[2][i]);
			
			for(var i = 0;i < q[1].length;i ++)jpf.XMLDatabase.removeNode(q[1][i]);
		}
	}

);
};

jpf.UndoData = function(action,xmlActionNode,args,jmlNode,selNode){
	this.tagName = "UndoData";
	
	if(action && action.tagName == "UndoData"){
		this.action = action.action;
		this.xmlActionNode = action.xmlActionNode;
		this.xmlNode = action.xmlNode;
		this.args = jpf.copyArray(action.args);
		this.rdb_args = jpf.copyArray(action.rdb_args);
		this.jmlNode = jmlNode;
		this.selNode = action.selNode;
	}
	else{
		this.action = action;
		this.xmlActionNode = xmlActionNode;
		this.args = args;
		this.jmlNode = jmlNode;
		this.selNode = selNode ||(action == "removeNode" ? args[0]:(jmlNode ? jmlNode.value:null));
	};
	this.getActionXmlNode = function(undo){
		if(! this.xmlActionNode)return false;
		
		if(! undo)return this.xmlActionNode;
		var xmlNode = $xmlns(this.xmlActionNode,"undo",jpf.ns.jpf)[0];
		
		if(! xmlNode)xmlNode = this.xmlActionNode;
		return xmlNode;
	};
	this.saveChange = function(undo,at,multicall){
		if(at && ! at.realtime)return at.stackRPC.push(this);
		
		if(typeof this.action == "function")return;
		
		if(this.action == "group"){
			var rpcNodes = this.args[1];
			
			for(var i = 0;i < rpcNodes.length;i ++)rpcNodes[i].saveChange(undo,at,multicall);
			return;
		};
		
		if(this.rdb_args){
			multicall ? jpf.XMLDatabase.socket.sendMulti("rdb",this.rdb_args):jpf.XMLDatabase.socket.send("rdb",this.rdb_args);
		};
		var id = this.id,xmlActionNode = this.getActionXmlNode(undo);
		
		if(! xmlActionNode)return;
		jpf.saveData(xmlActionNode.getAttribute("set"),this.selNode,function(data,state,extra){at.receive(data,state,extra,id);
		}
		,multicall);
	}

}

/*FILEHEAD(/in/Library/Core/Application/AppSettings.js)SIZE(6893)TIME(1213480636505)*/
jpf.appsettings ={
	tagName:"appsettings",autoHideLoading:true,autoDisable:true,disableSpace:true,colsizing:true,colmoving:true,colsorting:true,loadJML:function(x){
		this.jml = x;
		
		if(! self.jpf.debug)jpf.debug = jpf.isTrue(x.getAttribute("debug"));
		
		if(x.getAttribute("debugtype"))jpf.debugType = x.getAttribute("debugtype");
		jpf.debugFilter = jpf.isTrue(x.getAttribute("debug-teleport"))? "":"!teleport";
		this.disableRightClick = jpf.isTrue(x.getAttribute("disable-right-click"));
		this.allowSelect = jpf.isTrue(x.getAttribute("allow-select"));
		this.autoDisableActions = jpf.isTrue(x.getAttribute("auto-disable-actions"));
		this.autoDisable = ! jpf.isFalse(x.getAttribute("auto-disable"));
		this.disableF5 = jpf.isTrue(x.getAttribute("disable-f5"));
		this.autoHideLoading = ! jpf.isFalse(x.getAttribute("auto-hide-loading"));
		this.disableSpace = ! jpf.isFalse(x.getAttribute("disable-space"));
		this.disableBackspace = jpf.isTrue(x.getAttribute("disable-backspace"));
		
		if(jpf.hasDeskRun && this.disableF5)shell.norefresh = true;
		this.colsizing = ! jpf.isFalse(x.getAttribute("col-sizing"));
		this.colmoving = ! jpf.isFalse(x.getAttribute("col-moving"));
		this.colsorting = ! jpf.isFalse(x.getAttribute("col-sorting"));
		
		if(x.getAttribute("layout"))this.layout = x.getAttribute("layout");
	}

};

jpf.settings = function(){
	jpf.register(this,"settings",NOGUI_NODE);
	var oSettings = this;
	this.inherit(jpf.DataBinding);
	this.getSetting = function(name){
		return this[name];
	};
	this.setSetting = function(name,value){
		this.setProperty(name,value);
	};
	this.isChanged = function(name){
		if(! savePoint)return true;
		return this.getSettingsNode(savePoint,name)!= this[name];
	};
	this.exportSettings = function(instruction){
		if(! this.XMLRoot)return;
		jpf.saveData(instruction,this.XMLRoot,function(data,state,extra){if(state != __HTTP_SUCCESS__){
				if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
				else{
					var commError = new Error(0,jpf.formErrorString(0,oSettings,"Saving settings","Error saving settings: " + extra.message));
					
					if(oSettings.dispatchEvent("onerror",jpf.extend({error:commError,state:status}
					,extra))!== false)throw commError;
					return;
				}
			}
		}
	);
		this.savePoint();
	};
	this.importSettings = function(instruction,def_instruction){
		jpf.getData(instruction,null,function(xmlData,state,extra){if(state != __HTTP_SUCCESS__){
				if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
				else{
					var commError = new Error(0,jpf.formErrorString(0,oSettings,"Loading settings","Error loading settings: " + extra.message));
					
					if(oSettings.dispatchEvent("onerror",jpf.extend({error:commError,state:status}
					,extra))!== false)throw commError;
					return;
				}
			};
			
			if(! xmlData && def_instruction)oSettings.importSettings(def_instruction);
			else oSettings.load(xmlData);
		}
	);
	};
	var savePoint;
	this.savePoint = function(){
		savePoint = XMLDatabase.copyNode(this.XMLRoot);
	};
	this.smartBinding = true;
	this.__load = function(XMLRoot){
		XMLDatabase.addNodeListener(XMLRoot,this);
		
		for(var prop in settings){
			this.setProperty(prop,null);
			delete this[prop];
			delete settings[prop];
		};
		var nodes = this.XMLRoot.selectNodes(this.traverseRule || "node()[text()]");
		
		for(var i = 0;i < nodes.length;i ++){
			this.setProperty(this.applyRuleSetOnNode("name",nodes[i])|| nodes[i].tagName,this.applyRuleSetOnNode("value",nodes[i])|| getXmlValue(nodes[i],"text()"));
		}
	};
	this.__xmlUpdate = function(action,xmlNode,listenNode){
		var nodes = this.XMLRoot.selectNodes(this.traverseRule || "node()[text()]");
		
		for(var i = 0;i < nodes.length;i ++){
			var name = this.applyRuleSetOnNode("name",nodes[i])|| nodes[i].tagName;
			var value = this.applyRuleSetOnNode("value",nodes[i])|| getXmlValue(nodes[i],"text()");
			
			if(this[name]!= value)this.setProperty(name,value);
		};
		
		for(var prop in settings){
			if(! this.getSettingsNode(this.XMLRoot,prop)){
				this.setProperty(prop,null);
				delete this[prop];
				delete settings[prop];
			}
		}
	};
	this.reset = function(){
		if(! savePoint)return;
		this.load(XMLDatabase.copyNode(savePoint));
	};
	this.getSettingsNode = function(xmlNode,prop,create){
		if(! xmlNode)xmlNode = this.XMLRoot;
		var nameNode = this.getNodeFromRule("name",this.XMLRoot);
		var valueNode = this.getNodeFromRule("value",this.XMLRoot);
		nameNode = nameNode ? nameNode.getAttribute("select"):"@name";
		valueNode = valueNode ? valueNode.getAttribute("select")|| "text()":"text()";
		var traverse = this.traverseRule + "[" + nameNode + "='" + prop + "']/" + valueNode || prop + "/" + valueNode;
		return create ? jpf.XMLDatabase.createNodeFromXpath(xmlNode,traverse):jpf.getXmlValue(this.xmlNode,traverse);
	};
	this.handlePropSet = function(prop,value,force){
		if(! force && this.XMLRoot)return jpf.XMLDatabase.setNodeValue(this.getSettingsNode(this.XMLRoot,prop,true),true);
		this[prop]= value;
		settings[prop]= value;
	};
	this.loadJML = function(x){
		this.importSettings(x.getAttribute("get"),x.getAttribute("default"));
		this.exportInstruction = x.getAttribute("set");
		this.jml = x;
		jpf.JMLParser.parseChildren(this.jml,null,this);
		var modelId = jpf.XMLDatabase.getInheritedAttribute(x,"model");
		
		for(var i = 0;i < jpf.JMLParser.modelInit.length;i ++)
		if(jpf.JMLParser.modelInit[i][0]== this)return;
		jpf.setModel(modelId,this);
	};
	this.destroy = function(){
		if(this.exportInstruction)this.exportSettings(this.exportInstruction);
	}

}

/*FILEHEAD(/in/Library/Core/Application/DeskRun.js)SIZE(3302)TIME(1201642352828)*/

/*FILEHEAD(/in/Library/Core/Application/Layout.js)SIZE(35296)TIME(1213554952584)*/
jpf.layoutServer ={
	layouts:{
	}

,addParent:function(oHtml,pMargin){
		if(! oHtml.getAttribute("id"))jpf.setUniqueHtmlId(oHtml);
		return this.layouts[oHtml.getAttribute("id")]={
			layout:new jpf.Layout(oHtml,pMargin),controls:[]}
	}
	,splitters:{
	}

,freesplitters:[],vars:{
	}

,getSplitter:function(layout){
		if(! this.splitters[this.getHtmlId(layout.parentNode)])this.splitters[this.getHtmlId(layout.parentNode)]=[];
		
		if(this.freesplitters.length){
			var splitter = this.freesplitters.pop();
		}
		else{
			var splitter = new jpf.splitter(this.parentNode);
			splitter.loadSkin();
			splitter.draw();
		};
		this.splitters[this.getHtmlId(layout.parentNode)].push(splitter);
		return splitter;
	}
	,clearSplitters:function(layout){
		var ar = this.splitters[this.getHtmlId(layout.parentNode)];
		
		if(! ar)return;
		
		for(var i = 0;i < ar.length;i ++){
			this.freesplitters.push(ar[i]);
			
			if(! ar[i].oExt.parentNode)continue;
			ar[i].oExt.parentNode.removeChild(ar[i].oExt);
		};
		ar.length = 0;
	}
	,G:[],addGrid:function(str,pHtmlNode){
		this.G.push([str,pHtmlNode]);
	}
	,activateGrid:function(){
		if(! this.G.length)return;
		
		for(var i = 0;i < this.G.length;i ++){
			jpf.layoutServer.setRules(this.G[i][1],"grid",this.G[i][0]);
			
			if(! jpf.hasSingleRszEvent)jpf.layoutServer.activateRules(this.G[i][1]);
		};
		
		if(jpf.hasSingleRszEvent)jpf.layoutServer.activateRules();
	}
	,get:function(oHtml,pMargin){
		var layout = this.layouts[oHtml.getAttribute("id")];
		
		if(! layout)layout = this.addParent(oHtml,pMargin);
		return layout;
	}
	,isLoadedXml:function(xmlNode){
		var nodes = xmlNode.childNodes;
		var node = xmlNode.selectSingleNode(".//node[@name]");
		var jmlNode = node ? self[node.getAttribute("name")]:null;
		
		if(! jmlNode)throw new Error(0,jpf.formErrorString(0,null,"Loading Alignment from XML","Could not find JML node" +(node ? " by name '" + node.getAttribute("name")+ "'":""),xmlNode));
		var pNode = jmlNode.oExt.parentNode;
		var pId = this.getHtmlId(pNode);
		return this.loadedXml[pId]== xmlNode;
	}
	,loadedXml:{
	}

,cacheXml:{
	}

,loadXml:function(xmlNode){
		var nodes = xmlNode.childNodes;
		var node = xmlNode.selectSingleNode(".//node[@name]");
		var jmlNode = node ? self[node.getAttribute("name")]:null;
		
		if(! jmlNode)throw new Error(0,jpf.formErrorString(0,null,"Loading Alignment from XML","Could not find JML node" +(node ? " by name '" + node.getAttribute("name")+ "'":""),xmlNode));
		var pNode = jmlNode.oExt.parentNode;
		var layout = this.get(pNode,(xmlNode.getAttribute("margin")|| "").split(/,\s*/));
		var pId = this.getHtmlId(pNode);
		this.metadata =[];
		
		for(var i = 0;i < nodes.length;i ++){
			if(nodes[i].nodeType != 1)continue;
			layout.root = this.parseXml(nodes[i],layout);
			break;
		};
		this.compile(pNode);
		
		if(jpf.JMLParser.inited)this.activateRules(pNode);
		this.loadedXml[pId]= xmlNode;
	}
	,metadata:[],getData:function(type,layout){
		return{
			vbox:type == "vbox",hbox:type == "hbox",node:! type.match(/^(?:hbox|vbox)$/),children:[],isRight:false,isBottom:false,edgeMargin:0,splitter:null,minwidth:0,minheight:0,weight:1,pHtml:layout.parentNode,size:[300,200],position:[0,0],copy:function(){
				var copy = jpf.extend({}
			,this);
				
				if(! this.node){
					copy.children =[];
					
					for(var i = 0;i < this.children.length;i ++){
						copy.children[i]= this.children[i].copy();
						copy.children[i].parent = copy;
					}
				};
				return copy;
			}
			,setPosition:function(x,y){
				this.oHtml.style.left = x + "px";
				this.oHtml.style.top = y + "px";
				this.position =[x,y];
			}
			,setFloat:function(){
				var diff = jpf.compat.getDiff(this.oHtml);
				this.oHtml.style.width =(this.size[0]- diff[0])+ "px";
				
				if(this.state < 0)this.oHtml.style.height =(this.size[1]- diff[1])+ "px";
				this.prehide();
				this.hidden = 3;
				
				if(this.hid){
					var jmlNode = jpf.lookup(this.hid);
					
					if(jmlNode.syncAlignment)jmlNode.syncAlignment(this);
				}
			}
			,unfloat:function(){
				if(this.hidden != 3)return;
				this.show();
			}
			,state:- 1,minimize:function(height){
				if(this.state < 0){
					this.lastfheight = this.fheight;
					this.fheight = "" + height;
					this.lastsplitter = this.splitter;
					
					if(this.parent.vbox)this.splitter = - 1;
					this.state = 1;
				}
			}
			,restore:function(){
				if(this.state > 0){
					this.fheight = this.lastfheight;
					this.splitter = this.lastsplitter;
					this.state = - 1;
				}
			}
			,hidden:false,hiddenChildren:[],prehide:function(){
				if(this.hidden == 3){
					this.hidden = true;
					
					if(this.hid)jpf.lookup(this.hid).visible = false;
					
					if(this.oHtml)this.oHtml.style.display = "none";
					return;
				};
				this.hidepos ={
					prev:this.parent.children[this.stackId - 1],next:this.parent.children[this.stackId + 1]};
				this.hidden = true;
				jpf.layoutServer.dlist.push(this);
				
				for(var c = 0,i = 0;i < this.parent.children.length;i ++){
					if(! this.parent.children[i].hidden){
						c = 1;
						break;
					}
				};
				
				if(! c)this.parent.prehide();
			}
			,preshow:function(){
				if(! this.hidden)return;
				this.hidden = false;
				
				if(this.parent.hidden)this.parent.preshow();
				jpf.layoutServer.dlist.push(this);
			}
			,hide:function(){
				var nodes = this.parent.children;
				nodes.removeIndex(this.stackId);
				
				for(var i = 0;i < nodes.length;i ++)nodes[i].stackId = i;
				this.parent.hiddenChildren.push(this);
				
				if(this.hidden != 3){
					if(this.hid)jpf.lookup(this.hid).visible = false;
					
					if(this.oHtml)this.oHtml.style.display = "none";
				}
			}
			,show:function(){
				var nodes = this.parent.children;
				
				if(this.hidepos.prev && this.hidepos.prev.parent == this.parent && ! this.hidepos.prev.hidden){
					if(nodes.length < this.hidepos.prev.stackId + 1)nodes.push(this);
					else nodes.insertIndex(this,this.hidepos.prev.stackId + 1);
				}
				else 
				if(this.hidepos.next && this.hidepos.next.parent == this.parent && ! this.hidepos.next.hidden){
					if(this.hidepos.next.stackId == 0)nodes.unshift(this);
					else 
					if(nodes.length < this.hidepos.next.stackId - 1)nodes.push(this);
					else nodes.insertIndex(this,this.hidepos.next.stackId - 1);
				}
				else 
				if(! this.hidepos.prev){
					nodes.unshift(this);
				}
				else 
				if(! this.hidepos.next){
					nodes.push(this);
				}
				else{
					if(this.stackId < nodes.length)nodes.insertIndex(this,this.stackId);
					else nodes.push(this);
				};
				
				for(var i = 0;i < nodes.length;i ++)
				if(nodes[i])nodes[i].stackId = i;
				this.parent.hiddenChildren.remove(this);
				
				if(this.hidden != 3){
					if(this.hid)jpf.lookup(this.hid).visible = true;
					
					if(this.oHtml)this.oHtml.style.display = "block";
				};
				this.hidden = false;
				this.hidepos = null;
			}
		};
	}
	,parseXml:function(x,layout,jmlNode,norecur){
		var aData = this.getData(x[jpf.TAGNAME],layout.layout);
		
		if(aData.node){
			if(! jmlNode){
				var jmlNode = self[x.getAttribute("name")];
				
				if(! jmlNode)throw new Error(0,jpf.formErrorString(0,null,"Parsing Alignment from XML","Could not find JML node" + x.getAttribute("name"),x));
			};
			
			if(! jmlNode.visible)jmlNode.show(true);
			aData.oHtml = jmlNode.oExt;
			jmlNode.aData = aData;
			
			if(jmlNode.jml.getAttribute("width"))aData.fwidth = jmlNode.jml.getAttribute("width");
			
			if(jmlNode.jml.getAttribute("height"))aData.fheight = jmlNode.jml.getAttribute("height");
			
			if(jmlNode.minwidth)aData.minwidth = jmlNode.minwidth;
			
			if(jmlNode.minheight)aData.minheight = jmlNode.minheight;
			
			if(! this.getHtmlId(aData.oHtml))jpf.setUniqueHtmlId(aData.oHtml);
			aData.id = this.getHtmlId(aData.oHtml);
			
			if(aData.oHtml.style)aData.oHtml.style.position = "absolute";
			aData.hid = jmlNode.uniqueId;
		}
		else{
			aData.id = this.metadata.push(aData)- 1;
		};
		
		if(x.getAttribute("align"))aData.template = x.getAttribute("align");
		
		if(x.getAttribute("lean"))aData.isBottom = x.getAttribute("lean").match(/bottom/);
		
		if(x.getAttribute("lean"))aData.isRight = x.getAttribute("lean").match(/right/);
		
		if(x.getAttribute("edge")&& x.getAttribute("edge")!= "splitter")aData.edgeMargin = x.getAttribute("edge");
		
		if(x.getAttribute("weight"))aData.weight = parseFloat(x.getAttribute("weight"));
		
		if(x.getAttribute("splitter")|| x.getAttribute("edge")== "splitter")aData.splitter = x.getAttribute("splitter")||(x.getAttribute("edge")== "splitter" ? 5:false);
		
		if(x.getAttribute("width"))aData.fwidth = x.getAttribute("width");
		
		if(x.getAttribute("height"))aData.fheight = x.getAttribute("height");
		
		if(x.getAttribute("min-width"))aData.minwidth = x.getAttribute("min-width");
		
		if(x.getAttribute("min-height"))aData.minheight = x.getAttribute("min-height");
		
		if(x.getAttribute("lastheight"))aData.lastfheight = x.getAttribute("lastheight");
		
		if(x.getAttribute("lastsplitter"))aData.lastsplitter = x.getAttribute("lastsplitter");
		
		if(x.getAttribute("hidden"))aData.hidden = x.getAttribute("hidden")== 3 ? x.getAttribute("hidden"):jpf.isTrue(x.getAttribute("hidden"));
		
		if(x.getAttribute("state"))aData.state = x.getAttribute("state");
		
		if(x.getAttribute("stack"))aData.stackId = parseInt(x.getAttribute("stack"));
		
		if(x.getAttribute("position"))aData.position = x.getAttribute("position").split(",");
		
		if(x.getAttribute("size"))aData.size = x.getAttribute("size").split(",");
		
		if(aData.fwidth && aData.fwidth.indexOf("/")> - 1){
			aData.fwidth = eval(aData.fwidth);
			
			if(aData.fwidth <= 1)aData.fwidth =(aData.fwidth * 100)+ "%";
		};
		
		if(aData.fheight && aData.fheight.indexOf("/")> - 1){
			aData.fheight = eval(aData.fheight);
			
			if(aData.fheight <= 1)aData.fheight =(aData.fheight * 100)+ "%";
		};
		aData.edgeMargin = Math.max(aData.splitter || 0,aData.edgeMargin || 0);
		
		if(aData.node && jmlNode.syncAlignment)jmlNode.syncAlignment(aData);
		
		if(! norecur && ! aData.node){
			var nodes = x.childNodes;
			
			for(var last,a,i = 0;i < nodes.length;i ++){
				if(nodes[i].nodeType != 1)continue;
				a = this.parseXml(nodes[i],layout);
				
				if(last && last.hidden)last.hidepos.next = a;
				
				if(a.hidden){
					if(a.hid){
						var j = jpf.lookup(a.hid);
						
						if(a.hidden === true && j.visible){
							j.visible = false;
							a.oHtml.style.display = "none";
						};
						
						if(a.hidden == 3){
							var diff = jpf.compat.getDiff(a.oHtml);
							a.oHtml.style.left = a.position[0]+ "px";
							a.oHtml.style.top = a.position[1]+ "px";
							a.oHtml.style.width =(a.size[0]- diff[0])+ "px";
							a.oHtml.style.height =((! this.state || this.state < 0 ? a.size[1]:a.fheight)- diff[1])+ "px";
						}
					};
					aData.hiddenChildren.push(a);
					a.hidepos ={
						prev:aData.children[aData.children.length - 1]}
				}
				else{
					if(a.hid){
						var j = jpf.lookup(a.hid);
						
						if(! j.visible){
							j.visible = true;
							a.oHtml.style.display = "block";
						}
					};
					a.stackId = aData.children.push(a)- 1;
				};
				a.parent = aData;
				last = a;
			}
		};
		aData.xml = x;
		return aData;
	}
	,getXml:function(pNode){
		var l = jpf.layoutServer.get(pNode);
		var xmlNode = l.root.xml ? l.root.xml.ownerDocument.createElement("layout"):jpf.XMLDatabase.getXml("<layout />");
		jpf.layoutServer.parseToXml(l.root,xmlNode);
		return xmlNode}
	,saveXml:function(){
		for(var pId in this.loadedXml){
			var xmlNode = this.loadedXml[pId];
			var l = this.layouts[pId];
			var root = l.root;
			
			for(var i = xmlNode.childNodes.length - 1;i >= 0;i --)xmlNode.removeChild(xmlNode.childNodes[i]);
			this.parseToXml(root,xmlNode);
		}
	}
	,parseToXml:function(oItem,parentNode){
		var xmlNode = oItem.xml ? oItem.xml.cloneNode(false):parentNode.ownerDocument.createElement(oItem.vbox ? "vbox":(oItem.hbox ? "hbox":"node"));
		parentNode.appendChild(xmlNode);
		
		if(oItem.template)xmlNode.setAttribute("align",oItem.template);
		
		if(oItem.edgeMargin)xmlNode.setAttribute("margin",oItem.edgeMargin);
		
		if(oItem.weight)xmlNode.setAttribute("weight",oItem.weight);
		
		if(oItem.splitter)xmlNode.setAttribute("splitter",oItem.splitter === false ? - 1:oItem.splitter);
		
		if(oItem.fwidth)xmlNode.setAttribute("width",oItem.fwidth);
		
		if(oItem.fheight)xmlNode.setAttribute("height",oItem.fheight);
		
		if(oItem.minwidth)xmlNode.setAttribute("min-width",oItem.minwidth);
		
		if(oItem.minheight)xmlNode.setAttribute("min-height",oItem.minheight);
		
		if(oItem.lastfheight)xmlNode.setAttribute("lastheight",oItem.lastfheight);
		
		if(oItem.lastsplitter)xmlNode.setAttribute("lastsplitter",oItem.lastsplitter);
		
		if(oItem.hidden)xmlNode.setAttribute("hidden",oItem.hidden == 3 ? '3':'true');
		else 
		if(xmlNode.getAttribute("hidden"))xmlNode.removeAttribute("hidden");
		
		if(oItem.stackId)xmlNode.setAttribute("stack",oItem.stackId);
		
		if(oItem.state > 0)xmlNode.setAttribute("state",oItem.state);
		else 
		if(xmlNode.getAttribute("state"))xmlNode.removeAttribute("state");
		
		if(oItem.position)xmlNode.setAttribute("position",oItem.position.join(","));
		
		if(oItem.size)xmlNode.setAttribute("size",oItem.size.join(","));
		function getArrayIndex(arr,obj){
			for(var i = 0;i < arr.length;i ++)
			if(arr[i].id == obj.id)return i;
			return - 1;
		};
		var list = oItem.children.copy();
		
		for(var i = 0;i < oItem.hiddenChildren.length;i ++){
			var hidepos = oItem.hiddenChildren[i].hidepos;
			
			if(hidepos.prev){
				var index = getArrayIndex(list,hidepos.prev);
				
				if(index < 0)list.unshift(oItem.hiddenChildren[i]);
				else list.insertIndex(oItem.hiddenChildren[i],index);
			}
			else 
			if(hidepos.next){
				var index = getArrayIndex(list,hidepos.next);
				
				if(index - 1 < 0)list.unshift(oItem.hiddenChildren[i]);
				else list.insertIndex(oItem.hiddenChildren[i],index - 1);
			}
			else{
				list.push(oItem.hiddenChildren[i]);
			}
		};
		
		for(var i = 0;i < list.length;i ++){
			this.parseToXml(list[i],xmlNode);
		}
	}
	,compile:function(oHtml){
		var l = this.layouts[oHtml.getAttribute("id")];
		
		if(! l)return false;
		var root = l.root.copy();
		l.layout.compile(root);
		l.layout.reset();
	}
	,timer:null,qlist:[],dlist:[],queue:function(oHtml,compile){
		for(var i = 0;i < this.qlist.length;i ++)
		if(this.qlist[i][0]== oHtml)return;
		this.qlist.push([oHtml,compile]);
		
		if(! this.timer)this.timer = setTimeout("jpf.layoutServer.processQueue()");
	}
	,processQueue:function(){
		this.timer = null;
		
		for(var i = 0;i < this.dlist.length;i ++){
			if(this.dlist[i].hidden)this.dlist[i].hide();
			else this.dlist[i].show();
		};
		
		for(var i = 0;i < this.qlist.length;i ++){
			if(this.qlist[i][1])jpf.layoutServer.compile(this.qlist[i][0]);
			
			if(! jpf.hasSingleRszEvent)jpf.layoutServer.activateRules(this.qlist[i][0]);
		};
		
		if(jpf.hasSingleRszEvent)jpf.layoutServer.activateRules();
		this.qlist =[];
		this.dlist =[];
	}
	,rules:{
	}

,getHtmlId:function(oHtml){
		return oHtml.getAttribute ? oHtml.getAttribute("id"):1;
	}
	,setRules:function(oHtml,id,rules,overwrite){
		if(! this.getHtmlId(oHtml))jpf.setUniqueHtmlId(oHtml);
		
		if(! this.rules[this.getHtmlId(oHtml)])this.rules[this.getHtmlId(oHtml)]={
		};
		var ruleset = this.rules[this.getHtmlId(oHtml)][id];
		
		if(! overwrite && ruleset){
			this.rules[this.getHtmlId(oHtml)][id]= rules + "\n" + ruleset;
		}
		else this.rules[this.getHtmlId(oHtml)][id]= rules;
	}
	,getRules:function(oHtml,id){
		return id ? this.rules[this.getHtmlId(oHtml)][id]:this.rules[this.getHtmlId(oHtml)];
	}
	,removeRule:function(oHtml,id){
		if(! this.rules[this.getHtmlId(oHtml)])return;
		var ret = this.rules[this.getHtmlId(oHtml)][id]? true:false;
		delete this.rules[this.getHtmlId(oHtml)][id];
		var prop;
		
		for(prop in this.rules[this.getHtmlId(oHtml)]){
		};
		
		if(! prop)delete this.rules[this.getHtmlId(oHtml)];
		return ret;
	}
	,activateRules:function(oHtml,no_exec){
		if(! jpf.hasSingleRszEvent && ! oHtml){
			var prop;
			
			for(prop in this.rules){
				if(document.getElementById(prop).onresize)continue;
				this.activateRules(document.getElementById(prop));
			};
			return;
		};
		var strRules =[];
		
		if(! jpf.hasSingleRszEvent){
			var rules = this.rules[this.getHtmlId(oHtml)];
			
			if(! rules)return false;
			
			for(var id in rules){
				if(typeof rules[id]!= "string")continue;
				strRules.push(rules[id]);
			};
			var rsz = new Function(strRules.join("\n"));
			oHtml.onresize = rsz;
			
			if(! no_exec)rsz();
		}
		else{
			for(rule in this.rules){
				var rules = this.rules[rule];
				
				for(var id in rules){
					if(typeof rules[id]!= "string")continue;
					strRules.push(rules[id]);
				}
			};
			window.onresize = new Function(strRules.reverse().join("\n")+ "\n" + strRules.join("\n"));
			
			if(! no_exec)window.onresize();
		}
	}
	,forceResize:function(oHtml){
		var rsz =(! jpf.hasSingleRszEvent ? oHtml:window).onresize;
		
		if(rsz)rsz();
	}
	,paused:{
	}

,pause:function(oHtml,replaceFunc){
		if(jpf.hasSingleRszEvent)oHtml = window;
		this.paused[this.getHtmlId(oHtml)]= oHtml.onresize;
		
		if(replaceFunc){
			oHtml.onresize = replaceFunc;
			replaceFunc();
		}
		else oHtml.onresize = null;
	}
	,play:function(oHtml){
		if(jpf.hasSingleRszEvent)oHtml = window;
		var oldFunc = this.paused[this.getHtmlId(oHtml)];
		oHtml.onresize = oldFunc;
		
		if(oldFunc)oldFunc();
		this.paused[this.getHtmlId(oHtml)]= null;
	}

};

jpf.Layout = function(parentNode,pMargin){
	var pMargin = pMargin && pMargin.length == 4 ? pMargin:[0,0,0,0];
	this.pMargin = pMargin;
	this.RULES =[];
	this.parentNode = parentNode;
	
	if(! this.parentNode.getAttribute("id"))jpf.setUniqueHtmlId(this.parentNode);
	var knownVars ={
	};
	var minWidth = 0;
	var minHeight = 0;
	this.createSplitters = true;
	this.setMargin = function(sMargin){
		pMargin = sMargin;
	};
	this.reset = function(){
		this.RULES =[];
		knownVars ={
		};
		this.lastType = null;
		this.globalEdge = null;
		this.globalSplitter = null;
	};
	this.compile = function(root,noapply){
		this.addRule("var v = jpf.layoutServer.vars");
		this.globalSplitter = root.splitter;
		this.globalEdge = root.edgeMargin;
		
		if(this.globalSplitter || this.globalEdge)this.setglobals(root);
		this.preparse(root);
		this.parserules(root);
		
		if(this.createSplitters){
			jpf.layoutServer.clearSplitters(this);
			this.parsesplitters(root);
		};
		this.RULES = new DepTree().calc(this.RULES);
		var str =("try{" + this.RULES.join("}catch(e){}\ntry{")+ "}catch(e){}\n").replace(/([^=]+\.style[^=]+) = (.*?)\}/g,"$1 = ($2) + 'px'}");
		str = str.replace(/q([\w|]+)\.(offset|style)/g,'document.getElementById("q$1").$2');
		this.lastRoot = root;
		
		if(! noapply)jpf.layoutServer.setRules(this.parentNode,"layout",str,true);
		else return str;
		return false;
	};
	this.addRule = function(rule){
		this.RULES.push(rule);
	};
	this.setglobals = function(node){
		if(this.globalEdge && ! node.edgeMargin){
			if(! node.splitter)node.splitter = this.globalSplitter;
			node.edgeMargin = Math.max(this.globalSplitter,this.globalEdge);
		};
		
		if(node.node)return;
		
		for(var i = 0;i < node.children.length;i ++){
			this.setglobals(node.children[i]);
		}
	};
	this.preparse = function(node){
		if(node.node)return;
		else{
			var type = node.vbox ? "height":"width";
			var cmhwp = 0;
			var cmwwp = 0;
			var ctph = 0;
			node.childweight = 0;
			node.childminwidth = 0;
			node.childminheight = 0;
			var rules =["v." + type + "_" + node.id],extra =[];
			var nodes = node.children;
			
			for(var i = 0;i < nodes.length;i ++){
				if(i < nodes.length - 1)rules.push(" - " + nodes[i].edgeMargin);
				var f = nodes[i]["f" + type];
				
				if(f){
					extra.push(f.indexOf("%")> - 1 ? " - (" +(nodes[i]["calc" + type]= "v.innerspace_" + node.id + " * " + parseFloat(f)/ 100)+ ")":" - (" + f + ")");
				}
				else{
					node.childweight += nodes[i].weight;
					nodes[i]["calc" + type]= "Math." +(i % 2 == 0 ? "ceil":"floor")+ "(v.restspace_" + node.id + " * (" + nodes[i].weight + "/v.weight_" + node.id + "))";
				};
				var g =(node.vbox ? "width":"height");
				var v = nodes[i]["f" + g];
				
				if(! v)nodes[i]["calc" + g]=(node.vbox ? "v.width_":"v.height_")+ node.id;
				else nodes[i]["calc" + g]= v.indexOf("%")> - 1 ? "v.innerspace_" + node.id + " * " + parseFloat(v)/ 100:v;
				
				if(! nodes[i].node)this.preparse(nodes[i]);
				
				if(node.vbox){
					node.childminheight += Math.max(nodes[i].childminheight || 0,nodes[i].minheight || 0,10)+ nodes[i].edgeMargin;
					node.childminwidth = Math.max(node.childminwidth,nodes[i].minwidth || nodes[i].childminwidth || 10);
				}
				else{
					node.childminwidth += Math.max(nodes[i].minwidth || 0,nodes[i].childminwidth || 0,10)+ nodes[i].edgeMargin;
					node.childminheight = Math.max(node.childminheight,nodes[i].minheight || nodes[i].childminheight || 10);
				}
			};
			node.innerspace = rules.join("");
			node.restspace = node.innerspace + " " + extra.join("");
			
			if(! node.parent){
				var hordiff = 0,verdiff = 0;
				
				if(this.parentNode.tagName.toLowerCase()!= "body"){
					var diff = jpf.compat.getDiff(this.parentNode);
					var verdiff = diff[0];
					var hordiff = diff[1];
				};
				var strParentNodeWidth =(this.parentNode.tagName.toLowerCase()== "body" ?(jpf.isIE ? "document.documentElement['offsetWidth']":"window.innerWidth"):"document.getElementById('" + this.parentNode.id + "').offsetWidth");
				var strParentNodeHeight =(this.parentNode.tagName.toLowerCase()== "body" ?(jpf.isIE ? "document.documentElement['offsetHeight']":"window.innerHeight"):"document.getElementById('" + this.parentNode.id + "').offsetHeight");
				node.calcwidth = "Math.max(" + minWidth + ", " + strParentNodeWidth + " - " +(pMargin[1])+ " - " + pMargin[3]+ " - " + hordiff + ")";
				node.calcheight = "Math.max(" + minHeight + ", " + strParentNodeHeight + " - " +(pMargin[2])+ " - " + pMargin[0]+ " - " + verdiff + ")";
			}
		}
	};
	this.parserules = function(oItem){
		if(! oItem.node){
			this.addRule("v.width_" + oItem.id + " = Math.max(" + oItem.childminwidth + "," + oItem.minwidth + "," +(oItem.calcwidth || oItem.fwidth)+ ")");
			this.addRule("v.height_" + oItem.id + " = Math.max(" + oItem.childminheight + "," + oItem.minheight + "," +(oItem.calcheight || oItem.fheight)+ ")");
			this.addRule("v.weight_" + oItem.id + " = " + oItem.childweight);
			this.addRule("v.innerspace_" + oItem.id + " = " + oItem.innerspace);
			this.addRule("v.restspace_" + oItem.id + " = " + oItem.restspace);
			var aData = jpf.layoutServer.metadata[oItem.id];
			aData.calcData = oItem;
			oItem.original = aData;
			
			if(! oItem.parent){
				this.addRule("v.left_" + oItem.id + " = " + pMargin[0]);
				this.addRule("v.top_" + oItem.id + " = " + pMargin[3]);
				
				for(var i = 0;i < oItem.children.length;i ++)this.parserules(oItem.children[i]);
				return;
			}
			else{
				var vtop =["v.top_" + oItem.id," = "];
				var vleft =["v.left_" + oItem.id," = "];
			}
		}
		else{
			var vtop =[oItem.id,".style.top = "];
			var vleft =[oItem.id,".style.left = "];
			
			if(oItem.hid){
				var aData = jpf.lookup(oItem.hid).aData;
				aData.calcData = oItem;
				oItem.original = aData;
			};
			var oEl = oItem.oHtml;
			var diff = jpf.compat.getDiff(oEl);
			var verdiff = diff[1];
			var hordiff = diff[0];
			
			if(oItem.calcwidth)this.addRule(oItem.id + ".style.width = -" + hordiff + " + Math.max( " + oItem.calcwidth + ", " + oItem.minwidth + ")");
			else oEl.style.width = Math.max(0,oItem.fwidth - hordiff)+ "px";
			
			if(oItem.calcheight)this.addRule(oItem.id + ".style.height = -" + verdiff + " + Math.max( " + oItem.calcheight + ", " + oItem.minheight + ")");
			else oEl.style.height = Math.max(0,oItem.fheight - verdiff)+ "px";
		};
		var oLastSame = oItem.parent.children[oItem.stackId - 1];
		var oNextSame = oItem.parent.children[oItem.stackId + 1];
		
		if(oItem.parent.vbox){
			if(oItem.parent.isBottom){
				if(! oNextSame)vtop.push("v.top_",oItem.parent.id," + v.height_",oItem.parent.id," - ",oItem.id,".offsetHeight");
				else{
					if(oNextSame.node)vtop.push(oNextSame.id,".offsetTop - ",oNextSame.edgeMargin," - ",oItem.id,".offsetHeight");
					else vtop.push("v.top_" + oNextSame.id," - ",oNextSame.edgeMargin," - ",(oItem.node ? oItem.id + ".offsetHeight":"v.height_" + oItem.id));
				}
			}
			else 
			if(! oItem.stackId)vtop.push("v.top_" + oItem.parent.id);
			else 
			if(oLastSame){
				if(oLastSame.node)vtop.push(oLastSame.id,".offsetTop + ",oLastSame.id,".offsetHeight + ",oLastSame.edgeMargin);
				else vtop.push("v.top_",oLastSame.id," + v.height_",oLastSame.id," + ",oLastSame.edgeMargin);
			}
		}
		else vtop.push("v.top_" + oItem.parent.id);
		
		if(oItem.parent.hbox){
			if(oItem.parent.isRight){
				if(! oNextSame)vleft.push("v.left_",oItem.parent.id," + v.width_",oItem.parent.id," - ",oItem.id,".offsetWidth",null);
				else{
					if(oNextSame.node)vleft.push(oNextSame.id,".offsetLeft - ",oNextSame.edgeMargin," - ",oItem.id,".offsetWidth");
					else vleft.push("v.left_" + oNextSame.id," - ",oNextSame.edgeMargin," - ",(oItem.node ? oItem.id + ".offsetWidth":"v.width_" + oItem.id));
				}
			}
			else 
			if(! oItem.stackId)vleft.push("v.left_" + oItem.parent.id);
			else 
			if(oLastSame){
				if(oLastSame.node)vleft.push(oLastSame.id,".offsetLeft + ",oLastSame.id,".offsetWidth + ",oLastSame.edgeMargin);
				else vleft.push("v.left_",oLastSame.id," + v.width_",oLastSame.id," + ",oLastSame.edgeMargin);
			}
		}
		else vleft.push("v.left_" + oItem.parent.id);
		
		if(vleft.length > 2)this.addRule(vleft.join(""));
		
		if(vtop.length > 2)this.addRule(vtop.join(""));
		
		if(! oItem.node){
			for(var i = 0;i < oItem.children.length;i ++)this.parserules(oItem.children[i]);
		}
	};
	this.parsesplitters = function(oItem){
		if(oItem.parent && oItem.splitter > 0 && oItem.stackId != oItem.parent.children.length - 1)jpf.layoutServer.getSplitter(this).init(oItem.splitter,oItem.hid,oItem);
		
		if(! oItem.node){
			for(var i = 0;i < oItem.children.length;i ++)this.parsesplitters(oItem.children[i]);
		}
	};
	function DepTree(){
		this.parselookup ={
		};
		this.nRules =[];
		this.doneRules ={
		};
		this.maskText = function(str,m1,m2,m3){
			return m1 + ".offset" + m2.toUpperCase();
		};
		this.handleVar = function(match,m1,m2,m3){
			var vname = "a" + m1.replace(/\|/g,"_")+ "_style_" + m2.toLowerCase();
			return knownVars[vname]? vname:match;
		};
		this.parseRule = function(rule){
			var aRule = rule.split(" = ");
			var id = aRule[0].replace(/^([_\w\d\|]+)\.style\.(\w)/,this.maskText);
			var vname = "a" + aRule[0].replace(/[\.\|]/g,"_");
			knownVars[vname]= true;
			var depsearch = aRule[1].split(/[ \(\)]/);
			var deps =[];
			
			for(var i = 0;i < depsearch.length;i ++){
				if(depsearch[i].match(/^([_\w\d\|]+)\.offset(\w+)$/)&& ! depsearch[i].match(/PNODE/)){
					deps.push(depsearch[i]);
				}
			};
			
			if(vname.match(/width|height/i)){
				aRule[1]= aRule[1].replace(/^(\s*[\-\d]+[\s\-\+]+)/,"");
				ruleB = aRule[0]+ " = " + RegExp.$1 + vname;
			}
			else ruleB = aRule[0]+ " = " + vname;
			
			if(rule.match(/^v\./)){
				return{
					id:id,rule_p1:aRule[0]+ " = ",rule_p2:aRule[1],ruleb:null,deps:deps,processed:false};
			};
			return{
				id:id,rule_p1:"var " + vname + " = ",rule_p2:aRule[1],ruleb:ruleB,deps:deps,processed:false};
		};
		this.calc = function(aRules){
			var str = "";
			
			for(var i = 0;i < aRules.length;i ++){
				if(aRules[i].match(/^var/)){
					this.nRules.push(aRules[i]);
					continue;
				};
				var o = this.parseRule(aRules[i],i);
				this.parselookup[o.id]= o;
			};
			
			for(prop in this.parselookup){
				if(typeof prop != "string" || ! this.parselookup[prop]|| typeof this.parselookup[prop]== "boolean" || typeof this.parselookup[prop]== "function")continue;
				this.processNode(this.parselookup[prop]);
			};
			
			for(prop in this.parselookup){
				if(typeof prop != "string" || ! this.parselookup[prop]|| typeof this.parselookup[prop]== "boolean" || typeof this.parselookup[prop]== "function")continue;
				var root = this.parselookup[prop];
				this.walkRules(root);
			};
			
			for(prop in this.parselookup){
				if(typeof prop != "string" || ! this.parselookup[prop]|| typeof this.parselookup[prop]== "boolean" || typeof this.parselookup[prop]== "function" || ! this.parselookup[prop].ruleb)continue;
				this.nRules.push(this.parselookup[prop].ruleb);
			};
			return this.nRules;
		};
		this.str = "";
		this.walkRules = function(root){
			if(this.doneRules[root.id])return;
			
			for(var i = 0;i < root.deps.length;i ++){
				if(root.deps[i]&& ! root.deps[i].walked && ! this.doneRules[root.deps[i].id]){
					root.deps[i].walked = true;
					this.walkRules(root.deps[i]);
				}
			};
			this.doneRules[root.id]= true;
			this.nRules.push(root.rule_p1 + root.rule_p2.replace(/([_\w\d\|]+)\.offset(\w+)/g,this.handleVar));
		};
		this.processNode = function(o){
			for(var i = 0;i < o.deps.length;i ++){
				var l = typeof o.deps[i]== "string" ? this.parselookup[o.deps[i]]:o.deps[i];
				
				if(! l){
					o.deps[i]= null;
					continue;
				};
				o.deps[i]= l;
				
				if(! l.processed){
					l.processed = true;
					this.processNode(l);
				}
			}
		}
	}

}

/*FILEHEAD(/in/Library/Core/Application/Model.js)SIZE(29193)TIME(1213201290146)*/
jpf.Model = function(data,caching){
	jpf.register(this,"model",NOGUI_NODE);
	this.data = data;
	this.caching = caching;
	this.cache ={
	};
	this.loadInJmlNode = function(jmlNode,xpath){
		if(this.data && xpath){
			if(! jpf.supportNamespaces &&(this.data.prefix || this.data.scopeName))(this.data.nodeType == 9 ? this.data:this.data.ownerDocument).setProperty("SelectionNamespaces","xmlns:" +(this.data.prefix || this.data.scopeName)+ "='" + this.data.namespaceURI + "'");
			var xmlNode = this.data.selectSingleNode(xpath);
			
			if(! xmlNode)jmlNode.listenRoot = jpf.XMLDatabase.addNodeListener(this.data,jmlNode);
		}
		else xmlNode = this.data || null;
		jmlNode.load(xmlNode);
	};
	var jmlNodes ={
	};
	this.register = function(jmlNode,xpath){
		if(! jmlNode)return this;
		jmlNodes[jmlNode.uniqueId]=[jmlNode,xpath];
		jmlNode.model = this;
		
		if(this.connect){
			if(this.connect.type)this.connect.node.connect(jmlNode,null,this.connect.select,this.connect.type);
			else this.connect.node.connect(jmlNode,true,this.connect.select);
		}
		else{
			jmlNode.model = this;
			
			if(this.data)this.loadInJmlNode(jmlNode,xpath);
		};
		return this;
	};
	this.unregister = function(jmlNode){
		if(this.connect)this.connect.node.disconnect(jmlNode);
		delete jmlNodes[jmlNode.uniqueId]};
	this.getXpathByJmlNode = function(jmlNode){
		var n = jmlNodes[jmlNode.uniqueId];
		
		if(! n)return false;
		return n[1];
	};
	this.toString = function(){
		return this.data ? jpf.formatXML(jpf.XMLDatabase.clearConnections(this.data.cloneNode(true)).xml):"Model has no data.";
	};
	this.getXml = function(){
		return this.data ? jpf.XMLDatabase.clearConnections(this.data.cloneNode(true)):false;
	};
	this.setByXPath = function(xpath,value){
		var node = this.data.selectSingleNode(xpath);
		
		if(! node)return null;
		jpf.XMLDatabase.setTextNode(node,value);
		return node;
	};
	this.getByXPath = function(xpath){
		return jpf.getXmlValue(this.data,xpath);
	};
	this.getNodeByXPath = function(xpath,single){
		return single ? this.data.selectSingleNode(xpath):this.data.selectNodes(xpath);
	};
	this.clear = function(){
		this.load(null);
	};
	this.reset = function(){
		this.load(this.copy);
	};
	this.savePoint = function(){
		this.copy = this.data.cloneNode(true);
	};
	this.reloadJmlNode = function(uniqueId){
		if(! this.data)return;
		var xmlNode = jmlNodes[uniqueId][1]? this.data.selectSingleNode(jmlNodes[uniqueId][1]):this.data;
		jmlNodes[uniqueId][0].load(xmlNode);
	};
	var bindValidation =[],defSubmission,submissions ={
	}

,loadProcInstr;
	this.loadJML = function(x){
		this.name = x.getAttribute("id");
		this.jml = x;
		var attr = x.attributes;
		
		for(var i = 0;i < attr.length;i ++){
			if(attr[i].nodeName.substr(0,2)== "on")this.addEventListener(attr[i].nodeName,new Function(attr[i].nodeValue));
		};
		
		if(x.getAttribute("save-original")== "true")this.saveOriginal = true;
		
		if(! defSubmission)defSubmission = x.getAttribute("submission");
		this.submitType = x.getAttribute("submittype");
		this.useComponents = x.getAttribute("useComponents");
		this.session = x.getAttribute("session");
		var instanceNode;
		loadProcInstr = x.getAttribute("load")|| x.getAttribute("get");
		
		if(! loadProcInstr){
			var prefix = jpf.findPrefix(x,jpf.ns.jpf);
			
			if(! jpf.supportNamespaces)
			if(prefix)(x.nodeType == 9 ? x:x.ownerDocument).setProperty("SelectionNamespaces","xmlns:" + prefix + "='" + jpf.ns.jpf + "'");
			
			if(prefix)prefix += ":";
			var loadNode = x.selectSingleNode(prefix + "load");
			
			if(loadNode)loadProcInstr = loadNode.getAttribute("get");
		};
		
		if(! loadProcInstr){
			var xmlNode = instanceNode || x;
			
			if(xmlNode.childNodes.length)this.load((xmlNode.xml || xmlNode.serialize()).replace(new RegExp("^<" + xmlNode.tagName + "[^>]*>"),"").replace(new RegExp("<\/\s*" + xmlNode.tagName + "[^>]*>$"),"").replace(/xmlns=\"[^"]*\"/g,""));
		};
		
		if(! jpf.isFalse(x.getAttribute("init")))this.init();
		return this;
	};
	this.setConnection = function(jmlNode,type,select){
		if(! this.connect)this.connect ={
		};
		var oldNode = this.connect.node;
		this.connect.type = type;
		this.connect.node = jmlNode;
		this.connect.select = select;
		
		for(var uniqueId in jmlNodes){
			if(oldNode)oldNode.disconnect(jmlNodes[uniqueId][0]);
			this.register(jmlNodes[uniqueId][0]);
		}
	};
	this.init = function(){
		if(this.session){
			this.loadFrom(this.session,null,true);
		}
		else 
		if(loadProcInstr){
			this.loadFrom(loadProcInstr);
		};
		this.dispatchEvent("xforms-ready");
	};
	var oModel = this;
	this.loadFrom = function(instruction,xmlContext,isSession){
		var data = instruction.split(":");
		var instrType = data.shift();
		
		if(instrType.match(/^(?:url|url.post|rpc|call|eval|cookie|gears)$/)){
			this.dispatchEvent("onbeforecomm");
			jpf.getData(instruction,xmlContext,function(xmlData,state,extra){oModel.dispatchEvent("onaftercomm");
				
				if(state != __HTTP_SUCCESS__){
					if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
					else{
						var commError = new Error(1032,jpf.formErrorString(1032,oModel,"Loading xml data","Could not insert data using RPC for control " + oModel.name + "[" + oModel.tagName + "] \nUrl: " + extra.url + "\nInfo: " + extra.message + "\n\n" + xmlData));
						
						if(oModel.dispatchEvent("onerror",jpf.extend({error:commError,state:status}
						,extra))!== false)throw commError;
						return;
					}
				};
				
				if(isSession && ! xmlData){
					if(loadProcInstr)return oModel.loadFrom(loadProcInstr);
				}
				else{
					oModel.load(xmlData);
					oModel.dispatchEvent("onreceive",{xmlNode:xmlData}
				);
				}
			}
		);
		}
		else 
		if(instrType.substr(0,1)== "#"){
			instrType = instrType.substr(1);
			
			try{
				eval(instrType).test}
			catch(e){
				throw new Error(1031,jpf.formErrorString(1031,null,"Model Creation","Could not find object reference to connect databinding: '" + instrType + "'",dataNode))};
			this.setConnection(eval(instrType),data[0],data[1]);
		};
		return this;
	};
	this.load = function(xmlNode,nocopy){
		if(this.dispatchEvent("onbeforeload")=== false)return false;
		
		if(typeof xmlNode == "string")var xmlNode = jpf.getObject("XMLDOM",xmlNode).documentElement;
		
		if(xmlNode){
			jpf.XMLDatabase.nodeConnect(jpf.XMLDatabase.getXmlDocId(xmlNode,this),xmlNode,null,this);
			
			if(! nocopy && this.saveOriginal)this.copy = xmlNode.cloneNode(true);
		};
		this.data = xmlNode;
		var uniqueId;
		
		for(uniqueId in jmlNodes){
			if(! jmlNodes[uniqueId]|| ! jmlNodes[uniqueId][0])continue;
			this.loadInJmlNode(jmlNodes[uniqueId][0],jmlNodes[uniqueId][1]);
		};
		this.dispatchEvent("onafterload");
		return this;
	};
	this.insertFrom = function(instruction,xmlContext,insertPoint,jmlNode,extra_callback){
		if(! instruction)return false;
		this.dispatchEvent("onbeforecomm");
		return jpf.getData(instruction,xmlContext,function(xmlData,state,extra){oModel.dispatchEvent("onaftercomm");
			
			if(state != __HTTP_SUCCESS__){
				if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
				else{
					var commError = new Error(1032,jpf.formErrorString(1032,null,"Inserting xml data","Could not insert data for control " + this.name + "[" + this.tagName + "] \nInstruction:" + instruction + "\nUrl: " + extra.url + "\nInfo: " + extra.message + "\n\n" + xmlData));
					
					if((jmlNode || oModel).dispatchEvent("onerror",jpf.extend({error:commError,state:status}
					,extra))!== false)throw commError;
					return;
				}
			};
			
			if(typeof insertPoint == "string")insertPoint = oModel.data.selectSingleNode(insertPoint);
			(jmlNode || oModel).insert(xmlData,insertPoint,jpf.isTrue(extra.userdata[1]));
			
			if(extra_callback)extra_callback(xmlData);
		}
	);
	};
	this.insert = function(XMLRoot,parentXMLNode,clearContents,jmlNode){
		if(typeof XMLRoot != "object")XMLRoot = jpf.getObject("XMLDOM",XMLRoot).documentElement;
		
		if(! parentXMLNode)parentXMLNode = this.data;
		
		if(clearContents){
			var nodes = parentXMLNode.childNodes;
			
			for(var i = nodes.length - 1;i >= 0;i --)parentXMLNode.removeChild(nodes[i]);
		};
		var newNode = jpf.XMLDatabase.integrate(XMLRoot,parentXMLNode,true);
		jpf.XMLDatabase.applyChanges("insert",parentXMLNode);
		return XMLRoot;
	};
	this.getJsonObject = function(){
		var data ={
		};
		
		for(var p in this.elements){
			var name = this.elements[p].jml.getAttribute("name")|| this.elements[p].name;
			
			if(name)data[name]= this.elements[p].getValue();
		};
		return data;
	};
	this.getCgiString = function(){
		var uniqueId,k,sel,oJmlNode,name,value,str =[];
		
		for(uniqueId in jmlNodes){
			oJmlNode = jmlNodes[uniqueId][0];
			
			if(oJmlNode.disabled || ! oJmlNode.change && ! oJmlNode.hasFeature(__MULTISELECT__))continue;
			
			if(oJmlNode.tagName == "MultiBinding")oJmlNode = oJmlNode.getHost();
			
			if(oJmlNode.multiselect){
				sel = oJmlNode.getSelection();
				
				for(k = 0;k < sel.length;k ++){
					name = oJmlNode.jml.getAttribute("name");
					
					if(! name && oJmlNode.jml.getAttribute("ref"))name = oJmlNode.jml.getAttribute("ref").replace(/[\/\]\[@]/g,"_");
					
					if(! name)name = sel[k].tagName;
					
					if(! name.match(/\]$/))name += "[]";
					value = oJmlNode.applyRuleSetOnNode("value",sel[k])|| oJmlNode.applyRuleSetOnNode("caption",sel[k]);
					
					if(value)str.push(name + "=" + encodeURIComponent(value));
				}
			}
			else{
				name = oJmlNode.jml.getAttribute("name")|| oJmlNode.jml.getAttribute("id");
				
				if(! name && oJmlNode.jml.getAttribute("ref"))name = oJmlNode.jml.getAttribute("ref").replace(/[\/\]\[@]/g,"_");
				
				if(! name && oJmlNode.XMLRoot)name = oJmlNode.XMLRoot.tagName;
				
				if(! name)continue;
				value = oJmlNode.getValue();
				
				if(value)str.push(name + "=" + encodeURIComponent(value));
			}
		};
		return str.join("&");
	};
	this.submit = function(instruction,type,useComponents,xSelectSubTree){
		if(! instruction && ! defSubmission)return false;
		
		if(! instruction && typeof defSubmission == "string")instruction = defSubmission;
		var sub;
		
		if(submissions[instruction]|| ! instruction && defSubmission){
			sub = submissions[instruction]|| defSubmission;
			var useComponents = false;
			var type = sub.getAttribute("method").match(/^(?:urlencoded-post|get)$/)? "native":"xml";
			var xSelectSubTree = sub.getAttribute("ref")|| "/";
			var instruction =(sub.getAttribute("method").match(/post/)? "url.post:":"url:")+ sub.getAttribute("action");
			var file = sub.getAttribute("action");
		}
		else 
		if(instruction){
			if(! type)type = this.submitType;
			
			if(! useComponents)useComponents = this.useComponents;
		}
		else{
		};
		
		if(this.dispatchEvent("onbeforesubmit",{instruction:instruction}
	)=== false)return false;
		var model = this;
		function cbFunc(data,state,extra){
			if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
			else 
			if(state != __RPC_SUCCESS__){
				model.dispatchEvent("onsubmiterror",extra);
			}
			else{
				model.dispatchEvent("onsubmitsuccess",jpf.extend({data:data}
				,extra));
			}
		};
		
		if(type == "array" || type == "xml"){
			var data = type == "array" ? this.getJsonObject():jpf.XMLDatabase.serializeNode(this.data);
			jpf.saveData(instruction,this.data,cbFunc,null,null,[data]);
		}
		else 
		if(type == "native"){
			var data = useComponents ? this.getCgiString():jpf.XMLDatabase.convertXml(this.getXml(),"cgivars");
			
			if(instruction.match(/^rpc\:/)){
				rpc = rpc.split(".");
				var oRpc = self[rpc[0]];
				oRpc.callWithString(rpc[1],data,cbFunc);
			}
			else{
				if(instruction.match(/^url/))instruction +=(instruction.match(/\?/)? "&":"?")+ data;
				jpf.saveData(instruction,this.data,cbFunc);
			}
		};
		this.dispatchEvent("onaftersubmit")};
	this.destroy = function(){
		if(this.session && this.data)jpf.saveData(this.session,this.getXml());
	}

}

/*FILEHEAD(/in/Library/Core/Application/Scrollbar.js)SIZE(7055)TIME(1203730081134)*/

/*FILEHEAD(/in/Library/Core/Application/SmartBinding.js)SIZE(8343)TIME(1203730098946)*/
jpf.NameServer ={
	lookup:{
	}

,add:function(type,xmlNode){
		if(! lookup[type])lookup[type]=[];
		return lookup[type].push(xmlNode)- 1;
	}
	,register:function(type,id,xmlNode){
		if(! this.lookup[type])this.lookup[type]={
		};
		this.lookup[type][id]= xmlNode;
		return xmlNode;
	}
	,get:function(type,id){
		return this.lookup[type]? this.lookup[type][id]:null;
	}
	,getAll:function(type){
		var name,arr =[];
		
		for(name in this.lookup[type]){
			if(jpf.isSafariOld &&(! this.lookup[type][name]|| typeof this.lookup[type][name]!= "object"))continue;
			arr.push(this.lookup[type][name]);
		};
		return arr;
	}

};

jpf.SmartBinding = function(name,xmlNode){
	this.xmlbindings = null;
	this.xmlactions = null;
	this.xmldragdrop = null;
	this.bindings = null;
	this.actions = null;
	this.dragdrop = null;
	this.jmlNodes ={
	};
	this.modelXpath ={
	};
	this.name = name;
	var parts ={
		bindings:'loadBindings',actions:'loadActions',dragdrop:'loadDragDrop'};
	this.initialize = function(jmlNode,part){
		this.jmlNodes[jmlNode.uniqueId]= jmlNode;
		
		if(part)return jmlNode[parts[part]](this[part],this["xml" + part]);
		
		if(jmlNode.jml && this.name)jmlNode.jml.setAttribute("smartbinding",this.name);
		
		for(part in parts){
			if(typeof parts[part]!= "string")continue;
			
			if(! this[part])continue;
			
			if(! jmlNode[parts[part]])throw new Error(1035,jpf.formErrorString(1035,jmlNode,"initialize method in SmartBindings object","Could not find handler for '" + part + "'."));
			jmlNode[parts[part]](this[part],this["xml" + part]);
		};
		
		if(this.model)this.model.register(jmlNode,this.modelXpath[jmlNode.getHost ? jmlNode.getHost().uniqueId:jmlNode.uniqueId]|| this.modelBaseXpath);
		else 
		if(jmlNode.model)jmlNode.model.reloadJmlNode(jmlNode.uniqueId);
	};
	this.deinitialize = function(jmlNode){
		this.jmlNodes[jmlNode.uniqueId]= null;
		delete this.jmlNodes[jmlNode.uniqueId];
		
		if(this.model)this.model.unregister(jmlNode);
	};
	this.addBindRule = function(xmlNode,jmlParent){
		var str = xmlNode[jpf.TAGNAME]== "ref" ? jmlParent ? jmlParent.mainBind:"value":xmlNode.tagName;
		
		if(! this.bindings)this.bindings ={
		};
		
		if(! this.bindings[str])this.bindings[str]=[xmlNode];
		else this.bindings[str].push(xmlNode);
	};
	this.addBindings = function(rules){
		this.bindings = rules;
		this.xmlbindings = xmlNode;
	};
	this.addActionRule = function(xmlNode){
		var str = xmlNode[jpf.TAGNAME]== "action" ? "Change":xmlNode.tagName;
		
		if(! this.actions)this.actions ={
		};
		
		if(! this.actions[str])this.actions[str]=[xmlNode];
		else this.actions[str].push(xmlNode);
	};
	this.addActions = function(rules,xmlNode){
		this.actions = rules;
		this.xmlactions = xmlNode;
	};
	this.addDropRule = this.addDragRule = function(xmlNode){
		if(! this.dragdrop)this.dragdrop ={
		};
		
		if(! this.dragdrop[xmlNode[jpf.TAGNAME]])this.dragdrop[xmlNode[jpf.TAGNAME]]=[xmlNode];
		else this.dragdrop[xmlNode[jpf.TAGNAME]].push(xmlNode);
	};
	this.addDragDrop = function(rules,xmlNode){
		this.dragdrop = rules;
		this.xmldragdrop = xmlNode;
	};
	this.setModel = function(model,xpath){
		if(typeof model == "string")model = jpf.NameServer.get("model",model);
		this.model = jpf.NameServer.register("model",this.name,model);
		this.modelBaseXpath = xpath;
		
		for(var uniqueId in this.jmlNodes){
			this.model.unregister(this.jmlNodes[uniqueId]);
			this.model.register(jmlNode,this.modelXpath[jmlNode.getHost ? jmlNode.getHost().uniqueId:jmlNode.uniqueId]|| this.modelBaseXpath);
		}
	};
	this.load = function(xmlNode){
		this.setModel(new jpf.Model().load(xmlNode));
	};
	this.loadJML = function(xmlNode){
		this.name = xmlNode.getAttribute("id");
		this.jml = xmlNode;
		
		if(xmlNode.getAttribute("bindings")){
			var cNode = jpf.NameServer.get("bindings",xmlNode.getAttribute("bindings"));
			this.addBindings(jpf.getRules(cNode),cNode);
		};
		
		if(xmlNode.getAttribute("actions")){
			var cNode = jpf.NameServer.get("actions",xmlNode.getAttribute("actions"));
			this.addActions(jpf.getRules(cNode),cNode);
		};
		
		if(xmlNode.getAttribute("dragdrop")){
			var cNode = jpf.NameServer.get("dragdrop",xmlNode.getAttribute("dragdrop"));
			this.addDragDrop(jpf.getRules(cNode),cNode);
		};
		var data_node,nodes = xmlNode.childNodes;
		
		for(var i = 0;i < nodes.length;i ++){
			if(nodes[i].nodeType != 1)continue;
			switch(nodes[i][jpf.TAGNAME]){
				case "model":data_node = nodes[i];
				break;
				case "bindings":this.addBindings(jpf.getRules(nodes[i]),nodes[i]);
				break;
				case "actions":this.addActions(jpf.getRules(nodes[i]),nodes[i]);
				break;
				case "dragdrop":this.addDragDrop(jpf.getRules(nodes[i]),nodes[i]);
				break;
				case "ref":this.addBindRule(nodes[i]);
				break;
				case "action":this.addActionRule(nodes[i]);
				break;
				default:throw new Error(1039,jpf.formErrorString(1039,this,"setSmartBinding Method","Could not find handler for '" + nodes[i].tagName + "' node."));
				break;
			}
		};
		
		if(data_node)this.setModel(new jpf.Model().loadJML(data_node));
		else 
		if(xmlNode.getAttribute("model"))jpf.setModel(xmlNode.getAttribute("model"),this);
	};
	
	if(xmlNode)this.loadJML(xmlNode);
}

/*FILEHEAD(/in/Library/Core/Application/XMLDatabase.js)SIZE(34551)TIME(1213627348177)*/
jpf.XMLDatabaseImplementation = function(){
	this.xmlDocTag = "j_doc";
	this.xmlIdTag = "j_id";
	this.xmlListenTag = "j_listen";
	this.htmlIdTag = "id";
	var xmlDocLut =[];
	this.getElementById = function(id,doc){
		if(! doc)doc = xmlDocLut[id.split("\|")[0]];
		
		if(! doc)return false;
		return doc.selectSingleNode("descendant-or-self::node()[@" + this.xmlIdTag + "='" + id + "']");
	};
	this.getNode = function(htmlNode){
		if(! htmlNode || ! htmlNode.getAttribute(this.htmlIdTag))return false;
		return this.getElementById(htmlNode.getAttribute(this.htmlIdTag).split("\|",2).join("|"));
	};
	this.getNodeById = function(id,doc){
		var q = id.split("\|");
		q.pop();
		return this.getElementById(q.join("|"),doc);
	};
	this.getDocumentById = function(id){
		return xmlDocLut[id];
	};
	this.getDocument = function(node){
		return xmlDocLut[node.getAttribute(this.xmlIdTag).split("\|")[0]];
	};
	this.getID = function(xmlNode,o){
		return xmlNode.getAttribute(this.xmlIdTag)+ "|" + o.uniqueId;
	};
	this.getChildNumber = function(node){
		var p = node.parentNode;
		
		for(var i = 0;i < p.childNodes.length;i ++)
		if(p.childNodes[i]== node)return i;
	};
	this.isChildOf = function(pnode,childnode,orItself){
		if(! pnode || ! childnode)return false;
		
		if(orItself && pnode == childnode)return true;
		var nodes = pnode.getElementsByTagName("*");
		
		for(var i = 0;i < nodes.length;i ++)
		if(nodes[i]== childnode)return true;
		return false;
	};
	this.findHTMLNode = function(xmlNode,oComp){
		do{
			if(xmlNode.getAttribute(this.xmlIdTag)){
				return oComp.getNodeFromCache(xmlNode.getAttribute(this.xmlIdTag)+ "|" + oComp.uniqueId);
			};
			
			if(xmlNode == oComp.XMLRoot)return null;
			xmlNode = xmlNode.parentNode;
		}
		
		while(xmlNode && xmlNode.nodeType != 9)return null;
	};
	this.findXMLNode = function(htmlNode){
		if(! htmlNode)return false;
		
		while(htmlNode && htmlNode.nodeType == 1 && htmlNode.tagName.toLowerCase()!= "body" && ! htmlNode.getAttribute("id")|| htmlNode && htmlNode.nodeType == 1 && htmlNode.getAttribute(this.htmlIdTag)&& htmlNode.getAttribute(this.htmlIdTag).match(/^q/)){
			if(htmlNode.host && htmlNode.host.oExt == htmlNode)return htmlNode.host.XMLRoot;
			htmlNode = htmlNode.parentNode;
		};
		
		if(! htmlNode || htmlNode.nodeType != 1)return false;
		
		if(htmlNode.tagName.toLowerCase()== "body")return false;
		return this.getNode(htmlNode);
	};
	this.getElement = function(parent,nr){
		var nodes = parent.childNodes;
		
		for(var j = 0,i = 0;i < nodes.length;i ++){
			if(nodes[i].nodeType != 1)continue;
			
			if(j ++ == nr)return nodes[i];
		}
	};
	this.getModel = function(name){
		return jpf.NameServer.get("model",name);
	};
	this.setModel = function(model){
		jpf.NameServer.register("model",model.data.ownerDocument.documentElement.getAttribute(this.xmlDocTag),model);
	};
	this.findModel = function(xmlNode){
		return this.getModel(xmlNode.ownerDocument.documentElement.getAttribute(this.xmlDocTag));
	};
	this.getXml = function(strXml,no_error){
		return jpf.getObject("XMLDOM",strXml,no_error).documentElement;
	};
	this.nodeCount ={
	};
	this.nodeConnect = function(documentId,xmlNode,htmlNode,o){
		if(! this.nodeCount[documentId])this.nodeCount[documentId]= 0;
		var xmlID = xmlNode.getAttribute(this.xmlIdTag)|| documentId + "|" + ++ this.nodeCount[documentId];
		xmlNode.setAttribute(this.xmlIdTag,xmlID);
		
		if(! o)return xmlID;
		var htmlID = xmlID + "|" + o.uniqueId;
		
		if(htmlNode)htmlNode.setAttribute(this.htmlIdTag,htmlID);
		return htmlID;
	};
	this.addNodeListener = function(xmlNode,o){
		var listen = xmlNode.getAttribute(this.xmlListenTag);
		var nodes =(listen ? listen.split(";"):[]);
		
		if(! nodes.contains(o.uniqueId))nodes.push(o.uniqueId);
		xmlNode.setAttribute(this.xmlListenTag,nodes.join(";"));
		return xmlNode;
	};
	this.removeNodeListener = function(xmlNode,o){
		var listen = xmlNode.getAttribute(this.xmlListenTag);
		var nodes =(listen ? listen.split(";"):[]);
		
		for(var newnodes =[],i = 0;i < nodes.length;i ++){
			if(nodes[i]!= o.uniqueId)newnodes.push(nodes[i]);
		};
		xmlNode.setAttribute(this.xmlListenTag,newnodes.join(";"));
		return xmlNode;
	};
	this.integrate = function(XMLRoot,parentNode,copyAttributes){
		if(typeof parentNode != "object")parentNode = getElementById(parentNode);
		
		if(parentNode.ownerDocument.importNode)
		for(var i = XMLRoot.childNodes.length - 1;i >= 0;i --)parentNode.insertBefore(parentNode.ownerDocument.importNode(XMLRoot.childNodes[i],true),parentNode.firstChild);
		else 
		for(var i = XMLRoot.childNodes.length - 1;i >= 0;i --)parentNode.insertBefore(XMLRoot.childNodes[i],parentNode.firstChild);
		
		if(copyAttributes){
			var attr = XMLRoot.attributes;
			
			for(var i = 0;i < attr.length;i ++)
			if(attr[i].nodeName != this.xmlIdTag)parentNode.setAttribute(attr[i].nodeName,attr[i].nodeValue);
		};
		return parentNode;
	};
	this.synchronize = function(){
		this.forkRoot.parentNode.replaceChild(this.root,this.forkRoot);
		this.parent.applyChanges("synchronize",this.root);
	};
	this.copyNode = function(xmlNode){
		return this.clearConnections(xmlNode.cloneNode(true));
	};
	this.setNodeValue = function(xmlNode,nodeValue,applyChanges){
		if(xmlNode.nodeType == 1){
			if(! xmlNode.firstChild)xmlNode.appendChild(xmlNode.ownerDocument.createTextNode("-"));
			xmlNode.firstChild.nodeValue = jpf.isNot(nodeValue)? "":nodeValue;
			
			if(applyChanges)jpf.XMLDatabase.applyChanges("synchronize",xmlNode);
		}
		else{
			xmlNode.nodeValue = jpf.isNot(nodeValue)? "":nodeValue;
			
			if(applyChanges)jpf.XMLDatabase.applyChanges("synchronize",xmlNode.parentNode || xmlNode.selectSingleNode(".."));
		}
	};
	this.getNodeValue = function(xmlNode){
		if(! xmlNode)return "";
		return xmlNode.nodeType == 1 ?(! xmlNode.firstChild ? "":xmlNode.firstChild.nodeValue):xmlNode.nodeValue;
	};
	this.getInheritedAttribute = function(x,attr,func){
		var result,y = x;
		
		while(y && y.nodeType != 11 && y.nodeType != 9 && !(result = attr && y.getAttribute(attr)|| func && func(y))){
			y = y.parentNode;
		};
		
		if(! result && attr && jpf.appsettings.jml)result = jpf.appsettings.jml.getAttribute(attr);
		return result;
	};
	this.setTextNode = function(pnode,value,xpath,UndoObj){
		if(xpath){
			var tNode = pnode.selectSingleNode(xpath);
			
			if(! tNode)return;
			pnode = tNode.nodeType == 1 ? tNode:null;
		};
		
		if(pnode || ! tNode){
			if(! pnode.firstChild)var tNode = pnode.appendChild(pnode.ownerDocument.createTextNode(""));
			else var tNode = pnode.firstChild;
		};
		
		if(UndoObj)UndoObj.oldValue = tNode.nodeValue;
		tNode.nodeValue = value;
		this.applyChanges("text",tNode.parentNode,UndoObj);
	};
	this.setAttribute = function(xmlNode,name,value,xpath,UndoObj){
		(xpath ? xmlNode.selectSingleNode(xpath):xmlNode).setAttribute(name,value);
		this.applyChanges("attribute",xmlNode,UndoObj);
	};
	this.removeAttribute = function(xmlNode,name,xpath,UndoObj){
		if(UndoObj)UndoObj.name = name;
		(xpath ? xmlNode.selectSingleNode(xpath):xmlNode).removeAttribute(name);
		this.applyChanges("attribute",xmlNode,UndoObj);
	};
	this.replaceNode = function(oldNode,newNode,xpath,UndoObj){
		if(xpath)oldNode = oldNode.selectSingleNode(xpath);
		
		if(UndoObj)UndoObj.oldNode = oldNode;
		oldNode.parentNode.replaceChild(newNode,oldNode);
		this.copyConnections(oldNode,newNode);
		this.applyChanges("replacechild",newNode,UndoObj);
	};
	this.addChildNode = function(pnode,tagName,attr,beforeNode,xpath,UndoObj){
		var xmlNode = pnode.insertBefore(pnode.ownerDocument.createElement(tagName),beforeNode);
		
		for(var i = 0;i < attr.length;i ++)xmlNode.setAttribute(attr[i][0],attr[i][1]);
		
		if(UndoObj)UndoObj.addedNode = xmlNode;
		this.applyChanges("add",xmlNode,UndoObj);
		return xmlNode;
	};
	this.appendChildNode = function(pnode,xmlNode,beforeNode,unique,xpath,UndoObj){
		if(unique && pnode.selectSingleNode(xmlNode.tagName))return false;
		
		if(UndoObj)this.clearConnections(xmlNode);
		(xpath ? pnode.selectSingleNode(xpath):pnode).insertBefore(xmlNode,beforeNode);
		this.applyChanges("add",xmlNode,UndoObj);
		return xmlNode;
	};
	this.copyConnections = function(fromNode,toNode){
		try{
			toNode.setAttribute(this.xmlListenTag,fromNode.getAttribute(this.xmlListenTag));
			toNode.setAttribute(this.xmlIdTag,fromNode.getAttribute(this.xmlIdTag));
		}
		catch(e){
		}

};
	this.clearConnections = function(xmlNode){
		try{
			var nodes = xmlNode.selectNodes("descendant-or-self::node()[@" + this.xmlListenTag + "]");
			
			for(var i = nodes.length - 1;i >= 0;i --)nodes[i].removeAttributeNode(nodes[i].getAttributeNode(this.xmlListenTag));
			var nodes = xmlNode.selectNodes("descendant-or-self::node()[@" + this.xmlIdTag + "]");
			
			for(var i = nodes.length - 1;i >= 0;i --)nodes[i].removeAttributeNode(nodes[i].getAttributeNode(this.xmlIdTag));
			var nodes = xmlNode.selectNodes("descendant-or-self::node()[@" + this.xmlDocTag + "]");
			
			for(var i = nodes.length - 1;i >= 0;i --)nodes[i].removeAttributeNode(nodes[i].getAttributeNode(this.xmlDocTag));
			var nodes = xmlNode.selectNodes("descendant-or-self::node()[@j_loaded]");
			
			for(var i = nodes.length - 1;i >= 0;i --)nodes[i].removeAttributeNode(nodes[i].getAttributeNode("j_loaded"));
		}
		catch(e){
		};
		return xmlNode;
	};
	this.serializeNode = function(xmlNode){
		return this.clearConnections(xmlNode.cloneNode(true)).xml;
	};
	this.moveNode = function(pnode,xmlNode,beforeNode,xpath,UndoObj){
		if(! UndoObj)UndoObj ={
		};
		UndoObj.pNode = xmlNode.parentNode;
		UndoObj.beforeNode = xmlNode.nextSibling;
		UndoObj.toPnode =(xpath ? pnode.selectSingleNode(xpath):pnode);
		this.applyChanges("move-away",xmlNode,UndoObj);
		
		if(! jpf.isSafari && jpf.XMLDatabase.getXmlDocId(xmlNode)!= jpf.XMLDatabase.getXmlDocId(pnode)){
			xmlNode.removeAttributeNode(xmlNode.getAttributeNode(this.xmlIdTag));
			this.nodeConnect(jpf.XMLDatabase.getXmlDocId(pnode),xmlNode);
		};
		
		if(jpf.isSafari && pnode.ownerDocument != xmlNode.ownerDocument)xmlNode = pnode.ownerDocument.importNode(xmlNode,true);
		UndoObj.toPnode.insertBefore(xmlNode,beforeNode);
		this.applyChanges("move",xmlNode,UndoObj);
	};
	this.removeNode = function(xmlNode,xpath,UndoObj){
		if(xpath)xmlNode = xmlNode.selectSingleNode(xpath);
		
		if(UndoObj){
			UndoObj.pNode = xmlNode.parentNode;
			UndoObj.removedNode = xmlNode;
			UndoObj.beforeNode = xmlNode.nextSibling;
		};
		this.applyChanges("remove",xmlNode,UndoObj);
		var p = xmlNode.parentNode;
		p.removeChild(xmlNode);
		this.applyChanges("redo-remove",xmlNode,null,p);
	};
	this.removeNodeList = function(xmlNodeList,UndoObj){
		for(var rData =[],i = 0;i < xmlNodeList.length;i ++){
			if(UndoObj){
				rData.push({pNode:xmlNodeList[i].parentNode,removedNode:xmlNodeList[i],beforeNode:xmlNodeList[i].nextSibling}
			);
			};
			this.applyChanges("remove",xmlNodeList[i],UndoObj);
			var p = xmlNodeList[i].parentNode;
			p.removeChild(xmlNodeList[i]);
			this.applyChanges("redo-remove",xmlNodeList[i],null,p);
		};
		
		if(UndoObj)UndoObj.removeList = rData;
	};
	this.applyChanges = function(action,xmlNode,UndoObj,nextloop){
		var oParent = nextloop,loopNode =(xmlNode.nodeType == 1 ? xmlNode:xmlNode.parentNode),hash ={
		};
		
		while(loopNode && loopNode.nodeType != 9){
			var listen = loopNode.getAttribute(this.xmlListenTag);
			
			if(listen){
				var ids = listen.split(";");
				
				for(var i = 0;i < ids.length;i ++){
					if(hash[ids[i]])continue;
					hash[ids[i]]= true;
					var o = jpf.localLookup(ids[i]);
					
					if(o){
						if(o.listenRoot){
							var model = o.getModel();
							var xpath = model.getXpathByJmlNode(o);
							var XMLRoot = xpath ? model.data.selectSingleNode(xpath):model.data;
							
							if(XMLRoot){
								jpf.XMLDatabase.removeNodeListener(o.listenRoot,o);
								o.listenRoot = null;
								o.load(XMLRoot);
							};
							continue;
						};
						o.__xmlUpdate(action,xmlNode,loopNode,UndoObj,oParent);
					}
				}
			};
			loopNode = loopNode.parentNode || nextloop;
			
			if(loopNode == nextloop)nextloop = null;
		};
		
		if(UndoObj)UndoObj.xmlNode = xmlNode;
	};
	this.notifyListeners = function(xmlNode){
		var listen = xmlNode.getAttribute(jpf.XMLDatabase.xmlListenTag);
		
		if(listen){
			listen = listen.split(";");
			
			for(var j = 0;j < listen.length;j ++){
				jpf.lookup(listen[j]).__xmlUpdate("synchronize",xmlNode,xmlNode);
			}
		}
	};
	this.unbind = function(frm){
		for(var lookup ={}
	,i = 0;i < frm.jpf.local.length;i ++)
		if(frm.jpf.local[i].unloadBindings)lookup[frm.jpf.local[i].unloadBindings()]= true;
		
		for(var k = 0;k < xmlDocLut.length;k ++){
			if(! xmlDocLut[k])continue;
			var Nodes = xmlDocLut[k].selectNodes("//self::node()[@" + this.xmlListenTag + "]");
			
			for(var i = 0;i < Nodes.length;i ++){
				var listen = Nodes[i].getAttribute(this.xmlListenTag).split(";");
				
				for(var nListen =[],j = 0;j < listen.length;j ++)
				if(! lookup[listen[j]])nListen.push(listen[j]);
				
				if(nListen.length != listen.length)Nodes[i].setAttribute(this.xmlListenTag,nListen.join(";"));
			}
		}
	};
	this.selectNodes = function(sExpr,contextNode){
		if(jpf.hasXPathHtmlSupport || ! contextNode.style)return contextNode.selectNodes(sExpr);
		return jpf.XPath.selectNodes(sExpr,contextNode)};
	this.selectSingleNode = function(sExpr,contextNode){
		if(jpf.hasXPathHtmlSupport || ! contextNode.style)return contextNode.selectSingleNode(sExpr);
		var nodeList = this.selectNodes(sExpr +(jpf.isIE ? "":"[1]"),contextNode ? contextNode:null);
		return nodeList.length > 0 ? nodeList[0]:null;
	};
	this.createNodeFromXpath = function(contextNode,xPath,addedNodes){
		var xmlNode,foundpath = "",paths = xPath.split("/");
		
		if(xmlNode = contextNode.selectSingleNode(xPath))return xmlNode;
		
		for(var addedNode,isAdding = false,i = 0;i < paths.length - 1;i ++){
			if(! isAdding && contextNode.selectSingleNode(foundpath +(i != 0 ? "/":"")+ paths[i])){
				foundpath +=(i != 0 ? "/":"")+ paths[i];
				continue;
			};
			isAdding = true;
			addedNode = contextNode.selectSingleNode(foundpath).appendChild(contextNode.ownerDocument.createElement(paths[i]));
			
			if(addedNodes)addedNodes.push(addedNode);
			foundpath += paths[i]+ "/";
		};
		
		if(! foundpath)foundpath = ".";
		var lastpath = paths[paths.length - 1];
		
		if(lastpath.match(/^\@(.*)$/)){
			var attrNode = contextNode.ownerDocument.createAttribute(RegExp.$1);
			contextNode.selectSingleNode(foundpath).setAttributeNode(attrNode);
			return attrNode;
		}
		else 
		if(lastpath.trim()== "text()")return contextNode.selectSingleNode(foundpath).appendChild(contextNode.ownerDocument.createTextNode(""));
		else return contextNode.selectSingleNode(foundpath).appendChild(contextNode.ownerDocument.createElement(lastpath));
	};
	this.getXmlDocId = function(xmlNode,model){
		var docId =(xmlNode.ownerDocument.documentElement || xmlNode).getAttribute(this.xmlDocTag)|| xmlDocLut.indexOf(xmlNode.ownerDocument);
		
		if(docId && docId > - 1)return docId;
		docId = xmlDocLut.push(xmlNode.ownerDocument.documentElement || xmlNode.ownerDocument || xmlNode)- 1;
		
		if(xmlNode.ownerDocument.documentElement)xmlNode.ownerDocument.documentElement.setAttribute(this.xmlDocTag,docId);
		
		if(model)jpf.NameServer.register("model",docId,model);
		return xmlDocLut.length - 1;
	};
	this.getBindXmlNode = function(xmlRootNode){
		if(typeof xmlRootNode != "object")xmlRootNode = jpf.getObject("XMLDOM",xmlRootNode);
		
		if(xmlRootNode.nodeType == 9)xmlRootNode = xmlRootNode.documentElement;
		
		if(xmlRootNode.nodeType == 3 || xmlRootNode.nodeType == 4)xmlRootNode = xmlRootNode.parentNode;
		
		if(xmlRootNode.nodeType == 2)xmlRootNode = xmlRootNode.selectSingleNode("..");
		return xmlRootNode;
	};
	this.convertMethods ={
		"json":function(xml){
			var result ={
			}
		,filled = false,nodes = xml.childNodes;
			
			for(var i = 0;i < nodes.length;i ++){
				if(nodes[i].nodeType != 1)continue;
				var name = nodes[i].tagName;
				filled = true;
				var sameNodes = xml.selectNodes(x);
				
				if(sameNodes.length > 1){
					var z =[];
					
					for(var j = 0;j < sameNodes.length;j ++){
						z.push(this.json(sameNodes[j],result));
					};
					result[name]= z;
				}
				else result[name]= this.json(sameNodes[j],result);
			};
			return filled ? result:jpf.getXmlValue(xml,"text()");
		}
		,"cgivars":function(xml,basename){
			var str =[],filled = false,nodes = xml.childNodes;
			
			for(var i = 0;i < nodes.length;i ++){
				if(nodes[i].nodeType != 1)continue;
				var name = nodes[i].tagName;
				filled = true;
				var sameNodes = xml.selectNodes(name);
				
				if(sameNodes.length > 1){
					for(var j = 0;j < sameNodes.length;j ++){
						str.push(this.cgivars(sameNodes[j],(basename ? basename + ".":"")+ name + "[" + j + "]"));
					}
				}
				else str.push(this.cgivars(nodes[i],(basename ? basename + ".":"")+ name));
			};
			return filled ? str.join("&"):(basename || "")+ "=" + encodeURIComponent(jpf.getXmlValue(xml,"text()"));
		}
	};
	this.convertXml = function(xml,to){
		return this.convertMethods[to](xml);
	};
	this.getTextNode = function(x){
		for(var i = 0;i < x.childNodes.length;i ++){
			if(x.childNodes[i].nodeType == 3 || x.childNodes[i].nodeType == 4)return x.childNodes[i];
		};
		return false;
	};
	this.getAllNodesBefore = function(pNode,xpath,xmlNode,func){
		var nodes = jpf.XMLDatabase.selectNodes(xpath,pNode);
		
		for(var found = false,result =[],i = nodes.length - 1;i >= 0;i --){
			if(! found && nodes[i]== xmlNode){
				found = true;
				continue;
			};
			
			if(! found)continue;
			result.push(nodes[i]);
			
			if(func)func(nodes[i]);
		};
		return result;
	};
	this.getAllNodesAfter = function(pNode,xpath,xmlNode,func){
		var nodes = jpf.XMLDatabase.selectNodes(xpath,pNode);
		
		for(var found = false,result =[],i = 0;i < nodes.length;i ++){
			if(! found && nodes[i]== xmlNode){
				found = true;
				continue;
			};
			
			if(! found)continue;
			result.push(nodes[i]);
			
			if(func)func(nodes[i]);
		};
		return result;
	};
	this.clearBoundValue = function(jmlNode,xmlRoot,applyChanges){
		if(! xmlRoot && ! jmlNode.XMLRoot)return;
		var xmlNode =(jmlNode.nodeType == GUI_NODE)? xmlRoot.selectSingleNode(jmlNode.getAttribute("ref")):jmlNode.getNodeFromRule("value",jmlNode.XMLRoot);
		
		if(xmlNode)this.setNodeValue(xmlNode,"",applyChanges);
	};
	this.getBoundValue = function(jmlNode,xmlRoot,applyChanges){
		if(! xmlRoot && ! jmlNode.XMLRoot)return "";
		var xmlNode =(jmlNode.nodeType == 1)? xmlRoot.selectSingleNode(jmlNode.getAttribute("ref")):jmlNode.getNodeFromRule("value",jmlNode.XMLRoot);
		return xmlNode ? this.getNodeValue(xmlNode):"";
	};
	this.getArrayFromNodelist = function(nodelist){
		for(var nodes =[],j = 0;j < nodelist.length;j ++)nodes.push(nodelist[j]);
		return nodes;
	}

};

jpf.Init.run('XMLDatabaseImplementation');

/*FILEHEAD(/in/Library/Core/Application/XSDImplementation.js)SIZE(13191)TIME(1203730150634)*/

/*FILEHEAD(/in/Library/Core/Crypt/base64.js)SIZE(1203)TIME(1154549216739)*/

/*FILEHEAD(/in/Library/Core/Crypt/blowfish.js)SIZE(22124)TIME(1203724026790)*/

/*FILEHEAD(/in/Library/Core/Crypt/md4.js)SIZE(7274)TIME(1154550709568)*/

/*FILEHEAD(/in/Library/Core/Crypt/md5.js)SIZE(8861)TIME(1154550713380)*/

/*FILEHEAD(/in/Library/Core/Crypt/sha1.js)SIZE(5788)TIME(1154550711614)*/

/*FILEHEAD(/in/Library/TelePort/DeskRun.js)SIZE(6805)TIME(1203724557931)*/

/*FILEHEAD(/in/Library/TelePort/http.js)SIZE(15216)TIME(1213476784005)*/
jpf.http = function(){
	this.queue =[null];
	this.callbacks ={
	};
	this.cache ={
	};
	this.timeout = 10000;
	
	if(! this.uniqueId)this.uniqueId = jpf.all.push(this)- 1;
	jpf.Teleport.register(this);
	
	if(! this.toString){
		this.toString = function(){
			return "[Javeline TelePort Component : (HTTP)]";
		}
	};
	this.loadCache = function(name){
		var strResult = this.get(CWD + name + ".txt");
		
		if(! strResult)return false;
		eval("var data = " + strResult);
		this.cache = data.params;
		return true;
	};
	this.getXml = function(url,receive,async,userdata,nocache){
		return this.get(url,receive,! ! async,userdata,nocache,"",true);
	};
	this.getString = function(url,receive,async,userdata,nocache){
		return this.get(url,receive,! ! async,userdata,nocache,"");
	};
	this.get = function(url,receive,async,userdata,nocache,data,useXML,id,autoroute,useXSLT,caching){
		var tpModule = this;
		
		if(data){
			this.protocol = "POST";
			this.contentType = "application/x-www-form-urlencoded";
		};
		
		if(async === undefined)async = true;
		
		if(jpf.isOpera)async = true;
		
		if(jpf.isSafari)url = jpf.html_entity_decode(url);
		
		if(jpf.isNot(id)){
			var http = jpf.getObject("HTTP");
			id = this.queue.push([http,receive,null,null,userdata,null,[url,async,data,nocache,useXSLT,caching],useXML,0])- 1;
		}
		else{
			var http = this.queue[id][0];
			http.abort();
		};
		
		if(async){
			if(jpf.hasReadyStateBug){
				this.queue[id][3]= new Date();
				this.queue[id][2]= function(){
					var dt = new Date(new Date().getTime()- tpModule.queue[id][3].getTime());
					var diff = parseInt(dt.getSeconds()* 1000 + dt.getMilliseconds());
					
					if(diff > tpModule.timeout){
						tpModule.dotimeout(id);
						return};
					
					if(tpModule.queue[id][0].readyState == 4){
						tpModule.queue[id][0].onreadystatechange = function(){
						};
						tpModule.receive(id);
					}
				};
				this.queue[id][5]= setInterval(function(){tpModule.queue[id][2]()}
				,20);
			}
			else{
				http.onreadystatechange = function(){
					if(! tpModule.queue[id]|| http.readyState != 4)return;
					tpModule.receive(id);
				}
			}
		};
		
		if(! autoroute)autoroute = this.shouldAutoroute;
		
		if(this.autoroute && jpf.isOpera)autoroute = true;
		var srv = autoroute ? this.routeServer:url;
		
		try{
			http.open(this.protocol || "GET",srv +(nocache ?(srv.match(/\?/)? "&":"?")+ Math.random():""),async);
			http.setRequestHeader("User-Agent","Javeline TelePort 1.0.0");
			http.setRequestHeader("Content-type",this.contentType ||(this.useXML || useXML ? "text/xml":"text/plain"));
			
			if(autoroute){
				http.setRequestHeader("X-Route-Request",url);
				http.setRequestHeader("X-Proxy-Request",url);
				http.setRequestHeader("X-Compress-Response","gzip");
			}
		}
		catch(e){
			var useOtherXH = false;
			
			if(self.XMLHttpRequestUnSafe){
				try{
					http = new XMLHttpRequestUnSafe();
					http.onreadystatechange = function(){
						if(! tpModule.queue[id]|| http.readyState != 4)return;
						tpModule.receive(id);
					};
					http.open(this.protocol || "GET",srv +(nocache ?(srv.match(/\?/)? "&":"?")+ Math.random():""),async);
					this.queue[id][0]= http;
					async = true;
					useOtherXH = true;
				}
				catch(e){
				}
		};
			
			if(! useOtherXH && this.autoroute && ! autoroute){
				if(! jpf.isNot(id)){
					clearInterval(this.queue[id][5]);
				};
				this.shouldAutoroute = true;
				return this.get(url,receive,async,userdata,nocache,data,useXML,id,true,useXSLT);
			};
			
			if(! useOtherXH){
				var noClear = receive ? receive(null,__RPC_ERROR__,{userdata:userdata,http:http,url:url,tpModule:this,id:id,message:"Permission denied accessing remote resource: " + url}
			):false;
				
				if(! noClear)this.clearQueueItem(id);
				return;
			}
		};
		
		if(this.__HeaderHook)this.__HeaderHook(http);
		
		try{
			http.send(data);
		}
		catch(e){
			jpf.debugMsg("<strong>File or Resource not available " + arguments[0]+ "</strong><hr />","teleport");
			var noClear = receive ? receive(null,__RPC_ERROR__,{userdata:userdata,http:http,url:url,tpModule:this,id:id,message:"---- Javeline Error ----\nMessage : File or Resource not available: " + arguments[0]}
		):false;
			
			if(! noClear)this.clearQueueItem(id);
			return;
		};
		
		if(! async)return this.receive(id);
	};
	this.receive = function(id){
		if(! this.queue[id])return false;
		clearInterval(this.queue[id][5]);
		var data,message;
		var http = this.queue[id][0];
		
		try{
			if(http.status){
			}
	}
		catch(e){
			return setTimeout('jpf.lookup(' + this.uniqueId + ').receive(' + id + ')',10);
		};
		var callback = this.queue[id][1];
		var useXML = this.queue[id][7];
		var userdata = this.queue[id][4];
		var retries = this.queue[id][8];
		var a = this.queue[id][6];
		var from_url = a[0];
		var useXSLT = a[4];
		
		try{
			var msg = "";
			
			if(http.status != 200 && http.status != 0){
				if(this.isRPC && this.checkPermissions && this.checkPermissions(message,{id:id,http:http,tpModule:this,retries:retries}
			)=== true)return;
				throw new Error(0,"HTTP error [" + id + "]:" + http.status + "\n" + http.responseText);
			};
			
			if(useXML || this.useXML){
				if(http.responseText.replace(/^[\s\n\r]+|[\s\n\r]+$/g,"")== "")throw new Error("Empty Document");
				msg = "Received invalid XML\n\n";
				var xmlDoc = http.responseXML && http.responseXML.documentElement ? jpf.xmlParseError(http.responseXML):jpf.getObject("XMLDOM",http.responseText);
				
				if(! jpf.supportNamespaces)xmlDoc.setProperty("SelectionLanguage","XPath");
				var xmlNode = xmlDoc.documentElement;
			};
			var data = useXML || this.useXML ? xmlNode:http.responseText;
			
			if(this.isRPC){
				msg = "RPC result did not validate: ";
				message = this.checkErrors(data,http,{id:id,http:http,tpModule:this}
			);
				
				if(this.checkPermissions && this.checkPermissions(message,{id:id,http:http,tpModule:this,retries:retries}
			)=== true)return;
				data = this.unserialize(message);
			};
			
			if(useXML && useXSLT){
				var xmlNode = data;
				this.getXml(useXSLT,function(data,state,extra){if(state != __HTTP_SUCCESS__){
						if(state == __HTTP_TIMEOUT__ && extra.retries < jpf.maxHttpRetries)return extra.tpModule.retry(extra.id);
						else{
							extra.userdata.message = "Could not load XSLT from external resource :\n\n" + extra.message;
							extra.userdata.callback(data,state,extra.userdata);
						}
					};
					var result = xmlNode.transformNode(data);
					var noClear = extra.userdata.callback ? extra.userdata.callback([result,xmlNode],__RPC_SUCCESS__,extra.userdata):false;
					
					if(! noClear)extra.tpModule.queue[id]= null;
				}
				,true,{callback:callback,userdata:userdata,http:http,url:from_url,tpModule:this,id:id,retries:retries}
			);
				return;
			}
		}
		catch(e){
			var noClear = callback ? callback(data,__RPC_ERROR__,{userdata:userdata,http:http,url:from_url,tpModule:this,id:id,message:msg + e.message,retries:retries}
		):false;
			
			if(! noClear){
				http.abort();
				this.clearQueueItem(id);
			};
			return;
		};
		var noClear = callback ? callback(data,__RPC_SUCCESS__,{userdata:userdata,http:http,url:from_url,tpModule:this,id:id,retries:retries}
	):false;
		
		if(! noClear)this.clearQueueItem(id);
		return data;
	};
	this.dotimeout = function(id){
		if(! this.queue[id])return false;
		clearInterval(this.queue[id][5]);
		var http = this.queue[id][0];
		
		try{
			if(http.status){
			}
	}
		catch(e){
			return setTimeout('HTTP.dotimeout(' + id + ')',10);
		};
		var callback = this.queue[id][1];
		var useXML = this.queue[id][7];
		var userdata = this.queue[id][4];
		http.abort();
		var noClear = callback ? callback(null,__RPC_TIMEOUT__,{userdata:userdata,http:http,url:this.queue[id][6][0],tpModule:this,id:id,message:"HTTP Call timed out",retries:this.queue[id][8]}
	):false;
		
		if(! noClear)this.clearQueueItem(id);
	};
	this.clearQueueItem = function(id){
		if(! this.queue[id])return false;
		
		if(jpf.hasReadyStateBug)clearInterval(this.queue[id][5]);
		jpf.releaseHTTP(this.queue[id][0]);
		this.queue[id]= null;
		delete this.queue[id];
		return true;
	};
	this.retry = function(id){
		if(! this.queue[id])return false;
		clearInterval(this.queue[id][5]);
		var q = this.queue[id];
		var a = q[6];
		q[8]++;
		this.get(a[0],q[1],a[1],q[4],a[3],a[2],q[7],id,null,null,a[5]);
		return true;
	};
	this.cancel = function(id){
		if(id === null)id = this.queue.length - 1;
		
		if(! this.queue[id])return false;
		this.clearQueueItem(id);
	};
	
	if(! this.load){
		this.load = function(x){
			var receive = x.getAttribute("receive");
			
			for(var i = 0;i < x.childNodes.length;i ++){
				if(x.childNodes[i].nodeType != 1)continue;
				var useXML = x.childNodes[i].getAttribute("type")== "XML";
				var url = x.childNodes[i].getAttribute("url");
				var receive = x.childNodes[i].getAttribute("receive")|| receive;
				var async = x.childNodes[i].getAttribute("async")!= "false";
				this[x.childNodes[i].getAttribute("name")]= function(data,userdata){
					return this.get(url,self[receive],async,userdata,false,data,useXML);
				}
			}
		};
		this.instantiate = function(x){
			var url = x.getAttribute("src");
			var useXSLT = x.getAttribute("xslt");
			var async = x.getAttribute("async")!= "false";
			this.getURL = function(data,userdata){
				return this.get(url,this.callbacks.getURL,async,userdata,false,data,true,null,null,useXSLT);
			};
			var name = "http" + Math.round(Math.random()* 100000);
			jpf.setReference(name,this);
			return name + ".getURL()";
		};
		this.call = function(method,args){
			this[method].call(this,args);
		}
	}

};

jpf.Init.run('HTTP');

/*FILEHEAD(/in/Library/TelePort/iframe.js)SIZE(3146)TIME(1203724557931)*/
jpf.Init.run('XMLDatabaseImplementation');

/*FILEHEAD(/in/Library/TelePort/poll.js)SIZE(3521)TIME(1203724557931)*/

/*FILEHEAD(/in/Library/TelePort/RPC/get.js)SIZE(4469)TIME(1213481872052)*/
jpf.get = function(){
	this.supportMulticall = false;
	this.protocol = "GET";
	this.vartype = "cgi";
	this.isXML = true;
	this.namedArguments = true;
	jpf.Teleport.register(this);
	
	if(! this.uniqueId){
		jpf.makeClass(this);
		this.inherit(jpf.BaseComm);
		this.inherit(jpf.http);
		this.inherit(jpf.rpc);
	};
	this.unserialize = function(str){
		return str;
	};
	this.getSingleCall = function(name,args,obj){
		obj.push(args);
	};
	this.serialize = function(functionName,args){
		if(justUseUrl){
			this.URL = this.urls[functionName];
			return "";
		};
		var vars =[];
		function recur(o,stack){
			if(jpf.isArray(o)){
				for(var j = 0;j < o.length;j ++)recur(o[j],stack + "%5B" + j + "%5D");
			}
			else 
			if(typeof o == "object"){
				for(prop in o){
					if(jpf.isSafariOld &&(! o[prop]|| typeof p[prop]!= "object"))continue;
					
					if(typeof o[prop]== "function")continue;
					recur(o[prop],stack + "%5B" + encodeURIComponent(prop)+ "%5D");
				}
			}
			else vars.push(stack + "=" + o);
		};
		
		if(this.multicall){
			vars.push("func=" + this.mcallname);
			
			for(var i = 0;i < args[0].length;i ++)recur(args[0][i],"f%5B" + i + "%5D");
		}
		else{
			for(prop in args){
				if(jpf.isSafariOld &&(! args[prop]|| typeof args[prop]== "function"))continue;
				recur(args[prop],prop);
			}
		};
		
		if(! this.BaseURL)this.BaseURL = this.URL;
		var nUrl = this.urls[functionName]? this.urls[functionName]:this.BaseURL;
		this.URL = nUrl +(vars.length ?(nUrl.match(/\?/)? "&":"?")+ vars.join("&"):"");
		return "";
	};
	this.checkErrors = function(data,http){
		return data;
	};
	this.__load = function(x){
		if(x.getAttribute("method-name")){
			var mName = x.getAttribute("method-name");
			var nodes = x.childNodes;
			
			for(var i = 0;i < nodes.length;i ++){
				var y = nodes[i];
				var v = y.insertBefore(x.ownerDocument.createElement("variable"),y.firstChild);
				v.setAttribute("name",mName);
				v.setAttribute("value",y.getAttribute("name"));
			}
		}
	};
	this.submitForm = function(form,callback){
		if(! this['postform'])this.addMethod('postform',callback);
		var args =[];
		
		for(var i = 0;i < form.elements.length;i ++){
			if(! form.elements[i].name)continue;
			
			if(form.elements[i].tagname = 'input' &&(form.elements[i].type == 'checkbox' || form.elements[i].type == 'radio')&& ! form.elements[i].checked)continue;
			
			if(form.elements[i].tagname = 'select' && form.elements[i].multiple){
				for(j = 0;j < form.elements[i].options.length;j ++){
					if(form.elements[i].options[j].selected)args.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].options[j].value));
				}
			}
			else{
				args.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value));
			}
		};
		var loc =(form.action || location.href);
		this.urls['postform']= loc +(loc.indexOf("?")> - 1 ? "&":"?")+ args.join("&");
		this['postform'].call(this);
		return false;
	};
	var justUseUrl;
	this.callWithString = function(func,str,callback){
		this.setCallback(func,callback);
		var original_url = this.urls[func];
		justUseUrl = true;
		this.urls[func]= this.urls[func]+(this.urls[func].indexOf("?")> - 1 ? "&":"?")+ str;
		this[func].call(this);
		justUseUrl = false;
		this.urls[func]= original_url;
	}

}

/*FILEHEAD(/in/Library/TelePort/RPC/header.js)SIZE(1572)TIME(1203730250884)*/

/*FILEHEAD(/in/Library/TelePort/RPC/jphp.js)SIZE(3149)TIME(1203730262571)*/

/*FILEHEAD(/in/Library/TelePort/RPC/jsonrpc.js)SIZE(2967)TIME(1213477095959)*/

/*FILEHEAD(/in/Library/TelePort/RPC/jsop.js)SIZE(1696)TIME(1203730275915)*/

/*FILEHEAD(/in/Library/TelePort/RPC/post.js)SIZE(4122)TIME(1203730308040)*/
jpf.post = function(){
	this.supportMulticall = true;
	this.mcallname = "multicall";
	this.multicall = false;
	this.protocol = "POST";
	this.vartype = "cgi";
	this.isXML = true;
	this.namedArguments = true;
	this.contentType = "application/x-www-form-urlencoded";
	jpf.Teleport.register(this);
	
	if(! this.uniqueId){
		jpf.makeClass(this);
		this.inherit(jpf.BaseComm);
		this.inherit(jpf.http);
		this.inherit(jpf.rpc);
	};
	this.unserialize = function(str){
		return str;
	};
	this.__HeaderHook = function(http){
	};
	this.getSingleCall = function(name,args,obj){
		obj.push(args);
	};
	this.serialize = function(functionName,args){
		if(postVars){
			var v = postVars;
			postVars = null;
			this.URL = this.urls[functionName];
			return v;
		};
		var vars =[];
		function recur(o,stack){
			if(jpf.isArray(o)){
				for(var j = 0;j < o.length;j ++)recur(o[j],stack + "%5B" + j + "%5D");
			}
			else 
			if(typeof o == "object"){
				for(prop in o){
					if(typeof o[prop]== "function")continue;
					recur(o[prop],stack + "%5B" + encodeURIComponent(prop)+ "%5D");
				}
			}
			else vars.push(stack + "=" + o);
		};
		
		if(this.multicall){
			vars.push("func=" + this.mcallname);
			
			for(var i = 0;i < args[0].length;i ++)recur(args[0][i],"f%5B" + i + "%5D");
		}
		else{
			for(prop in args)recur(args[prop],prop);
		};
		
		if(! this.BaseURL)this.BaseURL = this.URL;
		this.URL = this.urls[functionName]? this.urls[functionName]:this.BaseURL;
		return vars.join("&");
	};
	this.checkErrors = function(data,http){
		return data;
	};
	this.__load = function(x){
		if(x.getAttribute("method-name")){
			var mName = x.getAttribute("method-name");
			var nodes = x.childNodes;
			
			for(var i = 0;i < nodes.length;i ++){
				if(nodes[i].nodeType != 1)continue;
				var y = nodes[i];
				var v = y.insertBefore(x.ownerDocument.createElement("variable"),y.firstChild);
				v.setAttribute("name",mName);
				v.setAttribute("value",y.getAttribute("name"));
			}
		}
	};
	var postVars;
	this.submitForm = function(form,callback){
		if(! this['postform'])this.addMethod('postform',callback);
		var args =[];
		
		for(var i = 0;i < form.elements.length;i ++){
			if(! form.elements[i].name)continue;
			
			if(form.elements[i].tagName = 'input' &&(form.elements[i].type == 'checkbox' || form.elements[i].type == 'radio')&& ! form.elements[i].checked)continue;
			
			if(form.elements[i].tagName = 'select' && form.elements[i].multiple){
				for(j = 0;j < form.elements[i].options.length;j ++){
					if(form.elements[i].options[j].selected)args.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].options[j].value));
				}
			}
			else{
				args.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value));
			}
		};
		this.urls['postform']= form.action || location.href;
		postVars = args.join("&");
		this['postform'].call(this);
		return false;
	};
	this.callWithString = function(func,str,callback){
		this.setCallback(func,callback);
		postVars = str;
		this[func].call(this);
	}

}

/*FILEHEAD(/in/Library/TelePort/RPC/soap.js)SIZE(7418)TIME(1205785603109)*/

/*FILEHEAD(/in/Library/TelePort/RPC/xmlp.js)SIZE(1754)TIME(1203730355040)*/

/*FILEHEAD(/in/Library/TelePort/RPC/xmlrpc.js)SIZE(7254)TIME(1205786423468)*/

/*FILEHEAD(/in/Library/TelePort/rpc.js)SIZE(9105)TIME(1213481898459)*/
jpf.rpc = function(){
	if(! this.supportMulticall)this.multicall = false;
	this.stack ={
	};
	this.globals =[];
	this.names ={
	};
	this.urls ={
	};
	this.isRPC = true;
	this.useHTTP = true;
	this.TelePortModule = true;
	this.routeServer = jpf.host + "/cgi-bin/rpcproxy.cgi";
	this.autoroute = false;
	this.namedArguments = false;
	this.tagName = "RPC";
	this.addMethod = function(name,receive,names,async,vexport,is_global,global_name,global_lookup,caching){
		if(is_global)this.callbacks[name]= new Function('data','status','extra','jpf.lookup(' + this.uniqueId + ').setGlobalVar("' + global_name + '"' + ', data, extra.http, "' + global_lookup + '", "' + receive + '", extra, status)');
		else 
		if(receive)this.callbacks[name]= receive;
		this.setName(name,names);
		
		if(vexport)this.vexport = vexport;
		this[name]= new Function('return this.call("' + name + '"' + ', this.fArgs(arguments, this.names["' + name + '"], ' +(this.vartype != "cgi" && this.vexport == "cgi")+ '));');
		this[name].async = async;
		this[name].caching = caching;
		return true;
	};
	this.setName = function(name,names){
		this.names[name]= names;
	};
	this.setCallback = function(name,func){
		this.callbacks[name]= func;
	};
	this.fArgs = function(a,nodes,no_globals){
		var args = this.namedArguments ?{
		}
	:[];
		
		if(! no_globals)
		for(var i = 0;i < this.globals.length;i ++)args[this.globals[i][0]]= this.globals[i][1];
		
		if(this.namedArguments){
			if(! nodes || nodes && ! nodes.length)return args;
			
			for(var value,j = 0,i = 0;i < nodes.length;i ++){
				var name = nodes[i].getAttribute("name");
				
				if(nodes[i].getAttribute("value"))value = nodes[i].getAttribute("value");
				else 
				if(nodes[i].getAttribute("method"))value = self[nodes[i].getAttribute("method")](args);
				else{
					if(a.length == 1 && typeof a[0]== 'object' && ! jpf.isNull(a[0])){
						value = a[0][name];
					}
					else{
						value = a[j];
						j ++;
					};
					
					if(jpf.isNot(value))value = nodes[i].getAttribute("default");
				};
				value = nodes[i].getAttribute("encoded")== "true" ? encodeURIComponent(value):value;
				this.namedArguments ?(args[name]= value):(args.push(value));
			}
		}
		else 
		for(var i = 0;i < a.length;i ++)args.push(a[i]);
		return args;
	};
	this.setGlobalVar = function(name,data,http,lookup,receive,extra,status){
		if(status != __RPC_SUCCESS__){
			if(receive)self[receive](data,status,extra);
			return;
		};
		
		if(this.vartype == "header" && lookup && http)data = http.getResponseHeader(lookup);
		
		if(lookup.split("\:",2)[0]== "xpath"){
			try{
				var doc = jpf.getObject("XMLDOM",data).documentElement;
			}
			catch(e){
				throw new Error(1083,jpf.formErrorString(1083,null,"Receiving global","Returned value is not XML (for global variable lookup with name '" + name + "')"));
			};
			var data = jpf.getXmlValue(doc,lookup.split("\:",2)[1]);
		};
		
		for(var found = false,i = 0;i < this.globals.length;i ++){
			if(this.globals[i][0]== name){
				this.globals[i][1]= data;
				found = true;
			}
		};
		
		if(! found)this.globals.push([name,data]);
		
		if(receive)self[receive](data,__RPC_SUCCESS__,extra);
	};
	this.call = function(name,args){
		if(this.workOffline)return;
		
		if(this.oncall)this.oncall(name,args);
		var receive = typeof this.callbacks[name]== "string" ? self[this.callbacks[name]]:this.callbacks[name];
		
		if(! receive)receive = function(){
		};
		
		if(this.multicall){
			if(! this.stack[this.URL])this.stack[this.URL]= this.getMulticallObject ? this.getMulticallObject():new Array();
			this.getSingleCall(name,args,this.stack[this.URL]);
			return true;
		};
		var data = this.serialize(name,args);
		var info = this.get(this.URL,receive,this[name].async,this[name].userdata,true,data,false,null,null,null,this[name].caching);
		return info;
	};
	this.purge = function(receive,userdata,async,extradata){
		var data = this.serialize("multicall",[this.stack[this.URL]]);
		var url = this.URL;
		
		if(extradata){
			for(var vars =[],i = 0;i < extradata.length;i ++){
				vars.push(encodeURIComponent(extradata[i][0])+ "=" + encodeURIComponent(extradata[i][1]|| ""))};
			url = url +(url.match(/\?/)? "&":"?")+ vars.join("&");
		};
		info = this.get(url,receive,async,userdata,true,data,false);
		this.stack[this.URL]= this.getMulticallObject ? this.getMulticallObject():[];
	};
	this.revert = function(modConst){
		this.stack[modConst.URL]= this.getMulticallObject ? this.getMulticallObject():[];
	};
	this.getStackLength = function(){
		return this.stack[this.URL]? this.stack[this.URL].length:0;
	};
	this.load = function(x){
		this.jml = x;
		this.timeout = parseInt(x.getAttribute("timeout"))|| this.timeout;
		this.URL = x.getAttribute("urleval")? eval(x.getAttribute("urleval")):x.getAttribute("url");
		
		if(this.URL)this.server = this.URL.replace(/^(.*\/\/[^\/]*)\/.*$/,"$1")+ "/";
		this.multicall = x.getAttribute("multicall")== "true";
		this.autoroute = x.getAttribute("autoroute")== "true";
		this.workOffline = x.getAttribute("offline")== "true";
		
		if(this.__load)this.__load(x);
		var q = x.childNodes;
		
		for(var url,i = 0;i < q.length;i ++){
			if(q[i].nodeType != 1)continue;
			
			if(q[i].tagName == "global"){
				this.globals.push([q[i].getAttribute("name"),q[i].getAttribute("value")]);
				continue;
			};
			var nodes = q[i].getElementsByTagName("*");
			url = q[i].getAttribute("urleval")? eval(q[i].getAttribute("urleval")):q[i].getAttribute("url");
			
			if(url)this.urls[q[i].getAttribute("name")]= url;
			this.addMethod(q[i].getAttribute("name"),q[i].getAttribute("receive")|| x.getAttribute("receive"),nodes,(q[i].getAttribute("async")== "false" ? false:true),q[i].getAttribute("export"),q[i].getAttribute("type")== "global",q[i].getAttribute("variable"),q[i].getAttribute("lookup"),q[i].getAttribute("caching")== "true");
		}
	}

}

/*FILEHEAD(/in/Library/TelePort/socket.js)SIZE(3579)TIME(1203730412931)*/

/*FILEHEAD(/in/Library/jpack_end.js)SIZE(120)TIME(1201645349781)*/
if(document.body)jpf.Init.run('BODY');

else window.onload = function(){
	jpf.Init.run('BODY');
};

jpf.start();

/*FILEHEAD(/cwd/jfw_release.map)SIZE(29781)TIME(1213646908974)*/

/*FILEHEAD(/cwd/jfwsym.txt)SIZE(0)TIME(0)*/

