ACMS.Dispatch.Linkmatchlocation._getHref=function(elm){if($(elm).is("a")){var href=elm.href}else{var $a=$("a",elm);if(!$a.size()){return false}var href=$a[0].href}return href};ACMS.Dispatch.Linkmatchlocation._linkmatchlocation=function(elm,aryPath,className){var href=this._getHref(elm);if(!href){return false}var re=new RegExp("https?://"+document.location.hostname+"/");if(!re.test(href)){return false}var root="/";if("string"==typeof ACMS.Config.offset){$.each(ACMS.Config.offset.split("/"),function(){if(""==this)return true;root+=this+"/"})}var path=root+aryPath.join("/");var pathname=decodeURI(href.replace(/https?:\/\/[^/]*/,"").replace(/\/$/,""));if(path.length<=pathname.length&&0<=pathname.indexOf(path)){$(elm).addClass(className)}};ACMS.Dispatch.Linkmatchlocation._match=function(elm,mode,className){var href=ACMS.Dispatch.Linkmatchlocation._getHref(elm);if(!href){return}var locationHref=document.location.href;href=href.replace(/https?/,"");locationHref=locationHref.replace(/https?/,"");if(mode==="part"){if(0||0===locationHref.indexOf(href)||0===encodeURI(locationHref).indexOf(href)){$(elm).addClass(className)}}else if(mode==="full"){if(0||href===locationHref||href===encodeURI(locationHref)){$(elm).addClass(className)}}return true};ACMS.Dispatch.Linkmatchlocation.part=function(elm,className){var className=className||ACMS.Config.linkMatchLocationClass;ACMS.Dispatch.Linkmatchlocation._match(elm,"part",className)};ACMS.Dispatch.Linkmatchlocation.full=function(elm,className){var className=className||ACMS.Config.linkMatchLocationFullClass;ACMS.Dispatch.Linkmatchlocation._match(elm,"full",className)};ACMS.Dispatch.Linkmatchlocation.contain=function(elm,className){var className=className||ACMS.Config.linkMatchLocationContainClass;var match=$(elm).data("match");var pathname=document.location.pathname;if(pathname.indexOf(match)!==-1){$(elm).addClass(className)}};ACMS.Dispatch.Linkmatchlocation.blog=function(elm,className){var className=className||ACMS.Config.linkMatchLocationBlogClass;var aryPath=[];if(ACMS.Config.bcd){aryPath.push(ACMS.Config.bcd)}ACMS.Dispatch.Linkmatchlocation._linkmatchlocation(elm,aryPath,className)};ACMS.Dispatch.Linkmatchlocation.category=function(elm,className){var className=className||ACMS.Config.linkMatchLocationCategoryClass;var aryPath=[];if(ACMS.Config.bcd){aryPath.push(ACMS.Config.bcd)}if(ACMS.Config.ccd){aryPath.push(ACMS.Config.ccd)}else{return true}ACMS.Dispatch.Linkmatchlocation._linkmatchlocation(elm,aryPath,className)};ACMS.Dispatch.Linkmatchlocation.entry=function(elm,className){var className=className||ACMS.Config.linkMatchLocationEntryClass;var aryPath=[];if(ACMS.Config.bcd){aryPath.push(ACMS.Config.bcd)}if(ACMS.Config.ccd){aryPath.push(ACMS.Config.ccd)}if(ACMS.Config.ecd){aryPath.push(ACMS.Config.ecd)}else{aryPath.push("acms-dummy-"+Math.random().toString(36).slice(-8)+".html")}ACMS.Dispatch.Linkmatchlocation._linkmatchlocation(elm,aryPath,className)};