var cssPath={getPN2:function(elm,rootNode){return this.path(elm,rootNode,[]).join(" > ")},classSelector:function(className){var selectors=className.split(/\s/g),array=[];for(var i=0;i0){array.push("."+selectors[i])}}return array.join("")},nthChild:function(elm){var childNumber=0,childNodes=elm.parentNode.childNodes,index=0;for(;indexme.scrollDeepest){me.scrollDeepest=sTop}},0)}function onScroll(){if(timeoutRef){clearTimeout(timeoutRef)}timeoutRef=setTimeout(recordScrollTop,50)}if(window.addEventListener){window.addEventListener("scroll",onScroll)}else if(window.attachEvent){window.attachEvent("scroll",onScroll)}if(getCookie("_51ctologStr"))this.ev(unescape(getCookie("_51ctologStr")));this.ev({type:"open"})},ev:function(json){var s=new Image,tps=this.copy(this.ps),url="https://logserver.51cto.com/log_server?";s.loaded=function(){setCookie("_51ctologStr","",-1)};if(typeof json=="string"){if(json.length<10)return false;s.src=url+json;return false}if(json){for(var v in json){tps[v]=json[v]}}tps["time"]=(new Date).getTime();var str=this.str(tps);if(json.type&&json.type=="close"){tps["duration"]=tps["time"]-this.openTime;str=this.str(tps);setCookie("_51ctologStr",escape(str))}s.src=url+str},str:function(json){var str="{";for(var v in json){str+=v+':"'+json[v]+'",'}str+="}";str=str.replace(",}","}");return"data="+encodeURI(str)},getPN:function(dom,ly){if(!ly)ly="|"+dom.className+"|"+dom.id;ly=dom.tagName+"-"+this.getIndex(dom)+(ly?">"+ly:ly);if(dom.parentNode.tagName=="BODY"){return ly}return this.getPN(dom.parentNode,ly)},getPN2:function(el){return encodeURIComponent(cssPath.getPN2(el))},getIndex:function(dom){var tmp=dom.parentNode.childNodes,list=[];for(var i=0;i0){this.catchDomTier--;return this.catchDom(dom.parentNode)}return false},getScrollPercent:function(sTop){var doc=document.documentElement;var body=document.body,html=document.documentElement;var top=(window.pageYOffset||doc.scrollTop)-(doc.clientTop||0);var scrollHeight=Math.max(body.scrollHeight,body.offsetHeight,html.clientHeight,html.scrollHeight,html.offsetHeight);if(sTop){return Math.round(sTop/scrollHeight*100)+"%"}return Math.round(top/scrollHeight*100)+"%"},copy:function(obj){var tmp={};for(i in obj){tmp[i]=obj[i]}return tmp},generateUUID:function(){var olduuid=getCookie("_51ctologuuid");if(olduuid){setCookie("_51ctologuuid","",-1);return olduuid}var d=(new Date).getTime();return"5xxxxxxx-1xxx-cxxx-txxx-oxxxxxyxxxxx".replace(/[xy]/g,function(c){var r=(d+Math.random()*16)%16|0;d=Math.floor(d/16);return(c=="x"?r:r&3|8).toString(16)})}};var __51log=new _51log(location.hostname.replace(".51cto.com",""));