﻿/*
 * Compressed by iPow(www.iPow.cn)
 */
var iPowTour=null,tripData=[],cirHotelInfo=[],iPowApi="http://sys.ipow.cn/",tripListData,globalTripData;function DrawTravel(A,B){this.element=null;this.parameters=B;this.travelElem=$("#hodometerContainer");this.isScroll=false;this.filters={Const:[],DayNum:[],Live:[]};this.resultSize=5;this.exituser="Exist"}DrawTravel.prototype={init:function(E){try{var D=this.travelElem;this.element=E;var A=this,C=getAllPosition(D),F=C.scrTop;if(F<140)F=10;else F=parseInt(F-136);D.animate({top:F},10).slideDown("fast",function(){var G=E.prev(),L=$(G).attr("title"),N=$(G).find("font.fontBlue2").text(),H=$(G).find("dl dd").text(),J=$(G).find("span.img1 img").attr("src"),I=$(G).attr("rel").split("|"),D=I[0],B="<a href=\"javascript:;\"><img src=\""+J+"\"/><em>"+L+"</em><h3>\uffe5"+N+"</h3></a>",O=parseInt(tripData.length+1),P=0;$("#TravelArea").text($("#txtKeyword").val());P=parseInt(P)+parseInt(N);var C=[{SName:L,SID:D,Ticket:N,IMG:J,Address:H,Latitude:I[1],Longitude:I[2]}],M={DayID:O,TName:"",Sight:C,Hotel:[],Traffic:[],DTotal:P,Destination:$("#txtKeyword").val()};if(tripData.length>0){if(!A.isExist(M.Sight[0])){var K="<div class=\"TB_Form\"><span><label>\u9009\u62e9\u884c\u7a0b\uff1a</label>";K+="<select name=\"selTravel\" id=\"selTravel\" class=\"selStyle\">";for(var F=1;F<=O;F++)if(F==O)K+="\t<option value=\""+F+"\" selected=\"selected\">\u7b2c"+F+"\u5929</option>";else K+="\t<option value=\""+F+"\">\u7b2c"+F+"\u5929</option>";K+="</select><a href=\"javascript:;\" class=\"btnSubmit\" id=\"btnSetPlan\"></a></span>";K+="</div>";$(E).TBwin({width:300,height:100,title:"\u884c\u7a0b\u5b89\u6392",datahtml:K,datatype:"html",isBG:false,callback:function(){$("#btnSetPlan").click(function(){B="<a href=\"javascript:;\" id=\"tripSight0\"><img src=\""+J+"\"/><em>"+L+"</em><h4></h4><h3>\uffe5"+N+"</h3></a>";A.toPlan($("#selTravel option:selected").attr("value"),B,M)})}})}else alert("\u5df2\u7ecf\u5b58\u5728\u6b64\u666f\u533a:)")}else{B="<a href=\"javascript:;\" id=\"tripSight00\"><img src=\""+J+"\"/><em>"+L+"</em><h4></h4><h3>\uffe5"+N+"</h3></a>";$("#hodometerSightBot").append("<span>"+B+"</span>");$("#tripSight00 h4").click(function(){A.deleteSight(M.Sight[0],1)});$("#tripSight00").hover(function(){$(this).find("h4").show()},function(){$(this).find("h4").hide()});$("#dayAmount").text("\uffe5"+M.DTotal);tripData.push(M);A.loadHotelInfo(M.Sight[0].SID,1,false)}if(!A.isScroll)A.wscroll()})}catch(B){}},wscroll:function(){var A=this.travelElem;if(A.is(":visible")){var B=this;$(window).scroll(function(){B.isScroll=true;B.resetPosition(A)})}},hide:function(){var A=this.travelElem;A.hide()},resetPosition:function(B){var A=getAllPosition(B),C=A.scrTop;if(C<140)C=10;else C=parseInt(C-136);B.animate({top:C},10).slideDown("slow")},isExist:function(B){var C=[];$.each(tripData,function(A,B){C=C.concat(B.Sight)});var A=false;$.map(C,function(C){if(C.SName==B.SName){A=true;return false}});return A},isExistHotel:function(C,B){var A=false;$.map(B,function(B){if(B.HName==C.HName){A=true;return false}});return A},toPlan:function(D,F,E){try{var B=this,A=parseInt($("#hodometerContainer").css("top"));$("#TB_Windows").animate({top:A+136},100).animate({opacity:"toggle"},1000,function(){if(tripData[parseInt(D-1)]==undefined||tripData[parseInt(D-1)]=="undefined"){tripData.push(E);F="<a href=\"javascript:;\" id=\"tripSight"+parseInt(D-1)+"0\"><img src=\""+E.Sight[0].IMG+"\"/><em>"+E.Sight[0].SName+"</em><h4></h4><h3>\uffe5"+E.Sight[0].Ticket+"</h3></a>";$("#hodometerSightBot").append("<span>"+F+"</span>");$("#tripSight"+parseInt(D-1)+"0 h4").click(function(){B.deleteSight(E.Sight[0],D)});$("#tripSight"+parseInt(D-1)+"0").hover(function(){$(this).find("h4").show()},function(){$(this).find("h4").hide()});$("#dayAmount").text("\uffe5"+E.DTotal)}else{var A=$("#hodometerSightBot span:eq("+parseInt(D-1)+") a").size();A=String(parseInt(D-1))+String(A);F="<a href=\"javascript:;\" id=\"tripSight"+A+"\"><img src=\""+E.Sight[0].IMG+"\"/><em>"+E.Sight[0].SName+"</em><h4></h4><h3>\uffe5"+E.Sight[0].Ticket+"</h3></a>";$("#hodometerSightBot span:eq("+parseInt(D-1)+")").append(F);$("#tripSight"+A+" h4").click(function(){B.deleteSight(E.Sight[0],D)});$("#tripSight"+A+"").hover(function(){$(this).find("h4").show()},function(){$(this).find("h4").hide()});$("#hodometerSightBot span").hide("fast",function(){$("#hodometerSightBot span:eq("+parseInt(D-1)+")").show();B.sightPage($("#hodometerSightBot span:eq("+parseInt(D-1)+")"),"sightPage",2)});tripData[parseInt(D-1)].Sight=tripData[parseInt(D-1)].Sight.concat(E.Sight);tripData[parseInt(D-1)].DTotal=parseInt(tripData[parseInt(D-1)].DTotal)+parseInt(E.DTotal);$("#dayAmount").text("\uffe5"+tripData[parseInt(D-1)].DTotal)}B.loadHotelInfo(E.Sight[0].SID,D,false)})}catch(C){}},deleteSight:function(C,D){try{D=parseInt(D-1);var A=this;$.each(tripData[D].Sight,function(A,B){if(B.SName==C.SName){tripData[D].Sight.splice(A,1);tripData[D].DTotal=parseInt(tripData[D].DTotal-C.Ticket);$("#dayAmount").text(tripData[D].DTotal);$("#hodometerSightBot span:eq("+D+") a:eq("+A+")").remove()}});if(tripData[D].Sight.length==0&&tripData[D].Hotel==""){tripData.splice(D,1);$("#hodometerSightBot span:eq("+D+")").remove();this.addDayInfo(tripData.length,tripData.length,false)}A.sightPage($("#hodometerSightBot span:eq("+D+")"),"sightPage",2)}catch(B){}},addDayInfo:function(D,H,E){var C="",B="",F=0,A=this;for(var G=1;G<=D;G++)if(G==D)C+="<a href=\"javascript:;\" class=\"current\">"+G+"</a>";else C+="<a href=\"javascript:;\">"+G+"</a>";$("#hodometerDayNum").html(C);if(E)$("#hodometerHotels").append("<span></span>");$("#hodometerDayNum a").click(function(){B=parseInt($(this).text());B=parseInt(B-1);$("#hodometerDayNum a").removeClass("current");$("#hodometerDayNum a:eq("+B+")").addClass("current");$("#dayAmount").text("\uffe5"+tripData[B].DTotal);$("#hodometerSightBot span").hide("fast",function(){$("#sightPage").html("");$("#hodometerSightBot span:eq("+B+")").show();A.sightPage($("#hodometerSightBot span:eq("+B+")"),"sightPage",2)});$("#hodometerHotels span").hide("fast",function(){$("#hodometerHotels span:eq("+B+")").show()});if(cirHotelInfo.length>0){var C=[];$.each(tripData[B].Sight,function(F,D){var E=String(B)+String(F),A={Name:D.SName,Url:"http://jq.ipow.cn/szhys",Type:"Sight",Latitude:D.Latitude,Longitude:D.Longitude,Price:D.Ticket,ImageSrc:D.IMG,Address:D.Address,CommCount:0,PicCount:0,SightType:"\u6d77\u6d0b\u4e3b\u9898\u516c\u56ed",DomID:"tripSight"+E+"",markerPic:"/images/flv_04.gif"};C.push(A)});A.hotelPage(B,7,1,C)}});if(H>0)$("#hodometerDayNum a").eq(parseInt(H-1)).trigger("click");A.statistics();document.cookie="TourData="+JSON.stringify(tripData)},hotelPage:function(G,E,J,H){var B=this,F=[];F=F.concat(H);var A=endindex=0,C=cirHotelInfo[parseInt(G)].length,I=Math.ceil(C/E);if(I>=J){switch(J){case 1:$("#hotelPage").html("<a href=\"javascript:;\" id=\"nextHotelPage\">\u4e0b\u4e00\u9875</a>");$("#nextHotelPage").click(function(){B.hotelPage(G,E,parseInt(J+1),H)});break;case I:$("#hotelPage").html("<a href=\"javascript:;\" id=\"prevHotelPage\">\u4e0a\u4e00\u9875</a>");$("#prevHotelPage").click(function(){B.hotelPage(G,E,parseInt(J-1),H)});break;default:$("#hotelPage").html("<a href=\"javascript:;\" id=\"nextHotelPage\">\u4e0b\u4e00\u9875</a><a href=\"javascript:;\" id=\"prevHotelPage\">\u4e0a\u4e00\u9875</a>");$("#nextHotelPage").click(function(){B.hotelPage(G,E,parseInt(J+1),H)});$("#prevHotelPage").click(function(){B.hotelPage(G,E,parseInt(J-1),H)});break}A=(J-1)*E;endindex=J*E;if(endindex>C)endindex=C;$("#CirHotelList").html("");var D=H.length;$.each(cirHotelInfo[parseInt(G)].slice(A,endindex),function(A,D){_html="<li id=\"hotel"+D.HotelID+"\"><a href=\"http://hotel.ipow.cn/"+D.HotelID+".shtml\" title=\""+D.HName+"\"><img src=\"/images/icon/htop"+parseInt(A+1)+".jpg\" border=\"0\"/><span>"+D.HName+"</span><em>\uffe5"+D.HPrice+"</em></a><span class=\"addHotel\" id=\"hotelOpration"+A+"\">\u6dfb\u52a0</span></li>";$("#CirHotelList").append(_html);$("#hotelOpration"+A+"").click(function(){B.addHotel(this,D)});var C={Name:D.HName,Url:"http://hotel.ipow.cn/3325.shtml",Type:"Hotel",Latitude:D.Latitude,Longitude:D.Longitude,Price:D.HPrice,ImageSrc:"/images/nopic116.jpg",Address:D.Address,CommCount:0,PicCount:0,HotelType:"\u56db\u661f\u7ea7",DomID:"hotel"+D.HotelID+"",OrderID:parseInt(A+1)};F.push(C)});mapinitialize(F,"tripMap","tripMapTipPanel",false)}},sightPage:function(B,C,E){var F=$(B).find("a").size(),D=Math.ceil(F/E),A="";if(D>=1){for(var G=1;G<=D;G++)A+="<a href=\"javascript:;\">"+G+"</a>";$("#"+C).html(A);$("#"+C+" a").click(function(){var D=$(this).text(),A=E*(parseInt(D)-1);$("#"+C+" a").removeClass("current1");$("#"+C+" a:eq("+parseInt(D-1)+")").addClass("current1");$(B).find("a:slice("+parseInt(A)+","+parseInt(A+E)+")").show().parent().find("a:lt("+parseInt(A)+")").hide()});$("#"+C+" a").eq(parseInt(D-1)).trigger("click")}else $("#"+C).html("")},statistics:function(){var B=0,A=0;$("#TravelDays").text(tripData.length);$.map(tripData,function(C){B=parseInt(B)+parseInt(C.DTotal);A=parseInt(A)+parseInt(C.Sight.length)});$("#TravelSights").text(A);$("#TravelCost").text("\uffe5"+B)},loadHotelInfo:function(E,B,H){try{var A=this,G="",D={},F=[];B=parseInt(B-1);$("#CirHotelList").html("");$.getScript(iPowApi+"IpowAPI/Hotel/Requset/GetHotelInfo.aspx?RequestType=GetCircleHotelByParkID&ParkID="+E+"&temp="+Math.random(),function(){F=[];$.each(hotelJson,function(C,E){D={HotelID:E.ID,HName:E.HotelName,Star:E.Starrating,Address:E.Address,HPrice:parseInt(E.MinPrice),Latitude:E.latitude,Longitude:E.longitude};if(cirHotelInfo[parseInt(B)]==undefined||cirHotelInfo[parseInt(B)]=="undefined")F.push(D);else if(!A.isExistHotel(D,cirHotelInfo[parseInt(B)]))F.push(D)});if(cirHotelInfo[parseInt(B)]==undefined||cirHotelInfo[parseInt(B)]=="undefined")cirHotelInfo[parseInt(B)]=F;else cirHotelInfo[parseInt(B)]=cirHotelInfo[parseInt(B)].concat(F);if(!H)A.addDayInfo(tripData.length,parseInt(B+1),true)})}catch(C){}},addHotel:function(C,I){var A=this,D=I.HName,H=I.HPrice,J=I.Address,G=parseInt(tripData.length),F="<span><h3>"+D+"</h3><em>\uffe5"+H+"</em><p>"+J+"</p></span>";if(G>1){var B="<div class=\"TB_Form\"><span><label>\u9009\u62e9\u884c\u7a0b\uff1a</label>";B+="<select name=\"selTravelHotel\" id=\"selTravelHotel\" class=\"selStyle\">";for(var E=1;E<=G;E++)if(E==G)B+="\t<option value=\""+E+"\" selected=\"selected\">\u7b2c"+E+"\u5929</option>";else B+="\t<option value=\""+E+"\">\u7b2c"+E+"\u5929</option>";B+="</select><a href=\"javascript:;\" class=\"btnSubmit\" id=\"btnSetHotel\"></a></span></div>";$(C).TBwin({width:300,height:100,title:"\u884c\u7a0b\u5b89\u6392",datahtml:B,datatype:"html",isBG:false,callback:function(){$("#btnSetHotel").click(function(){A.toPlanHotel($("#selTravelHotel option:selected").attr("value"),F,I)})}})}else{if(tripData[0].Hotel.HPrice>0)tripData[0].DTotal=parseInt(tripData[0].DTotal)-parseInt(tripData[0].Hotel.HPrice);tripData[0].Hotel=I;var K=parseInt(tripData[0].DTotal)+parseInt(I.HPrice);tripData[0].DTotal=K;A.addDayInfo(tripData.length,1,false);$("#hodometerHotels span:eq(0)").replaceWith(F);document.cookie="TourData="+JSON.stringify(tripData)}},toPlanHotel:function(E,D,C){var A=parseInt($("#hodometerContainer").css("top")),B=this;$("#TB_Windows").animate({top:A+136},100).animate({opacity:"toggle"},1000,function(){if(tripData[parseInt(E-1)].Hotel.HPrice>0)tripData[parseInt(E-1)].DTotal=parseInt(tripData[parseInt(E-1)].DTotal)-parseInt(tripData[parseInt(E-1)].Hotel.HPrice);tripData[parseInt(E-1)].Hotel=C;tripData[parseInt(E-1)].DTotal=parseInt(tripData[parseInt(E-1)].DTotal)+parseInt(C.HPrice);B.addDayInfo(tripData.length,E,false);$("#hodometerHotels span:eq("+parseInt(E-1)+")").replaceWith(D)})},save:function(C,D){try{if((tripData==""||tripData[0].Sight==undefined||tripData[0].Sight=="")&&tripData.length==0){alert("\u60a8\u8fd8\u672a\u6dfb\u52a0\u666f\u533a\u5230\u884c\u7a0b\u8868\u91cc:)");return false}var A=this;jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/UserLogin.ashx?type=chk&CallBack=iPowDraw.saveuser&temp="+Math.random(),function(){var B=getCookie("UserName");if(B=="null"||B==""){A.login(C,"save");return false}else{var E="<div class=\"TB_Form\"><span><label>\u884c\u7a0b\u540d\u79f0\uff1a</label><input id=\"TourName\" type=\"text\" class=\"txtInput\"/><em>*</em></span>";E+="<span style=\"height:55px;\"><label>\u884c\u7a0b\u6807\u7b7e\uff1a</label><textarea name=\"TourRemark\" id=\"TourRemark\" cols=\"20\" rows=\"4\"></textarea></span>";E+="<span><label id=\"subLoading\">&nbsp;</label><a href=\"javascript:;\" class=\"btnSubmit\" id=\"btnTourSave\"></a></span></div>";$(C).TBwin({width:320,height:165,title:"\u4fdd\u5b58\u884c\u7a0b",datahtml:E,datatype:"html",isBG:false,callback:function(){$("#btnTourSave").click(function(){var C=$("#TourName").val();if(C==""){alert("\u8bf7\u8f93\u5165\u884c\u7a0b\u540d\u79f0:)");$("#TourName").focus();return false}var E={TourName:C,TourRemark:$("#TourRemark").val(),UserName:B,Destination:$("#TravelArea").text(),DayNum:$("#TravelDays").text(),TravelCost:$("#TravelCost").text()};$("#subLoading").text("\u63d0\u4ea4\u4e2d\u2026");$(this).hide();A.submitdata(E,D)})}})}})}catch(B){}},submitdata:function(D,E){var A={PlanTitle:escape(D.TourName),UserName:escape(D.UserName),Remark:escape(D.TourRemark),Destination:escape(D.Destination),Days:tripData.length},B=[];$.each(tripData,function(C,D){$.map(D.Sight,function(A){var C={SightIDOrHotelID:A.SID,CurrentPrice:A.Ticket,Remark:"",DayID:D.DayID,DetailType:"sight"};B.push(C)});var E={};if(D.Hotel!=""){var A=Math.round(D.Hotel.HPrice);E={SightIDOrHotelID:D.Hotel.HotelID,CurrentPrice:A,Remark:"",DayID:D.DayID,DetailType:"hotel"};B.push(E)}});var F=JSON.stringify(A),C=JSON.stringify(B);if(E=="edit")jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/TourPlanHandler.ashx?Type=SaveTourPlan&CallBack=iPowEdit.savesuccess&Plan="+F+"&PlanDetail="+C+"");else jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/TourPlanHandler.ashx?Type=SaveTourPlan&CallBack=iPowDraw.savesuccess&Plan="+F+"&PlanDetail="+C+"")},clearHistory:function(){var A=new Date();A.setTime(A.getTime()-10000);document.cookie="TourData=; expire="+A.toGMTString();cirHotelInfo=[];tripData=[];this.isScroll=false;$("#hodometerSightBot").html("");$(window).unbind("scroll");$("#hodometerContainer").hide();alert("\u6e05\u695a\u5386\u53f2\u8bb0\u5f55\u6210\u529f:)")},tripMap:function(){var A="",B=[],C=[];$.each(planAll,function(E,A){$.each(A.Sight,function(D,C){var A={Name:C.SName,Url:"http://jq.ipow.cn/szhys",Type:"Sight",Latitude:C.Latitude,Longitude:C.Longitude,Price:C.Ticket,ImageSrc:C.IMG,Address:C.Address,CommCount:0,PicCount:0,SightType:"\u6d77\u6d0b\u4e3b\u9898\u516c\u56ed",DomID:""};B.push(A)});var D={Name:A.Hotel.HName,Url:"http://hotel.ipow.cn/szhys",Type:"hotel",Latitude:A.Hotel.Latitude,Longitude:A.Hotel.Longitude,Price:A.Hotel.HPrice,ImageSrc:A.Hotel.IMG,Address:A.Hotel.Address,CommCount:0,PicCount:0,SightType:"\u6d77\u6d0b\u4e3b\u9898\u516c\u56ed",DomID:""};C.push(D)});B=B.concat(C);mapinitialize(B,"gMap","jxMapTipPanel",false)},history:function(){var F=getCookie("TourData"),B=this;if(F!=""&&F!="undefined"&&F!=undefined){$travel=B.travelElem;if($travel.is(":hidden")){tripData=JSON.parse(F);var A="",E="";$("#hodometerSightBot").html(A);$("#hodometerHotels").html(E);var C=getAllPosition($travel),D=C.scrTop;if(D<140)D=10;else D=parseInt(D-136);$travel.animate({top:D},10).slideDown("fast",function(){$.each(tripData,function(C,D){A="";$("#hodometerSightBot").append("<span style=\"display:none;\"></span>");$("#TravelArea").text(D.Destination);$.each(D.Sight,function(E,D){var F=String(C)+String(E);A="<a href=\"javascript:;\" id=\"tripSight"+F+"\"><img src=\""+D.IMG+"\"/><em>"+D.SName+"</em><h4></h4><h3>\uffe5"+D.Ticket+"</h3></a>";$("#hodometerSightBot span:eq("+C+")").append(A);$("#tripSight"+F+" h4").click(function(){B.deleteSight(D,parseInt(C+1))});$("#tripSight"+F+"").hover(function(){$(this).find("h4").show()},function(){$(this).find("h4").hide()})});if(D.Hotel=="")E="<span></span>";else E="<span><h3>"+D.Hotel.HName+"</h3><em>\uffe5"+D.Hotel.HPrice+"</em><p>"+D.Hotel.Address+"</p></span>";$("#hodometerHotels").append(E);$.map(D.Sight,function(A){B.loadHotelInfo(A.SID,parseInt(C+1),false)})});B.wscroll()})}}},login:function(D,E){var A="",B=this;A="<div class=\"TB_Cotainer\">";A+="<div class=\"TB_Login\" id=\"TB_UserForm\"><h3>\u8bf7\u8f93\u5165\u60a8\u7684\u767b\u5f55\u4fe1\u606f</h3><span><label>\u7528\u6237\u540d\uff1a</label><input id=\"UserName\" type=\"text\" class=\"txtInput\"/><em>*</em></span>";A+="<span><label>\u5bc6\u3000\u7801\uff1a</label><input id=\"Password\" type=\"password\" class=\"txtInput\"/><em>*</em></span>";A+="<span><label>&nbsp;</label><a href=\"javascript:;\" class=\"btnLogin\" id=\"btnLogin\" title=\"\u767b\u5f55\"></a></span></div>";A+="<h4>\u6ca1\u6709\u8d26\u53f7?<a href=\"javascript:;\" id=\"btnRegister\">\u52a0\u5165\u6211\u4eec</a></h4>";A+="</div>";var C=false;if(E=="login")C=true;$(D).TBwin({width:600,height:280,title:"\u7528\u6237\u767b\u5f55",datahtml:A,datatype:"html",isBG:C,callback:function(){$("#btnRegister").click(function(){B.register(D,"loading")});$("#btnLogin").click(function(){var C=$("#UserName").val(),A=$("#Password").val();if(C==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u7528\u6237\u540d:)");$("#UserName").focus();return false}if(A==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u5bc6\u7801:)");$("#Password").focus();return false}if(E=="save")jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/UserLogin.ashx?username="+escape(C)+"&password="+escape(A)+"&type=login&CallBack=iPowDraw.saveuser&temp="+Math.random(),function(){B.save(D)});else jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/UserLogin.ashx?username="+escape(C)+"&password="+escape(A)+"&type=login&CallBack=iPowDraw.saveuser&temp="+Math.random(),function(){$("#TB_Windows").animate({top:136},100).animate({opacity:"toggle"},1000,function(){$("#TB_WinBg").remove()})})})}})},saveuser:function(A){if(A.ChkLogin){document.cookie="UserName="+A.UserName;$("#loginUserInfo").html("\u6b22\u8fce\u60a8\uff0c"+A.UserName+"\uff01<a href=\"javascript:;\" id=\"logout\" onclick=\"iPowDraw.logout()\" title=\"\u9000\u51fa\">\u9000\u51fa</a>")}else document.cookie="UserName="+A.UserName},logout:function(){var A=this;jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/UserLogin.ashx?type=out&temp="+Math.random(),function(){document.cookie="UserName="+"";$("#loginUserInfo").html("<a href=\"javascript:;\" id=\"goLogin\" title=\"\u7528\u6237\u767b\u5f55\">\u767b\u5f55</a>&nbsp;&nbsp;<a href=\"javascript:;\" id=\"goRegister\" title=\"\u65b0\u7528\u6237\u6ce8\u518c\">\u6ce8\u518c</a>");$("#goLogin").click(function(){A.login(this,"login")});$("#goRegister").click(function(){iPowDraw.register(this,"reg")})})},checkuser:function(){jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/UserLogin.ashx?type=chk&CallBack=iPowDraw.saveuser&temp="+Math.random(),function(){var A=getCookie("UserName")})},register:function(B,C){var A=this,D="";D+="<div class=\"TB_Cotainer\">";D+="<div class=\"TB_Login\"><h3>\u8bf7\u8f93\u5165\u60a8\u7684\u4e2a\u4eba\u4fe1\u606f</h3><span><label>\u7528\u6237\u540d\uff1a</label><input id=\"regUserName\" type=\"text\" class=\"txtInput\"/><em>*</em></span>";D+="<span><label>\u5bc6\u3000\u7801\uff1a</label><input id=\"regPassword\" type=\"password\" class=\"txtInput\"/><em>*</em></span>";D+="<span><label>\u786e\u8ba4\u5bc6\u7801\uff1a</label><input id=\"regPassword1\" type=\"password\" class=\"txtInput\"/><em>*</em></span>";D+="<span><label>Email\uff1a</label><input id=\"regEmail\" type=\"text\" class=\"txtInput\"/><em>*</em></span>";D+="<span><label>&nbsp;</label><a href=\"javascript:;\" class=\"btnSubmit\" id=\"rebtnSubmit\" title=\"\u63d0\u4ea4\"></a><a href=\"javascript:;\" class=\"btnReset\" id=\"btnReset\" title=\"\u91cd\u7f6e\"></a></span></div>";D+="<h4>\u5df2\u6709\u8d26\u53f7?<a href=\"javascript:;\" id=\"btnLogin\">\u73b0\u5728\u767b\u5f55</a></h4>";D+="</div>";$(B).TBwin({width:600,height:280,title:"\u7528\u6237\u6ce8\u518c",datahtml:D,datatype:"html",isBG:true,callback:function(){$("#btnLogin").click(function(){A.login(this,"login")});$("#regUserName").blur(function(){A.existreuser(this)});$("#rebtnSubmit").hide();$("#rebtnSubmit").click(function(){var F=$.trim($("#regUserName").val()),E=$.trim($("#regPassword").val()),D=$.trim($("#regPassword1").val()),G=$.trim($("#regEmail").val());if(F==""){alert("\u8bf7\u8f93\u5165\u6ce8\u518c\u7528\u6237\u540d:)");$("#regUserName").focus();return false}if(E==""){alert("\u8bf7\u8f93\u5165\u7684\u5bc6\u7801:)");$("#regPassword").focus();return false}if(D==""){alert("\u8bf7\u8f93\u5165\u786e\u8ba4\u5bc6\u7801:)");$("#regPassword1").focus();return false}if(E!=D){alert("\u5bc6\u7801\u548c\u786e\u8ba4\u5bc6\u7801\u4e0d\u4e00\u81f4\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u5bc6\u7801:)");$("#regPassword").focus();return false}if(G==""){alert("\u8bf7\u8f93\u5165Email:)");$("#regEmail").focus();return false}else if(!isEmail(G)){alert("\u60a8\u7684\u7535\u5b50\u90ae\u7bb1\u683c\u5f0f\u9519\u8bef:)");$("#regEmail").select();return false}if(C=="reg")jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/UserLogin.ashx?username="+escape(F)+"&password="+escape(E)+"&email="+escape(G)+"&type=register&CallBack=iPowDraw.saveuser&temp="+Math.random(),function(){$("#TB_Windows").animate({top:136},100).animate({opacity:"toggle"},1000,function(){$("#TB_WinBg").remove();alert("\u6ce8\u518c\u6210\u529f\uff01")})});else jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/UserLogin.ashx?username="+escape(F)+"&password="+escape(E)+"&email="+escape(G)+"&type=register&CallBack=iPowDraw.saveuser&temp="+Math.random(),function(){A.save(B)})})}})},userexit:function(A){if(A.Type=="Exist"){$("#rebtnSubmit").hide();alert("\u7528\u6237\u540d\u5df2\u7ecf\u5b58\u5728\uff01");$("#regUserName").select()}else if(A.Type=="NotExist")$("#rebtnSubmit").show()},existreuser:function(B){var A=$.trim($(B).attr("value"));if(A==""){alert("\u8bf7\u8f93\u5165\u6ce8\u518c\u7528\u6237\u540d:)");$("#regUserName").focus();return false}jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/UserLogin.ashx?type=exist&username="+escape(A)+"&CallBack=iPowDraw.userexit&temp="+Math.random())},savesuccess:function(C){if(C.Type=="OK"){var A=parseInt($("#hodometerContainer").css("top")),B=this;$("#TB_Windows").animate({top:A+136},100).animate({opacity:"toggle"},1000,function(){var A=new Date();A.setTime(A.getTime()-10000);document.cookie="TourData=; expire="+A.toGMTString();cirHotelInfo=[];tripData=[];this.isScroll=false;$("#hodometerSightBot").html("");$(window).unbind("scroll");$("#hodometerContainer").hide();$("#TB_Windows").hide();$("#btnTourSave").show();window.location.href="http://www.ipow.cn"+C.Path})}},iSearch:function(D,I){var E=this;switch(I){case"search":var C=$.query.get("q"),G=$.query.get("days"),A=$.query.get("live"),H=$.query.get("const");$("#sTripInfo").html("");if(C==""||C=="null")location.href="http://www.ipow.cn/";if(G!=""){$("#txtDays").val(G);$("#sTripInfo").append("\u3000\u884c\u7a0b\u5929\u6570\uff1a"+G+"");this.filters.DayNum=[[parseInt(G),parseInt(G)]]}if(A!=""){$("#txtLive").val(A);this.filters.Live=A}if(H!=""){$("#txtConst").val(H);$("#sTripInfo").append("\u3000\u884c\u7a0b\u9884\u7b97\uff1a\xa5"+H+"\u4ee5\u5185");this.filters.Const=[[0,parseInt(H)]]}if(C!=""){$("#txtKeyword").val(C);$("#fKeyword").text(C);jQuery.getScript(iPowApi+"IpowAPI/Search.ashx?q="+escape(C)+"&type=tour&CallBack=iPowDraw.searchComplete&temp="+Math.random())}break;case"gotour":C=$.trim($("#txtKeyword").val().replace("\u8bf7\u8f93\u5165\u5173\u952e\u5b57 \u5982\u6d77\u5357",""));if(C==""){alert("\u8bf7\u8f93\u5165\u641c\u7d22\u5173\u952e\u5b57:)");$("#txtKeyword").select();return false}var G=$.trim($("#txtDays").val().replace("\u5929\u6570","")),A=$.trim($("#txtLive").val().replace("\u4f4f\u5bbf\u6807\u51c6","")),H=$.trim($("#txtConst").val().replace("\u9884\u7b97\u91d1\u989d","")),F=$.query.set("q",C).toString();if(G!="")F+="&days="+encodeURIComponent(G);if(A!="")F+="&live="+encodeURIComponent(A);if(H!="")F+="&const="+encodeURIComponent(H);var B="/search/"+F;window.location.href=B;break;default:break}},searchComplete:function(B){var A=this;if(B.Type=="OK"){tripListData=B.Result;globalTripData=B.Result;listMap.init(globalTripData,A.filters);$("#priceAsc").trigger("click")}},sPage:function(F,C){var D=this;if(C==undefined)C=1;var B=F.length,A=Math.ceil(B/D.resultSize),E="",H=(C-1)*D.resultSize,G=C*D.resultSize;if(G>B)G=B;$.each(F.slice(H,G),function(A,B){E+="<a href=\""+B.Url+"\"  class=\"tripList\" target=\"_blank\">\t\t\t\t<img src=\""+B.Phone+"\" />\t\t\t\t<h3>"+B.PlanTitle+"</h3>\t\t\t\t<dl>\t\t\t\t   <dt>\t\t\t\t\t   <span>\uffe5<font class=\"fPrice\">"+B.Const+"</font>/\u5168\u7a0b</span>\t\t\t\t\t   <em></em>\t\t\t\t   </dt>\t\t\t\t   <dd>\u9014\u7ecf\u666f\u70b9\uff1a"+B.Sights+"</dd>\t\t\t\t   <dd>\u5929\u6570\uff1a"+B.DayNum+"\u5929</dd>\t\t\t\t   <dd>\u4f4f\u5bbf\uff1a"+B.Hotels+"</dd>\t\t\t\t   <dd>\u5173\u952e\u5b57\uff1a"+B.Remark+"</dd>\t\t\t   </dl>\t\t\t</a>"});$("#ResultList").html(E);D.pageUI(C,A,F)},pageUI:function(B,A,D){var C=this,E="";if(A!=1){if(B<=1);else if(B>1)E="<a href=\"javascript:;\" title=\"\u4e0a\u4e00\u9875\"  style=\"width:50px;\">\u4e0a\u4e00\u9875</a>"+E;var F;if(B<=10&&A<=10){for(F=1;F<=A;F++)if(F==B)E="<span>"+F+" </span>"+E;else E="<a href=\"javascript:void(0);\">"+F+"</a>"+E}else if(A>=10&&B<=5){for(F=1;F<=10;F++)if(F==B)E="<span>"+F+" </span>"+E;else E="<a href=\"javascript:void(0);\">"+F+"</a>"+E}else if((B+5)<=A){for(F=(B-4);F<=(B+5);F++)if(F==B)E="<span>"+F+" </span>"+E;else E="<a href=\"javascript:void(0);\">"+F+"</a>"+E}else for(F=(B-4);F<=A;F++)if(F==B)E="<span>"+F+" </span>"+E;else E="<a href=\"javascript:void(0);\">"+F+"</a>"+E}if(B<A&&A>1)E="<a href=\"javascript:;\" title=\"\u4e0b\u4e00\u9875\" style=\"width:50px;\">\u4e0b\u4e00\u9875</a>"+E;$("#RusultPage").html("<div class=\"pageContainer\">"+E+"</div>");$("#RusultPage a").unbind("click");$("#RusultPage a").click(function(){var A=$(this).text();switch(A){case"\u4e0a\u4e00\u9875":C.sPage(D,parseInt(B-1));break;case"\u4e0b\u4e00\u9875":C.sPage(D,parseInt(B+1));break;default:C.sPage(D,A);break}})}};function EditTravel(A,B){this.element=null;this.parameters=B;this.travelElem=$("#EditHodometer");this.tabDays=$("#tabDays");this.isScroll=false;this.isChange=false;this.cirSight=null;this.cirHotel=null;this.isEdit=false}EditTravel.prototype={init:function(){var B=this;B.cirSight=sightMap;B.cirHotel=hotelMap;var A=B.tabDays.find("a");$.each(A,function(A,C){$(C).click(function(){B.tabClick(this,A)})});B.travelElem.find(".aDeleteSight").click(function(){B.delSight(this)});B.travelElem.find(".aDeleteHotel").click(function(){B.delHotel(this)});tripData=planAll;this.tempTripData=planAll;B.cirInit(0)},tabClick:function(B,C){var A=this;A.tabDays.find("a").removeClass("current");A.tabDays.find("a:eq("+C+")").addClass("current");A.travelElem.find(".tourContainer").slideUp(500).parent().find(".tourContainer:eq("+C+")").slideDown(500);A.cirInit(C)},cirInit:function(B){var A=this;$("#cirContainer .rightCirInfo").slideUp(500).parent().find("..rightCirInfo:eq("+B+")").slideDown(500);$("#cirTab a").unbind("click");$("#cirTab a").click(function(){$(this).parent().find("a").removeClass("current");$(this).addClass("current");var C=[];$.each(tripData[parseInt(B)].Sight,function(B,E){var F="sight"+E.SID+"",A=$("#"+F+" h3").text().replace(E.SName,""),D={Name:E.SName,Url:$("#"+F+" a").attr("href"),Type:"Sight",Latitude:E.Latitude,Longitude:E.Longitude,Price:E.Ticket,ImageSrc:E.IMG,Address:E.Address,CommCount:0,PicCount:0,SightType:A,DomID:"sight"+E.SID+"",markerPic:"/images/flv_04.gif"};C.push(D)});if($(this).attr("rel")=="Sight")A.paging(B,5,1,C,A.cirSight,"Sight");else if($(this).attr("rel")=="Hotel")A.paging(B,5,1,C,A.cirHotel,"Hotel");else A.paging(B,5,1,C,repastMap,"Repast")});$("#cirTab a:first").trigger("click")},addSight:function(E){var D=this;if(E.Type=="OK"){var A=JSON.parse(E.SightEntity),C={SName:A.Name,SID:A.SightID,Ticket:A.Price,IMG:A.ImageSrc,Address:A.Address,Latitude:A.Latitude,Longitude:A.Longitude};if(!iPowDraw.isExist(C)){var B="<div class=\"TB_Form\"><span><label>\u9009\u62e9\u884c\u7a0b\uff1a</label>";B+="<select name=\"selTravel\" id=\"selTravel\" class=\"selStyle\">";var G=parseInt(tripData.length)+1;for(var F=1;F<=G;F++)if(F==G)B+="\t<option value=\""+F+"\" selected=\"selected\">\u7b2c"+F+"\u5929</option>";else B+="\t<option value=\""+F+"\">\u7b2c"+F+"\u5929</option>";B+="</select><a href=\"javascript:;\" class=\"btnSubmit\" id=\"btnSetPlan\"></a></span>";B+="</div>";$(D.travelElem).TBwin({width:300,height:100,title:"\u884c\u7a0b\u5b89\u6392",datahtml:B,datatype:"html",isBG:false,callback:function(){$("#btnSetPlan").click(function(){var B=$("#selTravel option:selected").attr("value");_sightHtml="<div class=\"infoContent\" id=\"sight"+C.SID+"\">       \t\t\t\t\t\t\t\t\t\t<a href=\""+A.Url+"\" class=\"aImg\">           \t\t\t\t\t\t\t\t\t\t<img src=\""+A.ImageSrc+"\" />       \t\t\t\t\t\t\t\t\t\t</a>       \t\t\t\t\t\t\t\t\t\t<div class=\"tourInfo\">           \t\t\t\t\t\t\t\t\t\t<h3><a href=\""+A.Url+"\" target=\"_blank\">"+C.SName+"</a>&nbsp;&nbsp;&nbsp;&nbsp;"+A.SightType+"</h3>           \t\t\t\t\t\t\t\t\t\t<dl>               \t\t\t\t\t\t\t\t\t\t<dt>                   \t\t\t\t\t\t\t\t\t\t<span>\uffe5<font class=\"fPrice\">"+C.Ticket+"</font>/\u95e8\u7968</span>                   \t\t\t\t\t\t\t\t\t\t<a href=\""+A.Url+"\" target=\"_blank\" class=\"aLookMore\">\u67e5\u770b\u8be6\u7ec6</a>                   \t\t\t\t\t\t\t\t\t\t<a href=\"javascript:;\" class=\"aDeleteSight\" rel=\"sight"+C.SID+"|"+B+"\">\u79fb\u9664\u884c\u7a0b</a>               \t\t\t\t\t\t\t\t\t\t</dt>               \t\t\t\t\t\t\t\t\t\t<dd class=\"dTitle\">[<a href=\""+E.SightEntity.Url+"/pic1.shtml\" title=\"\u66f4\u591a\u56fe\u7247\" target=\"_blank\">\u56fe\u7247</a>] \t\t\t\t\t\t\t\t\t\t\t\t\t[<a href=\""+A.Url+"/video1.shtml\" title=\"\u66f4\u591a\u89c6\u9891\" target=\"_blank\">\u89c6\u9891</a>] \t\t\t\t\t\t\t\t\t\t\t\t\t[<a href=\""+A.Url+"/article1.shtml\" title=\"\u66f4\u591a\u653b\u7565\" target=\"_blank\">\u653b\u7565</a>] \t\t\t\t\t\t\t\t\t\t\t\t\t[<a href=\""+A.Url+"/guide.shtml\" title=\"\u67e5\u770b\u5bfc\u6e38\u56fe\" target=\"_blank\">\u5bfc\u6e38\u56fe</a>]</dd>               \t\t\t\t\t\t\t\t\t\t<dd class=\"dSpecial\">\u8425\u4e1a\u65f6\u95f4\uff1a"+A.ShopHours+"</dd>               \t\t\t\t\t\t\t\t\t\t<dd class=\"dSpecial\">\u6700\u4f73\u65c5\u6e38\u65f6\u95f4\uff1a"+A.OpToTime+"</dd>               \t\t\t\t\t\t\t\t\t\t<dd class=\"dSpecial\">\u5730\u5740\uff1a"+A.Address+"</dd>           \t\t\t\t\t\t\t\t\t\t</dl>       \t\t\t\t\t\t\t\t\t\t</div>       \t\t\t\t\t\t\t\t\t</div>";D.toPlan(B,_sightHtml,C,E.CirSight,E.CirHotel)})}})}else alert("\u5df2\u7ecf\u5b58\u5728\u6b64\u666f\u533a:)")}},toPlan:function(F,E,B,A,D){var C=this;$("#TB_Windows").animate({top:136},100).animate({opacity:"toggle"},1000,function(){C.isEdit=true;var I=A,J=D;if(tripData[parseInt(F-1)]==undefined||tripData[parseInt(F-1)]=="undefined"){var H={DayID:F,TName:"",Sight:[B],Hotel:[],Traffic:[],DTotal:B.Ticket};tripData.push(H);C.cirSight.push(I);C.cirHotel.push(J);$("#tabDays").append("<a href=\"javascript:;\" rel=\""+F+"\">\u7b2c"+F+"\u5929</a>");var K="<div class=\"tourContainer\" id=\"tourContainer"+F+"\">";K+="<div class=\"tourTip\">       \t\t\t\t\t\t\t\t\t<h2>\u6e38\u73a9\u666f\u70b9</h2>\t\t\t\t\t\t\t\t\t\t<em class=\"emDayNum\" title=\"1\">\u7b2c"+F+"\u5929</em>   \t\t\t\t\t\t\t\t\t  </div>   \t\t\t\t\t\t\t\t\t\t<div class=\"insetContainer\" id=\"sightContainer"+F+"\">";K+=E;K+="\t</div>";K+="\t<div class=\"tourTip\">       \t\t\t\t\t\t\t\t\t\t<h2>\u4f4f\u5bbf\u9152\u5e97</h2>       \t\t\t\t\t\t\t\t\t\t<em></em>   \t\t\t\t\t\t\t\t\t\t</div><div class=\"insetContainer\">\u8bf7\u6839\u636e\u9700\u8981\u4ece\u5468\u8fb9\u9152\u5e97\u9009\u62e9\u60a8\u6ee1\u610f\u7684\u9152\u5e97\uff01<br><br></div>";K+="\t<div class=\"tourTip\">       \t\t\t\t\t\t\t\t\t\t<h2>\u4ea4\u901a</h2>       \t\t\t\t\t\t\t\t\t\t<em></em>   \t\t\t\t\t\t\t\t\t\t</div><div class=\"insetContainer\">\u6b63\u5728\u5efa\u8bbe\u4e2d\uff0c\u656c\u8bf7\u5173\u6ce8\uff01<br><br></div>";K+="</div>";C.travelElem.append(K);var G=C.tabDays.find("a");G.unbind("click");$.each(G,function(A,B){$(B).click(function(){C.tabClick(this,A)})})}else{if(parseInt(tripData[parseInt(F-1)].Sight.length)>1)if(!confirm("\u60a8\u7b2c"+F+"\u5929\u884c\u7a0b\u666f\u533a\u6570\u91cf\u8d85\u8fc72\u4e2a\u4e86\r\u662f\u5426\u7ee7\u7eed\u6dfb\u52a0\uff1f"))return false;tripData[parseInt(F-1)].Sight=tripData[parseInt(F-1)].Sight.concat(B);tripData[parseInt(F-1)].DTotal=parseInt(tripData[parseInt(F-1)].DTotal)+parseInt(B.Ticket);C.travelElem.find(".tourContainer:eq("+parseInt(F-1)+") .insetContainer:eq(0)").prepend(E)}C.tabDays.find("a:eq("+parseInt(F-1)+")").trigger("click");$("#sight"+B.SID+" .aDeleteSight").click(function(){C.delSight(this)});$("#sightAllInfo").append("+"+B.SName);$("#tourConst").text(parseInt($("#tourConst").text())+parseInt(B.Ticket))})},addHotel:function(F){var E=this,H="";if(F.Type=="OK"){var B=JSON.parse(F.SightEntity),C={HotelID:B.HotelID,HName:B.Name,Latitude:B.Latitude,Longitude:B.Longitude,HPrice:parseInt(B.Price),ImageSrc:B.ImageSrc,Address:B.Address,CommCount:B.CommCount,PicCount:B.PicCount,HotelType:B.HotelType,DomID:"hotel"+B.HotelID+""};if(tripData.length>1){var D="<div class=\"TB_Form\"><span><label>\u9009\u62e9\u884c\u7a0b\uff1a</label>";D+="<select name=\"selTravelHotel\" id=\"selTravelHotel\" class=\"selStyle\">";var I=parseInt(tripData.length);for(var G=1;G<=I;G++)if(G==I)D+="\t<option value=\""+G+"\" selected=\"selected\">\u7b2c"+G+"\u5929</option>";else D+="\t<option value=\""+G+"\">\u7b2c"+G+"\u5929</option>";D+="</select><a href=\"javascript:;\" class=\"btnSubmit\" id=\"btnSetHotel\"></a></span></div>";$(E.travelElem).TBwin({width:300,height:100,title:"\u884c\u7a0b\u5b89\u6392",datahtml:D,datatype:"html",isBG:false,callback:function(){$("#btnSetHotel").click(function(){var A=$("#selTravelHotel option:selected").attr("value");H="<div class=\"infoContent\" style=\" background-color:#EAEAEA;\" id=\"hotel"+C.HotelID+"\">\t\t\t\t\t\t\t<a href=\"http://hotel.ipow.cn/"+C.HotelID+".shtml\" class=\"aImg\" target=\"_blank\">\t\t\t\t\t\t\t\t<img src=\""+C.ImageSrc+"\" />\t\t\t\t\t\t\t</a>\t\t\t\t\t\t\t<div class=\"tourInfo\">\t\t\t\t\t\t\t\t<h3><a href=\"http://hotel.ipow.cn/"+C.HotelID+".shtml\" target=\"_blank\">"+C.HName+"</a>&nbsp;&nbsp;&nbsp;&nbsp;"+C.HotelType+"</h3>\t\t\t\t\t\t\t\t<dl>\t\t\t\t\t\t\t\t\t<dt>\t\t\t\t\t\t\t\t\t\t<span>\uffe5<font class=\"fPrice\">"+C.HPrice+"</font>/\u8d77</span>\t\t\t\t\t\t\t\t\t\t<a href=\"http://hotel.ipow.cn/"+C.HotelID+".shtml\" target=\"_blank\" class=\"aLookMore\">\u67e5\u770b\u8be6\u7ec6</a>\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:;\" class=\"aDeleteHotel\" rel=\"hotel"+C.HotelID+"|"+A+"\">\u79fb\u9664\u884c\u7a0b</a>\t\t\t\t\t\t\t\t\t</dt>\t\t\t\t\t\t\t\t\t<dd class=\"dContent\">\u5730\u5740\uff1a"+C.Address+"</dd>\t\t\t\t\t\t\t\t</dl>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>";E.toPlanHotel(A,H,C)})}})}else{var A=E.travelElem.find(".tourContainer:eq(0) .insetContainer:eq(1) .fPrice").text();H="<div class=\"infoContent\" style=\" background-color:#EAEAEA;\" id=\"hotel"+C.HotelID+"\">\t\t\t\t\t\t\t<a href=\"http://hotel.ipow.cn/"+C.HotelID+".shtml\" class=\"aImg\" target=\"_blank\">\t\t\t\t\t\t\t\t<img src=\""+C.ImageSrc+"\" />\t\t\t\t\t\t\t</a>\t\t\t\t\t\t\t<div class=\"tourInfo\">\t\t\t\t\t\t\t\t<h3><a href=\"http://hotel.ipow.cn/"+C.HotelID+".shtml\" target=\"_blank\">"+C.HName+"</a>&nbsp;&nbsp;&nbsp;&nbsp;"+C.HotelType+"</h3>\t\t\t\t\t\t\t\t<dl>\t\t\t\t\t\t\t\t\t<dt>\t\t\t\t\t\t\t\t\t\t<span>\uffe5<font class=\"fPrice\">"+C.HPrice+"</font>/\u8d77</span>\t\t\t\t\t\t\t\t\t\t<a href=\"http://hotel.ipow.cn/"+C.HotelID+".shtml\" target=\"_blank\" class=\"aLookMore\">\u67e5\u770b\u8be6\u7ec6</a>\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:;\" class=\"aDeleteHotel\" rel=\"hotel"+C.HotelID+"|1\">\u79fb\u9664\u884c\u7a0b</a>\t\t\t\t\t\t\t\t\t</dt>\t\t\t\t\t\t\t\t\t<dd class=\"dContent\">\u5730\u5740\uff1a"+C.Address+"</dd>\t\t\t\t\t\t\t\t</dl>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>";if(A=="")A=0;E.travelElem.find(".tourContainer:eq(0) .insetContainer:eq(1)").html(H);$("#hotel"+C.HotelID+" .aDeleteHotel").click(function(){E.delHotel(this)});$("#tourConst").text(parseInt($("#tourConst").text())+parseInt(C.HPrice)-parseInt(A));tripData[0].DTotal=parseInt(tripData[0].DTotal)+parseInt(C.HPrice)-parseInt(A)}}},toPlanHotel:function(D,C,A){var B=this;$("#TB_Windows").animate({top:136},100).animate({opacity:"toggle"},1000,function(){B.isEdit=true;tripData[parseInt(D-1)].Hotel=A;tripData[parseInt(D-1)].DTotal=parseInt(tripData[parseInt(D-1)].DTotal)+parseInt(A.HPrice);var E=B.travelElem.find(".tourContainer:eq("+parseInt(D-1)+") .insetContainer:eq(1) .fPrice").text();if(E=="")E=0;B.travelElem.find(".tourContainer:eq("+parseInt(D-1)+") .insetContainer:eq(1)").html(C);B.tabDays.find("a:eq("+parseInt(D-1)+")").trigger("click");$("#hotel"+A.HotelID+" .aDeleteHotel").click(function(){B.delHotel(this)});$("#tourConst").text(parseInt($("#tourConst").text())+parseInt(A.HPrice)-parseInt(E))})},delSight:function(E){var D=this,F=$(E).attr("rel");F=F.split("|");var G=F[0],C=parseInt(F[1]),B="tourContainer"+C.toString(),A=$("div.tourContainer").index($("#"+B));if(tripData.length==1&&tripData[A].Sight.length==1){alert("\u884c\u7a0b\u6e38\u73a9\u666f\u533a\u4e0d\u80fd\u4e3a\u7a7a\uff01\uff09\uff1a");return false}$("#"+G).fadeOut(500,function(){D.isEdit=true;var C=G.replace("sight",""),E=0,F=parseInt($("#tourConst").text());$.each(tripData[A].Sight,function(B,D){if(D.SID==parseInt(C)){E=tripData[A].Sight[B].Ticket;tripData[A].Sight.splice(B,1);$("#sightAllInfo").text($("#sightAllInfo").text().replace(D.SName,""));return false}});if((tripData[A].Sight==""||tripData[A].Sight.length==undefined)&&tripData[A].Hotel==""){tripData.splice(A,1);D.cirHotel.splice(A,1);D.cirSight.splice(A,1);$.each(D.travelElem.find(".tourContainer:gt("+A+") .tourTip .emDayNum"),function(A,B){var C=parseInt($(B).attr("title"));C=parseInt(C-1);$(B).attr("title",C);$(B).text("\u7b2c"+C+"\u5929")});$("#"+B).remove();D.reloadTab(A)}else tripData[A].DTotal=parseInt(tripData[A].DTotal)-parseInt(E);$("#tourConst").text(F-parseInt(E));$(this).remove()})},delHotel:function(F){var E=this,G=$(F).attr("rel");G=G.split("|");var H=G[0],D=parseInt(G[1]),C="tourContainer"+D.toString(),B=$("div.tourContainer").index($("#"+C)),A=tripData;$("#"+H).fadeOut(500,function(){E.isEdit=true;var A=H.replace("hotel",""),F=parseInt(tripData[B].Hotel.HPrice),D=parseInt($("#tourConst").text())-parseInt(F);tripData[B].Hotel="";if(tripData[B].Sight==""&&tripData[B].Hotel==""){tripData.splice(B,1);E.cirHotel.splice(B,1);E.cirSight.splice(B,1);$.each(E.travelElem.find(".tourContainer:gt("+B+") .tourTip .emDayNum"),function(A,B){var C=parseInt($(B).attr("title"));C=parseInt(C-1);$(B).attr("title",C);$(B).text("\u7b2c"+C+"\u5929")});$("#"+C).remove();E.reloadTab(B)}else tripData[B].DTotal=parseInt(tripData[B].DTotal)-F;$(this).parent().html("\u8bf7\u6839\u636e\u9700\u8981\u4ece\u5468\u8fb9\u9152\u5e97\u9009\u62e9\u60a8\u6ee1\u610f\u7684\u9152\u5e97\uff01<br><br>");$("#tourConst").text(D)})},reloadTab:function(C){var B=this;$.each(B.tabDays.find("a:gt("+C+")"),function(A,B){var C=parseInt($(B).attr("rel"));$(B).text("\u7b2c"+parseInt(C-1)+"\u5929")});B.tabDays.find("a:eq("+C+")").remove();var A=B.tabDays.find("a");A.unbind("click");$.each(A,function(A,C){$(C).click(function(){B.tabClick(this,A)})});B.tabDays.find("a").eq(0).trigger("click")},save:function(A){if(this.isEdit){if(iPowDraw==null)iPowDraw=new DrawTravel(null);iPowDraw.save(A,"edit")}else alert("\u8bf7\u5148\u4fee\u6539\u7ebf\u8def\u518d\u4fdd\u5b58:)")},savesuccess:function(B){if(B.Type=="OK"){var A=this;$("#TB_Windows").animate({top:136},100).animate({opacity:"toggle"},1000,function(){tripData=[];$("#TB_Windows").hide();window.location.href="http://www.ipow.cn"+B.Path})}},transpond:function(C){var D=document.location,A=document.title,B="<div class=\"TB_Form\"><span><label>\u540d\u3000\u79f0\uff1a</label><input id=\"EmailTitle\" value=\""+A+"\" type=\"text\" class=\"txtInput\"/><em>*</em></span>";B+="<span><label>\u90ae\u3000\u7bb1\uff1a</label><input id=\"Email\" type=\"text\" class=\"txtInput\"/><em>*</em></span>";B+="<span><label>&nbsp;</label><a href=\"javascript:;\" class=\"btnSubmit\" id=\"btnSubmit\"></a></span></div>";$(C).TBwin({width:350,height:140,title:"\u4fe1\u606f\u8f6c\u53d1",datahtml:B,datatype:"html",isBG:false,callback:function(){$("#btnSubmit").click(function(){var A=$("#Email").val();if(A==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u90ae\u7bb1:)");$("#Email").focus();return false}})}})},doprint:function(B){var A="",D=0,C=0;$.each(tripData,function(B,E){A+="<div class=\"printContent\">";A+="\t<div class=\"printContentL\"><span>\u7b2c"+E.DayID+"\u5929</span></div>";A+="\t<div class=\"printContentR\">";A+="\t\t<div class=\"printRTitle\"><h2>\u6e38\u73a9\u666f\u70b9\uff1a</h2></div>";$.each(E.Sight,function(B,C){A+="\t\t<div class=\"printInfos\">\t\t\t\t\t<span class=\"number\">"+parseInt(B+1)+"</span>\t\t\t\t\t<span class=\"sight\">\t\t\t\t\t\t<h3>"+C.SName+"</h3><em>\uffe5"+C.Ticket+"</em>\t\t\t\t\t\t<h4>"+C.Address+"</h4>\t\t\t\t\t</span>\t\t\t\t</div>"});A+="\t\t<div class=\"printRTitle\"><h2>\u4f4f\u5bbf\u9152\u5e97\uff1a</h2></div>";if(E.Hotel!="")A+="\t<div class=\"printInfos\">\t\t\t\t\t\t\t\t\t<span class=\"hotel\">\t\t\t\t\t\t\t\t\t\t<h3>"+E.Hotel.HName+"</h3><em>\uffe5"+E.Hotel.HPrice+"</em>\t\t\t\t\t\t\t\t\t\t<h4>"+E.Hotel.Address+"</h4>\t\t\t\t\t\t\t\t\t</span>\t\t\t\t\t\t\t\t</div>";A+="\t</div>";A+="\t<div class=\"clear\"></div>";A+="\t</div>";D=E.TName;C+=parseInt(E.DTotal)});A+="\t<div style=\"float:left;width:100%; height:30px; text-align:center;\"><a href=\"javascript:;\" onclick=\"window.print();\">\u6253\u5370</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:;\" onclick=\"window.close();\">\u5173\u95ed</a></div>";A="<div class=\"printTitle\">    \t\t\t<h1>"+$("#TourTitle").text()+"</h1>        \t\t<em></em>        \t\t<span class=\"daynum\">"+tripData.length+"\u65e5\u6e38</span>        \t\t<em></em>        \t\t<span class=\"cost\">\u603b\u8d39\u7528\uff1a<b>\uffe5"+C+"</b></span>    \t\t</div>"+A;document.domain="ipow.cn";var E=window.open("","newwin","height=540, width=880,toolbar=no,scrollbars=yes,menubar=no");E.document.write("<title>"+$("#TourTitle").text()+"\u6253\u5370</title>");E.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");E.document.write("<link type=\"text/css\" rel=\"stylesheet\" href=\"/style/tour.css\" />");E.document.write("<style type=\"text/css\">body{margin:0px;padding:0px;overflow-x:hidden}</style>");E.document.write("<body>");E.document.write(A);E.document.write("</body>");E.document.write("</HTML>");E.document.close();return false},paging:function(J,H,E,K,G,C){var A=this,B="",D=[];$("#CirInfoPage").html("").hide();if(G=="")$("#cirInfoList").html("<li>\u6682\u65e0\u5468\u8fb9\u4fe1\u606f\uff01</li>");else if(G[parseInt(J)]=="")$("#cirInfoList").html("<li>\u6682\u65e0\u5468\u8fb9\u4fe1\u606f\uff01</li>");else{var F=endindex=0,I=G[parseInt(J)].length,L=Math.ceil(I/H);if(L>=E){switch(E){case 1:$("#CirInfoPage").html("<a href=\"javascript:;\" id=\"nextHotelPage\">\u4e0b\u4e00\u9875</a>");$("#nextHotelPage").click(function(){A.paging(J,H,parseInt(E+1),K,G,C)});break;case L:$("#CirInfoPage").html("<a href=\"javascript:;\" id=\"prevHotelPage\">\u4e0a\u4e00\u9875</a>");$("#prevHotelPage").click(function(){A.paging(J,H,parseInt(E-1),K,G,C)});break;default:$("#CirInfoPage").html("<a href=\"javascript:;\" id=\"nextHotelPage\">\u4e0b\u4e00\u9875</a><a href=\"javascript:;\" id=\"prevHotelPage\">\u4e0a\u4e00\u9875</a>");$("#nextHotelPage").click(function(){A.paging(J,H,parseInt(E+1),K,G,C)});$("#prevHotelPage").click(function(){A.paging(J,H,parseInt(E-1),K,G,C)});break}F=(E-1)*H;endindex=E*H;if(endindex>I)endindex=I;$("#cirInfoList").html("");$.each(G[parseInt(J)].slice(F,endindex),function(A,F){var E={};switch(C){case"Sight":B+="<li id=\"hCirSight"+A+"\"><a href=\""+F.Url+"\" rel=\"sight\" title=\""+F.Name+"\"><img src=\"/images/icon/htop"+parseInt(A+1)+".jpg\" align=\"absmiddle\" border=\"0\"/><span class=\"title\">"+F.Name+"</span><em>\uffe5"+F.Price+"</em></a><span class=\"tourAddInfo\" rel=\""+F.SightID+"|sight\"></span></li>";E={Name:F.Name,Url:F.Url,Type:C,Latitude:F.Latitude,Longitude:F.Longitude,Price:F.Price,ImageSrc:F.ImageSrc,Address:F.Address,CommCount:F.CommCount,PicCount:F.PicCount,SightType:F.SightType,DomID:"hCirSight"+A+"",OrderID:parseInt(A+1)};break;case"Hotel":B+="<li id=\"hCirHotel"+A+"\"><a href=\""+F.Url+"\" rel=\"hotel\" title=\""+F.Name+"\"><img src=\"/images/icon/htop"+parseInt(A+1)+".jpg\" align=\"absmiddle\" border=\"0\"/><span class=\"title\">"+F.Name+"</span><em>\uffe5"+F.Price+"</em></a><span class=\"tourAddInfo\" rel=\""+F.HotelID+"|hotel\"></span></li>";E={Name:F.Name,Url:F.Url,Type:C,Latitude:F.Latitude,Longitude:F.Longitude,Price:F.Price,ImageSrc:F.ImageSrc,Address:F.Address,CommCount:F.CommCount,PicCount:F.PicCount,HotelType:F.HotelType,DomID:"hCirHotel"+A+"",OrderID:parseInt(A+1),markerPic:""};break;case"Repast":B+="";break;default:break}D.push(E)});$("#cirInfoList").html(B);$("#CirInfoPage").show();$("#cirInfoList .tourAddInfo").unbind("click");$("#cirInfoList .tourAddInfo").click(function(){var B=$(this).attr("rel").split("|"),C=B[0],A=B[1];switch(A){case"sight":jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/SightHandler.ashx?Type=GetSight&SightID="+C+"&CallBack=iPowEdit.addSight&temp="+Math.random());break;case"hotel":jQuery.getScript(iPowApi+"IpowAPI/Hotel/Requset/HotelHandler.ashx?Type=GetHotel&HotelID="+C+"&CallBack=iPowEdit.addHotel&temp="+Math.random());break;default:break}});D=D.concat(K);mapinitialize(D,"gMap","jxMapTipPanel",false)}}}};jQuery.fn.doGallery=function(A){A=jQuery.extend({itemsPerPage:2,animationSpeed:"normal"},A);return this.each(function(){var G=1,B=0,C=false,H=$(this),I=function(B){G--;if(C||$(B).hasClass("disabled"))return;C=true;H.find("a:gt("+(G*A.itemsPerPage-A.itemsPerPage-1)+")").each(function(A){jQuery(this).show();C=false});F()},E=function(B){if(C||$(B).hasClass("disabled"))return;C=true;H.find("a:lt("+(G*A.itemsPerPage)+")").each(function(A){jQuery(this).hide();C=false});G++;F()},D=function(){jQuery("#aPrev").bind("click",function(){I(this);return false});jQuery("#aNext").bind("click",function(){E(this);return false})},F=function(){if(B==1){jQuery("#aPrev").hide();jQuery("#aNext").hide()}else if(G==1){jQuery("#aPrev").hide();jQuery("#aNext").show()}else if(G==B){jQuery("#aPrev").show();jQuery("#aNext").hide()}else if(G<B){jQuery("#aPrev").show();jQuery("#aNext").show()}};if(jQuery(this).find("a").size()>=A.itemsPerPage){B=Math.ceil(jQuery(this).find("a").size()/A.itemsPerPage);D();F(this);G=1}})};jQuery.fn.doTab=function(A){A=jQuery.extend({itemsPerPage:5,tabContent:"",fun:""},A);return this.each(function(){var E=1,B=0,C=false,F=$(this),D=function(B){$("#"+A.tabContent).find("a").hide();$("#"+A.tabContent).contents().not("[rel!="+B+"]").show()};F.find("a").click(function(A){F.find("li").removeClass();$("#"+this.id).parent().addClass("current");D(this.rel)})})};jQuery.fn.TBwin=function(A){A=jQuery.extend({width:600,height:450,title:"",datahtml:"",datatype:"",isBG:true,url:"",callback:null},A);return this.each(function(){var G=$(this),C,H=function(G){if(A.isBG){var B="<div id=\"TB_WinBg\"></div>";C=getAllPosition(G);$("#TB_WinBg").remove();$("body").append(B);var E=document.body.scrollHeight>document.body.offsetHeight?document.body.scrollHeight:document.body.offsetHeight;if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden")}else $("#TB_WinBg").css("height",""+E+"px")}$("#TB_Windows").remove();D(G);$(window).scroll(function(){if($("#TB_Windows").is(":visible"))F(G)})},D=function(J){var B="<div id=\"TB_Windows\"><div id=\"TB_WinTitle\"><h3 class=\"title\">"+A.title+"</h3><a href=\"javascript:;\" id=\"TB_Close\" title=\"\u5173\u95ed\" class=\"close\"></a></div><div id=\"TB_WinContent\"></div></div>";$("body").append(B);var G="TB_Windows";$("#TB_Windows").css({"width":A.width,"height":A.height});$("#TB_WinContent").css({"height":A.height-40});C=getAllPosition(J);var D=parseInt(C.scrTop),I=parseInt(parseInt(C.offWidth-A.width)/2),H=A.height;$("#"+G).css({"left":I,"top":-H});var F=parseInt((C.offHeight-A.height)/2)+parseInt(C.scrTop);$("#"+G).animate({opacity:"show",top:F+50},100).animate({top:F},400,function(){switch(A.datatype){case"html":$("#TB_WinContent").html(A.datahtml);break;default:break}$("#TB_Windows #TB_Close").bind("click",function(){E()});if(jQuery.isFunction(A.callback))A.callback.call(this)})},E=function(){$("#TB_Windows").animate({top:150},100).animate({opacity:"toggle"},1000,function(){$("#TB_WinBg").remove();$("#TB_Windows").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","")}$(window).unbind("scroll");$(window).unbind("resize")})},B=function(F){var D=getAllPosition(F),B=parseInt(D.scrTop),E=parseInt(parseInt(D.offWidth-A.width)/2),C=parseInt((D.offHeight-A.height)/2)+parseInt(D.scrTop);$("#TB_Windows").css({"left":E,"top":C})},F=function(E){var D=getAllPosition(E),B=parseInt(D.scrTop),C=parseInt((D.offHeight-A.height)/2)+parseInt(D.scrTop);$("#TB_Windows").css({"top":C})};H(this)})};function getAllPosition(D){var A=[],E=$(D).offset();A.offLeft=E.left;A.offTop=E.top;A.offWidth=document.documentElement.clientWidth;A.offHeight=document.documentElement.clientHeight;var C,B,F;if(typeof window.pageYOffset!="undefined"){C=window.pageYOffset;B=0}else if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat"){C=document.documentElement.scrollTop;B=document.documentElement.scrollLeft}else if(typeof document.body!="undefined"){C=document.body.scrollTop;B=document.body.scrollLeft}if(A.offWidth>1003)F=parseFloat(A.offWidth-1003)/2;else F=0;A.scrTop=C;A.scrLeft=B;A.offsetLeft=F;return A}function getCookie(C){var E="",A=document.cookie;if(A!=""){var B=A.split("; ");for(var F=0;F<B.length;F++){var D=B[F].split("=");if(C==D[0]){E=D[1];break}}}if(E!="undefined")return E;else return""}var listMap=this.listMap=new function(){this.listMapData=[];this.tempMapData=[];this.showMapData=[];this.filters={Const:[],DayNum:[],Live:[]};this.orders={};this.init=function(A,B){this.listMapData=A;this.tempMapData=A;this.filters=B;this.filterManage()};this.filterPriceFace=function(B,F,A){var D=1,G=[],E=this.tempMapData;for(var H=0;H<E.length;H++){var C=parseInt(E[H][""+B+""]);if(A=="max"){if(C>=parseInt(F))G.push(E[H])}else if(C>=parseInt(F)&&C<=parseInt(A))G.push(E[H])}this.showMapData=this.showMapData.concat(G);iPowDraw.sPage(this.showMapData,1)};this.orderFace=function(B,C){C=parseInt(C);var A=this.showMapData,F;switch(C){case 0:for(var G=0;G<A.length;G++){F=false;for(var E=A.length-2;E>=G;E--)if((parseInt(A[E+1][""+B+""]))<parseInt(A[E][""+B+""])){var D=A[E+1];A[E+1]=A[E];A[E]=D;F=true}if(!F)break}break;case 1:for(G=0;G<A.length;G++){F=false;for(E=A.length-2;E>=G;E--)if(parseInt(A[E+1][""+B+""])>parseInt(A[E][""+B+""])){D=A[E+1];A[E+1]=A[E];A[E]=D;F=true}if(!F)break}break;default:break}this.showResult(A)};this.trackFilter=function(D,B){var A;switch(D){case"Const":case"DayNum":if($(B).attr("checked")){A=$(B).val().split("-");this.filters[""+D+""].push(A)}else{A=$(B).val().split("-");var C;$.each(this.filters[""+D+""],function(B,D){if(D.sort().toString()==A.sort().toString()){C=B;return false}});this.filters[""+D+""].splice(C,1)}break;default:break}this.filterManage()};this.trackOrder=function(B){if($(B).attr("checked")){var A=$(B).val().split(",");this.orderFace(A[0],A[1])}};this.filterManage=function(){var A=this;if(this.filters.Const!="")$.map(this.filters.Const,function(B){A.filterPriceFace("Const",B[0],B[1])});else this.showMapData=this.tempMapData;if(this.filters.DayNum!=""){if(this.filters.Const!=""||this.filters.Live!=""){this.tempMapData=this.showMapData;this.showMapData=[]}else this.showMapData=[];$.map(this.filters.DayNum,function(B){A.filterPriceFace("DayNum",B[0],B[1])})}};this.showResult=function(B){$("#sTripCount").html(this.showMapData.length);if(this.showMapData.length==0){var A=$("#fKeyword").text();$("#ResultList").html("<p>\u6682\u65e0\u6ee1\u8db3\u6761\u4ef6\u7684\u7ebf\u8def<br>\u8bf7\u4fee\u6539\u60a8\u7684\u641c\u7d22\u6761\u4ef6\u6216\u8005<a href=\"http://jq.ipow.cn/search/?q="+encodeURIComponent(A)+"\" target=\"_blank\">\u5236\u5b9a\u7ebf\u8def</a></p>")}else iPowDraw.sPage(B,1)}};function checkNumber(B){var D=window.event?B.keyCode:B.which,C=String.fromCharCode(D);reg=/\d/;var A=reg.test(C);if(!A){alert("\u53ea\u80fd\u8f93\u5165\u6570\u5b57:)");return false}else return true}function isEmail(A){var B=/^[a-zA-Z0-9_\-]{1,}@[a-zA-Z0-9_\-]{1,}\.[a-zA-Z0-9_\-.]{1,}$/;if(!B.exec(A))return false;return true}