(function(f){function p(a,b,c){var h=c.relative?a.position().top:a.offset().top,d=c.relative?a.position().left:a.offset().left,i=c.position[0];h-=b.outerHeight()-c.offset[0];d+=a.outerWidth()+c.offset[1];if(/iPad/i.test(navigator.userAgent))h-=f(window).scrollTop();var j=b.outerHeight()+a.outerHeight();if(i=="center")h+=j/2;if(i=="bottom")h+=j;i=c.position[1];a=b.outerWidth()+a.outerWidth();if(i=="center")d-=a/2;if(i=="left")d-=a;return{top:h,left:d}}function u(a,b){var c=this,h=a.add(c),d,i=0,j=0,m=a.attr("title"),q=a.attr("data-tooltip"),r=o[b.effect],l,s=a.is(":input"),v=s&&a.is(":checkbox, :radio, select, :button, :submit"),t=a.attr("type"),k=b.events[t]||b.events[s?v?"widget":"input":"def"];if(!r)throw'Nonexistent effect "'+b.effect+'"';k=k.split(/,\s*/);if(k.length!=2)throw"Tooltip: bad events configuration for "+t;a.bind(k[0],function(e){clearTimeout(i);if(b.predelay)j=setTimeout(function(){c.show(e)},b.predelay);else c.show(e)}).bind(k[1],function(e){clearTimeout(j);if(b.delay)i=setTimeout(function(){c.hide(e)},b.delay);else c.hide(e)});if(m&&b.cancelDefault){a.removeAttr("title");a.data("title",m)}f.extend(c,{show:function(e){if(!d){if(q)d=f(q);else if(b.tip)d=f(b.tip).eq(0);else if(m)d=f(b.layout).addClass(b.tipClass).appendTo(document.body).hide().append(m);else{d=a.next();d.length||(d=a.parent().next())}if(!d.length)throw"Cannot find tooltip for "+a;}if(c.isShown())return c;d.stop(true,true);var g=p(a,d,b);b.tip&&d.html(a.data("title"));e=e||f.Event();e.type="onBeforeShow";h.trigger(e,[g]);if(e.isDefaultPrevented())return c;g=p(a,d,b);d.css({position:"absolute",top:g.top,left:g.left});l=true;r[0].call(c,function(){e.type="onShow";l="full";h.trigger(e)});g=b.events.tooltip.split(/,\s*/);if(!d.data("__set")){d.bind(g[0],function(){clearTimeout(i);clearTimeout(j)});g[1]&&!a.is("input:not(:checkbox, :radio), textarea")&&d.bind(g[1],function(n){n.relatedTarget!=a[0]&&a.trigger(k[1].split(" ")[0])});d.data("__set",true)}return c},hide:function(e){if(!d||!c.isShown())return c;e=e||f.Event();e.type="onBeforeHide";h.trigger(e);if(!e.isDefaultPrevented()){l=false;o[b.effect][1].call(c,function(){e.type="onHide";h.trigger(e)});return c}},isShown:function(e){return e?l=="full":l},getConf:function(){return b},getTip:function(){return d},getTrigger:function(){return a}});f.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(e,g){f.isFunction(b[g])&&f(c).bind(g,b[g]);c[g]=function(n){n&&f(c).bind(g,n);return c}})}f.tools=f.tools||{version:"1.2.5"};f.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,b,c){o[a]=[b,c]}};var o={toggle:[function(a){var b=this.getConf(),c=this.getTip();b=b.opacity;b<1&&c.css({opacity:b});c.show();a.call()},function(a){this.getTip().hide();a.call()}],fade:[function(a){var b=this.getConf();this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};f.fn.tooltip=function(a){var b=this.data("tooltip");if(b)return b;a=f.extend(true,{},f.tools.tooltip.conf,a);if(typeof a.position=="string")a.position=a.position.split(/,?\s/);this.each(function(){b=new u(f(this),a);f(this).data("tooltip",b)});return a.api?b:this}})(jQuery);function playVid(vidId,noBlackout){if(_vidPane==null){_vidPane=document.getElementById('vidPane');if(!_vidPane){var tbody=document.getElementsByTagName("body")[0];tnode=document.createElement('div');tnode.id='vidPane';tnode.className='vidFrame';tbody.appendChild(tnode);_vidPane=document.getElementById('vidPane');_vidPane.style.position='absolute';_vidPane.style.display='none';_vidPane.style.zIndex='100';_vidPane.style.backgroundColor='#fff';_vidPane.style.width='435px';_vidPane.style.height='372px';_vidPane.style.fontFamily='verdana';_vidPane.style.fontSize='11px';}
_blackout=document.getElementById('blackout');if(!_blackout){tnode=document.createElement('div');tnode.id='blackout';tbody.appendChild(tnode);_blackout=document.getElementById('blackout');_blackout.style.position='absolute';_blackout.style.display='none';_blackout.style.left='0px';_blackout.style.top='0px';_blackout.style.backgroundColor='#000';_blackout.style.opacity='.9';_blackout.style.filter='alpha(opacity=90)';_blackout.style.zIndex='50';}
_vidPane.style.top='75px';_vidPane.style.left='75px';}
if(vidId==null){_vidPane.style.display='none';_vidPane.innerHTML='';_blackout.style.display='none';}else{vidId=vidId.href;if(!noBlackout){_blackout.style.width='100%';_blackout.style.height=(document.body.offsetHeight<screen.height)?screen.height+'px':document.body.offsetHeight+20+'px';_blackout.style.display='block';}else{_blackout.style.display='none';}
var vidInfo=vidId.split('/');var vidstring='<center><embed style="margin-top: 5px;"';vidstring+=' enableJavascript="false" allowScriptAccess="never"';vidstring+=' allownetworking="internal" type="application/x-shockwave-flash"';vidstring+=' wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" ';if(vidInfo[2].indexOf('youtube.com')>=0){vidInfo=vidId.match(/v=.+$/);vidInfo=String(vidInfo).replace(/v=/g,'');vidstring+=' src="http://www.youtube.com/v/'+vidInfo+'?fs=1&autoplay=1" ';vidstring+=' height="350" width="425" allowfullscreen="true"></embed></center>';}else if(vidInfo[2].indexOf('metacafe.com')>0){vidInfo=vidId.match(/watch.+$/);vidInfo=String(vidInfo).replace(/watch./,'');vidInfo=String(vidInfo).replace(/.$/,'');vidstring+=' flashVars="playerVars=autoPlay=yes" ';vidstring+=' src="http://www.metacafe.com/fplayer/'+vidInfo+'.swf" ';vidstring+=' width="400" height="345" allowfullscreen="true">';vidstring+='</embed></center>';}else if(vidInfo[2].indexOf('dailymotion.com')>=0){vidInfo=vidId.match(/video.+$/);vidInfo2=vidId.match(/_.+$/);vidInfo=String(vidInfo).replace(/video./,'');vidInfo=String(vidInfo).replace(vidInfo2,'');vidstring+=' src="http://www.dailymotion.com/swf/video/'+vidInfo+'?&autoPlay=1&start=" flashVars="autoStart=1" ';vidstring+=' allowFullScreen="true" height="350" width="425">';vidstring+='</embed></center>';}else if(vidInfo[2].indexOf('video.yahoo.com')>=0){vidInfo=vidId.match(/watch.+$/);vidInfo=String(vidInfo).replace(/watch./,'');var vidtemp=new Array();vidtemp=vidInfo.split('/');vidstring+=' src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf" ';vidstring+=' allowFullScreen="true" height="350" width="425" flashVars="id='+vidtemp[1]+'&vid='+vidtemp[0]+'&lang=en-us&intl=us&autoPlay=1">';vidstring+='</embed></center>';}else if(vidInfo[2].indexOf('vimeo.com')>=0){vidInfo=vidId.match(/[0-9].+$/);vidstring+=' src="http://vimeo.com/moogaloop.swf?clip_id='+vidInfo+'&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=1&amp;loop=0" ';vidstring+=' height="350" width="425" allowfullscreen="true"></embed></center>';}else{vidstring+='></embed><BR><BR><BR>Unsupported Video Source.</center>';}
vidstring+='<div style="background:#fff;text-align:right;padding:10px 5px 10px 5px"><A HREF="'+vidId+'" target="_blank"><strong>VIDEO LINK</strong></A> &nbsp;|&nbsp; <A style="color=#555" HREF="#" onClick="return(playVid())"><strong>CLOSE X</strong></A><div>';_vidPane.innerHTML=vidstring;var scrollTop=0;if(document.documentElement&&document.documentElement.scrollTop)
scrollTop=document.documentElement.scrollTop;else if(document.body)
scrollTop=document.body.scrollTop
_vidPane.style.top=scrollTop+100+'px';_vidPane.style.left=((document.body.clientWidth/2)-200)+'px';_vidPane.style.display='block';}
return(false);}
function moveHandler(e){if(e==null){e=window.event}
if(_dragOK){_savedTarget.style.left=e.clientX-_dragXoffset+'px';_savedTarget.style.top=e.clientY-_dragYoffset+'px';return false;}}
function cleanup(e){document.onmousemove=null;document.onmouseup=null;_savedTarget.style.cursor=_orgCursor;_dragOK=false;}
function dragHandler(e){var cursorType='-moz-grabbing';if(e==null){e=window.event;cursorType='move';}
var target=e.target!=null?e.target:e.srcElement;if(target.className=="vidFrame"){_orgCursor=target.style.cursor;_savedTarget=target;target.style.cursor=cursorType;_dragOK=true;_dragXoffset=e.clientX-parseInt(_savedTarget.style.left);_dragYoffset=e.clientY-parseInt(_savedTarget.style.top);document.onmousemove=moveHandler;document.onmouseup=cleanup;return false;}}
document.onmousedown=dragHandler;var _savedTarget=null;var _orgCursor=null;var _dragOK=false;var _dragXoffset=0;var _dragYoffset=0;var _vidPane=null;var _blackout=null;;var shutterLinks={},shutterSets={};function shutterAddLoad(a){if("undefined"!=typeof jQuery){jQuery(document).ready(a())}else{if(typeof window.onload!="function"){window.onload=a}else{oldonld=window.onload;window.onload=function(){if(oldonld){oldonld()}a()}}}}shutterReloaded={I:function(b){return document.getElementById(b)},settings:function(){var a=this,b=shutterSettings;a.L10n=b.L10n||["Previous","Next","Close","Full Size","Fit to Screen","Image","of","Loading..."];a.imageCount=b.imageCount||0;a.textBtns=b.textBtns||0;a.imgDir=b.imgDir||"/wp-content/plugins/shutter-reloaded/menu/";a.FS=b.FS||0;a.oneSet=b.oneSet||0},init:function(o){var p=this,n,e,b,h,f,c,s,r,l,q,d,g;if("object"!=typeof shutterSettings){shutterSettings={}}p.settings();for(h=0,f=document.links.length;h<f;h++){n=document.links[h];b=(n.href.indexOf("?")==-1)?n.href.slice(-4).toLowerCase():n.href.substring(0,n.href.indexOf("?")).slice(-4).toLowerCase();if(b!=".jpg"&&b!=".png"&&b!=".gif"&&b!="jpeg"){continue}if(o=="sh"&&n.className.toLowerCase().indexOf("shutter")==-1){continue}if(o=="lb"&&n.rel.toLowerCase().indexOf("lightbox")==-1){continue}if(n.className&&n.className.toLowerCase().indexOf("shutterset")!=-1){s=n.className.match(/shutterset[^\s]*/g)}else{if(n.rel&&n.rel.toLowerCase().indexOf("lightbox[")!=-1){s=n.rel.replace(/\s/g,"_")}else{if(p.oneSet){s="oneSetForAllLinks"}else{s=0,r=-1}}}if(s){if(!shutterSets[s]){shutterSets[s]=[]}r=shutterSets[s].push(h)}l=n.href.slice(n.href.lastIndexOf("/")+1);e=(n.title&&n.title!=l)?n.title:"";if(!e&&n.firstChild&&n.firstChild.nodeName=="IMG"){e=n.firstChild.title||""}shutterLinks[h]={link:n.href,num:r,set:s,title:e};n.onclick=new Function('shutterReloaded.make("'+h+'");return false;')}if(!p.textBtns){q=["close.gif","prev.gif","prev-d.gif","next.gif","next-d.gif","resize1.gif","resize2.gif","resize-d.gif","loading.gif"];for(d=0,c=q.length;d<c;d++){g=new Image();g.src=p.imgDir+q[d]}}},make:function(j,g){var n=this,q,r,b="",p="",s,c,a,l,o,f,e,h=-1,d,k,i,u,m;if(!n.Top){if(typeof window.pageYOffset!="undefined"){n.Top=window.pageYOffset}else{n.Top=(document.documentElement.scrollTop>0)?document.documentElement.scrollTop:document.body.scrollTop}}if(typeof n.pgHeight=="undefined"){n.pgHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)}if(g){n.FS=(g>0)?1:0}else{n.FS=shutterSettings.FS||0}if(n.resizing){n.resizing=null}window.onresize=new Function('shutterReloaded.resize("'+j+'");');document.documentElement.style.overflowX="hidden";if(!n.VP){n._viewPort();n.VP=true}if(!(f=n.I("shShutter"))){f=document.createElement("div");f.setAttribute("id","shShutter");document.getElementsByTagName("body")[0].appendChild(f);n.hideTags()}if(!(o=n.I("shDisplay"))){o=document.createElement("div");o.setAttribute("id","shDisplay");o.style.top=n.Top+"px";document.getElementsByTagName("body")[0].appendChild(o)}f.style.height=n.pgHeight+"px";m=n.textBtns?" | ":"";if(shutterLinks[j].num>1){q=shutterSets[shutterLinks[j].set][shutterLinks[j].num-2];a=n.textBtns?n.L10n[0]:'<img src="'+n.imgDir+'prev.gif" title="'+n.L10n[0]+'" />';b='<a href="#" onclick="shutterReloaded.make('+q+');return false">'+a+"</a>"+m;s=new Image();s.src=shutterLinks[q].link}else{b=n.textBtns?'<span class="srel-d">'+n.L10n[0]+"</span>"+m:'<img class="srel-d" src="'+n.imgDir+'prev-d.gif" title="'+n.L10n[0]+'" />'}if(shutterLinks[j].num!=-1&&shutterLinks[j].num<(shutterSets[shutterLinks[j].set].length)){r=shutterSets[shutterLinks[j].set][shutterLinks[j].num];l=n.textBtns?n.L10n[1]:'<img src="'+n.imgDir+'next.gif" title="'+n.L10n[1]+'" />';p='<a href="#" onclick="shutterReloaded.make('+r+');return false">'+l+"</a>"+m;c=new Image();c.src=shutterLinks[r].link}else{p=n.textBtns?'<span class="srel-d">'+n.L10n[1]+"</span>"+m:'<img class="srel-d" src="'+n.imgDir+'next-d.gif" title="'+n.L10n[1]+'" />'}k=n.textBtns?n.L10n[2]:'<img src="'+n.imgDir+'close.gif" title="'+n.L10n[2]+'" />';d=((shutterLinks[j].num>0)&&n.imageCount)?" "+n.L10n[5]+"&nbsp;"+shutterLinks[j].num+"&nbsp;"+n.L10n[6]+"&nbsp;"+shutterSets[shutterLinks[j].set].length:"";if(n.FS){i=n.textBtns?n.L10n[4]:'<img src="'+n.imgDir+'resize2.gif" title="'+n.L10n[4]+'" />'}else{i=n.textBtns?n.L10n[3]:'<img src="'+n.imgDir+'resize1.gif" title="'+n.L10n[3]+'" />';h=1}fsbtn_d=n.textBtns?'<span class="srel-d">'+n.L10n[3]+"</span>"+m:'<img class="srel-d" src="'+n.imgDir+'resize-d.gif" title="'+n.L10n[3]+'" />';u='<span id="fullSize"><a href="#" onclick="shutterReloaded.make('+j+", "+h+');return false">'+i+"</a>"+m+'</span><span id="fullSize-d">'+fsbtn_d+"</span>";if(!(e=n.I("shNavBar"))){e=document.createElement("div");e.setAttribute("id","shNavBar");document.getElementsByTagName("body")[0].appendChild(e)}e.innerHTML=m+b+'<a href="#" onclick="shutterReloaded.hideShutter();return false">'+k+"</a>"+m+p+u+d;o.innerHTML='<div id="shWrap"><img src="'+shutterLinks[j].link+'" id="shTopImg" onload="shutterReloaded.showImg();" onclick="shutterReloaded.hideShutter();" /><div id="shTitle">'+shutterLinks[j].title+"</div></div>";window.setTimeout(function(){shutterReloaded.loading()},2000)},loading:function(){var c=this,b,d,a;if((a=c.I("shWrap"))&&a.style.visibility=="visible"){return}if(!(b=c.I("shShutter"))){return}if(c.I("shWaitBar")){return}d=document.createElement("div");d.setAttribute("id","shWaitBar");d.style.top=c.Top+"px";d.innerHTML='<img src="'+c.imgDir+'loading.gif" title="'+c.L10n[7]+'" />';b.appendChild(d)},hideShutter:function(){var c=this,d,b,a;if(d=c.I("shDisplay")){d.parentNode.removeChild(d)}if(b=c.I("shShutter")){b.parentNode.removeChild(b)}if(a=c.I("shNavBar")){a.parentNode.removeChild(a)}c.hideTags(true);window.scrollTo(0,c.Top);window.onresize=c.FS=c.Top=c.VP=null;document.documentElement.style.overflowX=""},resize:function(c){var b=this,a;if(b.resizing){return}if(!b.I("shShutter")){return}a=b.I("shWrap");if(a){a.style.visibility="hidden"}window.setTimeout(function(){shutterReloaded.resizing=null},500);window.setTimeout(new Function('shutterReloaded.VP = null;shutterReloaded.make("'+c+'");'),100);b.resizing=true},_viewPort:function(){var d=this,b=window.innerHeight?window.innerHeight:0,f=document.body.clientHeight?document.body.clientHeight:0,c=document.documentElement?document.documentElement.clientHeight:0,a,e;if(b>0){d.wHeight=((b-f)>1&&(b-f)<30)?f:b;d.wHeight=((d.wHeight-c)>1&&(d.wHeight-c)<30)?c:d.wHeight}else{d.wHeight=(c>0)?c:f}a=document.documentElement?document.documentElement.clientWidth:0;e=window.innerWidth?window.innerWidth:document.body.clientWidth;d.wWidth=(a>1)?a:e},showImg:function(){var m=this,g=m.I("shShutter"),a=m.I("shDisplay"),i=m.I("shTopImg"),f=m.I("shTitle"),n=m.I("shNavBar"),c,l,b,k,j,e,d,h=0;if(!g){return}if((c=m.I("shWrap"))&&c.style.visibility=="visible"){return}if(l=m.I("shWaitBar")){l.parentNode.removeChild(l)}g.style.width=a.style.width="";f.style.width=(i.width-4)+"px";b=n.offsetHeight?f.offsetHeight+n.offsetHeight:30;k=m.wHeight-7-b;if(m.FS){if(i.width>(m.wWidth-10)){g.style.width=a.style.width=i.width+10+"px"}document.documentElement.style.overflowX=""}else{window.scrollTo(0,m.Top);if(i.height>k){i.width=i.width*(k/i.height);i.height=k;h=1}if(i.width>(m.wWidth-16)){i.height=i.height*((m.wWidth-16)/i.width);i.width=m.wWidth-16;h=1}f.style.width=(i.width-4)+"px";n.style.bottom="0px"}j=m.Top+i.height+b+10;if(j>m.pgHeight){g.style.height=j+"px"}window.scrollTo(0,m.Top);if((m.FS&&(i.height>k||i.width>m.wWidth))||h){m.I("fullSize").style.display="inline";m.I("fullSize-d").style.display="none"}e=(k-i.height)*0.45;d=(e>3)?Math.floor(e):3;a.style.top=m.Top+d+"px";n.style.bottom="0";c.style.visibility="visible"},hideTags:function(a){var f=document.getElementsByTagName("select"),g=document.getElementsByTagName("object"),b=document.getElementsByTagName("embed"),h=document.getElementsByTagName("iframe"),e=(a)?"visible":"hidden",d,c;for(d=0,c=f.length;d<c;d++){f[d].style.visibility=e}for(d=0,c=g.length;d<c;d++){g[d].style.visibility=e}for(d=0,c=b.length;d<c;d++){b[d].style.visibility=e}for(d=0,c=h.length;d<c;d++){h[d].style.visibility=e}}};
