|
|
|
|
$(function(){
|
|
|
|
|
thisURL = document.URL;
|
|
|
|
|
var mainMenu=$("#mainMenu li");
|
|
|
|
|
var subNav=$("#subMenu ul");
|
|
|
|
|
var subNum=subNav.length;
|
|
|
|
|
$.get("/siteMenu.asp",function(data){
|
|
|
|
|
var allSubNav=data.split("{links}");
|
|
|
|
|
var allNum=allSubNav.length-2;
|
|
|
|
|
if(thisURL.split("/")[3]=="community"){allNum=allNum+1;}
|
|
|
|
|
var thisNav=-1;
|
|
|
|
|
$(mainMenu).each(function(q){
|
|
|
|
|
if($(this).hasClass("active")){
|
|
|
|
|
thisNav=q;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if(thisNav==-1 && thisURL.split("/")[3]!="community" && thisURL.split("/")[3]!="faq" && thisURL.split("/")[3]!="travel-story" && thisURL.split("/")[3]!="feedback"){allSubNav.splice(0,1);}
|
|
|
|
|
for(var i=0;i<allNum;i++){
|
|
|
|
|
if(i==thisNav){
|
|
|
|
|
allSubNav.splice(i,1);
|
|
|
|
|
}
|
|
|
|
|
subNav.eq(i+1).html(allSubNav[i]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(typeof $=="function")
|
|
|
|
|
{$(function(){var dm=document.URL.split('/',3)[2],empcur=getCookie('Cht_Currencies',dm),curnum=-1,tcur=$("#Top_Currencies"),calist=$("#Tbody_Currencies a");if(typeof empcur=="string")
|
|
|
|
|
{curnum=parseInt(empcur);}
|
|
|
|
|
calist.each(function(i){var te=$(this);te.click(function(){tcur.attr("title",te.attr("title")).html(te.html());setCookie('Cht_Currencies',i,30,dm);});if(i==curnum)
|
|
|
|
|
{tcur.attr("title",te.attr("title")).html(te.html());}});menunHover();});}
|
|
|
|
|
function setCookie(c_name,value,expiredays,domian,pth)
|
|
|
|
|
{var exdate=new Date(),ckstr;exdate.setDate(exdate.getDate()+expiredays)
|
|
|
|
|
ckstr=c_name+"="+escape(value)+";";if(typeof expiredays!="undefined")ckstr+="expires="+exdate.toGMTString()+";";if(typeof domian=="string")ckstr+="domain="+domian+";";if(typeof pth=="string")
|
|
|
|
|
{ckstr+="patch="+pth+";";}
|
|
|
|
|
else
|
|
|
|
|
{ckstr+="patch=//;";}
|
|
|
|
|
document.cookie=ckstr;}
|
|
|
|
|
function getCookie(c_name,domian)
|
|
|
|
|
{var tcookie=document.cookie,reg="/"+c_name+"=(\\d+)/";if(tcookie.length<1)return false;result=tcookie.match(eval(reg));if(result)
|
|
|
|
|
{if(result.length>1)
|
|
|
|
|
{return unescape(result[1]);}}
|
|
|
|
|
return false;}
|
|
|
|
|
function menunHover(){var subMenuEList=$("#subMenu ul"),hi=0,mli=$("#mainMenu li"),hl=mli.filter(".active").length,timehide,communityinfodiv=$("#menu_customerCenterInfo");if(subMenuEList.length>1)
|
|
|
|
|
{if(hl>0)
|
|
|
|
|
{mli.each(function(i){var te=$(this),tecss=te.attr("class");if(tecss=="active")
|
|
|
|
|
{te.hover(function(){if(timehide)clearTimeout(timehide);subMenuEList.hide();resetMenu();});hi=i;}
|
|
|
|
|
else
|
|
|
|
|
{if(hi==0)
|
|
|
|
|
{if(i==mli.length-1)
|
|
|
|
|
{te.hover(function(){if(timehide)clearTimeout(timehide);subMenuEList.hide();subMenuEList.eq(i+1).show();addActiveCss(i);communityinfodiv.show();},function(){var mi=i+1;timehide=setTimeout(function(){subMenuEList.eq(mi).hide();communityinfodiv.hide();resetMenu();},100);});}
|
|
|
|
|
else
|
|
|
|
|
{te.hover(function(){if(timehide)clearTimeout(timehide);subMenuEList.hide();subMenuEList.eq(i+1).show();addActiveCss(i);communityinfodiv.hide();},function(){var mi=i+1;timehide=setTimeout(function(){subMenuEList.eq(mi).hide();resetMenu();},100);});}}
|
|
|
|
|
else
|
|
|
|
|
{if(i==mli.length-1)
|
|
|
|
|
{te.hover(function(){if(timehide)clearTimeout(timehide);subMenuEList.hide();subMenuEList.eq(i).show();addActiveCss(i);communityinfodiv.show()},function(){var mi=i;timehide=setTimeout(function(){subMenuEList.eq(mi).hide();communityinfodiv.hide();resetMenu();},100);});}
|
|
|
|
|
else
|
|
|
|
|
{te.hover(function(){if(timehide)clearTimeout(timehide);subMenuEList.hide();subMenuEList.eq(i).show();addActiveCss(i);communityinfodiv.hide();},function(){var mi=i;timehide=setTimeout(function(){subMenuEList.eq(mi).hide();resetMenu();},100);});}}}});}
|
|
|
|
|
else
|
|
|
|
|
{if(subMenuEList.eq(0).text().indexOf("About Us")>=0)
|
|
|
|
|
{mli.each(function(i){if(i==mli.length-1)
|
|
|
|
|
{$(this).hover(function(){if(timehide)clearTimeout(timehide);subMenuEList.hide();subMenuEList.eq(i).show();addActiveCss(i);communityinfodiv.show();},function(){var mi=i;timehide=setTimeout(function(){subMenuEList.eq(mi).hide();communityinfodiv.hide();resetMenu();},100);});}
|
|
|
|
|
else
|
|
|
|
|
{$(this).hover(function(){if(timehide)clearTimeout(timehide);subMenuEList.hide();subMenuEList.eq(i).show();addActiveCss(i);communityinfodiv.hide();},function(){var mi=i;timehide=setTimeout(function(){subMenuEList.eq(mi).hide();resetMenu();},100);});}});}
|
|
|
|
|
else
|
|
|
|
|
{mli.each(function(i){if(i<subMenuEList.length-1)
|
|
|
|
|
{if(i==mli.length-1)
|
|
|
|
|
{$(this).hover(function(){if(timehide)clearTimeout(timehide);subMenuEList.hide();subMenuEList.eq(i+1).show();addActiveCss(i);communityinfodiv.show();},function(){var mi=i+1;timehide=setTimeout(function(){subMenuEList.eq(mi).hide();resetMenu();},100);});}
|
|
|
|
|
else
|
|
|
|
|
{$(this).hover(function(){if(timehide)clearTimeout(timehide);subMenuEList.hide();subMenuEList.eq(i+1).show();addActiveCss(i);communityinfodiv.hide();},function(){var mi=i+1;timehide=setTimeout(function(){subMenuEList.eq(mi).hide();resetMenu();},100);});}}});}}
|
|
|
|
|
subMenuEList.each(function(yi){$(this).hover(function(){if(timehide)clearTimeout(timehide);$(this).show();},function(){timehide=setTimeout(function(){subMenuEList.eq(yi).hide();resetMenu();},1000);});});function resetMenu()
|
|
|
|
|
{subMenuEList.eq(0).show();mli.removeClass("active");if(hi>0)
|
|
|
|
|
{mli.eq(hi).addClass("active");}
|
|
|
|
|
communityinfodiv.hide();}
|
|
|
|
|
function addActiveCss(lindex)
|
|
|
|
|
{mli.removeClass("active");if(lindex>0&&lindex<mli.length-1)
|
|
|
|
|
{mli.eq(lindex).addClass("active");}}}
|
|
|
|
|
communityinfodiv.hover(function(){if(timehide)clearTimeout(timehide);},function(){var te=$(this);timehide=setTimeout(function(){te.hide();},100);});}
|