/*
* SocialBookmarks
* CoolControls.NET
* http://www.coolcontrols.net
*
* Copyright 2010 Aspira BV, The Netherlands
* All rights reserved.
*/
if(typeof(CoolControls)==="undefined"){var CoolControls={}}if(typeof(CoolControls.SocialBookmarks)==="undefined"){CoolControls.SocialBookmarks={}}CoolControls.SocialBookmarks.Loader=function(appRoot,handler,words,obj){var that=this,configLoaded=false,config={},browser=navigator.appName,version=parseInt(navigator.appVersion),nAgent=navigator.userAgent,dictionary={},w,cult;for(cult in words){if(!dictionary[cult]){dictionary[cult]={}}for(w in words[cult]){dictionary[cult][words[cult][w].Id]=words[cult][w].Value}}delete words;this.appRoot=appRoot;this.handler=appRoot+handler;this.articles=[];CoolControls.SocialBookmarks.attachEvent("load",function(){loadConfig()},window,true);this.getB=function(){return{browser:browser,version:version,nAgent:nAgent}};this.word=function(cult,id,fb){if(dictionary[cult][id]){return dictionary[cult][id]}return fb||id};function configLoadedCallback(){configLoaded=true;that.init(obj);delete obj}this.getConfig=function(grps){var retval=[],nav=that.getB(),ag,cg;for(var i in config){group_match:if(typeof grps=="object"&&grps.length>0){for(ag in grps){if(grps[ag]=="!"&&config[i].groups.length==0){break group_match}for(cg in config[i].groups){if(grps[ag].toLowerCase()==config[i].groups[cg].toLowerCase()){break group_match}}}continue}if(config[i].url.substring(0,9)=="favorite:"){if(!((nav.nAgent.indexOf("MSIE")!=-1&&nav.version<=4)||nav.nAgent.indexOf("Firefox")!=-1)){continue}}retval.push(config[i])}return retval};function loadConfig(){var xmlhttp;try{xmlhttp=new XMLHttpRequest()}catch(err){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(err){return false}}xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){eval("config = "+xmlhttp.responseText);configLoadedCallback()}};xmlhttp.open("GET",that.handler);xmlhttp.setRequestHeader("X-Req","CoolControls.NET");xmlhttp.send(null);return true}};CoolControls.SocialBookmarks.Loader.prototype={init:function(e){var b,f=e,a=this.articles;var d,c;for(b in f){if(f[b].Id&&f[b].Display&&f[b].URL&&f[b].Title){d=new CoolControls.SocialBookmarks.Article(f[b]);this.articles.push(d)}}for(b=0;b<a.length;b++){a[b].show(this)}}};CoolControls.SocialBookmarks.Article=function(obj){this.id=_set(obj.Id);this.display=_set(obj.Display)||"Inline";this.url=_set(obj.URL);this.title=_set(obj.Title);this.description=_set(obj.Description);this.tags=_set(obj.Tags);this.culture=_set(obj.Culture)||"en-US";this.text=_set(obj.Text);this.sourceURL=_set(obj.SourceURL);this.shareIcon=obj.ShareIcon;this.iconDefinition=obj.IconDefinition||{width:24,height:24,basePath:"/pics/ccSB/24x24/"};this.options=obj.Options;if(this.options!=null&&typeof this.options.cEt==="string"){var fn,foo,test;if(typeof window[this.options.cEt]!="undefined"){fn=window[this.options.cEt]}else{if(this.options.cEt.indexOf(".")!=-1){foo=this.options.cEt.split(".");test="fn = "+foo[0];foo=foo.slice(1);if(foo.length>0){test+="['"+foo.join("']['")+"'];"}try{eval(test)}catch(e){}}}if(typeof fn==="function"){this.eventTracker=fn}}function _set(s){return typeof s==="string"&&s.length>0?s:null}};CoolControls.SocialBookmarks.Article.prototype={show:function(p){var J=p.getConfig(this.options.grp),H=this.shareIcon,B=this.iconDefinition,Y=document.getElementById(this.id),C,V,I=this,w=this.display.toLowerCase();function M(i){if(B.basePath.substring(0,1)=="/"&&B.basePath.substring(0,p.appRoot.length)!=p.appRoot){i=(p.appRoot+B.basePath+i).replace(/\/+/g,"/")}else{i=B.basePath+i}return i}function u(i){i=i.replace("*URL*",escape(I.url));i=i.replace("*TITLE*",escape(I.title));i=i.replace("*DESCRIPTION*",escape(I.description));i=i.replace("*TAGS*",escape(I.tags));i=i.replace("*LANGUAGE*",escape(I.culture.split("-")[0]));i=i.replace("*SOURCEURL*",escape(I.sourceURL));i=i.replace("*SOURCE*",escape(I.sourceURL));i=i.replace("*SOURCETITLE*",escape(document.title));return i}function U(z,ac,i){return function(){var ad=u(i.url);z.blur();if(z.onmouseout){z.onmouseout()}if(I.options!=null&&I.options.lA==true&&typeof pageTracker==="object"&&typeof pageTracker._trackEvent=="function"){try{pageTracker._trackEvent("SocialBookmarks",I.display,i.title)}catch(af){}}if(typeof I.eventTracker==="function"){try{I.eventTracker.call(null,ad,z.title,ac,i)}catch(af){}}if(ad.substring(0,9)=="favorite:"){var ae=unescape(ad.substring(9));if(ae.substring(0,2)=="//"){ae=ae.substring(2)}try{window.external.AddFavorite(ae,ac.title)}catch(af){}try{window.sidebar.addPanel(ac.title,ae,"")}catch(af){}}else{if(ad.substring(0,6)=="print:"){window.print()}else{if(ad.substring(0,7)=="mailto:"){location.href=ad;return false}else{window.open(ad.replace(/&amp;/g,"&"))}}}return false}}function y(ac){var ad=ac.url.substring(0,6).toLowerCase(),i;switch(ad){case"mailto":i=p.word(I.culture,"mail").replace("#article",I.title);break;case"print:":i=p.word(I.culture,"print").replace("#article",I.title);break;case"favori":var z=p.getB().nAgent.indexOf("Firefox")!=-1?"bookmarks":"favorites";i=p.word(I.culture,"add_to_fav").replace("#article",I.title).replace("#bookmarks",p.word(I.culture,z));break;case"homepa":default:i=p.word(I.culture,"share_with").replace("#article",I.title).replace("#provider",ac.title)}return i}function E(z,ac){var ae,ad,i=ab("li","margin:0;padding:0;"),ac=ac||1;i.style.height=B.height+"px";ae=ab("a","margin:0 4px 0 0;padding:0;background:none");ae.href="#";ae.title=y(z);ae._analyticsTitle=z.title;ae.ondragend=function(){this.blur()};ae.onclick=U(ae,I,z);ad=ab("img");ad.onerror=(function(af){return function(){ad.style.width=0;ad.style.height=0}}(i));ad.style.width=B.width+"px";ad.style.height=B.height+"px";ad.src=M(z.icon);ad.border=0;ae.appendChild(ad);i.link=ae;i.appendChild(ae);if(ac>1){ad.style.marginRight="2px";ae.style.cssFloat="left";ae.style.lineHeight=(B.height-2)+"pt";ae.appendChild(S(z.title));if(V%ac==0){i.style.clear="both"}}if(w=="inline"){ae.className="opaq"}return i}function ab(i,ac){var z=document.createElement(i);if(typeof ac==="string"){z.style.cssText=ac}return z}function S(i){return document.createTextNode(i)}var c="position:absolute;z-index:9999;width:120px; text-align: center;padding:1px 4px;border:solid 1px #ddd; font-size:9px;margin-left:0px;cursor:pointer;font-family:icon,arial,helvetica,sans-serif;top:0;left:0;filter:alpha(opacity=0);opacity:.0;-moz-opacity:.0;";var G=ab("div",c+"color:#006593;background-color:#fff;");G.appendChild(S("Powered by CoolControls"));G.title="Social Bookmarks ASP.NET Server Control from CoolControls.NET";G.onclick=function(){window.open("http://www.coolcontrols.net/")};Y.appendChild(G);var t=false,Q=false,W=0,s=0,e,R=((Y.currentStyle)?15:20);function P(){clearInterval(e);s=0;Q=false}function a(i){G.style.filter="alpha(opacity="+(i*10)+")";G.style.opacity=(i/10);G.style["-moz-opacity"]=(i/10)}function v(){if(W<10){if(s>80){W+=1;a(W);if(W>=10){clearInterval(e);Q=false}}else{if(W==0&&s>79){var z=B.height,i=G.parentNode;if(G.parentNode.clientHeight>0){z=i.clientHeight}else{if(G.parentNode.offsetHeight>0){z=i.offsetHeight}else{i.style.display="inline-block";z=i.offsetHeight;if(z==0){z=B.height}}}G.style.top=z+"px"}s++}return}}function X(){if(W>0){W-=1}if(W<=0){G.style.display="none";P()}a(W)}function x(){if(Q==false){s=0;Q=true}if(t){v()}else{X()}}function O(z,ac){var i;try{if(z.currentStyle){ac=ac.replace("-c","C");i=z.currentStyle[ac]}else{if(window.getComputedStyle){i=document.defaultView.getComputedStyle(z,null).getPropertyValue(ac)}}}catch(z){}return i}CoolControls.SocialBookmarks.attachEvent("mouseover",function(){t=true;if(Q===true){return}G.style.display="";if(typeof G.style.setProperty=="function"){G.style.setProperty("display","block","important");G.style.setProperty("height","11px","important")}else{if(!this._a){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){if(parseInt(RegExp.$1,10)>6){document.styleSheets[1].addRule(Y.tagName+"."+Y.className+" div[title*=Social]","height:11px!important;min-height:12px!important;display:block!important;")}}this._a=true}}var z=Y.parentNode,ae,ad,ac,i;ae=O(G,"color"),ad=O(G,"background-color"),c3=O(G.parentNode,"background-color");ad=ad=="transparent"?c3:ad;if(ae&&ad){ac=new CoolControls.SocialBookmarks.Color(ae);i=new CoolControls.SocialBookmarks.Color(ad);if(ac.difference(i)<200){G.style.cssText=c+";color:#006593!important;background-color:#fff!important"}}P();e=setInterval(x,R)},Y,false);CoolControls.SocialBookmarks.attachEvent("mouseout",function(){t=false;if(Q===true){return}P();e=setInterval(x,R)},Y,false);switch(w){case"overline":case"underline":var F,b,L,r,V=0,K=0,d=(w=="inlinetext");b=ab("div","height:"+B.height+"px; display:inline-block;position:relative;overflow: hidden;");C=ab("ul","margin:0px; padding:0px; text-align:left;overflow:hidden; list-style:none; position:relative; display:block;");C.className=w;C.width="100%";if(w=="underline"){b.style.borderBottomWidth="1px";b.style.borderBottomColor="#ccc";b.style.borderBottomStyle="solid"}else{b.style.borderTopWidth="1px";b.style.borderTopColor="#ccc";b.style.borderTopStyle="solid"}b.className="cc"+this.display;Y.appendChild(b);if(H){var f=(B.height);F=ab("li","border-bottom:0;margin:0;padding:0; line-height:"+f+"px");F.title=this.text+" "+this.title+"";L=ab("img");L.src=H.icon;L.height=H.height;L.width=H.width;if(w=="underline"){var A=B.height-H.height;if(A<0){A=0}L.style.marginTop=(A)+"px"}F.appendChild(L);C.appendChild(F)}else{var D=ab("div","cursor:default; margin-right:4px");D.className="ccTitle";if(this.text.replace(/ /g,"").length>0){D.appendChild(S(this.text));if(d){D.appendChild(ab("br"))}var f=(w=="underline")?B.height+8:B.height-8;F=ab("li","border-bottom:0;margin:0 0 0 4px;padding:0;line-height:"+(f)+"px");F.title=this.text+" "+this.title+"";F.appendChild(D);C.appendChild(F)}}function aa(i,z){var ac=Math.abs(parseInt(i.style.marginTop,10)||0);ac=ac+2;if(ac<=z){i.style.marginTop=((w=="underline")?ac:0-ac)+"px";i.aniTimer=setTimeout(function(){aa(i,z)},Math.abs(ac)*6)}}for(V in J){F=E(J[V],1);F.style.position="relative";if(w=="underline"){F.link.style.marginTop=parseInt(B.height/2)+"px"}else{F.link.style.marginTop=0-parseInt(B.height/2)+"px"}if(V==0){F.style.marginLeft="5px"}F.link._i=V;F.link.onmouseover=(function(i){return function(){clearTimeout(i.link.aniTimer);i.link.style.marginTop="0px"}}(F));F.link.onmouseout=(function(i){return function(){var z=Math.floor(B.height/2);i.aniTimer=setTimeout(function(){aa(i,z)},50)}}(F.link));C.appendChild(F)}b.appendChild(C);Y.appendChild(b);break;case"popup":var F,o=ab("div","margin: 5px"),b,L,r,V=0,k,l,j,T;C=ab("ul","margin:0px; padding:0px; text-align:left; list-style:none; display:block;");C.className=w;b=ab("div","display:none; position:absolute; top:"+(H?H.height:12)+"px; left:0;");b.className="cc"+this.display;function m(){var i=CoolControls.SocialBookmarks.getScreenDimensions(),z=CoolControls.SocialBookmarks.getScrollTop();if(b.style.display=="block"){return}b.style.visibility="hidden";b.style.display="block";Y.style.zIndex=CoolControls.SocialBookmarks.getMaxZIndex()+1;if(Y.offsetLeft+b.offsetWidth>i.width){b.style.left=(i.width-(Y.offsetLeft+b.offsetWidth+2))+"px"}else{b.style.left=0+"px"}j=b.parentNode.offsetTop-z;if(j+b.offsetHeight>i.height){b.style.top=0-(b.offsetHeight)+"px";if(b.parentNode.offsetTop-b.offsetHeight<z){b.style.top=(0-j)+"px"}if(L.offsetTop-b.offsetHeight>=b.offsetTop){G.style.marginTop=L.clientHeight+"px"}else{G.style.marginTop="4px"}}else{b.style.top=H.height+"px";G.style.marginTop="4px"}b.style.visibility="visible"}function q(){b.style.display="none"}b.onclick=function(i){b.onmouseover()};b.onmouseover=function(i){if(k){clearTimeout(k)}m()};b.onmouseout=function(i){k=setTimeout(q,300)};if(this.text.replace(/ /g,"").length>0){var D=ab("div","cursor:pointer");D.className="ccTitle";D.appendChild(S(this.text));b.appendChild(D)}b.appendChild(o);if(H){L=ab("img","cursor:pointer");L.src=H.icon;L.height=H.height;L.width=H.width;L.title=this.text;Y.appendChild(L)}else{L=ab("div","cursor:pointer");L.className="ccTitle";if(this.text.replace(/ /g,"").length>0){L.appendChild(S(this.text))}else{L.appendChild(S(p.word(I.culture,"share")))}Y.style.display="inline-block";Y.appendChild(L);H={icon:null};H.width=L.clientWidth;H.height=L.offsetHeight}L.onmouseover=function(){clearTimeout(l);clearTimeout(k);l=setTimeout(m,300)};L.onmouseout=function(){b.onmouseout();clearTimeout(l)};for(V in J){F=E(J[V],2);C.appendChild(F)}if(V%2==0&&V+1!=J.length){var n=ab("li","margin:0;padding:0;");n.style.height=B.height+"px";C.appendChild(n)}o.appendChild(C);b.appendChild(ab("div","clear:both; height: 5px").appendChild(G));Y.appendChild(b);break;case"inline":case"inlinetext":var F,b,L,r,V=0,K=0,d=(w=="inlinetext");C=ab("ul","margin:0px; padding:0px; text-align:left; list-style:none; position:relative; display:block;");C.className=w;b=ab("div");b.className="cc"+this.display;Y.appendChild(b);if(H){F=ab("li","border-bottom:0;margin:0;padding:0;");F.title=this.text+" "+this.title+"";L=ab("img");L.src=H.icon;L.height=H.height;L.width=H.width;if(!d){F.style.marginRight="5px"}F.appendChild(L);C.appendChild(F)}else{var D=ab("div");D.className="ccTitle";if(this.text.replace(/ /g,"").length>0){D.appendChild(S(this.text));if(d){D.appendChild(ab("br"))}b.appendChild(D)}H={icon:null,width:D.clientWidth,height:D.clientHeight}}for(V in J){F=E(J[V],(d===true)?2:1);C.appendChild(F)}if(d&&V%2==0&&V+1!=J.length){var n=ab("li","margin:0;padding:0;");n.style.height=B.height+"px";C.appendChild(n)}b.appendChild(C);b.appendChild(ab("br","clear:both"));Y.appendChild(b);break;case"stacked":var F,L,r,V=0,K=0;C=ab("ul","margin:0px; padding:0px; text-align:left; list-style:none;position:relative; display:block;");C.className="horizontal";F=ab("li","margin:0;padding:0;");F.title=this.text+" "+this.title+"";var N=false,g=p.getB();if(g.nAgent.indexOf("Opera")!=-1){N=true}else{if(g.nAgent.indexOf("Firefox")!=-1&&parseInt(g.version,10)==2){N=true}}if(H){L=ab("img");L.src=H.icon;L.height=H.height;L.width=H.width;F.style.position="absolute";F.appendChild(L);Y.style.height=(H.height>B.height?H.height:B.height)+"px"}else{L=ab("div","display: block; line-height: "+parseInt(B.width,10)+"px");L.className="ccTitle";L.appendChild(S(this.text));if(N){F.style.position="relative"}F.style.marginRight=(parseInt(B.width/2,10)+5)+"px";F.appendChild(L);H={};H.width=F.clientWidth;H.height=F.offsetHeight}C.appendChild(F);function Z(i,z){i.style["-webkit-transform"]="rotate("+z+"deg)";i.style.MozTransform="rotate("+z+"deg)";i.style["-o-transform"]="rotate("+z+"deg)";i.style["-ms-transform"]="rotate("+z+"deg)";i.style.transform="rotate("+z+"deg)"}function h(z,i){var ac=Math.abs(parseInt(z.style.marginLeft,10)||0);ac=0-(ac+1);if(ac>=i){z.style.marginLeft=ac+"px";z.aniTimer=setTimeout(function(){h(z,i)},Math.abs(ac)*6)}}for(V in J){F=E(J[V],1);F.style.cssText="position: absolute; margin:0; margin-left:"+(V*Math.floor(B.width/2)+H.width)+"px";F.link.style.cssText="background:none;position: absolute; margin: 0 0 0 "+(0-Math.floor(B.width/2))+"px";F.link._i=V;if(N&&!H.icon){F.style.position="relative"}F.link.onmouseover=function(){clearTimeout(this.aniTimer);if(this._i>0||H.icon){this.style.marginLeft="-3px"}Z(this,(new Date().getMilliseconds()%2==0?"6":"-6"))};F.link.onmouseout=(function(i){return function(){Z(i,0);var z=0-Math.floor(B.width/2);i.aniTimer=setTimeout(function(){h(i,z)},50)}}(F.link));C.appendChild(F)}K=V+1;if(C.childNodes){for(V=0;V<C.childNodes.length;V++){C.childNodes[V].style.zIndex=K;K--}}Y.appendChild(C);break}}};CoolControls.SocialBookmarks.attachEvent=function(f,d,c,b){var h=c||window,a=b||false,e;if(typeof h.addEventListener!="undefined"){h.addEventListener(f,d,a);return true}else{if(typeof h.attachEvent!="undefined"){e=h.attachEvent("on"+f,d);return e}else{if(typeof h["on"+f]=="function"){var g=h["on"+f];h["on"+f]=function(){if(g){g()}d()}}else{h["on"+f]=d}return true}}};CoolControls.SocialBookmarks.getMaxZIndex=function(){var d,c,f,a,e,b;d=document.getElementsByTagName?document.getElementsByTagName("*"):document.all;c=0;for(b=0;b<d.length;b++){f=d[b];a=null;if(f.currentStyle){a=f.currentStyle}else{if(document.defaultView&&document.defaultView.getComputedStyle){a=document.defaultView.getComputedStyle(f,"")}}if(a){e=Number(a.zIndex)}else{e=Number(f.style.zIndex)}if(!isNaN(e)){c=Math.max(c,e)}}return c};CoolControls.SocialBookmarks.getScrollTop=function(){var a=document.body.scrollTop;if(a===0){if(window.pageYOffset){a=window.pageYOffset}else{a=(document.body.parentElement)?document.body.parentElement.scrollTop:0}}return a};CoolControls.SocialBookmarks.getScrollLeft=function(){var a=document.body.scrollLeft;if(a===0){if(window.pageXOffset){a=window.pageXOffset}else{a=(document.body.parentElement)?document.body.parentElement.scrollLeft:0}}return a};CoolControls.SocialBookmarks.getScreenDimensions=function(){var a=0,b=0;if(typeof window.innerWidth=="number"){a=window.innerWidth;b=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){a=document.body.clientWidth;b=document.body.clientHeight}}}return{width:a,height:b}};CoolControls.SocialBookmarks.Color=function RGBColor(e){this.ok=false;if(e.charAt(0)=="#"){e=e.substr(1,6)}e=e.replace(/ /g,"");e=e.toLowerCase();var f=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(g){return[parseInt(g[1]),parseInt(g[2]),parseInt(g[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(g){return[parseInt(g[1],16),parseInt(g[2],16),parseInt(g[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(g){return[parseInt(g[1]+g[1],16),parseInt(g[2]+g[2],16),parseInt(g[3]+g[3],16)]}}];for(var a=0;a<f.length;a++){var c=f[a].re;var b=f[a].process;var d=c.exec(e);if(d){channels=b(d);this.r=channels[0];this.g=channels[1];this.b=channels[2];this.ok=true}}this.r=(this.r<0||isNaN(this.r))?0:((this.r>255)?255:this.r);this.g=(this.g<0||isNaN(this.g))?0:((this.g>255)?255:this.g);this.b=(this.b<0||isNaN(this.b))?0:((this.b>255)?255:this.b);this.difference=function(k){var l=this,i=(l.r+k.r)/2,h=l.r-k.r,m=l.g-k.g,o=l.b-k.b,j=2+i/256,n=4,p=2+(255-i)/256;return Math.sqrt(j*h*h+n*m*m+p*o*o)}};