var index_module_index = {
		plat : 0.00001, //偏移量
		plng :  0.000001,//偏移量
		mapKey : 'index_module_index',
		map : null,
		timer : 30*1000,
		interval : null,
		index : 0,
		moduleKey : ["map-sort-carLife","map-sort-map","map-sort-dee","map-sort-carOwner","map-sort-bussness"],
		defaultImg : web4s.context_path+"/images/mapPoint_red.png",
		stopTime : 10*1000,
		timeObject : null,
		moduleName : "IndexPage",
		currentArray : [],
		pageSize : 5,
		cityId : null,
		cityName : null,
		cityLat : null,
		cityLng : null,
		keyword : null,
		
		
		isSearch : false,
		
		/**
		 * 缓存数据
		 */
		cacheActivityData : [],
		cacheDeeData : [],
		cacheMerchantData : [],
		cacheLivingData : [],
		cacheTravelData :  [],
		cacheMapData : [],
		
		cacheActivityList : null, //缓存路书查询数据
		cacheDeeList : null, //缓存嘀嘀查询数据
		cacheStarCarList : null, //缓存明星车主数据
		cacheMerchantList : null, //缓存商户数据
		cacheMapList :  null, //缓存的map数据
		cacheSearchList : null, //缓存查询数组
		cacheSearchMapList :  null, //缓存Map查询数据
		
		
		initPage : function(){
			index_module_index.initStyle();
			index_module_index.initBtn();
			index_module_index.initLoad();
			index_module_index.initModule();
		},
		
		initStyle : function(){
			
		},
		
		initBtn : function(){
			
			
			
			
			/**
			 * 热门去处更多按钮
			 */
			$('#dee_more').click(function(){
				window.location.href = module_config.menuControl['嘀嘀'].destPath;
				return false;
			});
			
			/**
			 * 热门去处更多按钮
			 */
			$('#hotplace_more').click(function(){
				window.location.href = module_config.menuControl['车友生活'].destPath;
				return false;
			});
			
			/**
			 * 推荐路书更多按钮
			 */
			$('#travel_more').click(function(){
				window.location.href = module_config.menuControl['路书'].destPath;
				return false;
			});
			
			/**
			 * 精彩活动更多按钮
			 */
			$('#activity_more').click(function(){
				window.location.href = module_config.menuControl['活动'].destPath;
				return false;
			});
			
			/**
			 * 车友生活
			 */
			$("#map-sort-carLife").click(function(){
				var cls= $(this).attr("class");
				if(cls == "noneHomeMapLink"){
					return false;
				}
				playControl.stop();
				playControl._index = 0;
				$(this).addClass("on").siblings().removeClass("on");
				if(index_module_index.isSearch){
					index_module_index.searchPlay();
				}else{
					index_module_index.loadLifeInfo();
				}
			});
			
			/**
			 * 嘀嘀
			 */
			$("#map-sort-dee").click(function(){
				var cls= $(this).attr("class");
				if(cls == "noneHomeMapLink"){
					return false;
				}
				playControl.stop();
				playControl._index = 0;
				$(this).addClass("on").siblings().removeClass("on"); 
				index_module_index.loadDeeInfo();
			});
			
			/**
			 * 明星车主
			 */
			$("#map-sort-carOwner").click(function(){
				var cls= $(this).attr("class");
				if(cls == "noneHomeMapLink"){
					return false;
				}
				playControl.stop();
				playControl._index = 0;
				$(this).addClass("on").siblings().removeClass("on"); 
				index_module_index.loadStarsOwner();
			});
			
			/**
			 * 推荐商户
			 */
			$("#map-sort-bussness").click(function(){
				var cls= $(this).attr("class");
				if(cls == "noneHomeMapLink"){
					return false;
				}
				playControl.stop();
				playControl._index = 0;
				$(this).addClass("on").siblings().removeClass("on"); 
				index_module_index.loadRecommendedMerchant();
			});
			
			$("#map-sort-map").click(function(){
				var cls= $(this).attr("class");
				if(cls == "noneHomeMapLink"){
					return false;
				}
				playControl.stop();
				playControl._index = 0;
				$(this).addClass("on").siblings().removeClass("on"); 
				if(index_module_index.isSearch){
					index_module_index.searchMapPlay();
				}else{
					index_module_index.loadPOIList();
				}
			});
			
			/**
			 * 当前城市的关闭
			 */
			$("#currentCityCloseId").click(function(){
				$("#cityValId").val("");
			});
			
			/**
			 * 当前关键字关闭
			 */
			$("#currentKeywordCloseId").click(function(){
				$("#keywordValId").val("");
			});
			
			$("#keywordValId").keyup(function(event){
				if(event.keyCode == 13){
					playControl.stop();
					index_module_index.searchLivingInfo();
				}
			});
			
			
			$("#searchBtnId").click(function(){
				playControl.stop();
				index_module_index.searchLivingInfo();
			});
			
			$("#searchMoreId").click(function(){
				var state = $("#searchMoreId").attr("state");
				if(eval(state)){
					module_navigation.living.direct({"cityId":index_module_index.cityId,"cityName":index_module_index.cityName,"keyword":index_module_index.keyword});
					return false;
				}
			});
			
			
			utils.suggest($('#cityValId') ,function(cb){
				index_module_index.searchCityByKeyWord(function(data){
					if(cb)
						cb(data,"cityName");
				});
			},function(data){
				index_module_index.cityId = data.cityId;
				index_module_index.cityName = data.cityName;
			},"arrowInput");
			
			/**
			 * 商城更多按钮
			 */
			$('#ics_more').click(function(){
				module_navigation.goToIcs();
				return false;
			});
			
			/**
             * 商品详情
             */
            $("#ics_ul").click(function(evnet){
            	var _cell = $(evnet.target);
            	var _id = _cell.attr("id");
            	if(_id && _id.indexOf("detail_") != -1){
            		 var code =  _id.split("_")[1];
            		 module_navigation.goToIcsDetail(code);
     				 return false;
            	}
            });
			
			/**
			 * 商户合作
			 */
			$('.homeBar_biz').click(function(){
			    window.location.href = web4s.context_path + "/module/register/page/merchantIntro.jsp";
                return false;
			});
			/**
             * 视频介绍
             */
            $('.homeBar_video').click(function(){
                var videohtml2='<div class="wrap_video">'+
                '       <div id="flashWrap" style="width:515px;height:412px;">'+
                '       <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="515" height="412">'+
                '           <param name="movie" value="/web4s/index/flash/viewPro.swf" />'+
                '           <param name="quality" value="high" />'+
                '           <param name="allowFullScreen" value="true" />'+                     
                '           <embed src="/web4s/index/flash/viewPro.swf" allowfullscreen="true"  quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="515" height="412"></embed>'+
                '       </object> '+
                '       </div>'+
                '   </div>';
              $.msgBox.window({
            	   title : "视频介绍",
                   html :videohtml2,
                   width:527
                   //cls:"noBorder"
             });
            });
            /**
             * 资源开发者招募
             */
            $('.homeBar_recruit').click(function(){
                window.location.href = web4s.context_path + "/index/Recruitment.html";
                return false;
            });
            /**
             * gps在线体验
             */
            $('.homeBar_gps').click(function(){
                var videohtml='<div class="wrap_video" style="background:#444;width:800px">'+
                '       <div style="width:800px;height:480px;color:red;background:black;">'+
                '       <object id="fff" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="800" height="480">'+
                '       <param name="movie" value="/web4s/index/flash/4SGps.swf" />'+
                '       <param name="quality" value="high" />'+
                '       <param name="allowFullScreen" value="true" />'+         
                '       <embed src="/web4s/index/flash/4SGps.swf" allowfullscreen="true"  quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="480"></embed>'+
                '       </object>'+                                     
                '   </div>';
                $.msgBox.window({
                	   title : "GPS在线体验",
	                   html :videohtml,
	                   width:810
	             });
            });
            
            $("#wrap_map").click(function(){
            	playControl.allStop();
            	if(index_module_index.timeObject)
            		window.clearTimeout(index_module_index.timeObject);
            	index_module_index.timeObject = window.setTimeout(function(){
            		playControl.goPlay();
            	}, index_module_index.stopTime);
            });
            
		},
		
		initLoad : function(){
			index_module_index.loadHotDee();
			index_module_index.loadHotPlace();
			index_module_index.loadHotActivity();
			index_module_index.loadHotTravel();
			index_module_index.loadIcarRecomm();
			index_module_index.loadIcsRecomm();
			index_module_index.loadHotFriend();
			index_module_index.loadWeekMoods();
			
			index_module_index.getUserCity(function(){
				index_module_index.initMap(function(){
					$("#map-sort-carLife").click();
					index_module_index.timerSwitchMenu();
				});
			});
		},
		initMap : function(cb){
			mapControl.initialize(function(map){
				map.createMap($("#wrap_index_map")[0], $.trim(index_module_index.cityLat)?index_module_index.cityLat:module.defaultLatLng.lat , $.trim(index_module_index.cityLng)?index_module_index.cityLng:module.defaultLatLng.lng , 8 , 1);
				index_module_index.map=map;
				if(cb)
					cb();
			});
		},
		
		unavailable : function(){
			$("#map-sort-dee").attr("class","noneHomeMapLink");
			$("#map-sort-carOwner").attr("class","noneHomeMapLink");
			$("#map-sort-bussness").attr("class","noneHomeMapLink");
		},
		
		searchPlay : function(){
			 index_module_index.clearBalloon();
			 for(var i = 0; i < index_module_index.cacheSearchList.livings.length; i++){
				 if(index_module_index.cacheSearchList.livings[i].type == 4){//团购
				 }else{ //生活信息
					var living = index_module_index.cacheSearchList.livings[i];
					living.addr = living.addr1;
					var balloon = index_module_index.showLifeBalloon(living,i);
					index_module_index.currentArray.push(balloon);
				 }
			 }
			 index_module_index.map.fit(index_module_index.currentArray);
		},
		
		searchMapPlay : function(){
			 index_module_index.clearBalloon();
			 for(var idx=0;idx< index_module_index.cacheSearchMapList.length;idx++){
				 index_module_index.cacheSearchMapList[idx].title = index_module_index.cacheSearchMapList[idx].POINAME;
				 index_module_index.cacheSearchMapList[idx].position = index_module_index.cacheSearchMapList[idx].POIADDR;
				 index_module_index.cacheSearchMapList[idx].lng = index_module_index.cacheSearchMapList[idx].POILNG;
				 index_module_index.cacheSearchMapList[idx].lat = index_module_index.cacheSearchMapList[idx].POILAT;
				 var balloon = index_module_index.showMapBalloon(index_module_index.cacheSearchMapList[idx],idx);
				 index_module_index.currentArray.push(balloon);
			 }
			 index_module_index.map.fit(index_module_index.currentArray);
		},
		
		getUserCity : function(cb){
			index_manage.getUserCity({},function(data){
				if(data.result.success){
					index_module_index.cityId = data.city.cityId; 
					index_module_index.cityName = data.city.cityName;
					var latLng = utils.formatLatLng(data.city.late,data.city.longi);
					index_module_index.cityLat = $.trim(latLng.lat);
					index_module_index.cityLng = $.trim(latLng.lng);
					$('#cityValId').val(index_module_index.cityName);
					if(cb)
						cb();
				}else{
					$.msgBox.alert({
	                    title : "提示",
	                    msg : "查询城市报错!",
	                    icon:"warning"
	                });
				}
			},function(){
				$.msgBox.alert({
                    title : "提示",
                    msg : "查询城市报错!",
                    icon:"warning"
                });
			});
		},
		
		/***
		 * 加载生活信息
		 */
		loadLifeInfo : function(){
			index_module_index.clearBalloon();
			var pvs = {cityName:index_module_index.cityName,"page.currentPage":1,"page.perPageSize":3};
			index_module_index.queryLatestDownloadPoint(pvs,function(data){
				if(data.result.success){
					var i = 0;
					index_module_index.clearBalloon();
					/*					//路书
					if(data.trackList.length>0){
						for(var i in data.trackList){
							 var balloon = index_module_index.showTravelBalloon(data.trackList[i],i);
							 index_module_index.currentArray.push(balloon);
							 i++;
						}
					}
					
					//活动
					if(data.activityList.length>0){
						for(var j  in data.activityList){
							var balloon =  index_module_index.showActivityBalloon(data.activityList[j],i);
							index_module_index.currentArray.push(balloon);
							i++;
						}
					}
					*/
					//生活信息
					if(data.livingInfoList.length>0){
						for(var k =0;k<data.livingInfoList.length;k++){
								var balloon = index_module_index.showLifeBalloon(data.livingInfoList[k],i);
								index_module_index.currentArray.push(balloon);
								i++;
						}
					}
					index_module_index.map.fit(index_module_index.currentArray);
					playControl.play(index_module_index.currentArray);
					
				}else{
					$.msgBox.alert({
	                    title : "提示",
	                    msg : "查询生活信息报错!",
	                    icon:"warning"
	                });
				}
			});
		},
		
		queryLatestDownloadPoint : function(pvs,cb){
			if(index_module_index.cacheActivityList){
				if(cb)
					cb(index_module_index.cacheActivityList);
			}else{
				index_manage.queryLatestDownloadPoint(pvs,function(data){
					index_module_index.cacheActivityList = data;
					if(cb)
						cb(data);
				},function(){
					$.msgBox.alert({
	                    title : "提示",
	                    msg : "查询生活信息报错!",
	                    icon:"warning"
	                });
				});
			}
		},
		
		/**
		 * 加载嘀嘀信息
		 */
		loadDeeInfo : function(){
			index_module_index.clearBalloon();
			var cent = index_module_index.map.getCenter();
			var pvs = { "latitude" : $.trim(index_module_index.cityLat)?index_module_index.cityLat:cent.lat(), "longitude" : $.trim(index_module_index.cityLng)?index_module_index.cityLng:cent.lng(),"bound":15000,"page.currentPage":1,"page.perPageSize":3};
			index_module_index.areaBlog(pvs,function(data){
				if(data.result.success){
					index_module_index.clearBalloon();
					for(var i=0 ;i<data.blogModelList.length;i++){
					  var balloon = index_module_index.showDeeBalloon(data.blogModelList[i],i);
					  index_module_index.currentArray.push(balloon);
					}
					index_module_index.map.fit(index_module_index.currentArray);
					playControl.play(index_module_index.currentArray);
				}else{
					$.msgBox.alert({
	                    title : "提示",
	                    msg : "查询嘀嘀数据错误!",
	                    icon:"warning"
	                });
				}
			});
		},
		
		areaBlog : function(pvs,cb){
			if(index_module_index.cacheDeeList){
				if(cb)
					cb(index_module_index.cacheDeeList);
			}else{
				index_manage.areaBlog(pvs,function(data){
					data.blogModelList = index_module_index.transformLatLng(data.blogModelList,function(data,arr){
						var key = data.lat+""+data.lon;
						if(arr[key]){
							data.lat = (parseFloat(data.lat)+index_module_index.plat)+"";
							data.lon = (parseFloat(data.lon)+index_module_index.plng)+"";
						}
						arr[key] = data;
						return data;
					});
					index_module_index.cacheDeeList = data;
					if(cb)
						cb(data);
				},function(){
				    $.msgBox.alert({
	                    title : "提示",
	                    msg : "查询嘀嘀数据错误!",
	                    icon:"warning"
	                });
				});
			}
		},
		
		/***
		 * 加载明星车主
		 */
		loadStarsOwner : function(){
			index_module_index.clearBalloon();
			var cent = index_module_index.map.getCenter();
			var pvs = { "latitude" : $.trim(index_module_index.cityLat)?index_module_index.cityLat:cent.lat(), "longitude" : $.trim(index_module_index.cityLng)?index_module_index.cityLng:cent.lng(),"bound":15000,"page.currentPage":1,"page.perPageSize":3};
			index_module_index.starCarOwner(pvs,function(data){
				if(data.result.success){
					index_module_index.clearBalloon();
					for(var i=0;i<data.starUserModelList.length;i++){
						var balloon = index_module_index.showStarsOwnerBalloon(data.starUserModelList[i],i);
						index_module_index.currentArray.push(balloon);
					}
					index_module_index.map.fit(index_module_index.currentArray);
					playControl.play(index_module_index.currentArray);
				}else{
					$.msgBox.alert({
	                    title : "提示",
	                    msg : "查询明星车主报错!",
	                    icon:"warning"
	                });
				}
			});
		},
		
		starCarOwner : function(pvs,cb){
			if(index_module_index.cacheStarCarList){
				if(cb)
					cb(index_module_index.cacheStarCarList);
			}else{
				index_manage.starCarOwner(pvs,function(data){
					index_module_index.cacheStarCarList = data;
					if(cb)
						cb(data);
				},function(){
					$.msgBox.alert({
	                    title : "提示",
	                    msg : "查询明星车主报错!",
	                    icon : "warning"
	                });
				});
			}
		},
		
		/**
		 * 加载推荐商户 
		 */
		loadRecommendedMerchant : function(){
			var cent = index_module_index.map.getCenter();
			var pvs = {"cityId":index_module_index.cityId,"page.currentPage":1,"page.perPageSize":3};
			index_module_index.getAreaUser(pvs,function(data){
				if(data.result.success){
					index_module_index.clearBalloon();
					for(var i=0;i<data.userModelList.length;i++){
						var balloon = index_module_index.showMerchantBalloon(data.userModelList[i],i);
						index_module_index.currentArray.push(balloon);
					}
					index_module_index.map.fit(index_module_index.currentArray);
					playControl.play(index_module_index.currentArray);
				}else{
					$.msgBox.alert({
	                    title : "提示",
	                    msg : "查询推荐商户报错!",
	                    icon:"warning"
	                });
				}
			});
		},
		
		getAreaUser : function(pvs,cb){
			if(index_module_index.cacheMerchantList){
				if(cb)
					cb(index_module_index.cacheMerchantList);
			}else{
				index_manage.getAreaUser(pvs,function(data){
					data.userModelList = index_module_index.transformLatLng(data.userModelList,function(data,arr){
						var key = data.latitude+""+data.longitude;
						if(arr[key]){
							data.latitude = (parseFloat(data.latitude)+index_module_index.plat)+"";
							data.longitude = (parseFloat(data.longitude)+index_module_index.plng)+"";
						}
						arr[key] = data;
						return data;
					});
					index_module_index.cacheMerchantList = data;
					if(cb)
						cb(data);
				},function(){
					$.msgBox.alert({
	                    title : "提示",
	                    msg : "查询推荐商户报错!",
	                    icon : "warning"
	                });
				});
			}
		},

		searchLivingInfo : function(){
			index_module_index.isSearch = true;
			index_module_index.unavailable();
			index_module_index.clearBalloon();
			index_module_index.clearTimerSwitchMenu();
			index_module_index.searchCityByKeyWord(function(data){
				 if(data.length > 0){
					 index_module_index.cityId = data[0].cityId;
					 index_module_index.cityName = data[0].cityName;
					 $("#cityValId").val(index_module_index.cityName);
				 }else{
					 $.msgBox.alert({
		                    title : "提示",
		                    msg : "请选择对应的城市!!",
		                    icon : "warning"
		             });
					 return null;
				 }
				 
				 index_module_index.keyword = $("#keywordValId").val(); 
				 (new gLocalSearch.search()).gKSearch({"keyword" : index_module_index.keyword,"cityId" : index_module_index.cityId,"pageSize" : 5,"currentPage" : 1,"map":index_module_index.map},function(data){
					 index_module_index.cacheSearchMapList = data.retVal;
					 for(var idx=0;idx<data.retVal.length;idx++){
						 data.retVal[idx].title = data.retVal[idx].POINAME;
						 data.retVal[idx].position = data.retVal[idx].POIADDR;
						 data.retVal[idx].lng = data.retVal[idx].POILNG;
						 data.retVal[idx].lat = data.retVal[idx].POILAT;
						 var balloon = index_module_index.showMapBalloon(data.retVal[idx],idx);
						 index_module_index.currentArray.push(balloon);
					 }
				 });
				 var param = {
				            "kw" : index_module_index.keyword,
				            "cid" : index_module_index.cityId,
				            "isStats" : 0,
				            "tt" : 1,
				            "page.perPageSize" : index_module_index.pageSize,
				            "page.currentPage" : 1,
				            "lg":""
				     };
					 index_manage.queryLivingInfo(param,function(data){
						 index_module_index.cacheSearchList = data;
						 for(var i = 0; i < data.livings.length; i++){
							 if(data.livings[i].type == 4){//团购
								 
							 }else{ //生活信息
								var living = data.livings[i];
								living.addr = living.addr1;
								var balloon = index_module_index.showLifeBalloon(living,i);
								index_module_index.currentArray.push(balloon);
								window.setTimeout(function(){
									index_module_index.map.fit(index_module_index.currentArray);
								}, 200);
								
							 }
						 }
						 if(data.total > index_module_index.pageSize){
							 $("#searchMoreId").removeClass("noMore");
							 $("#searchMoreId").attr("state",true);
						 }else{
							 $("#searchMoreId").addClass("noMore");
							 $("#searchMoreId").attr("state",false);
						 }
					 },function(){
						 $.msgBox.alert({
		                    title : "提示",
		                    msg : "查询推荐商户报错!",
		                    icon : "warning"
		                });
					 });
			});
		},
		
		/**
		 * 关键字查询 城市
		 */
		searchCityByKeyWord : function(cb){
			var cityName = $('#cityValId').val();
			if($.trim(cityName)){
				index_manage.queryCityByKeyword({"keyword" : $('#cityValId').val(),"page.perPageSize":5},function(data){
		    		if(cb)
						cb(data.cityList);
				 },function(data){
					 $.msgBox.alert({
		                 title : "提示",
		                 msg : "查询城市错误!",
		                 icon: "warning"
		             });
				});
			}else{
				$.msgBox.alert({
	                 title : "提示",
	                 msg : "请输入城市名称!",
	                 icon: "warning"
	            });
			}
		},
		
		
		/**
		 * 定时切换模块
		 */
		timerSwitchMenu : function(){
			index_module_index.interval = window.setInterval(function(){
				index_module_index.index++;
				var menuId = index_module_index.moduleKey[index_module_index.index];
				if(menuId)
					$("#"+menuId).click();
				else
					index_module_index.index = -1;
			}, index_module_index.timer);
		},
		
		/**
		 * 清楚定时切换模块
		 */
		clearTimerSwitchMenu : function(){
			if(index_module_index.interval)
				window.clearInterval(index_module_index.interval);
			$("#switchMenuId").find("a").removeClass("on");
		},
		
		/**
		 * 生活信息泡泡
		 */
		showLifeBalloon : function(param,index){
			index_module_index.cacheLivingData[param.partnerId] = param;
			if(!index_module_index.mapBalloon){
				index_module_index.mapBalloon = new Msd.BalloonContent();
			}
			
			var lifeCode=index_module_index.map.drawMarker(param.lat,param.lon,"", index_module_index.getDefaultImage(parseInt(index)+1) ,null, false,false);
			var myBc = new Msd.lifeInfoBalloon();
			myBc.setSize(300,"auto");
			myBc.load(param);
			lifeCode.setBalloon(myBc);
			return lifeCode;
		},
		
		/**
		 * 滴滴泡泡
		 */
		showDeeBalloon : function(param,index){
			index_module_index.cacheDeeData[param.id] = param;
	        var latLng = utils.formatLatLng(param.lat,param.lon);
	        if(!index_module_index.mapBalloon){
				index_module_index.mapBalloon = new Msd.BalloonContent();
			}
			
			var deeCode=index_module_index.map.drawMarker(latLng.lat,latLng.lng,"", index_module_index.getDefaultImage(parseInt(index)+1) ,null, false,false);
			var myBc = new Msd.DeeBalloon();
			myBc.setSize(300,"auto");
			myBc.load(param, function(){
				deeCode.setBalloon(myBc);
				var gcode = index_module_index.map.geocodeLatLng({"lat":latLng.lat,"lng":latLng.lng},function(data,_this){});
			});
			return deeCode;
		},
		
		/**
		 * 活动泡泡
		 */
		showActivityBalloon : function(param,index){
			var data = {};
			data.map = index_module_index.map;
			var startTime = dateUtil.dateFormat(param.beginTime,"-");
	    	var endTime = dateUtil.dateFormat(param.endTime,"-");
	    	
	    	data.content= $(_popHtml);
			data.content.click(function(event){
				  var _cell = $(event.target);
		          var _id = _cell.attr("id");
		          if(_id && _id.indexOf("detailID_") != -1){ //
		        	  var activityId = _id.split("_")[1];
		        	  module_navigation.goToActivityDetail(activityId);
		        	  return false;
		          }else if(_id && _id.indexOf("downGpsId_") != -1){
		        	  var activityId = _id.split("_")[1];
		        	  var data = index_module_index.cacheActivityData[activityId];
		        	  index_module_index.downIndexGps("活动",data);
		        	  return false;
		          }else if(_id && _id.indexOf("shareToFriend_") != -1){
                      var activityId = _id.split("_")[1];
                      var data = index_module_index.cacheActivityData[activityId];
                      index_module_index.sharePOIInfo("活动",data);
                      return false;
                  }
			});
			index_module_index.cacheActivityData[param.activityId] = param;
			var latLng = utils.formatLatLng(param.rendeLate,param.rendeLongi);
			data.lat = latLng.lat;
			data.lng = latLng.lng;
			
			//me
			var activityCode=index_module_index.map.drawMarker(data.lat,data.lng,"",index_module_index.getDefaultImage(parseInt(index)+1),null,false,false);
			//*var activityCode = drawMarker(data.lat,data.lng,"", index_module_index.getDefaultImage(parseInt(index)+1), index_module_index.map,false,index_module_index.moduleName);
			if(!index_module_index.mapBalloon){
				//*index_module_index.mapBalloon = new balloonControl();
				index_module_index.mapBalloon = new Msd.BalloonContent();
			}
	    	
	    	var paramData ={"balloon" : index_module_index.mapBalloon,"data" : data };
	    	
			//me
	    	/*Msd.lifeInfoBalloon = Msd.Class(Msd.BalloonContent,{
	    		construct : function(){
	    		},
	    		load : function(data,callback){
	    			this._div = $("<div style='overflow:hidden;width:" + this.bWidth + "px;height:" + this.bHeight + "px;background:#fff;'>"+_popHtml+"</div>");
	    			if(callback)
	    				callback();	
	    		}
	    	});*/
			var myBc = new Msd.lifeInfoBalloon();
			myBc.setSize(300,"auto");
			myBc.load(_popHtml);
	    	activityCode.setBalloon(myBc);
	    	
//*			mapEventControl.bind(index_module_index.moduleName,activityCode,paramData,"click",function(evnet,data){
//*				data.balloon.show(data.data);
//*			});
//*	    	return {"balloon" : index_module_index.mapBalloon,"code" : activityCode, "data" : data};
	    	return activityCode;
		},
		
		
		/**
		 * 路书泡泡
		 */
		showTravelBalloon : function(param,index){
			
			var data = {};

			var photoUrl = module_config.defaultInfo.errorImg;
			if($.trim(param.coverUrl).length>0){
				photoUrl = module_config.getTrackFootPhotoUrl(param.userId,param.coverUrl,"l");
			}
			var _popHtml='<div style="width:260px;">'+
				             '   <h3 title="'+param.title+'" class="mapPopTitle"><a  id="detailID_'+param.id+'">'+toolUtil.interceptString(param.title,10)+'</a><a id="detailID_'+param.id+'"  class="mapPopTitle_link">详情&gt;&gt;</a></h3>'+
	                         '   <img onerror="this.src=\''+module_config.defaultInfo.errorImg+'\'" src="'+photoUrl+'" class="minPhoho_65">'+
	                         '   <dl class="mapPop_dl ml82">'+
	                         '      <dt>出发地：</dt><dd>'+param.departure+'</dd>'+
	                         '      <dt>目的地：</dt><dd>'+param.destination+'</dd>'+
	                         '      <dt>作　者：</dt><dd title="'+param.userName+'">'+param.userName+'</dd>'+
	                         '   </dl>'+
	                         '  <div class=""><input type="button" id="downGpsId_'+param.id+'" class="greenDownLongBtn mt5" value="下载终点到GPS" /> <input type="button" id="shareToFriend_'+param.id+'" class="dtGps mt5" value="分享给车友" /></div>'+
	                         '</div>';
	        data.content=$(_popHtml);
			data.content.click(function(event){
				  var _cell = $(event.target);
		          var _id = _cell.attr("id");
		          if(_id && _id.indexOf("detailID_") != -1){
		        	  var id = _id.split("_")[1];
		        	  module_navigation.openTravelDetail(id);
		        	  return false;
		          }else if(_id && _id.indexOf("downGpsId_") != -1){
		        	  var id = _id.split("_")[1];
		        	  index_module_index.downIndexGps("路书",index_module_index.cacheTravelData[id]);
		        	  return false;
		          }else if(_id && _id.indexOf("shareToFriend_") != -1){
                      var id = _id.split("_")[1];
                      var data = index_module_index.cacheTravelData[id];
                      index_module_index.sharePOIInfo("路书",data);
                      return false;
                  }
			});

			data.map = index_module_index.map;
			data.lat = param.coverLat;
			data.lng = param.coverLon;
			index_module_index.cacheTravelData[param.id] = param;

			//me
			var travelCode=index_module_index.map.drawMarker(param.coverLat, param.coverLon,"",index_module_index.getDefaultImage(parseInt(index)+1) ,null,false,false);
			
			//*var travelCode = drawMarker(param.coverLat,param.coverLon,"", index_module_index.getDefaultImage(parseInt(index)+1), index_module_index.map,false,index_module_index.moduleName);
			if(!index_module_index.mapBalloon){
				//*index_module_index.mapBalloon = new balloonControl();
				index_module_index.mapBalloon = new Msd.BalloonContent();
			}
			

	    	
			var paramData ={"balloon" : index_module_index.mapBalloon,"data" : data };
			
			//me
			/*Msd.lifeInfoBalloon = Msd.Class(Msd.BalloonContent,{
				construct : function(){
				},
				load : function(data,callback){
					this._div = $("<div style='overflow:hidden;width:" + this.bWidth + "px;height:" + this.bHeight + "px;background:#fff;'>"+_popHtml+"</div>");
					if(callback)
						callback();	
				}
			});*/
			var myBc = new Msd.lifeInfoBalloon();
			myBc.setSize(400,"auto");
			myBc.load(_popHtml);
	    	travelCode.setBalloon(myBc);
	    	
//*			mapEventControl.bind(index_module_index.moduleName,travelCode,paramData,"click",function(evnet,data){
//*				data.balloon.show(data.data);
//*			});
//*	    	return {"balloon" : index_module_index.mapBalloon,"code" : travelCode ,"data" : data};
	    	
	    	return travelCode;
		},
		
		/**
		 * 商户泡泡
		 */
		showMerchantBalloon : function(param,index){
			index_module_index.cacheMerchantData[param.userId] = param;
			if(!index_module_index.mapBalloon){
				index_module_index.mapBalloon = new Msd.BalloonContent();
			}
			
			var merchantCode=index_module_index.map.drawMarker(param.latitude,param.longitude,"",index_module_index.getDefaultImage(parseInt(index)+1),null,false,false);
			var myBc = new Msd.MerchantBalloon();
			myBc.setSize(300,"auto");
			myBc.load(param);
			merchantCode.setBalloon(myBc);
			var gcode =index_module_index.map.geocodeLatLng({"lat":param.latitude,"lng":param.longitude},function(data,_this){});
			return merchantCode;
		},
		
		/**
		 * 明星车主泡泡 
		 */
		showStarsOwnerBalloon : function(param,index){
			var latLng = utils.formatLatLng(param.lat,param.longi);
			if(!index_module_index.mapBalloon){
				index_module_index.mapBalloon = new Msd.BalloonContent();
			}
			
			var starsCode=index_module_index.map.drawMarker(latLng.lat,latLng.lng,"",index_module_index.getDefaultImage(parseInt(index)+1),null,false,false);
			var myBc = new Msd.StarsOwnerBalloon();
			myBc.setSize(250,"auto");
			myBc.load(param);
			starsCode.setBalloon(myBc);
			return starsCode;
		},
		
		 /**
         * 地点泡泡页面
        */
        showMapBalloon : function(param,index){
			var data = {};
			if(param.trackPoints){
				var point = param.trackPoints.split("\t");
				data.lat = point[3].replace("t","");
				data.lng = point[2].replace("t","");
				param.lat = data.lat;
				param.lng = data.lng;
			}else{
				data.lat = param.lat;
				data.lng = param.lng;
			}
			index_module_index.cacheMapData[index] = param;
			if(!index_module_index.mapBalloon){
				index_module_index.mapBalloon = new Msd.BalloonContent();
			}
			param.index = index ;
			var starsCode=index_module_index.map.drawMarker(data.lat,data.lng,"",index_module_index.getMapIamge(parseInt(index)+1),null,false,false);
			var myBc = new Msd.MapBalloon();
			myBc.setSize(300,"auto");
			myBc.load(param,function(){
				starsCode.setBalloon(myBc);
			});
			return starsCode;
        },
		
        
        loadPOIList : function(){
        	index_module_index.clearBalloon();
			index_module_index.queryPOIList(function(data){
				if(data.result.success){
					index_module_index.clearBalloon();
					for(var i=0;i<data.downloadGPSList.length;i++){
						 var balloon = index_module_index.showMapBalloon(data.downloadGPSList[i],i);
						 index_module_index.currentArray.push(balloon);
					}
					index_module_index.map.fit(index_module_index.currentArray);
					playControl.play(index_module_index.currentArray);
				}else{
					$.msgBox.alert({
	                    title : "提示",
	                    msg : "查询地点信息报错!",
	                    icon:"warning"
	                });
				}
			});
		},
        
		/**
		 * 地点泡泡
		 */
		queryPOIList : function(cb){
			if(index_module_index.cacheMapList){
				if(cb)
					cb(index_module_index.cacheMapList);
			}else{
				var pvs = {"source":7,"cityName":index_module_index.cityName,"page.currentPage":1,"page.perPageSize":3};
				index_manage.queryPOIList(pvs,function(data){
					data.downloadGPSList = index_module_index.transformLatLng(data.downloadGPSList,function(data,arr){
						var point = data.trackPoints.split("\t");
						var lat = point[3].replace("t","");
						var lng = point[2].replace("t","");
						var key = lat+""+lng;
						if(arr[key]){
							data.trackPoints.replace(lat,(parseFloat(lat)+index_module_index.plat)+"");
							data.trackPoints.replace(lng,(parseFloat(lng)+index_module_index.plng)+"");
						}
						arr[key] = data;
						return data;
					});
					index_module_index.cacheMapList = data;
					if(cb)
						cb(data);
				},function(){
					
				});
			}
		},
		
		/**
		 * 关闭所有泡泡
		 */
		clearBalloon : function(){
			index_module_index.map.clearMap();
			index_module_index.currentArray = [];
		},
		
		/**
		 * 隐藏泡泡
		 */
		hideBalloon : function(){
			index_module_index.currentArray=[];
		},
		
		/**
		 * 加载热门嘀嘀
		 */
		loadHotDee : function(){
			index_manage.queryHotDee({'page.perPageSize' : 5},index_module_index.loadHotDee_scb , index_module_index.loadHotDee_ecb);
		},
		
		loadHotDee_scb : function(data){
			var results = data.blogModelList;
			var container = $('#dee_ul');
			var res = null;
			var _t = null;
			for(var key=0;key<results.length;key++){
				res = results[key];
				_t = $('<li>'+
							'<a href="javascript:;"><img id="userId_'+res.userId+'" src="'+(module_config.userPhoto.M + res.photo)+'" onerror="this.src=\''+module_config.defaultInfo.errorUserMiniPhoto+'\'" class="fl mr10" /></a>'+
							'<p>'+
								'<a href="javascript:;" id="userId_'+res.userId+'" title="'+res.nickName+'">'+(res.nickName)+'</a>：'+ 
								(index_module_index.loadDeeContent(res)) +
							'</p>'+
					   '</li>');
				_t.appendTo(container);
			}
			index_module_index.deeContentEvent(container);
			container.click(function(event){
				var cell = $(event.target);
				var cellId = cell.attr('id');
				if(cellId.indexOf('userId_') != -1){
					window.location.href = module_config.userHomeUrl(cellId.split('_')[1]);
					return false;
				}
			});
		},
		loadHotDee_ecb : function(data){
		},
		
		loadDeeContent : function(dee){
			var originDee = dee.blogModel;
			var html = "";
			if(dee.originBlogId > 0 && originDee){
		        html += '  <span id="deeCcontent_'+dee.id+'">'+dee_read.deeTopicParse(toolUtil.faceToHtml(dee.content))+'<a href="javascript:;" types="user_'+originDee.userId+'" title="'+originDee.nickName+'(@'+originDee.userId+')">@'+originDee.nickName+'</a>';
		        if((originDee.fromType == 8 || originDee.fromType == 9) && originDee.referId > 0){
	                html += dee_read.checkContent(originDee.content, originDee.referId, originDee.fromType);
	            }else{
	                html += dee_read.deeTopicParse(toolUtil.faceToHtml(originDee.content));
	            }
	            html += '        </span>';
		    }else{
	            if((dee.fromType == 8 || dee.fromType == 9) && dee.referId > 0){
	                html += '       <span id="deeCcontent_'+dee.id+'">'+dee_read.checkContent(dee.content, dee.referId, dee.fromType)+'</span>';
	            }else{
	                html += '       <span id="deeCcontent_'+dee.id+'">'+dee_read.deeTopicParse(toolUtil.faceToHtml(dee.content))+'</span>';
	            }
		    }
			return html;
		},
		
		deeContentEvent : function(container){
			container.bind("click", function(event){
	            var _cell = $(event.target);
	            var _types = _cell.attr("types");
	            var cellId = _cell.attr('id');
				if(cellId && cellId.indexOf('userId_') != -1){
					window.location.href = module_config.userHomeUrl(cellId.split('_')[1]);
					return false;
				}else if(_types && _types.indexOf('user_') != -1){
	                var pam = {target : "person", userId : _types.split('_')[1]};
	                module_navigation.dee.direct(pam);
	                toolUtil.stopBubble(event);
	            }else if(_types && _types.indexOf('activity_') != -1){
	                module_navigation.goToActivityDetail(_types.split('_')[1]);
	                toolUtil.stopBubble(event);
	            }else if(_types && _types.indexOf('track_') != -1){
	            	module_navigation.openTravelDetail(_types.split('_')[1]);
	            	toolUtil.stopBubble(event);
	            }else if(_types && _types == "topic"){
	            	var param = {target : "topic", topicName : _cell.attr("title")};
	            	module_navigation.dee.direct(param);
	                toolUtil.stopBubble(event);
	            }else if(_types && _types.indexOf('video_') != -1){
	            	window.open(_cell.html());
	            	return false;
	            }
			});
		},
		
		/**
		 * 加载热门去处
		 */
		loadHotPlace : function(){
			index_manage.queryHotPlace({cityAreaId : 1103 , 'page.perPageSize' : 5},index_module_index.loadHotPlace_scb , index_module_index.loadHotPlace_ecb);
		},
		
		loadHotPlace_scb : function(data){
			var results = data.hotPlace;
			var container = $('#hotplace_ul');
			var _t = null;
			var res = null;
			var name = null;
            var addr = null;
			for(var key=0;key<results.length;key++){
				res = results[key];
				name = res.name.length>20?res.name.substring(0,20):res.name;
                addr = res.addr.length>20?res.addr.substring(0,20):res.addr;
				_t = $('<li  id="'+key+'" fid="'+res.id+'">'
						+'<a href="javascript:;" id="placeId_'+res.id+'"><img class="fl mr10"  alt="'+res.name+'" src="'+res.image+'"  onerror="this.src=\''+module.defaultDNoImg+'\'" class="favImgP1"></a>'
						+'<p>'
                        +'<a href="javascript:;" id="placeId_'+res.id+'">'+addr+'</a>'
                        +'</p>'+
			          '</li>');
				_t.appendTo(container);
			}
			container.click(function(event){
				var cell = $(event.target);
				var cellId = cell.attr('id');
				if(cellId.indexOf('placeId_') != -1){
					module_navigation.living.direct({"module":"life",'lId':cellId.split("_")[1]});
					return false;
				}
			});
		},
		
		loadHotPlace_ecb : function(data){
		},
		
		/**
		 * 加载精彩活动
		 */
		loadHotActivity : function(){
			index_manage.queryActivities({'activity.cityId' : 0 , 'page.perPageSize' : 6},index_module_index.loadHotActivity_scb , index_module_index.loadHotActivity_ecb);
		},
		
		loadHotActivity_scb : function(data){
			var results = data.wonderfulActivity;
			var container = $('#activity_ul');
			var _t = null;
			var res = null;
			var subject = null;
            if(results.length >= 1){
            	res = results[0];
            	subject = res.subject.length>20?res.subject.substring(0,20):res.subject;
            	_t = $('<li class="numOne">'+
							'<a href="javascript:;" id="activityId_'+res.activityId+'"><img src="'+ module_config.getActivityPhotoUrl(res.images) +'" id="activityId_'+res.activityId+'" onerror="this.src=\''+module.defaultDNoImg+'\'" class="fl mr10" /></a>'+
							'<p>'+
								'<span class="numIcon1"></span>'+
								'<a href="javascript:;" id="activityId_'+res.activityId+'" class="c_2e75bc f_bold" title="'+res.subject+'">'+ toolUtil.subStrByCharCode(res.subject,40)+'</a><br />'+
								'<span class="c_666">路&nbsp;&nbsp;线：</span>' +toolUtil.subStrByCharCode(res.roadMap,36)+ '<br/>'+
								'<span class="c_666">召集人：</span>'+ toolUtil.subStrByCharCode(res.userName,10) + 
							'</p>'+
					   '</li>');
            	_t.appendTo(container);
            }
            if(results.length > 1){
            	for(var key = 1; key < results.length; key++){
            		res = results[parseInt(key)];
            		subject = res.subject.length>20?res.subject.substring(0,20):res.subject;
    				_t = $('<li  id="'+key+'" fid="'+res.id+'">'
    						+'<span class="numIcon'+(parseInt(key) + 1 )+'"></span>'
                            +'<a href="javascript:;" id="activityId_'+res.activityId+'">' + subject + '</a>'
                            +'<span class="person" title="'+res.userName+'">' + toolUtil.subStrByCharCode(res.userName,10) + '</span>'+
    			          '</li>');
    				_t.appendTo(container);
            	}
            }
			container.click(function(event){
				var cell = $(event.target);
				var cellId = cell.attr('id');
				if(cellId.indexOf('activityId_') != -1){
					module_navigation.goToActivityDetail(cellId.split('_')[1]);
					return false;
				}
			});
		},
		
		loadHotActivity_ecb : function(data){
		},
		
		/**
		 * 加载推荐路书
		 */
		loadHotTravel : function(){
			index_manage.queryHottestTravel({'page.perPageSize' : 6 , 'page.currentPage' : 1 , "track.type" : 0} , index_module_index.loadHotTravel_scb , index_module_index.loadHotTravel_ecb);
		},
		
		loadHotTravel_scb : function(data){
			var results = data.travelList;
			var container = $('#travel_ul');
			var _t = null;
			var res = null;
			var title = null;
            var roadMap = null;
            if(results.length >= 1){
            	res = results[0];
            	roadMap = res.departure.split('|')[2] + '>' + res.destination.split('|')[2];
            	title = res.title.length>20?res.title.substring(0,20):res.title;
            	var photoUrl = module_config.defaultInfo.errorImg;
            	
                if($.trim(res.coverUrl).length>0){
                    photoUrl = module_config.getTrackFootPhotoUrl(res.userId,res.coverUrl,"l");
                }
            	_t = $('<li class="numOne">'+
							'<a href="javascript:;"><img id="travelId_'+res.id+'" src="'+ photoUrl +'" onerror="this.src=\''+module.defaultDNoImg+'\'" class="fl mr10" /></a>'+
							'<p>'+
								'<span class="numIcon1"></span>'+
								'<a href="javascript:;" class="c_2e75bc f_bold" id="travelId_'+res.id+'">'+ res.title +'</a><br />'+
								'<span class="c_666">出发地&nbsp;&nbsp;目的地：</span>' +roadMap+ '<br/>'+
								'<span class="c_666">作者：</span title="'+res.userName+'">'+ toolUtil.subStrByCharCode(res.userName,10) + 
							'</p>'+
					   '</li>');
            	_t.appendTo(container);
            }
			for(var key=0;key< results.length;key++){
				res = results[parseInt(key)+1];
				if(!res)
					continue;
				roadMap = res.departure.split('|')[2] + '-' + res.destination.split('|')[2];
				title = res.title.length>20?res.title.substring(0,20):res.title;
				_t = $('<li  id="'+key+'" fid="'+res.id+'">'
						+'<span class="numIcon'+(parseInt(key) + 2 )+'"></span>'
                        +'<a href="javascript:;" id="travelId_'+res.id+'">' + title + '</a>'
                        +'<span class="person" title="'+res.userName+'">' + toolUtil.subStrByCharCode(res.userName,10) + '</span>'+
			          '</li>');
				_t.appendTo(container);
			}
			
			container.click(function(event){
				var cell = $(event.target);
				var cellId = cell.attr('id');
				if(cellId.indexOf('travelId_') != -1){
					module_config.openTravelDetail(cellId.split('_')[1]);
					return false;
				}
			});
		},
		
		/**
		 * 下载到GPS
		 */
		downIndexGps : function(type,data){
			if("undefined" == typeof(menu)){
				module_navigation.login.open();
				return false;
			}
			if(type == "活动"){
				var latLng = utils.formatLatLng(data.rendeLate,data.rendeLongi);
				var data = [{name : data.subject ,destination:"活动集结地:"+$.trim(data.rendezvous)?data.rendezvous:"暂无", lat :latLng.lat , lon :latLng.lng, type : 4 , id : data.activityId,shareType:web4s.shareType.defa, state : "1" }];
	     		utils.downGps(data);
			}else if(type == "嘀嘀"){
				var data = [{name : data.content ,destination : null, lat : data.lat , lon : data.lon, type : 6 , id : data.id,shareType:web4s.shareType.defa, state : "1" }];
	     		utils.downGps(data);
			}else if(type =="商户"){
				var data = [{name : data.nickName ,destination : null, lat :data.latitude , lon :data.longitude, type : 0 , id : data.userId, shareType:web4s.shareType.defa,state : "1" }];
	     		utils.downGps(data);
			}else if(type =="生活信息"){
				var data = [{name : data.name ,destination : null, lat :data.lat , lon : data.lon, type : 5 , id : data.id,shareType:web4s.shareType.life, state : "1" }];
				utils.downGps(data);
			}else if(type == "路书"){
				var data = [{name : data.title , lat : data.coverLat, lon : data.coverLon, type : 1 , id : data.id,shareType:web4s.shareType.defa, pointType : 1, state:"1"}];
				utils.downGps(data);
			}else if(type =="地点"){
				var data = [{name : data.title , lat : data.lat, lon :data.lng, type : 7 , id : 0,shareType:web4s.shareType.defa, state:"1"}];
				utils.downGps(data);
			}
		},
		
		sharePOIInfo : function(type, data){
			if("undefined" == typeof(menu)){
				module_navigation.login.open();
				return false;
			}
			if(type == "活动"){
                var latLng = utils.formatLatLng(data.rendeLate,data.rendeLongi);
                var data = {name : data.subject ,destination:"活动集结地:"+$.trim(data.rendezvous)?data.rendezvous:"暂无", lat :latLng.lat , lon :latLng.lng, type : 4 , id : data.activityId,shareType:web4s.shareType.defa, state : "1", shareTarType : 2 };
                utils.sharePointToFriend(data);
            }else if(type == "嘀嘀"){
                var data = {name : data.content ,destination : null, lat : data.lat , lon : data.lon, type : 6 , id : data.id,shareType:web4s.shareType.defa, state : "1", shareTarType : 2 };
                utils.sharePointToFriend(data);
            }else if(type =="商户"){
                var data = {name : data.nickName ,destination : null, lat :data.latitude , lon :data.longitude, type : 0 , id : data.userId, shareType:web4s.shareType.defa,state : "1", shareTarType : 2 };
                utils.sharePointToFriend(data);
            }else if(type =="生活信息"){
                var data = {name : data.name ,destination : null, lat :data.lat , lon : data.lon, type : 5 , id : data.id,shareType:web4s.shareType.life, state : "1", shareTarType : 2 };
                utils.sharePointToFriend(data);
            }else if(type == "路书"){
                var data = {name : data.title , lat : data.coverLat, lon : data.coverLon, type : 1 , id : data.id,shareType:web4s.shareType.defa, pointType : 1, state:"1", shareTarType : 2};
                utils.sharePointToFriend(data);
            }else if(type =="地点"){
                var data = {name : data.title , lat : data.lat, lon :data.lng, type : 7 , id : 0,shareType:web4s.shareType.defa, state:"1", shareTarType : 2};
                utils.sharePointToFriend(data);
            }
		},
		
		loadHotTravel_ecb : function(data){
		},
		
		/**
		 * 加载推荐车友
		 */
		loadHotFriend : function(){
			index_manage.queryRecommendUser({'page.perPageSize' : 3 , 'page.currentPage' : 1},index_module_index.loadHotFriend_scb,index_module_index.loadHotFriend_ecb);
		},
		
		loadHotFriend_scb : function(data){
			var photoUrl = module_config.userPhoto.M;
			var container = $('#hotFriend_ul');
			var _t = null;
			var res = null;
			if(data.users && data.users.length > 0){
				var results = data.users;
				for(var key=0;key<results.length;key++){
					res = results[key];
					_t = $('<li><span class="numIcon'+(parseInt(key)+1)+'"></span><a href="'+module_config.userHomeUrl(res.userId)+'"><img src="'+photoUrl+res.userPhoto+'" onerror="this.src=\''+module_config.defaultInfo.errorUserMiniPhoto+'\'" /><span title="'+res.nickName+'">'+($.trim(res.nickName) ? res.nickName : res.userId)+'</span></a></li>');
					_t.appendTo(container);
				}
			}
		},
		
		loadHotFriend_ecb : function(data){
		},
		
		/**
		 * 加载周人气
		 */
		loadWeekMoods : function(){
			index_manage.queryWeekPopularity({'page.perPageSize' : 10 , 'page.currentPage' : 1},index_module_index.loadWeekMoods_scb,index_module_index.loadWeekMoods_ecb);
		},
		
		loadWeekMoods_scb : function(data){
			var container = $('#weekMoods_ol');
			var results = data.userList;
			var _t = null;
			var res = null;
			for(var key=0;key<results.length;key++){
				res = results[key];
				_t = $('<li><a href="'+module_config.userHomeUrl(res.userId)+'" title="'+res.nickName+'">' + res.nickName + '</a></li>');
				_t.appendTo(container);
			}
		},
		
		loadWeekMoods_ecb : function(){
			
		},
		
		/**
		 * 加载爱车
		 */
		loadIcarRecomm : function(){
			index_manage.queryIcarRecomm({},index_module_index.loadIcarRecomm_scb , index_module_index.loadIcarRecomm_ecb);
		},
		
		loadIcarRecomm_scb : function(data){
			var results = data.carApps;
			var container = $('#icar_ul');
			var _t = null;
			var res = null;
			for(var key=0;key<results.length;key++){
				res = results[key];
				var img="../images/img/"+res.imgUrl;
				var href=module_config.menuControl['爱车管家'].destPath+"&type="+res.url;
				_t = $('<li><a href="'+href+'"><img src="'+img+'" />'+res.name+'</a></li>');
				_t.appendTo(container);
			}
		},
		
		loadIcarRecomm_ecb : function(data){
			
		},
		
		/**
		 * 加载商城推荐
		 */
		loadIcsRecomm : function(){
			var url = web4s.agentSite + web4s.findHotCommodityList;
	        $.ajax( {
	            url : web4s.sendHttpUrl,
	            type : "post",
	            dataType : 'json',
	            data : {url:url,'page.perPageSize' : 3 , 'page.currentPage' : 1}, 
	            success : function(data) {
	            	 $("#ics_ul").html("");
	            	if(data.flag == 1 && data.result.res.result == 0){
	            		 var shoplist=data.result.commodityList;
	            		 for(var i=0;i<shoplist.length;i++){
	            			 $('<li><a href="javascript:void(0);" id="detail_'+shoplist[i].code+'" title="'+shoplist[i].name+'" ><img src="'+shoplist[i].smallIcon+'" id="detail_'+shoplist[i].code+'" onerror="this.src=\'/web4s/images/img/iCar_lovingCarIcon01.png\'"  />'+toolUtil.subStrByCharCode(shoplist[i].name,8)+'</a></li>').appendTo($("#ics_ul"));
	                     }
	            	}
	            }
	        });
		},
		
		initModule : function(){
			module.module_path = 'index_module';
			module.module_page_path = module.module_path + '/page';
			module.module_html_path = module.module_path + '/html';
			module.module_css_path = module.module_path + '/css';
			module.module_js_path = module.module_path + '/js';
		},
		
		/**
		 * 获得map图片
		 */
		getMapIamge : function(index){
			return web4s.context_path+"/images/mapPoint/mapPoint_blue0"+index+".png";
		},
		
		getDefaultImage : function(index){
			return web4s.context_path+"/images/mapPoint/mapPoint_red0"+index+".png";
		},
		
		/**
		 * 重复经纬度偏移
		 */
		transformLatLng : function(data,cb){
			var arr = [];
			for(var i =0;i< data.length;i++){
				if(cb)
					data[i] = cb(data[i],arr);
			}
			return data;
		}
};
/**
 * 首页播放控制
 */
var playControl ={
		_index : 0,
		_time  : null, //播放时间控制
		_sleep : 5000, //播放间隔
		_cacheData : null,
		
		play: function(data){//开始播放
			playControl.stop();
			playControl._time = window.setInterval(function(){
				index_module_index.hideBalloon();
				var curent = data[playControl._index];
				if(curent){
					curent.openBalloon();
					playControl._index++;
					if(data.length <= playControl._index)
						playControl._index = 0;
				}else{
					playControl._index = 0;
					playControl.stop();
				}
			}, playControl._sleep);
		},
		
		stop : function(){
			if(playControl._time)
				window.clearInterval(playControl._time);
		},
		
		allStop : function(){
			playControl.stop();
			if(index_module_index.interval)
				window.clearInterval(index_module_index.interval);
		},
		
		goPlay : function(){
			//继续播放
			index_module_index.timerSwitchMenu();
			playControl.play(playControl._cacheData);
		}
};
