
jQuery.noConflict();if('function'!=typeof getCookie){getCookie=function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return false;}
else{begin+=2;}
var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length;}
return unescape(dc.substring(begin+prefix.length,end));}}
if('function'!=typeof setCookie){setCookie=function(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}}
function view_archive_month(url){if(url!=''){location.href=url;}}
if('function'!=typeof addLoadEvent){addLoadEvent=function(func){var oldonload=window.onload;if(typeof window.onload!='function')window.onload=func;else window.onload=function(){oldonload();func();}}}
var commentPreview;var commentPreviewLast='';var emptyString="Click the &quot;Preview&quot; button to preview your comment here.";var acpFormElement;var inputElement;var outputElement;var doitElement;var authorElement;var urlElement;function commentPreviewInit(){doitElement=document.getElementById('acp-preview');if(doitElement){acpFormElement=doitElement.parentNode;while('form'!=acpFormElement.tagName.toLowerCase())
acpFormElement=acpFormElement.parentNode;inputElement=acpGetFormInput('comment');outputElement=document.getElementById('ajax-comment-preview');authorElement=acpGetFormInput('author');urlElement=acpGetFormInput('url');if(inputElement==null||outputElement==null||doitElement==null)return;if(''==emptyString)outputElement.style.display='none';else outputElement.innerHTML=emptyString;}}
addLoadEvent(commentPreviewInit);function acpGetFormInput(el){for(i=0;i<acpFormElement.elements.length;i++)
if(el==acpFormElement.elements[i].name)
return acpFormElement.elements[i];}
function commentPreviewAJAX(){var req='';var newSack=false;commentPreview=new sack('/index.php');var sep=commentPreview.argumentSeparator?commentPreview.argumentSeparator:'&';commentPreview.method='POST';commentPreview.encodeURIString=false;commentPreview.onLoading=function(){outputElement.innerHTML='Loading.';};commentPreview.onLoaded=function(){outputElement.innerHTML+='.';};commentPreview.onInteractive=function(){outputElement.innerHTML+='.';};commentPreview.onCompletion=function(){outputElement.innerHTML=commentPreview.response;};commentPreview.encVar('ak_action','comment_preview');req=commentPreview.encVar('text',inputElement.value);if(req){req+=authorElement?sep+commentPreview.encVar('author',authorElement.value):'';req+=urlElement?sep+commentPreview.encVar('url',urlElement.value):'';}else{if(authorElement)commentPreview.encVar('author',authorElement.value);if(urlElement)commentPreview.encVar('url',urlElement.value);req=new Array();for(key in commentPreview.vars)
req[req.length]=key+"="+commentPreview.vars[key][0];req=req.join(sep);newSack=true;}
if(req!=commentPreviewLast&&''!=inputElement.value){commentPreview.runAJAX(newSack?'':req);}
else if(''==inputElement.value){if(''==emptyString){outputElement.innerHTML='';outputElement.style.display="none";}
else outputElement.innerHTML=emptyString;}
commentPreviewLast=req;}
function atdCookieExpand(){jQuery('#cookie_more_link').css('display','none');jQuery('#cookie_box').addClass('open');jQuery("#cookie_more").slideDown("slow");jQuery("#cookie_footer").slideDown("slow");}
function atdCookieCollapse(){jQuery("#cookie_more").slideUp("slow");jQuery("#cookie_footer").slideUp("slow");jQuery('#cookie_more_link').show();jQuery('#cookie_box').setClass('');}
function atdCookieHide(){if(document.all){jQuery('#cookie_notice').css('display','none');jQuery('#cookie_box').css('display','none');}else{jQuery('#cookie_box').fadeOut('slow');}}
function atdCookieShow(){var cookie_value=getCookie('atd_cookie_notice');if(!cookie_value){setCookie('atd_cookie_notice',1,3600,'/','.allthingsd.com');}
if(getCookie('atd_cookie_notice')=='1'){jQuery.get('/display_cookie_notice/',false,function(data,textStatus){jQuery('#cookie_box').html(data);jQuery('#cookie_notice').css("display","block");if(document.all){jQuery('#cookie_box').css('display','block');}else{jQuery('#cookie_box').fadeIn('slow');}},'text');setCookie('atd_cookie_notice',2,3600,'/','.allthingsd.com');}}
addLoadEvent(atdCookieShow);function atdStartDynamic()
{var blocks=jQuery('div.atd_dc');blocks.each(function(index){var id=this.id;var items=this.getElementsByTagName('div');if(items){var len=items.length;var toShow=-1;var toHide=-1;if(len>1){for(var i=0;i<len;i++){var item=items[i];var display=jQuery(item).css('display');if(display=='block'||display==''){toHide=i;toShow=(i==len-1)?0:i+1;}
if(i!=toShow&&i!=toHide){jQuery(item).css('display','none');}}}
if(toHide!=-1&&toShow!=-1){toShowObj=items[toShow];toHideObj=items[toHide];jQuery(toHideObj).fadeOut('slow');jQuery(toShowObj).fadeIn('slow');}}});}
jQuery(document).ready(function(){setInterval('atdStartDynamic()',7000);});var atd_refresh_url=unescape(window.location.pathname);var atd_refresh_timer_running=true;var atd_refresh_interval=900000;var atd_refresh_timer=null;function atd_mousemove(evt){if(atd_refresh_timer_running){clearTimeout(atd_refresh_timer);atd_refresh_timer=setTimeout('atd_refresh_page()',atd_refresh_interval);}}
function atd_refresh_page(){if(typeof dj.context.video.players!="undefined"){for(var i=0;i<dj.context.video.players.length;i++){var objID=dj.context.video.players[i][0];var duration=dj.context.video.players[i][1];var lastSeek=dj.context.video.players[i][2];var swf=swfobject.getObjectById(objID);console.log("Checking video player: "+objID+" with duration: "+duration);if(swf){var seek=swf.getSeek();if(seek>0&&seek<duration&&seek!=lastSeek){console.log("Video is active and playing and not paused. Don't refresh the page. Get Seek:"+swf.getSeek());dj.context.video.players[i][2]=seek;clearTimeout(atd_refresh_timer);atd_refresh_timer=setTimeout('atd_refresh_page()',atd_refresh_interval);return;}else{}}}}
if(jsver==1.0){window.location.href=atd_refresh_url;}else if(jsver==1.1){window.location.replace(atd_refresh_url);}else if(jsver>=1.2){window.location.reload(true);}}
function atd_refresh_start(){atd_refresh_timer_running=true;atd_refresh_timer=setTimeout('atd_refresh_page()',atd_refresh_interval);jQuery(window).mousemove(function(evt){atd_mousemove(evt);});}
jQuery(document).ready(function(){atd_refresh_start();});

