﻿/**
 * AjaxSuggest component for Naver - naver main, us
 * @author mania
 * @version 20090409
 * @version r12589
 */

//document.domain = "naver.com";

/**
 * Component Base Class
 *
 * @author gony, hooriza
 * @see http://wiki.nhncorp.com/display/lsuit/Component
 */
nhn.Component = jindo.$Class({

	_eventHandlers : null,
	_options : null,

	$init  : function() {
		var ins = this.constructor._instances;
		if (typeof ins == "undefined") {
			this.constructor._instances = ins = [];
		}
		ins[ins.length] = this;
		this._eventHandlers = {};
		this._options = {};
	},

	option : function(sName, sValue) {
		var nameType = (typeof sName);

		if (nameType == "undefined") {
			return this._options;
		} else if (nameType == "string") {
			if (typeof sValue != "undefined") {
				this._options[sName] = sValue;
				return this;
			} else {
				return this._options[sName];
			}
		} else if (nameType == "object") {
			try {
				for(var x in sName) {
					this._options[x] = sName[x];
				}
			} catch(e) {}
			return this;
		}
	},

	fireEvent : function(sEvent, oEvent) {

		var oEvent = oEvent ? (oEvent instanceof jindo.$Event ? oEvent._event : oEvent) : {};

		var isRealEvent =
			('boundElements' in oEvent && 'cancelBubble' in oEvent) ||
			(typeof Event != 'undefined' && oEvent instanceof Event);

		if (isRealEvent) {
			oEvent = jindo.$Event(oEvent);
		} else {
			oEvent.type = oEvent.type || sEvent;
			oEvent.canceled = false;
			oEvent.stop = function() { this.canceled = true; };
		}

		var aArg = [ oEvent ];

		for (var i = 2, len = arguments.length; i < len; i++)
			aArg.push(arguments[i]);

		var inlineHandler = this['on' + sEvent];

		if (typeof inlineHandler == 'function')
			inlineHandler.apply(this, aArg);

		var handlerList = this._eventHandlers[sEvent];

		if (typeof handlerList != 'undefined') {

			for (var i = 0, handler; handler = handlerList[i]; i++)
				handler.apply(this, aArg);

		}

		return !oEvent.canceled;

	},

	attach : function(sEvent, fpHandler) {

		if (arguments.length == 1) {

			jindo.$H(arguments[0]).forEach(jindo.$Fn(function(fpHandler, sEvent) {
				this.attach(sEvent, fpHandler);
			}, this).bind());
		
			return this;
		}

		var handlers = this._eventHandlers[sEvent];

		if (typeof handlers == 'undefined')
			handlers = this._eventHandlers[sEvent] = [];

		handlers.push(fpHandler);

		return this;

	},

	detach : function(sEvent, fpHandler) {

		if (arguments.length == 1) {

			jindo.$H(arguments[0]).forEach(jindo.$Fn(function(fpHandler, sEvent) {
				this.detach(sEvent, fpHandler);
			}, this).bind());
		
			return this;
		}

		var handlers = this._eventHandlers[sEvent];

		if (typeof handlers == 'undefined') return this;

		for (var i = 0, handler; handler = handlers[i]; i++) {
			if (handler === fpHandler) {
				handlers = handlers.splice(i, 1);
				break;
			}
		}

		return this;

	}

});

nhn.WatchInput = jindo.$Class({
	/**
	 * @lends nhn.WatchInput
	 */
	_nInterval : 100,
	_bTimerRunning : false,
	$init : function(sInputId, nInterval) {
		/**
		 * TextInput
		 */
		this.elInput 	= jindo.$(sInputId);
		var _nInterval 	= nInterval || this._nInterval;
		this.setInterval(_nInterval);
		this._oTimer = new nhn.Timer();
		
		this._bIE = jindo.$Agent().navigator().ie;
		this._wfFocus = jindo.$Fn(this._onFocus, this);
		this._wfBlur = jindo.$Fn(this._onBlur, this);
		this._wfKeyUp = jindo.$Fn(this._onKeyUp, this);
	},
	start : function() {
		this._sPrevValue = this.elInput.value;
		if(this._bIE) {
			this._wfKeyUp.attach(this.elInput, "keyup");	
		}
		else {
			if (this._isTimerRunning()) {
				return;
			}
			this._wfFocus.attach(this.elInput, "focus");
			this._wfBlur.attach(this.elInput, "blur");
		}	

		this.fireEvent("start");
		
	},
	stop : function() {
		if(this._bIE) {
			this._wfKeyUp.detach(this.elInput, "keyup");
		}
		else {
			this._wfFocus.detach(this.elInput, "focus");
			this._wfBlur.detach(this.elInput, "blur");
		}
		this._bTimerRunning = false;
		this.fireEvent("stop");
	
	},
	getInterval : function() {
		return this._nInterval;
	},
	setInterval : function(n) {
		this._nInterval = n;
	},
	_isTimerRunning : function() {
		return this._bTimerRunning;
	},
	_onKeyUp : function(e) {
		this._compare();
	},	
	_onFocus : function() {
		if(this._isTimerRunning()) {
			clearTimeout(this._nTimerStopCall);
			this._nTimerStopCall = null;
			return;
		}
		
		this._bTimerRunning = true;
		this.fireEvent("timerStart");
		this._compare();
		
		var self = this;
		
		this._oTimer.start(function(){
			self._compare();
			return true;
		}, this.getInterval());

	},	
	_onBlur : function() {
		var self = this;
		this._nTimerStopCall = setTimeout(function() {
			self._oTimer.abort();
			self._bTimerRunning = false;
			self.fireEvent("timerStop");
		}, this.getInterval());
	},
	_compare : function(){
		var sValue = this.elInput.value;
		if (sValue != this._sPrevValue) {
			this.fireEvent("change", {
				text: sValue
			});
			
			this._sPrevValue = sValue;
		}
	}
}).extend(nhn.Component);




/**
 * AutoComplete component
 * @author gony
 * @update mania
 * @version 20080311
 */
nhn.AutoComplete = jindo.$Class({
	
	/** @lends nhn.AutoComplete */
	_data: [],
	input: null,
	suggest: null,
	watcher: null,
	listbox: null,
	template: "",
	_searchStatus : "",
	

	$init: function(oInputEl, oSuggestEl, oOptions) {
		var opt = this._options;
		var self = this;
		var vDisabled = false;
		if(this.getCookie("NaverSuggestUse")){
			vDisabled = (this.getCookie("NaverSuggestUse") == "use") ? false: true;
		}
		this.option({
			listbox: "_resultBox1",
			async: false,
			disabled: vDisabled,
			triangleBtn : "",
			sTriangleUpOn : "http://sstatic.naver.com/search/images11/btn_atcmp_up_on.gif",
			sTriangleUpOff : "http://sstatic.naver.com/search/images11/btn_atcmp_up_off.gif",
			sTriangleDownOn : "http://sstatic.naver.com/search/images11/btn_atcmp_down_on.gif",
			sTriangleDownOff : "http://sstatic.naver.com/search/images11/btn_atcmp_down_off.gif",
			query: function(keyword, asyncCallback) {
				return [];
			}
		});
		
		this.option(oOptions);
		this._data = [];
		this._aDivId = [];
		this._searchStatus = "";
		
		this.input = jindo.$Element(oInputEl).attr("autocomplete", "off");
		this.suggest = jindo.$Element(oSuggestEl);
		
		if (this.listbox) this.template = this.listbox.html().replace(/^\s+|\s+$/g, "");
		this._onInput = jindo.$Fn(this.onInput, this).bind();
		
		this.watcher = new nhn.WatchInput(oInputEl);
		this.watcher.attach("change", this._onInput);

		jindo.$Fn(this.onClick, this).attach(this.input, "focus");
		jindo.$Fn( this._setClickDisplay, this).attach(document, "click");
		
		if (this.option("triangleBtn")) {
			jindo.$Fn(this._setClickTriangle, this).attach(jindo.$(this.option("triangleBtn")), "click");
			this.elTiangleImg = this._findElement(".triangleImg", jindo.$(this.option("triangleBtn")))[0];
			if(this.option("disabled")) this._setTriangleImg("hide");
		}
		this.watcher.start();
	},

	_checkTemplate : function(){
		var opt = this._options;
	
		this.elFrameDiv =jindo.$Element(this.suggest._element.contentWindow.document.getElementById('atcmp'));
		this.listbox = this._findElement("." + opt.listbox, this.elFrameDiv.$value())[0];
		this.listbox = this.listbox ? jindo.$Element(this.listbox) : null;
		this.bCheckTemplate = true;
		
	},
		

	_setTriangleImg : function(sMode){
		if(this.option("disabled")){
			if (sMode == "show") {
				this.elTiangleImg.src = this.option("sTriangleUpOn");
				var sAltMsg = "자동완성 접기";
			}else{
				this.elTiangleImg.src = this.option("sTriangleDownOff");
				var sAltMsg = "자동완성 켜기";
			}
		}else{
			if (sMode == "show") {
				this.elTiangleImg.src = this.option("sTriangleUpOn");
				var sAltMsg = "자동완성 접기";
			}else{
				this.elTiangleImg.src = this.option("sTriangleDownOn");
				var sAltMsg = "자동완성 펼치기";
			}
		}
		
		this.elTiangleImg.title = sAltMsg;
		this.elTiangleImg.alt = sAltMsg;
	},
	

	_setClickTriangle : function(e){
		if (!this.listbox_fw) this._checkTemplate();
		
		if(this.option("disabled")){
			this.useSuggest();
			this._setTriangleImg("show");
			if(this.input.$value().value){
				this.nListCnt = 0;
				this._searchStatus = "Triangle_false";
				this.onInput();
				
				e.stop();
			}else{
				var elUse=this._getFrameElement('atcmpStart');
				elUse.show();
				this.show();
				e.stop();
			}

		}else{
			if(this.suggest.visible()){
				this.hide();
			}else if(this.input.$value().value){
				this._searchStatus = "Triangle_true";
				this.onInput();
			}else{
				var elUse=this._getFrameElement('atcmpIng');
				elUse.show();
				this.show();
			}
			e.stop();
		}
	},
	

	_setClickDisplay : function(e){
		if(!jindo.$Element(e.element)){
			this.hide();
			this.fireEvent('onBlur');
			return false;
		}
		if(jindo.$Element(e.element).attr('id') == this.input.attr('id')){
			if (this.input.$value().value) {
				if (this.suggest.visible()) {
					this.hide();
				}
				else {
					this.onInput();
				}
					
			}
		}else{
			this.hide();
			this.fireEvent('onBlur');
		}
	},

	query: function(pFunc) { 
		var opt = this._options;
		if (typeof pFunc == "undefined") return opt.query;
		opt.query = pFunc;
		return this;
	},

	async: function(bAsync) { 
		if (typeof bAsync == "undefined") return this._options.async;
		this._options.async = !!bAsync;
		return this;
	},

	disabled: function(bDisabled) { 
		if (typeof bDisabled == "undefined") return this._options.disabled;
		this._options.disabled = bDisabled = !!bDisabled;
		if (bDisabled) {
			this.watcher.stop();
		}else{
			this.watcher.start();
		}

		this._data = [];
		if ( !! bDisabled && this.suggest.visible()) {
			this.hide();
		}
		this.paint();
		return this;
	},
	

	_getFrameElement : function(sId){
		var aDivElement = this.suggest._element.contentWindow.document.getElementsByTagName("div");
		for (var x in aDivElement) {
			try {
				var sDivId = aDivElement[x].getAttribute("id");
				if (sDivId) {
				aDivElement[x].style.display = "none";
				}
			} 
			catch (e) {
			}
		
		}
		
		var elElement = jindo.$Element(this.suggest._element.contentWindow.document.getElementById(sId));
		return elElement;
	},
	

	_findElement: function(sSelector, oParent) { 
		var p = oParent || document;
		var ret = jindo.$A(),
		tag = "",
		cls = "";
		if (!/^(\w+|\*)?(?:\.(\w+))?$/.test(sSelector)) return [];
		tag = RegExp.$1 || "*";
		cls = RegExp.$2 ? RegExp.$2 + " ": "";
		
		var elGetEl = (tag == "*") ? p.all || p.getElementsByTagName(tag) : p.getElementsByTagName(tag);
		jindo.$A(elGetEl).forEach(function(v, i, a) {
			if (cls) {
				if ((v.className + " ").indexOf(cls) > -1) ret.push(v);
			} else {
				ret.push(v);
			}
		});
		return ret.$value();
	},
	

	paint: function() {
		if (this._options.disabled) return false;
		if (!this.listbox) this._checkTemplate();
		if (!this.listbox) return false;

		var list = [];
		var tpl = this.template;
		var data = this._data;
		function tpl_replace(s, d) {
			for (var x in d) {
				if (!d.propertyIsEnumerable(x)) continue;
				s = s.replace(new RegExp("@" + x + "@", "g"), d[x]);
			}
			return s;
		}
		this.suggest[data.length ? "removeClass": "addClass"]("ac_noList");
		this.suggest[this._options.disabled ? "addClass": "removeClass"]("ac_disabled");
		
		for (var i = 0; i < data.length; i++) {
			list[list.length] = tpl_replace(tpl, data[i]);
			this.nListCnt++;
		}
		this.listbox.html(list.join(""));
		
		if(!jindo.$Element(this.suggest._element.contentWindow.document.getElementById('atcmp')).visible()){
			var elList = this._getFrameElement("atcmp");
			elList.show();
		}
		this.show();
		return this;
	},

	show: function() {
		if (this._options.disabled) return false;
		if(this.suggest.height() < 1)	this.suggest.height(1);
		this.suggest.show();
		this._setTriangleImg("show");
		if(this._options.disabled){
			this.suggest.height(0);
		}else{
			if (jindo.$Agent().navigator().ie) {
				this.suggest.height(this.suggest._element.contentWindow.document.body.scrollHeight);
			}
			else {
				this.suggest.height(this.suggest._element.contentWindow.document.body.clientHeight);
			}
			this.fireEvent("acShow");			
		}
		return this;
	},

	hide: function() { 
		if (this._options.disabled) return false;
		this.suggest.hide();
		this._setTriangleImg("hide");
		this.fireEvent("acHide");
		return this;
	},

	onInput: function(event) {
		var opt = this._options;
		var val = this.input.$value().value;

		var self = this;
		this._data = [];
		if (opt.async) {
			opt.query(val, 
			function(data) {
				self.onDataLoad(data)
			});
		} else {
			this.onDataLoad(opt.query(val));
		}
	},

	onDataLoad: function(data) {
		this._data = data;
		this.paint();
	},
	

	onClick: function() {
		if(!this.bCheckTemplate)  this._checkTemplate();
		this.fireEvent('onFocus');
	},

	highlight : function( sText, sQuery, sQueryErr, bBack ) {
		var sReturn = "";
		if ( !bBack ) {
			sReturn = this.makeHighPre( sText, sQuery );
			if (sReturn == "") {
				sReturn = this.makeHighPre(sText, sQueryErr);
			}
		} else {
			sReturn = this.makeHighSuf( sText, sQuery );
			if ( sReturn == "" )
				sReturn = this.makeHighSuf( sText, sQueryErr );
		}
		if (sReturn == "" )
			return sText;
		else
			return sReturn;
	},

	makeHighPre : function( sText, sQuery ) {
		var sReturn = "" ;
		var sRepText = sText.replace( / /g, "" );
		var sRepQuery = sQuery.replace( / /g, "" );
		if ( sRepQuery == sRepText.substring(0, sRepQuery.length) ) {
			sReturn = "<strong>";
			for ( var i = 0,j = 0; j < sRepQuery.length; i++ ) {
				if ( sText.substring( i, i + 1 ) != " " )
					j++;
				sReturn += sText.substring( i, i + 1 );
			}
			sReturn += "</strong>" + sText.substring( i, sText.length );
		}
		return sReturn;
	},

	makeHighSuf : function( sText, sQuery ) {
		var sReturn = "";
		var sRepText = sText.replace( / /g, "" );
		var sRepQuery = sQuery.replace( / /g, "" );
		if ( sRepQuery == sRepText.substring( sRepText.length - sRepQuery.length ) ) {
			for ( var i = 0, j = 0; j < sRepText.length - sRepQuery.length; i++ ) {
				if ( sText.substring( i, i + 1 ) != " " )
					j++;
				sReturn += sText.substring( i, i + 1 );
			}
			sReturn += "<strong>";
			for (var k = i, l = 0; l < sRepQuery.length; k++ ) {
				if ( sText.substring( k, k + 1 ) != " " )
					l++;
				sReturn += sText.substring( k, k + 1 );
			}
			sReturn += "</strong>";
		}
		return sReturn;
	},

	cutStr: function( str, myCut, hanSize, engUpperSize, engLowSize, others ) {
		var cnt = 0;
		var cutPos = str.length;
		
		for ( var i = 0 ; i < str.length ; i++ ) {
			var code = str.charAt( i ).charCodeAt(0);
			
			if( ( code >= 44032 && code <= 552013 ) || ( code >= 12593 && code <= 12643) ) {
				cnt += hanSize;
			} else if( code >= 65 && code <= 90 ) {
				if ( code == 73 && code == 74 ) {
					cnt += engLowSize;
				} else {
					cnt += engUpperSize;
				}
			} else if( code >= 97 && code <= 122 ) {
				cnt += engLowSize;
			} else {
				cnt += others;
			}
			if( Math.floor(cnt) > myCut ) {
				cutPos = i;
				break;
			}
		}
		return ( cutPos < str.length ? str.substring( 0, cutPos ) + "..." : str );
	},

	callCutStr: function(str, myCut) {
		return this.cutStr(str, myCut, 2, 2, 1, 1);
	},
	
	
	_getElementFirst : function(elEl) {
		var el = elEl._element.firstElementChild || elEl._element.firstChild;
		if (!el) return null;
		while (el && el.nodeType != 1) el = el.nextSibling;
		return el ? jindo.$Element(el) : null;
	},
	_getElementLast : function(elEl) {
		var el = elEl._element.lastElementChild || elEl._element.lastChild;
		if (!el) return null;
		while (el && el.nodeType != 1) el = el.previousSibling;
		return el ? jindo.$Element(el) : null;
	},
	_getElementIndexOf : function(element) {
		try {
			var e = jindo.$Element(element).$value();
			var n = this._element.childNodes;
			var c = 0;
			var l = n.length;
			for (var i = 0; i < l; i++) {
				if (n[i].nodeType != 1) continue;
				if (n[i] === e) return c;
				c++;
			}
		} catch(e) {}
		return - 1;
	},
	getCookie : function( sName ) {
		var ca = document.cookie.split(/\s*;\s*/);
		var re = new RegExp("^(\\s*"+sName+"\\s*=)");

		for(var i=0; i < ca.length; i++) {
			if (re.test(ca[i])) return ca[i].substr(RegExp.$1.length);
		}
		return null;
	},
	setCookie : function( sName, sValue, nDays, sDomain ) {
		if( nDays == 0 )
			document.cookie = sName + "=" + escape(sValue) + "; path=/; domain=" + sDomain + ";";
		else {
			document.cookie = sName + "=" + escape(sValue) + "; path=/; expires=" + (new Date((new Date()).getTime()+nDays*1000*60*60*24)).toGMTString() + "; domain=" + sDomain + ";";
		}
	}
	
		
}).extend(nhn.Component);


/**
 * AjaxSuggestUS
 * @author mania
 * @version 20080311
 */
nhn.AjaxSuggestUS = jindo.$Class({
	/** @lends nhn.AjaxSuggestUS */
	_request: null,
	_cache: {},
	_data_bw: [],
	_data_bw_err: [],
	suggestbox: null,
	messagebox1: null,
	messagebox2: null,
	selected: null,
	
	

	$init: function(oInputEl, oSuggestEl, oOptions) {
		var opt = this._options;
		var self = this;
		this.option({
			area : "searchResult",
			sFromName : "search", 			
			listbox_fw: "_resultBox1",			
			listbox_bw: "_resultBox2",		
	
			suggestbox: "colgroup",
			query_var: "{query}",
			request_type: "xhr",
			request_method: "get",
			request_data: {},
			sListMaxLength: 60,					
			sListMaxLength3: 60					
		});
		this.elInputEl = jindo.$(oInputEl);
		this.option(oOptions);
		this.query_var(opt.query_var);
		this._data_bw = [];
		this._data_bw_err = [];
		opt.async = true;
		opt.query = jindo.$Fn(this._remoteQuery, this).bind();
		
		this.elForm = document.forms[opt.sFromName];
	
		var _positioning = false;
		
		this.onKeyDownFn = jindo.$Fn(this.onKeyDown, this).attach(this.input, "keydown");

		if (jindo.$Agent().navigator().opera) {
			jindo.$Fn(this.handleBlur, this).attach(this.input, "blur");
			jindo.$Fn(this.handleFocus, this).attach(this.input, "focus");
		}
	},


	query_var: function(sQueryVar) { 
		var opt = this._options;
		if (typeof sQueryVar == "undefined") return opt.query_var;
		opt.query_var = sQueryVar;
		opt.query_var_regexp = new RegExp(sQueryVar.replace(/([\?\.\*\+\-\/\(\)\{\}\[\]\:\!\^\$\\])/g, "\\$1"), "g");
		return this;
	},
	

	disabled: function(bDisabled) {
		if (typeof bDisabled == "undefined") return this._options.disabled;
		bDisabled = !!bDisabled;
		if (bDisabled) {
			this._data_bw = [];
			this._data_bw_err = [];
		}
		return this.$super.disabled(bDisabled);
	},

	_remoteQuery: function(keyword, callback) { 
		var opt = this._options;
		var url = opt.url.replace(opt.query_var_regexp, keyword);
		var dat = jindo.$H(opt.request_data);
		var self = this;
		if (opt.disabled) return false;
		this.sQuery = [];
		this._data = [];
		this._data_bw = [];
		this._data_err = [];
		this._data_bw_err = [];
		
		keyword = keyword.replace(/\s/g, "");
		if (!keyword) return callback([]);
		
		if (typeof this._cache[keyword] != "undefined") {
			if (keyword.toLowerCase() == this._cache[keyword].sQuery[0]) {
				this.sQuery = this._cache[keyword].sQuery;
				this._data = this._cache[keyword].data;
				this._data_bw = this._cache[keyword].aDataBw;
				this._data_err = this._cache[keyword].data_err;
				this._data_bw_err = this._cache[keyword].aDataBwErr;
				return callback(this._data);
			}
		}
		try {
			this._request.abort();
			this._request = null;
		} catch(e) {}
		dat.map(function(v, k, o) {
			if (typeof v == "string") {
				return v.replace(opt.query_var_regexp, keyword);
			} else {
				return v;
			}
		});
		function trim(s) {
			return s.replace(/^\s+|\s+$/g, "")
		};
		
		this._request = acAjax.$Ajax(url, {
			jsonp_charset : "UTF-8",
			type: opt.request_type,
			method: opt.request_method,
			onload: function(req) {
				try {
					var json = req.json();
					var items = json.items;
					
					self.sQuery = json.query;
					

					jindo.$A(items[0]).forEach(function(v, i, a) {
						self._data[self._data.length] = {
							encoded: encodeURIComponent(v[0]),
							txt: trim(self.callCutStr(v[0], opt.sListMaxLength)),
							in_txt: trim(v[0])
						};
					});

					jindo.$A(items[2]).forEach(function(v, i, a) {
						self._data_err[self._data_err.length] = {
							encoded: encodeURIComponent(v[0]),
							txt: trim(self.callCutStr(v[0], opt.sListMaxLength)),
							in_txt: trim(v[0])
						};
					});

					jindo.$A(items[1]).forEach(function(v, i, a) {
						var nCheckCnt = 0;

						for (var j = 0; j < self._data.length; j++) {
							if (self._data[j].in_txt == v[0]) {
								nCheckCnt++;
							}
						}
						if (nCheckCnt < 1) {
							self._data_bw[self._data_bw.length] = {
								encoded: encodeURIComponent(v[0]),
								txt: trim(self.callCutStr(v[0], opt.sListMaxLength)),
								in_txt: trim(v[0])
							};
						}
					});

					jindo.$A(items[3]).forEach(function(v, i, a) {
						var nCheckCnt = 0;

						for (var j = 0; j < self._data_err.length; j++) {
							if (self._data_err[j].in_txt == v[0]) {
								nCheckCnt++;
							}
						}
						if (nCheckCnt < 1) {
							self._data_bw_err[self._data_bw_err.length] = {
								encoded: encodeURIComponent(v[0]),
								txt: trim(self.callCutStr(v[0], opt.sListMaxLength)),
								in_txt: trim(v[0])
							};
						}
					});
					
					if (json.query) {
						if (keyword.toLowerCase() == self.sQuery[0]) {
							self._cache[keyword] = {
								sQuery: self.sQuery,
								data: self._data,
								aDataBw: self._data_bw,
								data_err: self._data_err,
								aDataBwErr: self._data_bw_err
							}
						}
					}
					callback(self._data);
				} catch(e) {
				}
			}
		}).request(dat.$value());
		
	},


	handleFocus : function(e) {
		this.lastKey = null;
	},


	handleBlur : function(e) {
		if (this.lastKey == 9) {
			this.input.$value().focus();
		}
	},


	handleKeyDown : function(e) {
		this.lastKey = e.key().keyCode;
	},	


	onKeyDown: function(event) {
		if (!this.watcher._isTimerRunning()) {
			if (!this.bCheckTemplate) {
				this._checkTemplate();
				this.watcher._onFocus();
			}
		}
		
		var key = event.key();

		if (jindo.$Agent().navigator().opera) {
			this.handleKeyDown(event);
		}
		var opt = this._options;
		var item = null,
		children = null;
		var len = 0,
		len_bw = 0,
		len_dm = 0,
		idx = -1;
		if (!key.down && !key.up && key.keyCode != 9) {
			return;
		}
		if (this._options.disabled) return false;
		if(!this.input.$value().value) return;
		if (this.nTotalListCnt > 0) {
			this.show();
		}else{
			return false;

			var elUse=this._getFrameElement('atcmpIng');
			elUse.show();
			this.show();
			return false;
		}
		
		if (jindo.$Agent().os().mac) {
			this.input.$value().focus();
			this.input.$value().blur();
			this.input.$value().focus();
			this.watcher._onFocus();
		}
		
		if (this.selected && !this.selected.$value().parentNode) this.selected = null;
		try{
			len = this.listbox_fw.$value().childNodes.length;
			len_bw = this.listbox_bw.$value().childNodes.length;
		}catch(e){ return false;}
		if (!this.selected) {
			if (key.down || ( key.keyCode == 9 && !key.shift )) {
				if (len) {
					this.selected = this._getElementFirst(this.listbox_fw);
				} else if (len_bw) {
					this.selected = this._getElementFirst(this.listbox_bw);
				}
			}else{
				this.hide();
				return;
			}
			event.stop();
			if (this.selected) {
				jindo.$Element(this.selected._element).addClass("atcmp_on");
				this.watcher.stop();
				this.input.$value().value = this._getElementLast(this.selected).text();
				this.watcher.start();
				this.show();
			}
			event.stop();
			var sClassName = jindo.$Element(this.selected.$value().parentNode).className();
			if(sClassName){
				this._setParameter(this.selected.child()[0]);
			}
			return;
		}
		jindo.$Element(this.selected._element).removeClass("atcmp_on");
		item = this._getElementFirst(this.selected).removeClass("atcmp_on").parent().$value();

		if (key.down || ( key.keyCode == 9 && !key.shift )) {
			if (item.nextSibling) {
				this.selected = this.selected.next();
			} else {
				if(this.selected.isChildOf(this.listbox_fw) ){
					if (len_bw > 0) {
						this.selected = this._getElementFirst(this.listbox_bw);
					}
				}
				
			}
			event.stop();
		} else {
			if (item.previousSibling) {
				this.selected = this.selected.prev();
			} else {
				if (this.selected.isChildOf(this.listbox_bw) && len) {
					this.selected = this._getElementLast(this.listbox_fw);
				}

			}
			event.stop();
		}
		if (this.selected) {
			jindo.$Element(this.selected._element).addClass("atcmp_on");

			this.watcher.stop();
			
			this.input.$value().value = this._getElementLast(this.selected).text();
			
			this.watcher.start();
			
		} else {
			this.hide();
		}
			var sClassName = jindo.$Element(this.selected.$value().parentNode).className();
			if(sClassName){
				this._setParameter(this.selected.child()[0]);
			}
	},
	_setParameter : function(oEl){
		var elList = "";
		if (typeof oEl._element == "undefined") {
			elList = oEl.element;
		}
		else {
			elList = oEl._element
		}

		var sWhereParameter = "";
		var sSmParameter = "";
		try {
			if (elList.tagName == "STRONG") {
				elList = elList.parentNode;
			}
			if (elList.parentNode.tagName == "LI" || elList.tagName == "EM") {
				if (elList.className || elList.parentNode.parentNode.className) {
				}
				if (elList.parentNode.tagName == "LI") {
					var sClassName = elList.parentNode.parentNode.className.replace(/ other/g, "");
					sClassName = sClassName.replace(/^\s+|\s+$/g, "");
					
					switch (sClassName) {
						case "_resultBox1":
							sSmParameter = "tab_sug.pre";
							break;
						case "_resultBox2":
							sSmParameter = "tab_sug.suf";
							break;
					}
				}
				
				if (elList.tagName == "EM") {
					sSmParameter = "tab_sug.tx";
				}
				if (sSmParameter) this.elForm["sm"].value = sSmParameter;

				return true;
			}
			return false;
		} 
		catch (e) {
			return false;
		}
					
	},
	/**
	 * @function
	 * @public
	 * @description
	 */
	_setLinkMove : function(e){
		this.input.$value().focus();
		this.input.$value().blur();
//console.log(e)
		if(this._setParameter(e)){
			this.input.$value().value = this._getElementLast(this.selected).text();
			this.fireEvent('actSubmit');
		}

	},


	onMouseOver: function(event) {
		var el = event.element;
		if (!el || !el.tagName || el.tagName.toUpperCase() != "A") return false;
		if (!el.parentNode || !el.parentNode.tagName || el.parentNode.tagName.toUpperCase() != "LI") return false;
		if (this.selected) {
			jindo.$Element(this.selected._element).removeClass("atcmp_on");
		}
		jindo.$Element(el.parentNode).addClass("atcmp_on");
		this.selected = jindo.$Element(el.parentNode);
	},

	_checkTemplate : function(){
		this.listbox_fw = "";
		this.listbox_bw = "";
		this.template_fw = "";
		this.template_bw = "";
		this.template_dm = "";
		
		
		var opt = this._options;
		if (this.suggest._element.contentWindow.document.getElementById('atcmp').innerHTML.indexOf("@txt@") > -1) {
			this.elFrameDiv = jindo.$Element(this.suggest._element.contentWindow.document.getElementById('atcmp'));
			this.elIngDiv = jindo.$Element(this.suggest._element.contentWindow.document.getElementById('atcmpIng'));
			this.elStartDiv = jindo.$Element(this.suggest._element.contentWindow.document.getElementById('atcmpStart'));
			
			jindo.$Fn(this.onMouseOver, this).attach(this.elFrameDiv, "mouseover");
			jindo.$Fn(this._setLinkMove, this).attach(this.elFrameDiv, "click");
			
			this.listbox_fw = this._findElement("." + opt.listbox_fw, this.elFrameDiv.$value())[0];
			this.listbox_fw = this.listbox_fw ? jindo.$Element(this.listbox_fw) : null;
			this.listbox_bw = this._findElement("." + opt.listbox_bw, this.elFrameDiv.$value())[0];
			this.listbox_bw = this.listbox_bw ? jindo.$Element(this.listbox_bw) : null;


			
			if (this.listbox_fw) this.template_fw = this.listbox_fw.html().replace(/^\s+|\s+$/g, "");
			if (this.listbox_bw) this.template_bw = this.listbox_bw.html().replace(/^\s+|\s+$/g, "");

			this.bCheckTemplate = true;
			
			// 자동완성
			this.elMoreBtn = this._findElement(".run_view", this.elFrameDiv.$value())[0];
			this.elHelpImg1 = this.suggest._element.contentWindow.document.getElementById('help_tooltip1');
			this.elHelpImg2 = this.suggest._element.contentWindow.document.getElementById('help_tooltip2');
			this.elHelpImg3 = this.suggest._element.contentWindow.document.getElementById('help_tooltip3');
			this.elFunoffBtn = this._findElement(".funoff", this.elFrameDiv.$value())[0];
			
			// 자동완성 사용중 || 활성화
			this.elIngBtn = this._findElement(".funoff", this.elIngDiv.$value())[0];
			this.elStartBtn = this._findElement(".funoff", this.elStartDiv.$value())[0];
			
			jindo.$Fn(this._setMoreProcess, this).attach(this.elMoreBtn, "click");
			jindo.$Fn(jindo.$Fn(this._setFunctionOffImg, this).bind("on", "1"), this).attach(this.elFunoffBtn, "mouseover");
			jindo.$Fn(jindo.$Fn(this._setFunctionOffImg, this).bind("off"), this).attach(this.elFunoffBtn, "mouseout");
			jindo.$Fn(jindo.$Fn(this._setFunctionOffImg, this).bind("on", "2"), this).attach(this.elIngBtn, "mouseover");
			jindo.$Fn(jindo.$Fn(this._setFunctionOffImg, this).bind("off"), this).attach(this.elIngBtn, "mouseout");
			jindo.$Fn(jindo.$Fn(this._setFunctionOffImg, this).bind("on", "3"), this).attach(this.elStartBtn, "mouseover");
			jindo.$Fn(jindo.$Fn(this._setFunctionOffImg, this).bind("off"), this).attach(this.elStartBtn, "mouseout");
		}
		else {
			this.suggest._element.src = this.suggest._element.src;
		}
	},


	setTplReplace : function(sTpl , aKeyword , aError, bBack){
		var oData = new Object();
		var _aTmpData = [];
		
		if (typeof aError != "object") {
			oData = aKeyword;
		}else if (typeof aKeyword != "object") {
			oData = aError;
		}else{
			oData = aKeyword;
		}
 		for (var x in oData) {
			_aTmpData[x] = oData[x];
			if(x == "txt")	_aTmpData['txt'] = this.highlight(oData['txt'], this.sQuery[0], this.sQuery[1], bBack);
			if (!oData.propertyIsEnumerable(x)) continue;
	
			sTpl = sTpl.replace(new RegExp("@" + x + "@", "g"), _aTmpData[x]);
		}
		return sTpl;
	},



	_setFunctionOffImg : function(type,nNum){
		if (type == "on") {
			if (nNum) {
				var sImgEl = eval("this.elHelpImg" + nNum);
			}else{
				var sImgEl = this.elHelpImg1;
			}
			jindo.$Element(sImgEl).show();
			
			jindo.$Element(sImgEl).css({
				bottom: "27px",
				right: "2px"
			});
			
		}else{
			jindo.$Element(this.elHelpImg1).hide();
			jindo.$Element(this.elHelpImg2).hide();
			jindo.$Element(this.elHelpImg3).hide();
		}
		
	},


	_setMoreProcess : function(e){
		var elElement = e.element;
		if(elElement.tagName == "A"){
			if(elElement.innerHTML == "끝단어 더보기"){
				this.sListMode = "bw";
			}else if(elElement.innerHTML == "첫단어 더보기"){
				this.sListMode = "fw";
			}else if(elElement.innerHTML == "주제별검색 더보기"){
				this.sListMode = "mw";
			}
			this.input.$value().focus();
			this.input.$value().value = this.input.$value().value;
		}
		this.paint();
		e.stop();
	},


	paint: function() {
		if (this._options.disabled) return false;
		if (!this.listbox_fw) this._checkTemplate();
		if (!this.listbox_fw) return false;
		
		this._setFunctionOffImg("off");
		var list_fw = [];
		var list_bw = [];
		var list_dm = [];

		var aDataFw = this._data;
		var aDataBw = this._data_bw;
		var aDataFwErr = this._data_err;
		var aDataBwErr = this._data_bw_err;
		var opt = this._options;
		var self = this;
		this.nListCnt = 0;

		if(!this.sListMode) this.sListMode = "fw";
		var nFWListCnt = 0;		// 전위 리스트 갯수 저장변수
		var nBWListCnt = 0;		// 후위 리스트 갯수 저장변수

		if (this.sListMode == "fw") {
			nFWListCnt = (aDataFw.length > 0) ? ( aDataFw.length < 11 ) ? aDataFw.length : 11 : ( aDataFwErr.length < 11 ) ? aDataFwErr.length : 11;
			nBWListCnt = (aDataBw.length > 0) ? ( nFWListCnt + aDataBw.length < 13 ) ? aDataBw.length : 13 - nFWListCnt : ( nFWListCnt + aDataBwErr.length < 13 ) ? aDataBwErr.length : 13 - nFWListCnt;
		}
		if (this.sListMode == "bw") {
			nBWListCnt = (aDataBw.length > 0) ? ( aDataBw.length < 11 ) ? aDataBw.length :11 : ( aDataBwErr.length < 11 ) ? aDataBwErr.length : 11;
			nFWListCnt = (aDataFw.length > 0) ? ( nBWListCnt + aDataFw.length < 13 ) ? aDataFw.length : 13 - nBWListCnt : ( nBWListCnt + aDataFwErr.length < 13 ) ? aDataFwErr.length : 13 - nBWListCnt;
		}
		
		
		var sFWMore = (aDataFw.length > nFWListCnt || aDataFwErr.length > nFWListCnt) ? '<a href="#" onclick="return false;">첫단어 더보기</a>' : '';
		var sBWMore = (aDataBw.length > nBWListCnt || aDataBwErr.length > nBWListCnt) ? '<a href="#" onclick="return false;">끝단어 더보기</a>' : '';



		if (nFWListCnt > 0) {
			this.listbox_fw.show();
			for (var i = 0; i < nFWListCnt; i++) {
				list_fw[list_fw.length] = this.setTplReplace(this.template_fw, aDataFw[i], aDataFwErr[i],false);
			}
			this.nListCnt++;
			this.listbox_fw.html(list_fw.join(""));
		}else{			
			this.listbox_fw.hide();
			this.listbox_fw.html("");
			
		}


		if (nBWListCnt > 0) {
			this.listbox_bw.show();
			for (var i = 0; i < nBWListCnt; i++) {
				list_bw[list_bw.length] = this.setTplReplace(this.template_bw, aDataBw[i], aDataBwErr[i], true);
			}
			this.listbox_bw.html(list_bw.join(""));
			if(nFWListCnt > 0){
				this.listbox_bw.className('_resultBox2 other');	
			}else{
				this.listbox_bw.className('_resultBox2');
			}
			this.nListCnt++;
		}else{
			this.listbox_bw.hide();
			this.listbox_bw.html("");
		}
		
		this.nTotalListCnt = nFWListCnt + nBWListCnt;
		if (this.nTotalListCnt > 0) {
				var elList = this._getFrameElement("atcmp");
				elList.show();
			this.show();
			this._searchStatus = "";
		}
		else {
			this.hide();
			this._setStatusLayer();
		}
		
		if(this.sListMode == "bw"){
			this.elMoreBtn.innerHTML = sFWMore;
		}else if(this.sListMode == "fw"){
			this.elMoreBtn.innerHTML = sBWMore;
		}
		
		return this;
	},

	_setStatusLayer : function(){
		if (this._searchStatus) {
			if (this._searchStatus == "Triangle_false") {
				var elUse = this._getFrameElement('atcmpStart');
				elUse.show();
				this.show();
			}else if (this._searchStatus == "Triangle_true") {
				var elUse = this._getFrameElement('atcmpIng');
				elUse.show();
				this.show();
			}
			
		}
		this._searchStatus = "";
	},

	unuseSuggest: function() {
		this.setCookie("NaverSuggestUse", "unuse", 21900, "naver.com");
		var opt = this._options;
		this._setFunctionOffImg("off");
		this.hide();
		opt.disabled = true;
		this._setTriangleImg("hide");
		this.input.$value().focus();
		this.input.$value().blur();
		
	},
	

	useSuggest: function() {
		this.setCookie("NaverSuggestUse", "use", 21900, "naver.com");
		var opt = this._options;
		opt.disabled = false;
	}
	

}).extend(nhn.AutoComplete);


/**
 * @author hooriza (ajaxUI)
 * @see http://wiki.nhncorp.com/display/lsuit/nhn.Timer
 */
nhn.Timer = jindo.$Class({
	_timer: null,
	_lastest: null,
	_remained: 0,
	_delay: null,
	_callback: null,
	$init: function() {},
	start: function(fpCallback, nDelay) {
		var self = this;
		this.abort();
		this.fireEvent('wait');
		this._lastest = new Date().getTime();
		this._remained = 0;
		this._delay = nDelay;
		this._callback = fpCallback;
		this.resume();
		return true;
	},
	_clearTimer: function() {
		var bFlag = false;
		if (this._timer) {
			clearInterval(this._timer);
			bFlag = true;
		}
		this._timer = null;
		return bFlag;
	},
	abort: function() {
		var bRet;
		if (bRet = this._clearTimer())
		this.fireEvent('abort');
		return bRet;
	},
	pause: function() {
		var nPassed = new Date().getTime() - this._lastest;
		this._remained = this._delay - nPassed;
		if (this._remained < 0) this._remained = 0;
		return this._clearTimer();
	},
	resume: function() {
		var self = this;
		var fpGo = function(nDelay, bRecursive) {
			self._clearTimer();
			self._timer = setInterval(function() {
				self.fireEvent('run');
				var r = self._callback();
				self._lastest = new Date().getTime();
				if (!r) {
					clearInterval(self._timer);
					self._timer = null;
					self.fireEvent('end');
					return;
				}
				self.fireEvent('wait');
				if (bRecursive) fpGo(self._delay, false);
			},
			nDelay);
		};
		if (this._remained) {
			fpGo(this._remained, true);
			this._remained = 0;
		} else {
			fpGo(this._delay, false);
		}
	}
}).extend(nhn.Component);

// 통검에서 $Aajx 사용시 charset 이 euc-kr 로 변경되어 있는 case 가 있음.
// 따로 acAjax 를 묶어 Ajax 통신시 처리
var acAjax = {}
acAjax.$Ajax = function (url, option) {
	var cl = arguments.callee;
	if (!(this instanceof cl)) return new cl(url, option);

	function _getXHR() {
		if (window.XMLHttpRequest) {
			return new XMLHttpRequest();
		} else if (ActiveXObject) {
			try { return new ActiveXObject('MSXML2.XMLHTTP'); }
			catch(e) { return new ActiveXObject('Microsoft.XMLHTTP'); }
			return null;
		}
	}

	var loc    = location.toString();
	var domain = '';
	try { domain = loc.match(/^https?:\/\/([a-z0-9_\-\.]+)/i)[1]; } catch(e) {}

	this._url = url;
	this._options  = new Object;
	this._headers  = new Object;
	this._options = {
		type   :"xhr",
		method :"post",
		proxy  :"",
		timeout:0,
		onload :function(req){},
		onerror :null,
		ontimeout:function(req){},
		jsonp_charset : "utf-8",
		callbackid : ""
	};

	this.option(option);

	var _opt = this._options;

	_opt.type   = _opt.type.toLowerCase();
	_opt.method = _opt.method.toLowerCase();

	if (typeof window.__jindo2_callback == "undefined") {
		window.__jindo2_callback = new Array();
	}

	switch (_opt.type) {
		case "jsonp":
			_opt.method = "get";
			this._request = new acAjax.$Ajax.JSONPRequest();
			this._request.charset = _opt.jsonp_charset;
			this._request.callbackid = _opt.callbackid;
			break;
	}
};

/**
 * @ignore
 */
acAjax.$Ajax.prototype._onload = function() {
	if (this._request.readyState == 4) {
		if ( this._request.status!=200 && typeof this._options.onerror == 'function')
			this._options.onerror(acAjax.$Ajax.Response(this._request));
		else
			this._options.onload(acAjax.$Ajax.Response(this._request));
	}
};

acAjax.$Ajax.prototype.request = function(oData) {
	var t   = this;
	var req = this._request;
	var opt = this._options;
	var data, v,a = [], data = "";
	var _timer = null;

	if (typeof oData == "undefined" || !oData) {
		data = null;
	} else {
		for(var k in oData) {
			v = oData[k];
			if (typeof v == "function") v = v();
			a[a.length] = k+"="+encodeURIComponent(v);
		}
		data = a.join("&");
	}

	req.open(opt.method.toUpperCase(), this._url, true);
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
	req.setRequestHeader("charset", "utf-8");
	for(var x in this._headers) {
		if (typeof this._headers[x] == "function") continue;
		req.setRequestHeader(x, String(this._headers[x]));
	}

	if (typeof req.onload != "undefined") {
		req.onload = function(rq){ clearTimeout(_timer); t._onload(rq) };
	} else {
		req.onreadystatechange = function(rq){ clearTimeout(_timer); t._onload(rq) };
	}

	if (opt.timeout > 0) {
		_timer = setTimeout(function(){ try{ req.abort(); }catch(e){}; opt.ontimeout(req); }, opt.timeout * 1000);
	}

	req.send(data);

	return this;
};

acAjax.$Ajax.prototype.abort = function() {
	this._request.abort();

	return this;
};

acAjax.$Ajax.prototype.option = function(name, value) {
	if (typeof name == "undefined") return "";
	if (typeof name == "string") {
		if (typeof value == "undefined") return this._options[name];
		this._options[name] = value;
		return this;
	}

	try { for(var x in name) this._options[x] = name[x] } catch(e) {};

	return this;
};

acAjax.$Ajax.prototype.header = function(name, value) {
	if (typeof name == "undefined") return "";
	if (typeof name == "string") {
		if (typeof value == "undefined") return this._headers[name];
		this._headers[name] = value;
		return this;
	}

	try { for(var x in name) this._headers[x] = name[x] } catch(e) {};

	return this;
};
acAjax.$Ajax.Response  = function(req) {
	if (this === acAjax.$Ajax) return new acAjax.$Ajax.Response(req);
	this._response = req;
};

acAjax.$Ajax.Response.prototype.json = function() {
	if (this._response.responseJSON) {
		return this._response.responseJSON;
	} else if (this._response.responseText) {
		try {
			return eval("("+this._response.responseText+")");
		} catch(e) {
			return {};
		}
	}

	return {};
};

/**
 * @class
 */
acAjax.$Ajax.RequestBase = jindo.$Class({
	_headers : {},
	_respHeaders : {},
	_respHeaderString : "",
	callbackid:"",
	responseXML  : null,
	responseJSON : null,
	responseText : "",
	status : 404,
	readyState : 0,
	$init  : function(){},
	onload : function(){},
	abort  : function(){},
	open   : function(){},
	send   : function(){},
	setRequestHeader  : function(sName, sValue) {
		this._headers[sName] = sValue;
	},
	getResponseHeader : function(sName) {
		return this._respHeaders[sName] || "";
	},
	getAllResponseHeaders : function() {
		return this._respHeaderString;
	},
	_getCallbackInfo : function() {
		var id = "";

		if(this.callbackid!="") {
			var idx = 0;
			do {
				id = "$" + this.callbackid + "_"+idx;
				idx++;
			}
			while (window.__jindo2_callback[id]);	
		}
		else{
			do {
				id = "$" + Math.floor(Math.random() * 10000);
			}
			while (window.__jindo2_callback[id]);
		}

		return {id:id,name:"window.__jindo2_callback."+id};
	}
});

/**
 * @class
 */
acAjax.$Ajax.JSONPRequest = jindo.$Class({
	charset : "utf-8",
	_script : null,
	_onerror : null,
	_callback : function(data) {
		
		if (this._onerror) {
			clearTimeout(this._onerror);
			this._onerror = null;
		}
			
		var self = this;

		this.responseJSON = data;
		this.onload(this);
		setTimeout(function(){ self.abort() }, 10);
	},
	abort : function() {
		if (this._script) {
			try { this._script.parentNode.removeChild(this._script) }catch(e){};
		}
	},
	open  : function(method, url) {
		this.responseJSON = null;

		this._url = url;
	},
	send  : function(data) {
		var t    = this;
		var info = this._getCallbackInfo();
		var head = document.getElementsByTagName("head")[0];

		this._script = jindo.$("<script>");
		this._script.type    = "text/javascript";
		this._script.charset = this.charset;

		if (head) {
			head.appendChild(this._script);
		} else if (document.body) {
			document.body.appendChild(this._script);
		}

		window.__jindo2_callback[info.id] = function(data){
			try {
				t.readyState = 4;
				t.status = 200;
				t._callback(data);
			} finally {
				delete window.__jindo2_callback[info.id];
			}
		};
		
		var agent = jindo.$Agent(); 
		if (agent.navigator().ie || agent.navigator().opera) {
			this._script.onreadystatechange = function(){			
				if (this.readyState == 'loaded'){
					if (!t.responseJSON) {
						t.readyState = 4;
						t.status = 500;
						t._onerror = setTimeout(function(){t._callback(null);}, 200);
					}
					this.onreadystatechange = null;
				}
			};
		}
		else {
			this._script.onload = function(){
				if (!t.responseJSON) {
					t.readyState = 4;
					t.status = 500;
					t._onerror = setTimeout(function(){t._callback(null);}, 200);
				}
				this.onload = null;
				this.onerror = null;
			};
			this._script.onerror = function(){
				if (!t.responseJSON) {
					t.readyState = 4;
					t.status = 404;
					t._onerror = setTimeout(function(){t._callback(null);}, 200);
				}
				this.onerror = null;
				this.onload = null;
			};
		}
		this._script.src = this._url+"?_callback="+info.name+"&"+data;
		
	}
}).extend(acAjax.$Ajax.RequestBase);

