if(typeof nRelate=="undefined")var nRelate=window.nRelate={domain:nr_domain,api_url:"http://api.nrelate.com/rcw_t/0.02.0/index.php",clicked_link:null,load_link:!1,domready:!1,domready_bound:!1,domready_list:[],ie_browser:navigator.appName=="Microsoft Internet Explorer",loadFrame:function(){var a=nRelate;if(a.load_link)a.load_link=!1,window.location.href=a.clicked_link},innerText:function(a){var b=document.getElementsByTagName("body");if(b.length==0)return"";t=b[0].innerText!=void 0?a.innerText:a.textContent;
return t=t.replace(/^[\s\t\n\r]*/,"").replace(/[\s\t\n\r]*$/,"")},ie6fix:function(a){for(var b=nRelate.xGetElementsByClassName(a),c=RegExp("(^|\\s)"+a+"(\\s|$)","g"),a=0;a<b.length;a++)b[a].className=b[a].className.replace(c," ")},eventSource:function(a){var b=null;if(a.target)b=a.target;else if(a.srcElement)b=a.srcElement;if(b.nodeType==3)b=b.parentNode;return b},onclick:function(a){var b=null,c=nRelate;if(!a)a=window.event;for(b=c.eventSource(a);b.nodeName!="A";)b=b.parentNode;a.cancelBubble=!0;
a.returnValue=!1;var d=window.location.href,f="http://api.nrelate.com/rcw_wp/track.html",e=document.getElementById("nr_clickthrough_frame"),g=b.className,b=b.href;nr_type=g.indexOf("nr_ad")!=-1?"ad":g.indexOf("nr_external")!=-1?"external":"internal";f+="?type="+nr_type+"&domain="+escape(c.domain)+"&src_url="+escape(d)+"&dest_url="+escape(b);c.load_link=!0;c.clicked_link=b;e.src=f;a.stopPropagation&&(a.stopPropagation(),a.preventDefault());return!1},tracking:function(a){for(var b=nRelate,c=[],c=b.xGetElementsByClassName("nr_link",
a,"a"),a=0;a<c.length;a++)c[a].onclick=b.onclick},fixHeight:function(a){var b=nRelate,c=[],c=b.xGetElementsByClassName,c=c("nr_panel",a,"a");if(c.length!=0){var d=0,f=0,e=[],g,h=0,i=0,f=0,f=b.xPageY(c[0]);for(g=0;g<c.length;g++){a=c[g];h=b.xPageY(a);if(f!=h){for(currentDiv=0;currentDiv<e.length;currentDiv++)b.xHeight(e[currentDiv],d);e.length=0;f=h;d=b.xHeight(a);e.push(a)}else e.push(a),d=d<b.xHeight(a)?b.xHeight(a):d;for(currentDiv=0;currentDiv<e.length;currentDiv++)b.xHeight(e[currentDiv],d)}h=
b.xPageY(c[0]);for(g=0;g<c.length;g++){if(b.xPageY(c[g])!=h)break;i++}var f=Math.ceil(c.length/i),d=b=1,j,l,k,m;for(g=0;g<c.length;g++)a=c[g],e=b%2==0?" nr_even_row":" nr_odd_row",h=d%2==0?" nr_even_col":" nr_odd_col",j=d==1?" nr_first_col":"",l=d==i&&j==""?" nr_last_col":"",k=b==1?" nr_first_row":"",m=b==f&&k==""?" nr_last_row":"",a.className+=" nr_row_"+b+" nr_col_"+d+e+h+j+l+k+m,d++,d>i&&(d=1,b++)}},adAnimation:function(a){var b=nRelate,a=b.xGetElementsByClassName("nr_sponsored",a,"span");if(a.length!=
0)for(var c=b.xWidth(a[0].parentNode)-18,d=b.xAddEventListener,f=new b.xAnimation,b=0;b<a.length;b++)d(a[b],"mouseover",function(a){a=nRelate.eventSource(a);f.css(a,"left",0,150,1)},!1),d(a[b],"mouseout",function(a){a=nRelate.eventSource(a);f.css(a,"left",c,150,1)},!1)},getScript:function(a,b){var c=document.createElement("script");c.type="text/javascript";c.src=a;if(b)c.async=!0;document.getElementsByTagName("head")[0].appendChild(c)},bindDomReady:function(a){var b=nRelate;if(b.domready)a();else if(b.domready_list.push(a),
!b.domready_bound)if(b.domready_bound=!0,document.addEventListener)document.addEventListener("DOMContentLoaded",b.domReadyReached,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",b.readyStateChange);a=!1;try{a=window.frameElement==null}catch(c){}document.documentElement.doScroll&&a&&b.scrollCheck()}},readyStateChange:function(){var a=document,b=arguments.callee;a.readyState==="complete"&&(a.detachEvent("onreadystatechange",b),nRelate.domReadyReached())},scrollCheck:function(){var a=
nRelate;if(!a.domready)try{document.documentElement.doScroll("left")}catch(b){setTimeout(a.scrollCheck,0);return}a.domReadyReached()},domReadyReached:function(){var a=nRelate;if(!a.domready){a.domready=!0;document.addEventListener&&document.removeEventListener("DOMContentLoaded",a.domReadyReached,!1);for(var b=0;b<a.domready_list.length;b++)a.domready_list[b]();a.domready_list=[]}},getRelatedPosts:function(a){var b=nRelate;b.ie_browser?b.getScript(a,!0):b.jsIframe(a,"nRelate=window.parent.nRelate;")},
sw:function(a,b){if(a.substr(0,3)!="var"){var c=nRelate;if(document.getElementById(b))document.getElementById(b).innerHTML=a,c.fixHeight(b),c.adAnimation(b),c.tracking(b);else{var d=arguments.callee;setTimeout(function(){d(a,b)},100)}}},jsIframe:function(a,b){var c=document;nrDiv=c.createElement("div");nrDiv.style.display="none";ifr=c.createElement("iframe");ifr.frameBorder="0";ifr.allowTransparency="true";nrDiv.appendChild(ifr);c.body.appendChild(nrDiv);domainSrc="javascript:var d=document.open(); d.domain='"+
c.domain+"';";try{ifr.contentWindow.document.open()}catch(d){iframe.src=domainSrc+"void(0);"}b=typeof b=="string"?b:"";a=a.replace(/\'/g,"\\'");iframe_html='<body onload="d=document; '+b+"d.getElementsByTagName('head')[0].appendChild(d.createElement('script')).src='"+a+"';\"></body>";try{var f=ifr.contentWindow.document;f.write(iframe_html);f.close()}catch(e){ifr.src=domainSrc+'d.write("'+iframe_html.replace(/"/g,'\\"')+'");d.close();'}},addHolder:function(a,b){if(!document.getElementById("nrelate_related_"+
b)){var c=document.createElement("div");c.setAttribute("id","nrelate_related_"+b);a.appendChild(c)}},xAddEventListener:function(a,b,c,d){if(a=nRelate.xGetElementById(a))if(b=b.toLowerCase(),a.addEventListener)a.addEventListener(b,c,d||!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var f=a["on"+b];a["on"+b]=typeof f=="function"?function(a){f(a);c(a)}:c}},xAnimation:function(a){this.res=a||10;this.axes=function(a){var c;if(!this.a||this.a.length!=a){this.a=[];for(c=0;c<a;++c)this.a[c]={i:0,
t:0,d:0,v:0}}};this.init=function(a,c,d,f,e,g,h){this.e=nRelate.xGetElementById(a);this.t=c;this.or=d;this.ot=f;this.oe=e;this.at=g||0;this.v=[function(a){return a},function(a){return Math.abs(Math.sin(a))},function(a){return 1-Math.abs(Math.cos(a))},function(a){return(1-Math.cos(a))/2},function(a){return 1-Math.exp(-a*6)}][this.at];this.qc=1+(h||0);this.fq=1/this.t;if(this.at>0&&this.at<4&&(this.fq*=this.qc*Math.PI,this.at==1||this.at==2))this.fq/=2;for(a=0;a<this.a.length;++a)this.a[a].d=this.a[a].t-
this.a[a].i};this.run=function(a){var c,d,f,e=this;if(!a)e.t1=(new Date).getTime();if(!e.tmr)e.tmr=setInterval(function(){e.et=(new Date).getTime()-e.t1;if(e.et<e.t){e.f=e.v(e.et*e.fq);for(c=0;c<e.a.length;++c)e.a[c].v=e.a[c].d*e.f+e.a[c].i;e.or(e)}else{clearInterval(e.tmr);e.tmr=null;d=e.qc%2;for(c=0;c<e.a.length;++c)e.a[c].v=d?e.a[c].t:e.a[c].i;e.ot(e);f=!1;typeof e.oe=="function"?f=e.oe(e):typeof e.oe=="string"&&(f=eval(e.oe));f&&e.resume(1)}},e.res)};this.pause=function(){clearInterval(this.tmr);
this.tmr=null};this.resume=function(a){if(typeof this.tmr!="undefined"&&!this.tmr)this.t1=(new Date).getTime(),a||(this.t1-=this.et),this.run(!a)};this.css=function(a,c,d,f,e,g,h){function i(a){a.e.style[a.prop]=Math.round(a.a[0].v)+"px"}this.axes(1);this.a[0].i=nRelate.xGetComputedStyle(a,c,!0);this.a[0].t=d;this.prop=nRelate.xCamelize(c);this.init(a,f,i,i,h,e,g);this.run()}},xCamelize:function(a){var b,c,d;c=a.split("-");d=c[0];for(a=1;a<c.length;++a)b=c[a].charAt(0),d+=c[a].replace(b,b.toUpperCase());
return d},xClientHeight:function(){var a=nRelate,b=0,c=document,d=window;if((!c.compatMode||c.compatMode=="CSS1Compat")&&c.documentElement&&c.documentElement.clientHeight)b=c.documentElement.clientHeight;else if(c.body&&c.body.clientHeight)b=c.body.clientHeight;else if(a.xDef(d.innerWidth,d.innerHeight,c.width))b=d.innerHeight,c.width>d.innerWidth&&(b-=16);return b},xClientWidth:function(){var a=nRelate,b=0,c=document,d=window;if((!c.compatMode||c.compatMode=="CSS1Compat")&&!d.opera&&c.documentElement&&
c.documentElement.clientWidth)b=c.documentElement.clientWidth;else if(c.body&&c.body.clientWidth)b=c.body.clientWidth;else if(a.xDef(d.innerWidth,d.innerHeight,c.height))b=d.innerWidth,c.height>d.innerHeight&&(b-=16);return b},xDef:function(){for(var a=0;a<arguments.length;++a)if(typeof arguments[a]=="undefined")return!1;return!0},xGetComputedStyle:function(a,b,c){var d=nRelate;if(!(a=d.xGetElementById(a)))return null;var f="undefined",e=document.defaultView;if(e&&e.getComputedStyle)(a=e.getComputedStyle(a,
""))&&(f=a.getPropertyValue(b));else if(a.currentStyle)f=a.currentStyle[d.xCamelize(b)];else return null;return c?parseInt(f)||0:f},xGetElementById:function(a){typeof a=="string"&&(a=document.getElementById?document.getElementById(a):document.all?document.all[a]:null);return a},xGetElementsByTagName:function(a,b){var c=nRelate,d=null,a=a||"*",b=c.xGetElementById(b)||document;if(typeof b.getElementsByTagName!="undefined"){if(d=b.getElementsByTagName(a),a=="*"&&(!d||!d.length))d=b.all}else a=="*"?d=
b.all:b.all&&b.all.tags&&(d=b.all.tags(a));return d||[]},xGetElementsByClassName:function(a,b,c,d){for(var f=nRelate,e=[],a=RegExp("(^|\\s)"+a+"(\\s|$)"),b=f.xGetElementsByTagName(c,b),c=0;c<b.length;++c)a.test(b[c].className)&&(e[e.length]=b[c],d&&d(b[c]));return e},xHeight:function(a,b){var c=nRelate,d,f=0,e=0,g=0,h=0;if(!(a=c.xGetElementById(a)))return 0;b=c.xNum(b)?b<0?0:Math.round(b):-1;d=c.xDef(a.style);if(a==document||a.tagName.toLowerCase()=="html"||a.tagName.toLowerCase()=="body")b=c.xClientHeight();
else if(d&&c.xDef(a.offsetHeight)&&c.xStr(a.style.height)){if(b>=0){if(document.compatMode=="CSS1Compat")if(f=c.xGetComputedStyle(a,"padding-top",1),f!==null)e=c.xGetComputedStyle(a,"padding-bottom",1),g=c.xGetComputedStyle(a,"border-top-width",1),h=c.xGetComputedStyle(a,"border-bottom-width",1);else if(c.xDef(a.offsetHeight,a.style.height))a.style.height=b+"px",f=a.offsetHeight-b;b-=f+e+g+h;if(isNaN(b)||b<0)return;else a.style.height=b+"px"}b=a.offsetHeight}else if(d&&xDef(a.style.pixelHeight)){if(b>=
0)a.style.pixelHeight=b;b=a.style.pixelHeight}return b},xNum:function(){for(var a=0;a<arguments.length;++a)if(isNaN(arguments[a])||typeof arguments[a]!="number")return!1;return!0},xPageY:function(a){for(var b=nRelate,c=0,a=b.xGetElementById(a);a;)b.xDef(a.offsetTop)&&(c+=a.offsetTop),a=b.xDef(a.offsetParent)?a.offsetParent:null;return c},xStr:function(){for(var a=0;a<arguments.length;++a)if(typeof arguments[a]!="string")return!1;return!0},xWidth:function(a,b){var c=nRelate,d,f=0,e=0,g=0,h=0;if(!(a=
c.xGetElementById(a)))return 0;b=c.xNum(b)?b<0?0:Math.round(b):-1;d=c.xDef(a.style);if(a==document||a.tagName.toLowerCase()=="html"||a.tagName.toLowerCase()=="body")b=c.xClientWidth();else if(d&&c.xDef(a.offsetWidth)&&c.xStr(a.style.width)){if(b>=0){if(document.compatMode=="CSS1Compat")if(f=c.xGetComputedStyle(a,"padding-left",1),f!==null)e=c.xGetComputedStyle(a,"padding-right",1),g=c.xGetComputedStyle(a,"border-left-width",1),h=c.xGetComputedStyle(a,"border-right-width",1);else if(c.xDef(a.offsetWidth,
a.style.width))a.style.width=b+"px",f=a.offsetWidth-b;b-=f+e+g+h;if(isNaN(b)||b<0)return;else a.style.width=b+"px"}b=a.offsetWidth}else if(d&&c.xDef(a.style.pixelWidth)){if(b>=0)a.style.pixelWidth=b;b=a.style.pixelWidth}return b}};
