/*
Copyright 2006-2010 Christine Blachford. All rights reserved.
*/
window.log=function(){var b="history";log[b]=log[b]||[];log[b].push(arguments);window.console&&console.log[console.firebug?"apply":"call"](console,Array.prototype.slice.call(arguments))};window.logargs=function(b){log(b,arguments.callee.caller.arguments)};var keyPressTimer=null;$(function(a){a(document).bind("mousemove mousedown mousewheel DOMMouseScroll keydown focusin",handleInputEvent);a(".adminEdit").append(handleAdmin);a("#calendarLink").live("click",toggleCalendar);a("#commentFilter").append(createCommentsFilter).prepend(createCommentsFilterPlaceholder);a("#author,#messageFormName").attr("value",function(){return a.cookie("commentAuthor")||""});a("#email,#messageFormEmail").attr("value",function(){return a.cookie("commentAuthorEmail")||""});a("#url").attr("value",function(){return a.cookie("commentAuthorUrl")||""});a("a[href^=#][href!=#]").live("click",function(b){if(b.button===0){a("html,body").animate({scrollTop:a(a(this).attr("href")).offset().top+"px"});b.preventDefault()}})});function handleInputEvent(a){if(a.type==="keydown"){if(!($(a.target).is("input,textarea"))&&!(a.ctrlKey||a.altKey||a.metaKey)){if(a.which===219&&$("a[rel^=prev]").length===1){window.location.href=$("a[rel^=prev]").attr("href")}if(a.which===221&&$("a[rel^=next]").length===1){window.location.href=$("a[rel^=next]").attr("href")}}}}function handleAdmin(){var b=null,a=0,c="",d="";b=$.cookie("wp-settings-1")||$.cookie("wp-settings-3");if(b!==null&&b!==undefined){a=$(this).parents(".post").attr("id");a=a.replace(/\D+/,"");c="/wp-admin/post.php?action=edit&post="+a+"";d+='&nbsp;[<a href="'+c+'">edit</a>]'}return d}function toggleCalendar(a){var b="";if($("#calendarDisplay").html()===""){b+='<iframe src="https://www.google.com/calendar/hosted/sidepodcast.com/embed?showTitle=0&amp;mode=AGENDA&amp;wkst=2&amp;bgcolor=%23FFFFFF&amp;showPrint=0&amp;showNav=0&amp;showTabs=0&amp;src=sidepodcast.com_c3893r6k1a12v6urv4hkg1lpe0%40group.calendar.google.com&amp;color=%23A32929&amp;src=sidepodcast.com_kj08nkbbgcos0poanjdlup46ms%40group.calendar.google.com&amp;color=%230D7813&amp;src=sidepodcast.com_b8qbobtcu3sd33u69m7182atq4%40group.calendar.google.com&amp;color=%23AB8B00&amp;src=sidepodcast.com_vbs29ake37mf1n3hser5aknt8c%40group.calendar.google.com&amp;color=%231B887A&amp;src=sidepodcast.com_7tlldtgdkcv6g3v3unnrcl3eak%40group.calendar.google.com&amp;color=%23B1440E&amp;src=sidepodcast.com_7v2hl2eak2m2tchf8k946tf34k%40group.calendar.google.com&amp;color=%235229A3&amp;ctz=Europe%2FLondon" width="298" height="298" frameborder="0" scrolling="no"></iframe>';b+='<p id="calendarMoreText" class="noMargin"><a href="/calendar/">View calendar in more detail</a></p>';$("#calendarDisplay").append(b).slideToggle("slow")}else{$("#calendarDisplay").slideToggle("slow")}a.preventDefault()}function createCommentsFilter(b){var a;a=$("<input />",{id:"commentFilterInput",keyup:function(c){if(keyPressTimer!==null){clearTimeout(keyPressTimer)}keyPressTimer=setTimeout(filterCommentTree,1100,c)},placeholder:"Filter comments",title:"Start filter with - (minus symbol) to exclude comments",});if("placeholder" in document.createElement("input")){a.attr("type","search")}return a}function createCommentsFilterPlaceholder(a){var b;if("placeholder" in document.createElement("input")){return}b=$("<span />",{text:"Filter: "});return b}function filterCommentTree(c){var d,b=false,a=false;d=$("#commentFilterInput").val();d=d.toLowerCase();if(d.indexOf("-")===0){d=d.substring(1);a=true}$("#commentsList li").each(function(e,f){b=!($(this).text().toLowerCase().indexOf(d)===-1);if((!a&&!b)||(a&&b)){$(this).slideUp(500)}else{$(this).slideDown(500)}})}function sortNumber(d,c){return d-c}function sortNameAscending(b,a){if(b.name.toLowerCase()>a.name.toLowerCase()){return 1}else{if(b.name.toLowerCase()<a.name.toLowerCase()){return -1}}return 0}if(!Array.indexOf){Array.prototype.indexOf=function(b){var a;for(a=0;a<this.length;a++){if(this[a]==b){return a}}return -1}}jQuery.cookie=function(b,h,l){var d="",k="",f="",a="",c=null,j,e,g;if(typeof h!=="undefined"){l=l||{};if(h===null){h="";l.expires=-1}if(l.expires&&(typeof l.expires==="number"||l.expires.toUTCString)){if(typeof l.expires==="number"){e=new Date();e.setTime(e.getTime()+(l.expires*24*60*60*1000))}else{e=l.expires}d="; expires="+e.toUTCString()}k=l.path?"; path="+(l.path):"";f=l.domain?"; domain="+(l.domain):"";a=l.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(h),d,k,f,a].join("")}else{if(document.cookie&&document.cookie!==""){j=document.cookie.split(";");for(g=0;g<j.length;g++){cookie=jQuery.trim(j[g]);if(cookie.substring(0,b.length+1)==(b+"=")){c=decodeURIComponent(cookie.substring(b.length+1).replace(/\+/g," "));break}}}return c}};