/*
 *  bpCountdown 1.0 - 5/12/2011 release
 *  Created by Bradyn Poulsen 2011
 *  http://www.bradynp.info/bpcountdown.html
 *
 *  For use examples, visit the address listed above.
 *
 *  Based off of http://scripts.hashemian.com/js/countdown.js
*/
function bpCountdown(a){var b={a:null,b:true,c:"12/25/2010 12:00 AM",d:"span",e:"bpCountdown",f:null,g:null,h:"~d days, ~h hours, ~m minutes, ~s seconds",i:"",j:true,k:true,l:-1},z="undefined",y="boolean",x="number";if(typeof(a.eventName)==z){a.eventName=b.a;}if(typeof(a.embedName)!=y){a.embedName=b.b;}if(typeof(a.date)==z){a.date=b.c;}if(typeof(a.element)==z || a.element==""){a.element=b.d;}if(typeof(a.class)==z){a.class=b.e;}if(typeof(a.id)==z){a.id=b.f;}if(typeof(a.style)==z){a.style=b.g;}if(typeof(a.format)==z){a.format=b.h;}if(typeof(a.complete)==z){a.complete=b.i;}if(typeof(a.lead)!=y){a.lead=b.j;}if(typeof(a.active)!=y){a.active=b.k;}if(typeof(a.step)!=x){a.step=b.l;}while(typeof(h)==z || document.getElementById(h)){h="bpCountdown-"+Math.random();}if(a.eventName && a.embedName){if(a.step<0){a.format+=" until ";}else{a.format+=" since ";}a.format+=String(a.eventName);}if(!a.complete){a.complete=a.format;if(a.eventName && a.embedName){if(a.step<0){a.complete+=" until ";}else{a.complete+=" since ";}a.complete+=String(a.eventName);}}var html="<"+String(a.element)+" id=\""+String(h);if(a.id){html+=" "+String(a.id);}html+="\"";if(a.class){html+=" class=\""+String(a.class)+"\"";}if(a.style){html+=" style=\""+String(a.style)+"\"";}html+="></"+String(a.element)+">";document.write(html);a.step=Math.ceil(a.step);if(a.step==0){a.active=false;}var g=(Math.abs(a.step)-1)*1000+990;var c=new Date(),d=new Date(a.date);if(a.step>0){e=new Date(c-d);}else{e=new Date(d-c);}f=Math.floor(e.valueOf()/1000);bpCountdown_update(f,h,a.complete,a.format,a.lead,a.active,a.step,g);}function bpCountdown_update(a,b,c,d,e,f,g,h){if(a < 0){var i=c;i=i.replace(/\~d/g, "00");i=i.replace(/\~h/g, "00");i=i.replace(/\~m/g, "00");i=i.replace(/\~s/g, "00");document.getElementById(b).innerHTML=i;return;}var i=d;i=i.replace(/\~d/g, function(){var r=((Math.floor(a/86400))%100000).toString();if(e && r.length < 2){r="0" + r;}return r;});i=i.replace(/\~h/g, function(){var r=((Math.floor(a/3600))%24).toString();if(e && r.length < 2){r="0" + r;}return r;});i=i.replace(/\~m/g, function(){var r=((Math.floor(a/60))%60).toString();if(e && r.length < 2){r="0" + r;}return r;});i=i.replace(/\~s/g, function(){var r=((Math.floor(a/1))%60).toString();if(e && r.length < 2){r="0" + r;}return r;});document.getElementById(b).innerHTML=i;setTimeout("bpCountdown_update("+(a+g)+",\""+String(b)+"\",\""+String(c)+"\",\""+String(d)+"\","+e+","+f+","+g+","+h+")",h);}

