if(typeof SD=="undefined"||!SD)var SD={};SD.config={pmhost:"http://xml.tw.overture.com/d/search/p/standard/js/flat/tw/rlb/",cmhost:"http://cmh.tw.yahoo.overture.com/js_flat_1_0/",pm:{partner:"tw_syndication_sitetag_komica2_adult_pm",charset:"utf8"},cm:{config:"20618435762",ctxtid:"tw_syndication_sitetag_beauty",partner:"sitetag_tw_index_cm"},stop:false,statichost:"http://ad.sitemaji.com/",sitename:"komica2"};
(function(){SD.util=SD.util||{};S=SD.util;SD.util.Dom={_reClassNameCache:{},_getClassRegEx:function(a){var b=S.Dom._reClassNameCache[a];if(!b){b=RegExp("(?:^|\\s+)"+a+"(?:\\s+|$)");S.Dom._reClassNameCache[a]=b}return b},getElementsByClassName:function(a,b,c,e){b=b||"*";c=c||document;var d=[];b=c.getElementsByTagName(b);a=S.Dom._getClassRegEx(a);c=0;for(var g=b.length;c<g;c++)if(a.test(b[c].className)){d[d.length]=b[c];e&&e.call(b[c],b[c])}return d},getAncestorByTagName:function(a,b){for(;a=a.parentNode;)if(a.tagName.toLowerCase()==
b)return a;return null}};SD.util.Event={getTarget:function(a){return this.resolveTextNode(a.target||a.srcElement)},resolveTextNode:function(a){try{if(a&&3==a.nodeType)return a.parentNode}catch(b){}return a},preventDefault:function(a){if(a.preventDefault)a.preventDefault();else a.returnValue=false}}})();
(function(){SD.util.createEl={dom:function(a,b,c){a=document.createElement(a);for(var e in b)a[e]=b[e];if(c)a.innerHTML=c;return a},get:function(a,b,c){a=document.createElement(a);for(var e in b)a[e]=b[e];if(c)a.innerHTML=c;this.append(a);return a},append:function(a){(document.getElementsByTagName("head")[0]||document.body).appendChild(a)},remove:function(a){setTimeout(function(){a.parentNode.removeChild(a);a=null},0)},js:function(a,b){var c=this.get("script",{src:a,type:"text/javascript"},null);
b&&c.setAttribute("charset",b);return c},css:function(a,b){b||(b="all");return this.get("link",{href:a,rel:"stylesheet",type:"text/css",media:b},null,"head")}}})();(function(){SD.tool={getUrlArgument:function(a,b){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=RegExp("[\\?&]"+a+"=([^&#]*)");return!c.exec(b)?"":c.exec(b)[1]},log:function(a){if(document.images)(new Image).src=a+""},debug:function(a){window.console&&window.console.firebug&&console.log(a)}}})();
(function(){var a=document.getElementById("nav");if(a){a=a.getElementsByTagName("a");a=a[a.length-1];if(a.href.indexOf("128")!=-1)SD.config.cm.ctxtid="tw_syndication_sitetag_food_001";else if(a.href.indexOf("129")!=-1)SD.config.cm.ctxtid="tw_syndication_sitetag_3c_001";else if(a.href.indexOf("forum-7-")!=-1)SD.config.cm.ctxtid="tw_syndication_sitetag_health_001";else if(a.href.indexOf("forum-74-1")!=-1)SD.config.cm.ctxtid="tw_syndication_sitetag_beauty_001";else if(a.href.indexOf("83")!=-1)SD.config.cm.ctxtid=
"tw_syndication_sitetag_leisure_001";else if(a.href.indexOf("68")!=-1)SD.config.cm.ctxtid="tw_syndication_sitetag_travel_001";else{a=["tw_syndication_sitetag_3c_001","tw_syndication_sitetag_beauty_001"," tw_syndication_sitetag_travel_001","tw_syndication_sitetag_game_002","tw_syndication_sitetag_friend"];SD.config.cm.ctxtid=a[Math.floor(Math.random()*a.length)]}}SD.params={initPm:function(b,c){return["?Partner="+encodeURIComponent(SD.config.pm.partner),"Keywords="+encodeURIComponent(c),"mkt=tw&adultFilter=adult",
"maxCount="+b,"outputCharEnc="+SD.config.pm.charset].join("&")},initCm:function(b){return["?config="+SD.config.cm.config,"mkt=tw","source="+encodeURIComponent(SD.config.cm.partner),"maxCount="+parseInt(b),"outputCharEnc=utf8","ctxtId="+encodeURIComponent(SD.config.cm.ctxtid),"ctxtUrl="+encodeURIComponent(document.location)].join("&")}}})();
(function(){SD.manage={queue:[],feed:null,stop:function(){SD.config.stop=true;SD.manage.execute()},execute:function(){if(this.feed&&SD.config.stop||!this.feed){this.queue.length==0&&SD.ysm.genHtml();if(!this.queue.length){this.feed=null;return false}var a=this.feed=this.queue.shift();setTimeout(function(){SD.ysm.overture(a)},5)}}}})();
(function(){var a=SD.util.Event,b,c=0,e=SD.util.Dom.getElementsByClassName("sitemajiad");SD.ysm={adHTML:[],arrange:function(d){for(var g=[],f=6,k=d.length;f<k;f+=6)g.push({desc:d[f],tmp:d[f+1],link:d[f+2],title:d[f+3],url:d[f+4]});return g},structure:function(d){d=SD.ysm.arrange(d);if(d.length>0){i=0;for(j=d.length;i<j;i++){SD.ysm.adHTML[c]="<dl onclick=\"window.open('"+d[i].link+'\');"><dt><a target="_blank" href="'+d[i].link+'">'+d[i].title+"</a></dt><dd>"+d[i].desc+"</dd><address>"+d[i].url+"</address></dl>";
c++}}},genHtml:function(){for(var d=0,g=e.length;d<g;d++){for(var f=e[d],k=f.getAttribute("model"),h="",l=0,n=parseInt(k);l<n;l++){if(l==0)h='<div class="bd">'+h;if(SD.ysm.adHTML.length>0)h+=SD.ysm.adHTML.shift();if(l==k-1)h+="</div>"}f.innerHTML=h;f.onclick=function(m){m=m||window.event;a.preventDefault(m)}}},getData:function(){if(typeof zSr!=="undefined"){SD.ysm.structure(zSr);SD.manage.stop();SD.util.createEl.remove(b)}else setTimeout(arguments.callee,30)},overture:function(d){zSr=undefined;b=
SD.util.createEl.js(d);SD.ysm.getData()}}})();
(function(){var a=SD.util.Dom.getElementsByClassName("sitemajiad");if(a[0]){for(var b=0,c=0,e=a.length;c<e;c++){var d=parseInt(a[c].getAttribute("model"));b+=d}a="";aKws=["\u5145\u6c23 \u5a03\u5a03","\u8272\u60c5","\u6027","\u81ea\u6170 \u5668","\u6027\u611b","\u6210\u4eba \u5361\u901a","a \u6f2b","\u5de8\u4e73","\u9ad8\u6f6e","\u60c5\u8272","h \u6f2b","\u60c5\u8272 \u6587\u5b78"," \u8272\u60c5 \u904a\u6232","\u6210\u4eba \u804a\u5929\u5ba4","\u6210\u4eba \u60c5\u8272 \u7db2"];a=SD.tool.getUrlArgument("p",
document.referrer);a.length||(a=SD.tool.getUrlArgument("q",document.referrer));a.lenghth||(a=aKws[Math.floor(Math.random()*aKws.length)]);a=decodeURIComponent(a);c=aKws[Math.floor(Math.random()*aKws.length)];SD.manage.queue=[SD.config.pmhost+SD.params.initPm(b,a),SD.config.pmhost+SD.params.initPm(b,c)+"&r=1"];SD.manage.execute();SD.util.createEl.css(SD.config.statichost+SD.config.sitename+".css","screen")}})();

