AE.namespace('AE.run.partnerYahoo');
if( !AE.run.partnerYahoo.noResult ){
	AE.run.partnerYahoo.noResult = new function(){		
		var _self=this;	
		_self.factory = function(sfn,oConfig){
			try{
					var fn=eval('new _self.'+sfn+'()');
					fn.init(oConfig);
					return fn;
				} catch(e) {
				}
		}
	}
}


AE.run.partnerYahoo.noResult.amityInfo = function(){	
	var _self = this;	

	var config;
	var defConfig = {
		keywordsTargetId:'userSearchKeywords',
		limitCount:20,
		keywordsPostfix:'...',

		searchTipsId:'searchTipsId',
		searchTipsContent:'searchTipsContent',
		showDelayTime:200,
		hiddenDelayTime:200,
		searchTipsExcursion:['right','bottom']
	}

	_self.init = function (e,oConfig){
			config = TB.applyIf( oConfig || {}, defConfig );
			limitKeywordsShowLength( config.keywordsTargetId, config.limitCount );
			initSearchTips();
	 }

	 var limitKeywordsShowLength = function( targetId, limitCount ){
	 		var dKeywords = get(targetId);
			if( dKeywords ){
				var s = dKeywords.innerHTML;
				if( s.length > limitCount ){
					s = s.substring(0, limitCount) + config.keywordsPostfix;
					dKeywords.innerHTML = s;
				}
			}
	}
	
	var initSearchTips = function(){
		
			var overkShowConfig={
				targetId: config.searchTipsId,
				contentId: config.searchTipsContent,
				showDelayTime: config.showDelayTime,
				hiddenDelayTime: config.hiddenDelayTime,
				excursion: config.searchTipsExcursion
			};
			var overkShowInstance = new AE.widget.overShow();
			overkShowInstance.init(overkShowConfig);
	}
}



AE.run.partnerYahoo.noResult.vipAmityInfo = function(){	
	var _self = this;	

	var config;
	var defConfig = {
		searchTipsId:'searchTipsId',
		searchTipsContent:'searchTipsContent',
		showDelayTime:200,
		hiddenDelayTime:200,
		searchTipsExcursion:['left','bottom'],
		needMask:true
	}

	_self.init = function (e,oConfig){		
			config = TB.applyIf( oConfig || {}, defConfig );
			initSearchTips();
	 }

	var initSearchTips = function(){		
			var overkShowConfig={
				targetId: config.searchTipsId,
				contentId: config.searchTipsContent,
				showDelayTime: config.showDelayTime,
				hiddenDelayTime: config.hiddenDelayTime,
				excursion: config.searchTipsExcursion
			};
			var overkShowInstance = new AE.widget.overShow();
			overkShowInstance.init(overkShowConfig);
	}
}