/* xajax Javascript library :: version 0.2.5 */
var xajaxDebug=false;
var xajaxStatusMessages=false;
var xajaxWaitCursor=true;
var xajaxDefinedGet=0;
var xajaxDefinedPost=1;
var xajaxLoaded=false;
var loadingTimeout;

function Xajax(){
  this.color = {r:124,g:12,b:86};
	this.arrayContainsValue = function(array, valueToCheck){
		for(i in array)	if(array[i] == valueToCheck) return true;
		return false;
	};
	
	this.workId = 'xajaxWork'+ new Date().getTime();
	this.depth = 0;
	this.responseErrorsForAlert = ["400","401","402","403","404","500","501","502","503"];
	
	this.getRequestObject = function(){
		var req = null;
		if(typeof XMLHttpRequest != "undefined") req = new XMLHttpRequest();
		if(!req && typeof ActiveXObject != "undefined"){
			try{
				req=new ActiveXObject("Msxml2.XMLHTTP");
				XMLHttpRequest = function(){return new ActiveXObject("Msxml2.XMLHTTP");}
			}catch(e){
				try{
					req=new ActiveXObject("Microsoft.XMLHTTP");
					XMLHttpRequest = function(){return new ActiveXObject("Microsoft.XMLHTTP");}
				}catch(e2){
					try{
						req=new ActiveXObject("Msxml2.XMLHTTP.4.0");
						XMLHttpRequest = function(){return new ActiveXObject("Msxml2.XMLHTTP.4.0");}
					}catch(e3){	req=null;	}
				}
			}
		}
		if(!req && window.createRequest) req = window.createRequest();
		return req;
	}

	this.$ = function(sId){
		if(!sId) return null;
		var returnObj = document.getElementById(sId);
		if (!returnObj && document.all) returnObj = document.all[sId];
		return returnObj;
	}
	
	this.include = function(sFileName){
		var objHead = document.getElementsByTagName('head');
		var objScript = document.createElement('script');
		objScript.type = 'text/javascript';
		objScript.src = sFileName;
		objHead[0].appendChild(objScript);
	}
	
	this.stripOnPrefix = function(sEventName){
		sEventName = sEventName.toLowerCase();
		if(sEventName.indexOf('on') == 0) sEventName = sEventName.replace(/on/,'');
		return sEventName;
	}
	
	this.addOnPrefix = function(sEventName){
		sEventName = sEventName.toLowerCase();
		if(sEventName.indexOf('on') != 0)	sEventName = 'on' + sEventName;		
		return sEventName;
	}
	
	this.addHandler = function(sElementId, sEvent, sFunctionName){
		if(window.addEventListener){
			sEvent = this.stripOnPrefix(sEvent);
			eval("this.$('"+sElementId+"').addEventListener('"+sEvent+"',"+sFunctionName+",false);");
		}
		else if(window.attachEvent){
			sAltEvent = this.addOnPrefix(sEvent);
			if(eval("this.$('"+sElementId+"').attachEvent('"+sAltEvent+"',"+sFunctionName+");"))
				window.attachEvent('onunload', 
					eval("function(){xajax.$('"+sElementId+"').detachEvent('"+sAltEvent+"',"+sFunctionName+");}"));
		}else{
			sAltEvent = this.addOnPrefix(sEvent);
			eval("this.$('"+sElementId+"')."+sAltEvent+" = "+sFunctionName);
		}
	}
	
	this.removeHandler = function(sElementId, sEvent, sFunctionName){
		if(window.removeEventListener){
			sEvent = this.stripOnPrefix(sEvent);
			eval("this.$('"+sElementId+"').removeEventListener('"+sEvent+"',"+sFunctionName+",false);");
		}else if(window.detachEvent){
			sAltEvent = this.addOnPrefix(sEvent);
			try{ eval("this.$('"+sElementId+"').detachEvent('"+sAltEvent+"',"+sFunctionName+");");
			}catch(ignore) {}
		}else{
			sAltEvent = this.addOnPrefix(sEvent);
			eval("this.$('"+sElementId+"')."+sAltEvent+" = null");
		}
	}
	
	this.create = function(sParentId, sTag, sId){
		var objParent = this.$(sParentId);
		objElement = document.createElement(sTag);
		objElement.setAttribute('id',sId);
		if(objParent) objParent.appendChild(objElement);
	}
	
	this.insert = function(sBeforeId, sTag, sId){
		var objSibling = this.$(sBeforeId);
		objElement = document.createElement(sTag);
		objElement.setAttribute('id',sId);
		objSibling.parentNode.insertBefore(objElement, objSibling);
	}

	this.insertAfter = function(sAfterId, sTag, sId){
		var objSibling = this.$(sAfterId);
		objElement = document.createElement(sTag);
		objElement.setAttribute('id',sId);
		objSibling.parentNode.insertBefore(objElement, objSibling.nextSibling);
	}
	
	this.getInput = function(sType, sName, sId){
		var Obj;
		if(!window.addEventListener) Obj = document.createElement('<input type="'+sType+'" id="'+sId+'" name="'+sName+'">');
		else{
			Obj = document.createElement('input');
			Obj.setAttribute('type',sType);
			Obj.setAttribute('name',sName);
			Obj.setAttribute('id',sId);
		}
		return Obj;
	}
	
	this.createInput = function(sParentId, sType, sName, sId){
		var objParent = this.$(sParentId);
		var objElement = this.getInput(sType, sName, sId);
		if (objParent && objElement) objParent.appendChild(objElement);
	}
	
	this.insertInput = function(sBeforeId, sType, sName, sId){
		var objSibling = this.$(sBeforeId);
		var objElement = this.getInput(sType, sName, sId);
		if(objElement && objSibling && objSibling.parentNode)	objSibling.parentNode.insertBefore(objElement, objSibling);
	}

	this.insertInputAfter = function(sAfterId, sType, sName, sId){
		var objSibling = this.$(sAfterId);
		var objElement = this.getInput(sType, sName, sId);
		if(objElement && objSibling && objSibling.parentNode) objSibling.parentNode.insertBefore(objElement, objSibling.nextSibling);
	}
		
	this.remove = function(sId){
		objElement = this.$(sId);
		if(objElement && objElement.parentNode && objElement.parentNode.removeChild) objElement.parentNode.removeChild(objElement);
	}
	
	this.replace = function(sId,sAttribute,sSearch,sReplace){
		var bFunction = false;
		
		if(sAttribute == "innerHTML") sSearch = this.getBrowserHTML(sSearch);
		
		eval("var txt=this.$('"+sId+"')."+sAttribute);
		if(typeof txt == "function"){
            txt = txt.toString();
            bFunction = true;
    }
		if(txt.indexOf(sSearch)>-1){
			var newTxt = '';
			while(txt.indexOf(sSearch) > -1){
				x = txt.indexOf(sSearch)+sSearch.length+1;
				newTxt += txt.substr(0,x).replace(sSearch,sReplace);
				txt = txt.substr(x,txt.length-x);
			}
			newTxt += txt;
			if (bFunction) eval('this.$("'+sId+'").'+sAttribute+'=newTxt;');
			else if(this.willChange(sId,sAttribute,newTxt))	eval('this.$("'+sId+'").'+sAttribute+'=newTxt;');
		}
	}
	
	this.getFormValues = function(frm){
		var objForm;
		var submitDisabledElements = false;
		if(arguments.length > 1 && arguments[1] == true) submitDisabledElements = true;
		var prefix="";
		if(arguments.length > 2) prefix = arguments[2];
		
		if(typeof(frm) == "string")	objForm = this.$(frm);
		else objForm = frm;
		var sXml = "<xjxquery><q>";
		if(objForm && objForm.tagName.toUpperCase() == 'FORM'){
			var formElements = objForm.elements;
			for(var i=0; i < formElements.length; i++){
				if(!formElements[i].name) continue;
				if(formElements[i].name.substring(0, prefix.length) != prefix) continue;
				if(formElements[i].type && (formElements[i].type == 'radio' || formElements[i].type == 'checkbox') && formElements[i].checked == false)	continue;
				if(formElements[i].disabled && formElements[i].disabled == true && submitDisabledElements == false)	continue;
				var name = formElements[i].name;
				if(name){
					if(sXml != '<xjxquery><q>')	sXml += '&';
					if(formElements[i].type=='select-multiple'){
						for(var j = 0; j < formElements[i].length; j++){
							if (formElements[i].options[j].selected == true) sXml += name+"="+encodeURIComponent(formElements[i].options[j].value)+"&";
						}
					}
					else sXml += name+"="+encodeURIComponent(formElements[i].value);
				} 
			}
		}
		sXml +="</q></xjxquery>";
		return sXml;
	}
	
	this.objectToXML = function(obj){
		var sXml = "<xjxobj>";
		for(i in obj){
			try{
				if(i == 'constructor') continue;
				if(obj[i] && typeof(obj[i]) == 'function') continue;
					
				var key = i;
				var value = obj[i];
				if(value && typeof(value)=="object" && this.depth <= 50){
					this.depth++;
					value = this.objectToXML(value);
					this.depth--;
				}
				sXml += "<e><k>"+key+"</k><v>"+value+"</v></e>";
			}catch(e){}
		}
		sXml += "</xjxobj>";
		return sXml;
	}

	this._nodeToObject = function(node) {
		if(!node) return '';
		if(node.nodeName == '#cdata-section' || node.nodeName == '#text'){
			var data = "";
			for(var j=0; j<node.parentNode.childNodes.length; j++) data += node.parentNode.childNodes[j].data;
			return data;
		}
		else if(node.nodeName == 'xjxobj'){
			var data = new Array();
			for(var j=0; j<node.childNodes.length; j++){
				var child = node.childNodes[j];
				var key;
				var value;
				if(child.nodeName == 'e'){
					for(var k=0; k<child.childNodes.length; k++){
						if(child.childNodes[k].nodeName == 'k')	key = child.childNodes[k].firstChild.data;
						else if(child.childNodes[k].nodeName == 'v') value = this._nodeToObject(child.childNodes[k].firstChild);
					}
					if(key != null && value != null){
						data[key] = value;
						key = value = null;
					}
				}
			}
			return data;
		}		
	}

	this.loadingFunction = function(){};
	this.doneLoadingFunction = function(){};
	var loadingTimeout;

	this.call = function(sFunction, aArgs){
		var i,r,postData;
		if(document.body && xajaxWaitCursor) document.body.style.cursor = 'wait';
		if(xajaxStatusMessages == true) window.status = 'Sending Request...';
		clearTimeout(loadingTimeout);
		loadingTimeout = setTimeout("xajax.loadingFunction();",400);

		var value,uri = xajaxRequestUri;
		
		postData = "xajax="+encodeURIComponent(sFunction);
		postData += "&xajaxr="+new Date().getTime();
		if(aArgs){
			for(i = 0; i <aArgs.length; i++){
				value = aArgs[i];
				if(typeof(value)=="object")	value = this.objectToXML(value);
				postData = postData+"&xajaxargs[]="+encodeURIComponent(value);
			}
		}
			
		r = this.getRequestObject();
		if (!r) return false;
		r.open("POST", uri, true);
			try{
        r.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
				r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			}catch(e){
				alert("Twoja przeglądarka nie obsługuje asynchronicznej komunikacji.");
				return false;
			}
		r.onreadystatechange = function(){
			if(r.readyState != 4) return;
			
			if(r.status==200){
				if (r.responseXML && r.responseXML.documentElement)
					xajax.processResponse(r.responseXML);
				else{
					var errorString = "Error: the XML response that was returned from the server is invalid.";
					errorString += "\nReceived:\n" + r.responseText;
					trimmedResponseText = r.responseText.replace( /^\s+/g, "" );
					trimmedResponseText = trimmedResponseText.replace( /\s+$/g, "" );
					if(trimmedResponseText != r.responseText) errorString += "\nYou have whitespace in your response.";
					alert(errorString);
					document.body.style.cursor = 'default';
					if (xajaxStatusMessages == true) window.status = 'Invalid XML response error';				
				}
			}
			else{
      	if(xajax.arrayContainsValue(xajax.responseErrorsForAlert, r.status)){
					var errorString = "Error: the server returned the following HTTP status: " + r.status;
					errorString += "\nReceived:\n" + r.responseText;
					alert(errorString);
				}
				document.body.style.cursor = 'default';
				if(xajaxStatusMessages == true) window.status = 'Invalid XML response error';								
			}
			
			delete r;
			r = null;
		}
		r.send(postData);
		if (xajaxStatusMessages == true) window.status = 'Waiting for data...';
		delete r;
		return true;
	}
	
	this.getBrowserHTML = function(html){
		tmpXajax = this.$(this.workId);
		if(!tmpXajax){
			tmpXajax = document.createElement("div");
			tmpXajax.setAttribute('id',this.workId);
			tmpXajax.style.display = "none";
			tmpXajax.style.visibility = "hidden";
			document.body.appendChild(tmpXajax);
		}
		tmpXajax.innerHTML = html;
		var browserHTML = tmpXajax.innerHTML;
		tmpXajax.innerHTML = '';	
		
		return browserHTML;
	}
	
	this.willChange = function(element, attribute, newData){
		if(!document.body) return true;

		if(attribute == "innerHTML") newData = this.getBrowserHTML(newData);
			
		elementObject = this.$(element);
		if(elementObject){
			var oldData;		
			eval("oldData=this.$('"+element+"')."+attribute);
			if(newData !== oldData) return true;
		}

		return false;
	}
	
	this.viewSource = function(){
		return "<html>"+document.getElementsByTagName("HTML")[0].innerHTML+"</html>";
	}
	
  this.newSessionID = function(){
    var sessionID;
    sessionID = new String(new Date().getTime());
    var random = new String(Math.random( )).substr(2);
    sessionID = sessionID + random;
    return sessionID;
  }
   
  this.setStatusMessages = function(msg){
    window.status = msg;
  }
	
  this.upload = function(rpcFunc,formID,url){
    var form = document.getElementById(formID);
    if(!form)return false;

    if(form.encoding.toLowerCase() != 'multipart/form-data') form.encoding = 'multipart/form-data';
    if(form.method.toLowerCase() != 'post') form.method = 'post';
        
    var newSessionID = xajax.newSessionID();

    if(document.body && xajaxWaitCursor) document.body.style.cursor = 'wait';
    if(xajaxStatusMessages == true) xajax.setStatusMessages('Sending Request...');
    clearTimeout(loadingTimeout);
    loadingTimeout = setTimeout("xajax.loadingFunction();",400);
 
    if(!url) url = xajaxRequestUri;
    url = url.replace(/\.html/i, ".php");
    url += '?xajax='+encodeURIComponent(rpcFunc) + "&xajaxr=" + new Date().getTime();
    
    var formItem,nodeName;
    for(var i=0; i<form.getElementsByTagName('input').length; i++){
      formItem = form.elements[i];
      nodeName = new String(formItem.nodeName).toLowerCase();
      if(formItem.name == '' || nodeName == 'button') continue;
      if(formItem.type == 'file') url += '&'+formItem.name+'='+encodeURIComponent(formItem.value);
    }

    form.action = url;
    
    var iframe,iframeName = form.id + newSessionID;
    if((iframe = document.getElementById(iframeName))) document.body.removeChild(iframe);
    iframe = xajax.createIframe(iframeName,iframeName);
    
    form.target = iframeName;
    form.submit();
    var xmlDoc,responseXML;
    
    if(typeof iframe.onreadystatechange == 'object'){
      iframe.onreadystatechange = function(){
        if(iframe.readyState == 'complete' && !iframe.loaded){
          iframe.loaded = true;
          xmlDoc = document.frames(iframe.id);
          if(xmlDoc.window.document.location != iframe.src){
            responseXML = xmlDoc.window.document.XMLDocument;
            xajax.uploadResponse(responseXML,iframe, xmlDoc);
          }
        }
      }
    }else{    
      iframe.onload = function(){
        xmlDoc = iframe.contentWindow;
        if(xmlDoc.window.document.location != iframe.src){
          responseXML = xmlDoc.document;
          xajax.uploadResponse(responseXML, iframe, xmlDoc);
        }
      }
    }
    xajax.deleteIframe(iframe);
  }
	
	this.uploadResponse = function(responseXML,iframeObj, xmlDoc){
    var error=false;
    if(responseXML){
      try{
        xajax.processResponse(responseXML);
      }catch(e){error = true;}
    }else error = true;

    if(error){
      var responseText = new String(xmlDoc.document.body.innerHTML);
      var errorString = "Error: the XML response that was returned from the server is invalid.";
      errorString += "\nReceived:\n" + responseText;
      trimmedResponseText = responseText.replace( /^\s+/g, "" );// strip leading space
      trimmedResponseText = trimmedResponseText.replace( /\s+$/g, "" );// strip trailing
      if(trimmedResponseText != responseText) errorString += "\nYou have whitespace in your response.";
      document.body.style.cursor = 'default';
      alert(errorString);
      if(xajaxStatusMessages == true) xajax.setStatusMessages('Invalid XML response error');
    }

    iframeObj = null;  
  }
    
  this.deleteIframe = function(iframeName){
    if((iframe = document.getElementById(iframeName))) document.body.removeChild(iframe);
  }
  
  this.HSBtoRGB = function(hue, saturation, brightness){
      var br = Math.round(brightness / 100 * 255);
	    if(saturation == 0){
		    return {r:br, g:br, b:br};
	    }else{
		    hue = hue % 360;
		    var f = hue % 60;
		    var p = Math.round((brightness * (100 - saturation)) / 10000 * 255);
		    var q = Math.round((brightness * (6000 - saturation * f)) / 600000 * 255);
		    var t = Math.round((brightness * (6000 - saturation * (60 - f))) / 600000 * 255);
		    switch (Math.floor(hue / 60)){
			   case 0: return {r:br, g:t, b:p};
			   case 1: return {r:q, g:br, b:p};
			   case 2: return {r:p, g:br, b:t};
			   case 3: return {r:p, g:q, b:br};
			   case 4: return {r:t, g:p, b:br};
			   case 5: return {r:br, g:p, b:q};
		    }
	    }
    }
    
    this.RGBtoHSB = function(red, green, blue){
      var hue, saturation, brightness;
	    var max = Math.max(red, green, blue), min = Math.min(red, green, blue);
	    var delta = max - min;
	    brightness = max / 255;
	    saturation = (max != 0) ? delta / max : 0;
	    if(saturation == 0){ hue = 0;
	    }else{
		    var rr = (max - red) / delta;
		    var gr = (max - green) / delta;
		    var br = (max - blue) / delta;
		    if (red == max) hue = br - gr;
		    else if (green == max) hue = 2 + rr - br;
		    else hue = 4 + gr - rr;
		    hue /= 6;
		    if (hue < 0) hue++;
	   }
      return {h:Math.round(hue * 360), s:Math.round(saturation * 100), b:Math.round(brightness * 100)};
    }
    
    this.setHue = function(h){
      this.color = this.HSBtoRGB(h, 100, 100);
    }
    
    this.setHueBright = function(s,b){
      var hsb = this.RGBtoHSB(this.color.r, this.color.g, this.color.b);
      hsb.s = s;
      hsb.b = b;
      this.color = this.HSBtoRGB(hsb.h, hsb.s, hsb.b);
    }
    
    this.asHue = function(s,b){
      var hsb = this.RGBtoHSB(this.color.r, this.color.g, this.color.b);
      hsb.h;
      return this.HSBtoRGB(hsb.h, 100, 100);
    }
    
    this.rgbToHex = function(r,g,b,includeHash){
      r = Math.round(r);
      g = Math.round(g);
      b = Math.round(b);
      if(includeHash == undefined) includeHash = true;
    
      r = r.toString(16);
      if(r.length == 1) r = '0' + r;
      g = g.toString(16);
      if(g.length == 1) g = '0' + g;
      b = b.toString(16);
      if(b.length == 1) b = '0' + b;
      return ((includeHash ? '#' : '') + r + g + b).toUpperCase();
    } 
    
  this.createIframe = function(name,id){
    var iframe;
    if(!id) id = '';
    if(document.all){
      iframe = document.createElement('<iframe id="'+id+'" name="'+name+'">');
    }else{
      iframe = document.createElement('iframe');
      iframe.id = id;
      iframe.name = name;
    }
    iframe.width = '100';
    iframe.height = '100';
    iframe.style.display = 'none';
    iframe.scrolling = 'no';
    iframe.src = 'about:blank';
    document.body.appendChild(iframe);
    return iframe;
  }
	
	this.processResponse = function(xml){
		clearTimeout(loadingTimeout);
		this.doneLoadingFunction();
		if(xajaxStatusMessages == true) window.status = 'Processing...';
		var tmpXajax = null;
		xml = xml.documentElement;
		if(xml == null) return;
		
		var skipCommands = 0;
		for(var i=0; i<xml.childNodes.length; i++){
			if(skipCommands > 0){
				skipCommands--;
				continue;
			}
			if(xml.childNodes[i].nodeName == "cmd")
			{
				var cmd;
				var id;
				var property;
				var data;
				var search;
				var type;
				var before;
				var objElement = null;

				for(var j=0; j<xml.childNodes[i].attributes.length; j++){
				if(xml.childNodes[i].attributes[j].name == "n") cmd = xml.childNodes[i].attributes[j].value;
					else if(xml.childNodes[i].attributes[j].name == "t")	id = xml.childNodes[i].attributes[j].value;
					else if(xml.childNodes[i].attributes[j].name == "p")	property = xml.childNodes[i].attributes[j].value;
					else if(xml.childNodes[i].attributes[j].name == "c") type = xml.childNodes[i].attributes[j].value;
				}
				if(xml.childNodes[i].childNodes.length > 1 && (xml.childNodes[i].firstChild.nodeName == "#cdata-section" || xml.childNodes[i].firstChild.nodeName == '#text')){
					data = "";
					for(var j=0; j<xml.childNodes[i].childNodes.length; j++) data += xml.childNodes[i].childNodes[j].data;
				}
				else if(xml.childNodes[i].firstChild && xml.childNodes[i].firstChild.nodeName == 'xjxobj'){
					data = this._nodeToObject(xml.childNodes[i].firstChild);
					objElement = "XJX_SKIP";
				}
				else if(xml.childNodes[i].childNodes.length > 1){
					for(var j=0; j<xml.childNodes[i].childNodes.length; j++){
						if(xml.childNodes[i].childNodes[j].childNodes.length > 1 && (xml.childNodes[i].childNodes[j].firstChild.nodeName == "#cdata-section" || xml.childNodes[i].childNodes[j].firstChild.nodeName == "#text")){
							var internalData = "";
							for(var k=0; k<xml.childNodes[i].childNodes[j].childNodes.length;k++) internalData+=xml.childNodes[i].childNodes[j].childNodes[k].nodeValue;
						}else	var internalData = xml.childNodes[i].childNodes[j].firstChild.nodeValue;
					
						if(xml.childNodes[i].childNodes[j].nodeName == "s")	search = internalData;
						if(xml.childNodes[i].childNodes[j].nodeName == "r") data = internalData;
					}
				}
				else if(xml.childNodes[i].firstChild) data = xml.childNodes[i].firstChild.nodeValue;
				else data = "";
				
				if(objElement != "XJX_SKIP") objElement = this.$(id);
				var cmdFullname;
				try{
					if(cmd=="cc"){
						cmdFullname = "addConfirmCommands";
						var confirmResult = confirm(data);
						if(!confirmResult) skipCommands = id;
					}
					if (cmd=="al"){
						cmdFullname = "addAlert";
						alert(data);
					}else if(cmd=="js"){
						cmdFullname = "addScript/addRedirect";
						eval(data);
					}else if (cmd=="jc"){
						cmdFullname = "addScriptCall";
						var scr = id + '(';
						if(data[0] != null){
							scr += 'data[0]';
							for(var l=1; l<data.length; l++) scr += ',data['+l+']';
						}
						scr += ');';
						eval(scr);
					}else if(cmd=="in"){
						cmdFullname = "addIncludeScript";
						this.include(data);
					}else if(cmd=="as"){
						cmdFullname = "addAssign/addClear";
						if(this.willChange(id,property,data))	eval("objElement."+property+"=data;");
					}else if(cmd=="ap"){
						cmdFullname = "addAppend";
						eval("objElement."+property+"+=data;");
					}else if(cmd=="pp"){
						cmdFullname = "addPrepend";
						eval("objElement."+property+"=data+objElement."+property);
					}else if(cmd=="rp"){
						cmdFullname = "addReplace";
						this.replace(id,property,search,data)
					}else if(cmd=="rm"){
						cmdFullname = "addRemove";
						this.remove(id);
					}else if(cmd=="ce"){
          	cmdFullname = "addCreate";
						this.create(id,data,property);
					}else if(cmd=="ie"){
						cmdFullname = "addInsert";
						this.insert(id,data,property);
					}else if(cmd=="ia"){
						cmdFullname = "addInsertAfter";
						this.insertAfter(id,data,property);
					}else if(cmd=="ci"){
						cmdFullname = "addCreateInput";
						this.createInput(id,type,data,property);
					}else if(cmd=="ii"){
						cmdFullname = "addInsertInput";
						this.insertInput(id,type,data,property);
					}else if(cmd=="iia"){
						cmdFullname = "addInsertInputAfter";
						this.insertInputAfter(id,type,data,property);
					}else if(cmd=="ev"){
						cmdFullname = "addEvent";
						property = this.addOnPrefix(property);
						eval("this.$('"+id+"')."+property+"= function(){"+data+";}");
					}else if(cmd=="ah"){
						cmdFullname = "addHandler";
						this.addHandler(id, property, data);
					}else if(cmd=="rh"){
						cmdFullname = "addRemoveHandler";
						this.removeHandler(id, property, data);
					}
				}
				catch(e){}
				delete objElement;
				delete cmd;
				delete cmdFullname;
				delete id;
				delete property;
				delete search;
				delete data;
				delete type;
				delete before;
				delete internalData;
				delete j;
				delete k;
			}	
		}
		delete xml;
		delete i;
		document.body.style.cursor = 'default';
		if (xajaxStatusMessages == true) window.status = 'Done';
	}
	this.test = function(){
    alert("test");
  }
	
}

var xajax = new Xajax();
xajaxLoaded = true;

