﻿var kcShare={kcDomain:function(){var s=document.getElementsByTagName("script");var reProtocol=/(http|https):\/\//i;var reKcFilePath=/\/kcscripts\/kc\.js/i;var kcDomain="";if(s!=null&&s.length>0) for(var idx=0;idx<s.length;idx++) if(s[idx].src!==undefined&&s[idx].src.match(reKcFilePath)){kcDomain=s[idx].src.replace(reProtocol,"").replace(reKcFilePath,"");if(kcDomain==null||kcDomain==""){kcDomain=location.host;}break;}if(kcDomain==null||kcDomain=="") kcDomain="www.kingcounty.gov";return kcDomain;},email:function(b,c,d){this.share("http://"+this.kcDomain()+"/kcscripts/kcShareByEmail.aspx?title=##TITLE##&url=##URL##",b,c,d)},facebook:function(b,c,d){this.share("http://www.facebook.com/sharer.php?u=##URL##&t=##TITLE##",b,c,d)},twitter:function(b,c,d){this.share("http://twitter.com/home?status=##URL##+##TITLE##",b,c,d)},buzz:function(b,c,d){this.share("http://www.google.com/buzz/post?url=##URL##&imageurl=##IMAGEURL##",b,c,d)},delicious:function(b,c,d){this.share("http://del.icio.us/post?url##URL##&title=##TITLE##",b,c,d)},stumbleupon:function(b,c,d){this.share("http://www.stumbleupon.com/submit?url=##URL##",b,c,d)},reddit:function(b,c,d){this.share("http://www.reddit.com/submit?url=##URL##",b,c,d)},digg:function(b,c,d){this.share("http://digg.com/submit?phase=2&url=##URL##&title=##TITLE##",b,c,d)},share:function(a,b,c,d){c||(c=encodeURIComponent(window.location)); b||(b=encodeURIComponent(document.title));d||(d=encodeURIComponent("http://"+this.kcDomain()+"/style/kcBaseImages/kc-bw-logo.gif"));a=a.replace("##URL##",c).replace("##TITLE##",b).replace("##IMAGEURL##",d);window.open(a,"sharewindow"+a.substr(7,15).replace(/\W/g,""),"width=640,height=480,scrollbars=yes");return false;}}; function kcDisplayToggle(a){var b=document.getElementById(a);if(b){b.style.display=(b.style.display=="none"?"":"none");}} function kcHideSharePage(event){var e=event||window.event;var a=document.getElementById("kcSharePage");if(a!=null){if(e.target){if(e.target.parentNode.parentNode.id!="kcSharePage") a.style.display="none";}else if(e.srcElement.parentNode.parentNode.id!="kcSharePage") a.style.display="none";}} document.onclick=function(event){kcHideSharePage(event)}; function kcShareLink(){document.write("\n<div id=\"kcShareLink\">\n\t<a href=\"javascript:kcDisplayToggle('kcSharePage')\" title=\"Show/hide share options\">Share</a>\n\t<ul id=\"kcSharePage\" style=\"display:none;\">\n\t\t<li class=\"kcShareEmail\"><a href=\"javascript:kcShare.email()\" title=\"Share by email\" onblur=\"kcHideSharePage(event)\">e-mail</a></li>\n\t\t<li class=\"kcShareFacebook\"><a href=\"javascript:kcShare.facebook()\" title=\"Share on Facebook\" onblur=\"kcHideSharePage(event)\">Facebook</a></li>\n\t\t<li class=\"kcShareTwitter\"><a href=\"javascript:kcShare.twitter()\" title=\"Share on Twitter\" onblur=\"kcHideSharePage(event)\">Twitter</a></li>\n\t\t<li class=\"kcShareDelicious\"><a href=\"javascript:kcShare.delicious()\" title=\"Share on delicious\" onblur=\"kcHideSharePage(event)\">del.icio.us</a></li>\n\t\t<li class=\"kcShareDigg\"><a href=\"javascript:kcShare.digg()\" title=\"Share on Digg\" onblur=\"kcHideSharePage(event)\">Digg</a></li>\n\t</ul>\n</div>\n");}
