var winW=0;var winH=0;var pageW=0;var pageH=0;var popupW=0;var popupH=0;var popupMoving;var popupTask='';var isDoTask=false;var closeTask='';var isDoCloseTask=false;var isIe6=false;function setWinPageWH(){winW=$j(window).width();winH=$j(window).height();pageW=$j(document).width();pageH=$j(document).height();if(isIE8()){pageW=pageW-scrollbarWidth()-4;}
if(isIE6()){pageH=parseInt($('body11').scrollHeight);isIe6=true;var rs=document.getElementsByTagName('html');rs[0].style.overflowY='auto';rs[0].style.overflowX='hidden';}
if(!pageW||!winW){pageW=1000;winW=1000;}
if(!pageH||!winH){pageH=500;winH=500;}}
function f_scrollLeft(){return f_filterResults(window.pageXOffset?parseInt(window.pageXOffset):0,document.documentElement?parseInt(document.documentElement.scrollLeft):0,document.body?parseInt(document.body.scrollLeft):0);}
function f_scrollTop(){var bodyScrollTop=parseInt($('body11').scrollTop);var scrollTop=document.documentElement?parseInt(document.documentElement.scrollTop):0;var scrollTopValue=0;if(bodyScrollTop>scrollTop){scrollTopValue=15;}else{scrollTopValue=scrollTop;}
return f_filterResults(window.pageYOffset?parseInt(window.pageYOffset):0,document.documentElement?parseInt(document.documentElement.scrollTop):0,document.body?parseInt(document.body.scrollTop):0);}
function f_filterResults(n_win,n_docel,n_body){var n_result=n_win?n_win:0;if(n_docel&&(!n_result||(n_result>n_docel)))
n_result=n_docel;return n_body&&(!n_result||(n_result>n_body))?n_body:n_result;}
function displaySelects(visibility){var selects=document.getElementsByTagName('select');for(i=0;i<selects.length;i++){selects[i].style.visibility=visibility;}}
function displayFacebookBtn(visibility){if($('facebookBtnDiv')){$('facebookBtnDiv').style.visibility=visibility;}}
function displayObjects(visibility){var objects=document.getElementsByTagName('object');for(i=0;i<objects.length;i++){objects[i].style.visibility=visibility;}}
function showCurtain(mode){displaySelects('hidden');displayObjects('hidden');displayFacebookBtn('hidden');setWinPageWH();if(mode&&mode==1){var curtain=$('editBg');}else{var curtain=$('curtain');}
if(pageW>winW){curtain.style.width=pageW+'px';}else{curtain.style.width=winW+'px';}
if(pageH>winH){curtain.style.height=pageH+'px';}else{curtain.style.height=winH+'px';}
curtain.style.display='';}
function closeCurtain(mode){if(isIe6==true){var rs=document.getElementsByTagName('html');rs[0].style.overflow='hidden';}
displaySelects('visible');displayObjects('visible');displayFacebookBtn('visible');if(mode&&mode==1){var curtain=$('editBg');}else{var curtain=$('curtain');}
curtain.style.display='none';curtain.style.width='10px';curtain.style.height='10px';}
function switchCurtain(mode){if(mode&&mode==1){var curtain=$('editBg');}else{var curtain=$('curtain');}
if(curtain.style.display=='none'){showCurtain(mode);}else{closeCurtain(mode);}}
function setPopupW(width){popupW=width;$('popup').style.width=width+'px';}
function setPopupH(height){popupH=height;}
function movePopup(){var pLeft=parseInt(f_scrollLeft()+(winW/2)-(popupW/2));var pTop=parseInt(f_scrollTop()+(winH/2)-(popupH/2));if(!pLeft||pLeft<5){pLeft=5;}
if(!pTop||pTop<5){pTop=5;}
var popup=$('popup');popup.style.left=parseInt(pLeft)+'px';popup.style.top=parseInt(pTop)+'px';}
function setPopupTask(task){popupTask=task;isDoTask=true;}
function confirmOk(){isDoTask=true;closePopup();}
function showPopup(url,width,height){showCurtain();if(url){loadDivContent(url,'popupContainer');}else{width=300;height=150;$('popupContainer').innerHTML=loadingStr;}
if(width&&height){setPopupW(width);setPopupH(height);}else{setPopupW(350);setPopupH(150);}
movePopup();$('popup').style.display='';}
function closePopup(){$('popup').style.display='none';$('popupContainer').innerHTML='';closeCurtain();if(isDoTask&&popupTask.length>0){isDoTask=false;eval(popupTask);}else if(isDoCloseTask&&closeTask.length>0){isDoCloseTask=false;eval(closeTask);}
popupTask='';closeTask='';}
function popupInfo(task,key,width,height,arg0){if(task&&task.length>0){popupTask=task;isDoTask=true;}
var param='?class=info&key='+key;if(arg0){param+='&arg0='+arg0;}
if(width&&height){showPopup('/alert.jsp'+param,width,height);}else{showPopup('/alert.jsp'+param);}}
function popupAlert(task,key,width,height,arg0){if(task&&task.length>0){popupTask=task;isDoTask=true;}
var param='?class=alert&key='+key;if(arg0){param+='&arg0='+arg0;}
if(width&&height){showPopup('/alert.jsp'+param,width,height);}else{showPopup('/alert.jsp'+param);}}
function popupAlertWithMsg(msg,width,height){var param='?class=alert&msg='+msg;if(width&&height){showPopup('/alert.jsp'+param,width,height);}else{showPopup('/alert.jsp'+param);}}
function popupAlertWithMsgCallback(msg,callbackUrl){var param='?class=alert&msg='+msg+'&callback='+callbackUrl;showPopup('/alert.jsp'+param);}
function popupHelp(task,key,width,height,arg0){if(task&&task.length>0){popupTask=task;isDoTask=true;}
var param='?class=help&key='+key;if(arg0){param+='&arg0='+arg0;}
if(width&&height){showPopup('/alert.jsp'+param,width,height);}else{showPopup('/alert.jsp'+param);}}
function popupConfirm(task,key,width,height,arg0,arg1,cTask){if(task&&task.length>0){popupTask=task;isDoTask=false;}
if(cTask&&cTask.length>0){closeTask=cTask;isDoCloseTask=true;}
var param='?class=confirm&key='+key;if(arg0){param+='&arg0='+arg0;}
if(arg1){param+='&arg1='+arg1;}
if(width&&height){showPopup('/alert.jsp'+param,width,height);}else{showPopup('/alert.jsp'+param);}}
function popupAffair(affairId,isInsert){if(isInsert){showPopup('/login/affair.do?affairId='+affairId+'&isInsert='+isInsert,500,400);}else{showPopup('/login/affair.do?affairId='+affairId,500,400);}}
function popupAssist(eventId){showPopup('/login/assist.do?eventId='+eventId,320,400);}
function popupBookingAlert(task,mode){if(task&&task.length>0){popupTask=task;isDoTask=true;}
if(mode==1){showPopup('/gogogo/bookingAlert.jsp?mode='+mode,600,500);}else{showPopup('/gogogo/bookingAlert.jsp?mode='+mode,600,550);}}
function popupStoreAlert(task,mode){if(task&&task.length>0){popupTask=task;isDoTask=true;}
if(mode==1){showPopup('/shop/store/storeAlert.jsp?mode='+mode,600,350);}}
function popupBookingInfo(task){if(task&&task.length>0){popupTask=task;isDoTask=true;}
showPopup('/bookingInfo.jsp',500,400);}
function popupContactUs(mode){showPopup('/tw/contactUs.jsp?mode='+mode,500,350);}
function popupListPlaces(placeId,type,typeId){showPopup('/listPlaces.jsp?placeId='+placeId+'&type='+type+'&typeId='+typeId,790,500);}
function popupForgetUser(){showPopup('/forgetUser.jsp',350,300);}
function popupInsertAffair(year,month,date){if(year&&month&&date){showPopup('/insertAffair.jsp?startDate='+year+'-'+(month<10?'0'+month:month)+'-'+(date<10?'0'+date:date),500,400);}else{showPopup('/insertAffair.jsp',500,400);}}
function popupInsertAlert(type,typeId,targetId){if(targetId){showPopup('/insertAlert.jsp?type='+type+'&typeId='+typeId+'&targetId='+targetId,500,350);}else{showPopup('/insertAlert.jsp?type='+type+'&typeId='+typeId+'&targetId=0',500,350);}}
function popupInsertCouponMobile(type,typeId,storeId,coupon){showPopup('/login/insertCouponMobilePage.do?type='+type+'&typeId='+typeId+'&storeId='+storeId+'&coupon='+coupon,480,200);}
function popupInsertEdit(editId,topicId,subject){showPopup('/insertEdit.jsp?editId='+editId+'&topicId='+topicId+'&subject='+encodeURIComponent(subject),600,400);}
function popupInsertEnrollAlert(mode,memberState){if(memberState){showPopup('/insertEnrollAlert.jsp?mode='+mode+'&memberState='+memberState,500,200);}else{showPopup('/insertEnrollAlert.jsp?mode='+mode,400,200);}}
function popupInsertInform(eventId){showPopup('/login/inform.do?eventId='+eventId,750,550);}
function popupInsertKick(userAccount,memberId){showPopup('/insertKick.jsp?userAccount='+userAccount+'&memberId='+memberId,570,300);}
function popupInsertRepair(){showPopup('/insertRepair.jsp',650,350);}
function popupInsertBookingRepair(){showPopup('/gogogo/insertBookingRepair.jsp',650,350);}
function popupInsertTopic(parentId){showPopup('/insertTopic.jsp?parentId='+parentId,450,350);}
function popupDelteTopic(topicId){showPopup('/forum/deleteTopic.jsp?topicId='+topicId,450,450);}
function popupMoveTopic(topicId,mode){showPopup('/forum/topic.do?method=listMoveTopic&topicId='+topicId+"&mode="+mode,450,450);}
function popupJoinedEventFriends(eventId){showPopup('/event/joinedEventFriends.jsp?eventId='+eventId,405,300);}
function popupLogin(){showPopup('/login.jsp',600,350);}
function popupPlace(){showPopup('/place.jsp',790,500);}
function popupPostPhoto(postContent,mode){showPopup('/postPhoto.jsp?postContent='+postContent+'&mode='+mode,480,300);}
function popupPostMovie(postContent){showPopup('/postMovie.jsp?postContent='+postContent,480,300);}
function popupPostIcon(postContent){showPopup('/postIcon.jsp?postContent='+postContent,480,400);}
function popupPostTable(postContent){showPopup('/postTable.jsp?postContent='+postContent,300,250);}
function popupPostLink(postContent){showPopup('/postLink.jsp?postContent='+postContent,480,250);}
function popupQualify(clubId){showPopup('/login/qualify.do?clubId='+clubId+'&mode=1',380,300);}
function popupEventReview(storeId,eventId){showPopup('/login/review.do?eventId='+eventId+'&storeId='+storeId,560,500);}
function popupDeliverReview(storeId,deliverId,eventId,free){var DELIVERSTATE_CONFIRM=2;if(free!=null&&free!=''){showPopup('/login/review.do?deliverId='+deliverId+'&storeId='+storeId+"&free=true",560,500);}else{if(eventId!=null&&eventId!=''){showPopup('/login/review.do?deliverId='+deliverId+'&storeId='+storeId
+'&eventId='+eventId,560,500);}else{showPopup('/login/review.do?deliverId='+deliverId+'&storeId='+storeId,560,500);}}}
function popupTransfer(type,typeId){showPopup('/login/transfer.do?storeId='+$('storeId').innerHTML+'&type='+type+'&typeId='+typeId+'&mode=1',650,450);}
function popupUpdateDeliver(){showPopup('/updateDeliver.jsp',600,350);}
function popupUpdateEnroll(enrollId,price){showPopup('/updateEnroll.jsp?enrollId='+enrollId+'&price='+price,550,400);}
function popupPayEnroll(eventId){showPopup('/login/payEnroll.do?eventId='+eventId,550,400);}
function popupPayDeliver(deliverId){showPopup('/login/payDeliver.do?deliverId='+deliverId,550,400);}
function popupUpdateInvolveFolderId(chatsSize,folderId,parentId){var url='/updateInvolveFolderId.jsp?chatsSize='+chatsSize;if(folderId){url+='&folderId='+folderId;}
if(parentId){url+='&parentId='+parentId;}
showPopup(url,330,400);}
function popupUpdateProfile(){showPopup('/updateProfile.jsp?mode=1',600,450);}
function popupUpdateArea(){showPopup('/updateArea.jsp',550,250);}
function popupInsertFavoriteArea(){showPopup('/event/insertFavoriteArea.jsp',550,250);}
function popupUpdateUserEmail(userAccount,userEmail){if(userEmail!=null&&userEmail.length>0){showPopup('/updateUserEmail.jsp?userAccount='+userAccount+'&userEmail='+userEmail,400,250);}else{showPopup('/updateUserEmail.jsp?userAccount='+userAccount,400,250);}}
function popupUserInfo(aUserAccount){showPopup('/userInfo.do?aUserAccount='+aUserAccount,560,550);}
function popupUserLock(){showPopup('/userLock.jsp',400,250);}
function popupUserStatus(){showPopup('/tw/userStatus.jsp',524,550);}
function popupAddProductToEnroll(storeId,eventId,mailUserId){showPopup('/listPopoutProducts.jsp?dispalyType=AddToEnroll&storeId='+storeId+'&eventId='+eventId+'&mailUserId='+mailUserId,745,550);}
function popupAddProductToDeliver(storeId,deliverId,forFree){if(forFree==''){showPopup('/listPopoutProducts.jsp?dispalyType=AddToDeliver&storeId='+storeId+'&deliverId='+deliverId,745,550);}else{showPopup('/listPopoutProducts.jsp?dispalyType=AddToDeliver&storeId='+storeId+'&deliverId='+deliverId+"&forFree=true",745,550);}}
function popupAddProductToFree(storeId){showPopup('/listPopoutProducts.jsp?dispalyType=AddToFree&storeId='+storeId,745,550);}
function popupAddProductToEventDeliver(storeId,eventId){showPopup('/listPopoutProducts.jsp?dispalyType=AddToEventDeliver&Deliver&storeId='+storeId+'&eventId='+eventId,745,550);}
function popupShowConvertWarn(level){if(level!=1){closeCartContent();}
showPopup('/showConvertWarn.jsp',600,300);}
function popupInsertMember(clubIds){showPopup('/insertMember.jsp?clubIds='+clubIds,500,400);}
