<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Webmaster Sucks &#187; countdown javascript</title>
	<atom:link href="http://www.webmastersucks.com/tags/countdown-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webmastersucks.com</link>
	<description>Here I share stuff I used to suck at as a novice webmaster..</description>
	<lastBuildDate>Mon, 13 Jun 2011 06:39:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Countdown Date &amp; Time JavaScript</title>
		<link>http://www.webmastersucks.com/countdown-date-time-javascript/</link>
		<comments>http://www.webmastersucks.com/countdown-date-time-javascript/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 16:57:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Html & Javascript]]></category>
		<category><![CDATA[countdown]]></category>
		<category><![CDATA[countdown date]]></category>
		<category><![CDATA[countdown javascript]]></category>
		<category><![CDATA[countdown time]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.webmastersucks.com/?p=158</guid>
		<description><![CDATA[
			
				
			
		
I need javascript to countdown a date but with time. I search a lot and find a solution. Here it is  
You can use in your HTML file:
Dont worry! Only &#60;script language=&#34;JavaScript&#34;&#62;
TargetDate = &#34;6/11/2010 1:00&#34;;
BackColor = &#34;white&#34;;
ForeColor = &#34;navy&#34;;
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = &#34;%%D%% Day, %%H%% Hour, %%M%% Minute, %%S%% Second [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webmastersucks.com%2Fcountdown-date-time-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webmastersucks.com%2Fcountdown-date-time-javascript%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I need javascript to countdown a date but with time. I search a lot and find a solution. Here it is <img src='http://www.webmastersucks.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>You can use in your HTML file:</strong></p>
<pre class="brush: jscript; title: ;">Dont worry! Only &lt;script language=&quot;JavaScript&quot;&gt;
TargetDate = &quot;6/11/2010 1:00&quot;;
BackColor = &quot;white&quot;;
ForeColor = &quot;navy&quot;;
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = &quot;%%D%% Day, %%H%% Hour, %%M%% Minute, %%S%% Second &quot;;
FinishMessage = &quot;World cup start..&quot;;
&lt;/script&gt;
&lt;script language=&quot;JavaScript&quot; src=&quot;countdown.js&quot;&gt;&lt;/script&gt; left to begin World Cup 2010.</pre>
<p><span id="more-158"></span><br />
<strong>countdown.js</strong></p>
<pre class="brush: jscript; title: ;">/*
Author: Robert Hashemian
&lt;a href=&quot;http://www.hashemian.com/&quot;&gt;http://www.hashemian.com/&lt;/a&gt;

You can use this code in any manner so long as the author's
name, Web address and this disclaimer is kept intact.
*/

function calcage(secs, num1, num2) {
  s = ((Math.floor(secs/num1))%num2).toString();
  if (LeadingZero &amp;&amp; s.length &lt; 2)
    s = &quot;0&quot; + s;
  return &quot;&lt;b&gt;&quot; + s + &quot;&lt;/b&gt;&quot;;
}

function CountBack(secs) {
  if (secs &lt; 0) {
    document.getElementById(&quot;cntdwn&quot;).innerHTML = FinishMessage;
    return;
  }
  DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));
  DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));
  DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));
  DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));

  document.getElementById(&quot;cntdwn&quot;).innerHTML = DisplayStr;
  if (CountActive)
    setTimeout(&quot;CountBack(&quot; + (secs+CountStepper) + &quot;)&quot;, SetTimeOutPeriod);
}

function putspan(backcolor, forecolor) {
 document.write(&quot;&lt;span id='cntdwn' style='background-color:&quot; + backcolor +
                &quot;; color:&quot; + forecolor + &quot;'&gt;&lt;/span&gt;&quot;);
}

if (typeof(BackColor)==&quot;undefined&quot;)
  BackColor = &quot;white&quot;;
if (typeof(ForeColor)==&quot;undefined&quot;)
  ForeColor= &quot;black&quot;;
if (typeof(TargetDate)==&quot;undefined&quot;)
  TargetDate = &quot;12/31/2020 5:00 AM&quot;;
if (typeof(DisplayFormat)==&quot;undefined&quot;)
  DisplayFormat = &quot;%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.&quot;;
if (typeof(CountActive)==&quot;undefined&quot;)
  CountActive = true;
if (typeof(FinishMessage)==&quot;undefined&quot;)
  FinishMessage = &quot;&quot;;
if (typeof(CountStepper)!=&quot;number&quot;)
  CountStepper = -1;
if (typeof(LeadingZero)==&quot;undefined&quot;)
  LeadingZero = true;
CountStepper = Math.ceil(CountStepper);
if (CountStepper == 0)
  CountActive = false;
var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
putspan(BackColor, ForeColor);
var dthen = new Date(TargetDate);
var dnow = new Date();
if(CountStepper&gt;0)
  ddiff = new Date(dnow-dthen);
else
  ddiff = new Date(dthen-dnow);
gsecs = Math.floor(ddiff.valueOf()/1000);
CountBack(gsecs);
</pre>
<p>Script Author: <a href="http://www.hashemian.com/" target="_blank">Robert Hashemian</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webmastersucks.com/countdown-date-time-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

