function isIE(){ return document.all?true:false } function editperson(){ $("#pf2").addClass("default-tab current"); $("#pf1").removeClass(); $("#persontab1").hide(); $("#persontab2").show(); } function displaypro(){ $("#pf2").removeClass(); $("#pf1").addClass("default-tab current"); $("#persontab1").show(); $("#persontab2").hide(); } function displayselect(o){ } //profile function onSel(o,p,pn){ $(".profliephoto li").removeClass(); $(o).addClass("active"); $("#profilephotoid").val(p); $("#profilephotoname").val(pn); } function saveSelProfilePhoto(){ _ppn = $("#profilephotoid").val(); _rtxt = $.ajax({async:false,type:"GET", url:"/community/profile/updateprofile.asp?action=upicon&ppn="+_ppn}).responseText; if (_rtxt.replace(/\s+/g,"").toLowerCase().substring(0,4)=="true"){ $("#customerpic").attr("src","/community/profile/profilephoto/"+$("#profilephotoname").val()); } generalDivWinClose(); } //remove user msg function removeMsg(_n){ _rtxt = $.ajax({async:false,type:"GET", url:"/community/include/delmessages.asp?m="+_n}).responseText; //alert(_rtxt); location.reload(); //$("#msg"+_n).hide(); // generalDivWinClose(); } function doWinLogin(_s){ _r = location.href; ShowIFrame('','/community/login-win.asp?r='+_r+'&s='+_s,630,350,'bottom'); } function Keydown(evt,me,pe,se) { var keycode = window.event ? evt.keyCode : evt.which; if(keycode==13)doLogin(me,pe,se); } function doLogin(formsign){ var ec,cc,me,pe,se;//rc, if(typeof formsign =="string") { me="loginmail"+formsign; pe="loginpass"+formsign; se="loginErrTips"+formsign; } else { me="loginmail"; pe="loginpass"; se="loginErrTips"; } ec = RegCkElement(me,"The email or password you've entered is incorrect.","/^(([\\u4E00-\\u9FA5]|[\\uFE30-\\uFEFF]|[\\d]|[a-zA-Z]|[\\_\\-\\.])+[\\@])(((([\\d]|[a-zA-Z]|[\\_\\-]|[\\[\\]\{\\}\>\\<])+[\\.])+)([\\d]|[a-zA-Z\\_\\-])+)$/","Email",se,false); if(!ec)return false; cc = StrIsNullOrEmpty(pe,"The email or password you've entered is incorrect.","",se,false); if(!cc)return false; webLoginAuth($("#"+me).val(),$("#"+pe).val(),$("input[name='s']").val(),se,$("#rememberme").attr("checked")) ; //showLoginErrMsg("Login,please wait.",se); } function doLoginHref(){ if (!doLogin()) return; } function doWinLoginHref(){ var ole,olp; ole = document.loginForm.loginmail.value; olp = document.loginForm.loginpass.value; if (ole == "" || olp == "" || ole.length<6) { showLoginErrMsg("The email or password you've entered is incorrect.","loginErrTips"); return false; } if (!webWinLoginAuth(ole,olp)){ showLoginErrMsg("The email or password you've entered is incorrect.","loginErrTips"); return false; } return true; } function getPass(){ } function webLoginAuth(le,lp,ls,se,rm){ $.post("/community/logincheck.asp", {loginmail:le,loginpass:lp,rememberme:rm},function(_sf){ if (_sf == "true"){ if (typeof ls =="string"){ location.href=ls; }else{ location.href="/community/customer-center/"; } //return true; }else{ showLoginErrMsg("The email or password you've entered is incorrect.",se); } }); } //comments login function basecommMain(_s){ parent.$("#personinfoComment").hide(); parent.$("#commentLogin").hide(); } //qa right login function qaRightBaseMain(le,lp){ parent.$("#personid").hide(); parent.$("#qaLogin").hide(); parent.$("#qabody").focus(); } //qa-list login function qawinreplyMain(_n){ nArray = _n.split("-"); nid = nArray[1]; parent.$("#replydivimg"+nid).hide(); parent.$("#div"+nid).slideDown(300); } //usercomments login function commmentMain(_e) { parent.$("#notologin").show(); parent.$("#nologin").remove(); parent.$("#Email").val(_e); parent.$("#NickName").val(_e).hide(); } function webWinLoginAuth(le,lp){ $.post("/community/logincheck.asp", {loginmail:le,loginpass:lp},function(_sf){ if (_sf == "true"){ sourcediv1 = sourcediv; if (sourcediv.indexOf("-")){ sourcediv1 = sourcediv.split("-")[0]; } switch (sourcediv1){ case "qarightbase": qaRightBaseMain(le,lp); break; case "qawinreply": qawinreplyMain(sourcediv); break; case "basecomm": basecommMain(sourcediv); break; case "comments": commmentMain(le); break; default: } try { parent.Check_Login(); //parent.$("#"+sourcediv).html(); } catch(err) { for (i=0;i\\<])+[\\.])+)([\\d]|[a-zA-Z\\_\\-])+)$/","","createAccountErrTips",false); if(!ec)return false; if (olp1 != olp2) { showLoginErrMsg("Your password confirmation does not match.","createAccountErrTips"); return false; } if (olp1.length<6) { showLoginErrMsg("Your Password must be more than 6 characters.","createAccountErrTips"); return false; } if(recommendEmail.length>0 && recommendEmail !="Did anyone refer you to us?"){ cc = RegCkElement("recommendEmail","The referrer's email you've entered is not valid. Please check format or change another email.","/^(([\\u4E00-\\u9FA5]|[\\uFE30-\\uFEFF]|[\\d]|[a-zA-Z]|[\\_\\-\\.])+[\\@])(((([\\d]|[a-zA-Z]|[\\_\\-]|[\\[\\]\{\\}\>\\<])+[\\.])+)([\\d]|[a-zA-Z\\_\\-])+)$/","","createAccountErrTips",false); if(!cc){return false} else{ if(recommendEmail.toLowerCase() == ole.toLowerCase()){showLoginErrMsg("You can't refer yourself.","createAccountErrTips");return false;} } } rtxt = $.ajax({async:false,type:"POST", url:"/community/save-create-account.asp",data: "cemail="+ole+"&cpass="+olp1+"&cname="+oln+"&vc="+vcode+"&recommendEmail="+recommendEmail}).responseText; if (rtxt.replace(/\s+/g,"").toLowerCase()=="true"){ loginFlag = true; location.href="/community/customer-center/"; } else if(rtxt.replace(/\s+/g,"").toLowerCase()=="000"){ showLoginErrMsg("Please enter the correct Verify Code","createAccountErrTips"); return false } else{ showLoginErrMsg("The email you've entered is not available.","createAccountErrTips"); return false; } } function webCreateAccount(_u,_p,_n){ return false; } function isLogin(){ var loginFlag; loginFlag = false; rtxt = $.ajax({async:false,type:"GET", url:"/community/islogin.asp?"+Math.random()}).responseText; if (rtxt.replace(/\s+/g,"").toLowerCase()=="true"){ loginFlag = true; } return loginFlag; } function qaReply(n){ if (!isLogin()){ $.facebox({ajax:"/community/usercp.asp?cp=sendfaq&SN="+n}); //doWinLogin("qawinreply-"+n); return; } $("#replydivimg"+n).hide(); $("#div"+n).slideDown(300); $("#reply"+n).focus(); } function qaSave(_o,n){ $("#replydivimg"+n).show(); //$("#div"+n).slideUp(300); writeQAtoA(_o,n); } function qaCancel(n){ $("#replydivimg"+n).show(); $("#div"+n).slideUp(300); } //save question //_n name //_e email //_mf mailflag //_wf isweb flag //_b question body function writeQAtoQ(_o,_n,_e,_mf,_wf,_b) { _title = document.title; _h1 = isIE()?document.getElementsByTagName("H1")[0].innerText:document.getElementsByTagName("H1")[0].textContent; _url = location.href.replace("http://",""); _url = _url.substring(_url.indexOf("/"),_url.length); if (!isLogin()){ if (_n==""){ alert("please input your name???"); return false; } if (_e==""){ alert("please input your email"); return false; } if (!isemail(_e)){ alert("Your Email address invalid!"); return false; } } _wf = _wf?0:1; _mf = _mf?1:0; var o = { name : _n, email: _e, mailflag: _mf, webflag: _wf, surl:_url, stitle:_title, body:_b }; oldsrc = _o.src; _o.disabled="disabled"; _o.src="/pic/loading.gif"; $.post("/community/include/saveQA.inc.asp?action=q",{qaname:o.name,qaemail:o.email,qamailflag:o.mailflag,qawebflag:o.webflag,qasourceurl:o.surl,qasourcetitle:o.stitle,qabody:o.body,h1:_h1},function(_sf){ if (parseInt(_sf)>0){ //alert("ok"); if (parseInt(_wf)!=1){ //location.href="/faq/"; location.href="/forms/thankyou-questions.asp"; }else{ location.href="/faq/question/"+parseInt(_sf)+"/"; } }else{ alert("The question must be more than 20 characters long"); _o.src = oldsrc; _o.disabled=""; } }); } //save question on div form function saveQAtoQonDiv(_n,_e,_mf,_wf,_b){ writeQAtoQ(_n,_e,_mf,_wf,_b); generalDivWinClose(); } //save answer function writeQAtoA(_o,o) { oldsrc = _o.src; _o.disabled="disabled"; _o.src="/pic/loading.gif"; a_body = document.getElementById("reply"+o).value; $.post("/community/include/saveQA.inc.asp?action=a", {qaqid:o,qaabody:a_body},function(_sf){ if (parseInt(_sf)>0){ location.href="/faq/question/"+o+"/"; }else{ alert("The answer must be more than 20 characters long"); _o.src = oldsrc; _o.disabled=""; } }); } function faqindexTab(_n){ $(".qaNav ul li").eq(1).removeClass(); $(".qaNav ul li").eq(2).removeClass(); $("#lastquestion").hide(); $("#Unanswered").hide(); if (_n==1){ $(".qaNav ul li").eq(1).addClass("active"); $("#lastquestion").show(); }else{ $(".qaNav ul li").eq(2).addClass("active"); $("#Unanswered").show(); } } //update newsletter select function updateNewsLetter(){ //alert($("#editNewsLetter_newslettertype").size()); var tmpt; tmpt = ""; for (i=0;i
"+_cname+"
on "+['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][dt.getMonth()]+"."+dt.getDate()+","+dt.getFullYear()+" said
"; tmpHtmlStr = tmpHtmlStr + "
"; tmpHtmlStr = tmpHtmlStr + _cmsg + "
"; tmpHtmlStr = tmpHtmlStr + "
" $(".commentList.roundCorner").append(tmpHtmlStr); commform.appendTo(".commentList.roundCorner"); $("#commentMsg").val(""); $("#CommCount").text(parseInt($("#CommCount").text())+1); }else{ alert("System error!"); } }); } //close win(div) function generalDivWinClose(){ $(document).trigger('close.facebox'); } function stroyBack(){ generalDivWinClose(); location.href="index.asp"; } //send messages function smtu(n){ if (!isLogin()){ alert("Please first login"); return false; } _divid = "sendmessages"; _msg = document.getElementById(_divid+ "_msg").value; if (_msg.length<10){ alert("please input Messages,the message must be more than 10 characters long."); return false; } if (_msg.length>500){ alert("The message must be less than 500 characters long."); return false; } // rt = $.get("/community/include/sendmessages.asp?u="+n+"&m="+_msg).responseText; rt = $.ajax({async:false,type:"GET", url:"/community/include/sendmessages.asp?u="+n+"&m="+_msg}).responseText; generalDivWinClose(); //alert(_msg); //alert(rt); //alert(n); } function hideNewsLetter(){ generalDivWinClose(); } //delete travel story function deleteTravelStory(n){ generalDivWinClose(); $.post("/community/travel-story/del-story.asp?sid="+n,function(_sf){ //alert(_sf); }); $("#trid"+n).fadeOut(300); } //delete travel notes function deleteTravelNotes(n){ generalDivWinClose(); $.post("/community/travel-story/save-story.asp?action=delcity&nid="+n,function(_sf){ //alert(_sf); }); $("#trid"+n).fadeOut(300); } //save story new Itinerary function saveStoryNewCity(_ac){ _divid = "newItinerary"; _cityname = document.getElementById(_divid+ "_newcityname").value; if (_cityname.length<2){ alert("please input city name"); return; } _tourdate = document.getElementById(_divid+ "_newtourdate").value; if (_tourdate.length<2){ alert("please input tour date"); return; } // _citynote = document.getElementById(_divid+ "_newnotesbody").value; // if (_citynote.length<100){ // alert("please input Trip Journal,the story must be more than 100 characters long."); // return ; // } _days = document.getElementById(_divid+ "_tourdays").value; _sid = document.getElementById("sid").value; $.post("/community/travel-story/save-story.asp?action="+_ac, {cityname:_cityname,tourdate:_tourdate,sid:_sid,days:_days},function(_sf){ if (parseInt(_sf)>0){ generalDivWinClose(); location.reload(); }else{ alert("The content cannot be null"); } }); } //add story submit Checkbox function storycheck(){ st = document.getElementById("storytitle").value; sb = document.getElementById("storybody").value; sb = CKEDITOR.instances.storybody.getData(); if (st=="" || st.length>60){ document.getElementById("stitleErrTips").style.display=''; $("#stitleErrTips").css("opacity","100"); $("#stitleErrTips").focus(); return false; } if (sb=="" || sb.length<100){ $("#storyBodyErrTips").show(); $("#storyBodyErrTips").css("opacity","100"); $("#storyBodyErrTips").focus(); return false; } if (document.addStory.tourdate.length == undefined){ if (document.addStory.city.value==""){ alert("please input cityname?"); return false; } if (document.addStory.tourdate.value==""){ alert("please input arrival date?"); return false; } }else{ for (n=0;nDelete This Place"; if (tabObj.rows.length % 2==0) isIE()?ggg.setAttribute("className","alt-row"):ggg.setAttribute("class","alt-row"); } function delPlace(o){ rn = document.getElementById("tr"+o).rowIndex; // alert(n.parentNode); tabObj = document.getElementById("placeTable"); tabObj.deleteRow(rn); for (u=1;u