<?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>Ruben Sargsyan &#187; JavaScript</title>
	<atom:link href="http://rubensargsyan.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubensargsyan.com</link>
	<description>Personal Website</description>
	<lastBuildDate>Fri, 27 Aug 2010 07:08:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Count of all external links of the web page</title>
		<link>http://rubensargsyan.com/count-of-all-external-links-of-the-web-page/</link>
		<comments>http://rubensargsyan.com/count-of-all-external-links-of-the-web-page/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 11:40:40 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[external links]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=402</guid>
		<description><![CDATA[This is a JavaScript script for counting all external links of the web page. Just add this script after the tag &#60;/body&#62;: &#60;script type=&#34;text/javascript&#34;&#62; var all_a = document.getElementsByTagName&#40;&#34;a&#34;&#41;; &#160; var this_link = window.location.toString&#40;&#41;; this_link = this_link.substr&#40;7,parseInt&#40;this_link.indexOf&#40;&#34;/&#34;,7&#41;-7&#41;&#41;; &#160; var external_links_count = 0; &#160; for&#40;var i=0; i&#60;all_a.length; i++&#41;&#123; if&#40;all_a&#91;i&#93;.href.indexOf&#40;this_link&#41;==-1&#41;&#123; external_links_count++; &#125; &#125; &#160; alert&#40;&#34;External links count is: [...]]]></description>
			<content:encoded><![CDATA[<p>This is a JavaScript script for counting all external links of the web page<span id="more-402"></span>. Just add this script after the tag &lt;/body&gt;:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">var</span> all_a <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> this_link <span style="color: #339933;">=</span> window.<span style="color: #660066;">location</span>.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
this_link <span style="color: #339933;">=</span> this_link.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">7</span><span style="color: #339933;">,</span>parseInt<span style="color: #009900;">&#40;</span>this_link.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">7</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> external_links_count <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>all_a.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>all_a<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>this_link<span style="color: #009900;">&#41;</span><span style="color: #339933;">==-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        external_links_count<span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;External links count is: &quot;</span><span style="color: #339933;">+</span>external_links_count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/count-of-all-external-links-of-the-web-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Countdown Clock</title>
		<link>http://rubensargsyan.com/countdown-clock/</link>
		<comments>http://rubensargsyan.com/countdown-clock/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 12:09:20 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[countdown]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=390</guid>
		<description><![CDATA[This script is an example of countdown clock. You can set seconds and start countdown. &#60;html&#62; &#160; &#60;head&#62; &#60;title&#62;Countdown Clock&#60;/title&#62; &#160; &#60;script type=&#34;text/javascript&#34;&#62; function convert&#40;&#41;&#123; var seconds = document.getElementById&#40;&#34;inputted_seconds&#34;&#41;.value; &#160; if&#40;isNaN&#40;seconds&#41;&#41;&#123; alert&#40;&#34;Please enter a valid number.&#34;&#41;; &#125;else&#123; document.getElementById&#40;&#34;inputted_seconds&#34;&#41;.setAttribute&#40;&#34;disabled&#34;,&#34;disabled&#34;&#41;; document.getElementById&#40;&#34;start&#34;&#41;.setAttribute&#40;&#34;disabled&#34;,&#34;disabled&#34;&#41;; &#160; var days = seconds/60/60/24; days = parseInt&#40;days.toString&#40;&#41;&#41;; &#160; seconds = seconds - days*24*60*60; &#160; var [...]]]></description>
			<content:encoded><![CDATA[<p>This script is an example of countdown clock. You can set seconds and start countdown<span id="more-390"></span>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;html&gt;
&nbsp;
&lt;head&gt;
  &lt;title&gt;Countdown Clock&lt;/title&gt;
&nbsp;
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
  <span style="color: #003366; font-weight: bold;">function</span> convert<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> seconds <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;inputted_seconds&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>isNaN<span style="color: #009900;">&#40;</span>seconds<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Please enter a valid number.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;inputted_seconds&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;disabled&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;disabled&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;start&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;disabled&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;disabled&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> days <span style="color: #339933;">=</span> seconds<span style="color: #339933;">/</span><span style="color: #CC0000;">60</span><span style="color: #339933;">/</span><span style="color: #CC0000;">60</span><span style="color: #339933;">/</span><span style="color: #CC0000;">24</span><span style="color: #339933;">;</span>
        days <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>days.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        seconds <span style="color: #339933;">=</span> seconds <span style="color: #339933;">-</span> days<span style="color: #339933;">*</span><span style="color: #CC0000;">24</span><span style="color: #339933;">*</span><span style="color: #CC0000;">60</span><span style="color: #339933;">*</span><span style="color: #CC0000;">60</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> hours <span style="color: #339933;">=</span> seconds<span style="color: #339933;">/</span><span style="color: #CC0000;">60</span><span style="color: #339933;">/</span><span style="color: #CC0000;">60</span><span style="color: #339933;">;</span>
        hours <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>hours.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        seconds <span style="color: #339933;">=</span> seconds <span style="color: #339933;">-</span> hours<span style="color: #339933;">*</span><span style="color: #CC0000;">60</span><span style="color: #339933;">*</span><span style="color: #CC0000;">60</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> minutes <span style="color: #339933;">=</span> seconds<span style="color: #339933;">/</span><span style="color: #CC0000;">60</span><span style="color: #339933;">;</span>
        minutes <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>minutes.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        seconds <span style="color: #339933;">=</span> seconds <span style="color: #339933;">-</span> minutes<span style="color: #339933;">*</span><span style="color: #CC0000;">60</span><span style="color: #339933;">;</span>
&nbsp;
        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;countdown_clock&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> days<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;d &quot;</span><span style="color: #339933;">+</span>hours<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;h &quot;</span><span style="color: #339933;">+</span>minutes<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;m &quot;</span><span style="color: #339933;">+</span>seconds<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;s&quot;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
        t <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;start_countdown(&quot;</span><span style="color: #339933;">+</span>days<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #339933;">+</span>hours<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #339933;">+</span>minutes<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #339933;">+</span>seconds<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">function</span> start_countdown<span style="color: #009900;">&#40;</span>days<span style="color: #339933;">,</span>hours<span style="color: #339933;">,</span>minutes<span style="color: #339933;">,</span>seconds<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>seconds<span style="color: #339933;">==-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            minutes<span style="color: #339933;">--;</span>
            seconds <span style="color: #339933;">=</span> <span style="color: #CC0000;">59</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>minutes<span style="color: #339933;">==-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            hours<span style="color: #339933;">--;</span>
            minutes <span style="color: #339933;">=</span> <span style="color: #CC0000;">59</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hours<span style="color: #339933;">==-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>days<span style="color: #339933;">&gt;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                days<span style="color: #339933;">--;</span>
                hours <span style="color: #339933;">=</span> <span style="color: #CC0000;">23</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;countdown_clock&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> days<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;d &quot;</span><span style="color: #339933;">+</span>hours<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;h &quot;</span><span style="color: #339933;">+</span>minutes<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;m &quot;</span><span style="color: #339933;">+</span>seconds<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;s&quot;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>days<span style="color: #339933;">==</span><span style="color: #CC0000;">0</span> <span style="color: #339933;">&amp;&amp;</span> hours<span style="color: #339933;">==</span><span style="color: #CC0000;">0</span> <span style="color: #339933;">&amp;&amp;</span> minutes<span style="color: #339933;">==</span><span style="color: #CC0000;">0</span> <span style="color: #339933;">&amp;&amp;</span> seconds<span style="color: #339933;">==</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Countdown is finished.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;inputted_seconds&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;disabled&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;start&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;disabled&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;countdown_clock&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Countdown is finished.&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
            seconds<span style="color: #339933;">--;</span>
            t <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;start_countdown(&quot;</span><span style="color: #339933;">+</span>days<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #339933;">+</span>hours<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #339933;">+</span>minutes<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,&quot;</span><span style="color: #339933;">+</span>seconds<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/head&gt;
&nbsp;
&lt;body&gt;
&nbsp;
&lt;label for=&quot;inputted_seconds&quot;&gt;Input Seconds&lt;/label&gt; &lt;input type=&quot;text&quot; id=&quot;inputted_seconds&quot; /&gt; &lt;input type=&quot;button&quot; id=&quot;start&quot; value=&quot;Start Countdown&quot; onclick=&quot;convert();&quot; /&gt;
&nbsp;
&lt;div id=&quot;countdown_clock&quot;&gt;&lt;/div&gt;
&nbsp;
&lt;/body&gt;
&nbsp;
&lt;/html&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/countdown-clock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grayscale</title>
		<link>http://rubensargsyan.com/grayscale/</link>
		<comments>http://rubensargsyan.com/grayscale/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 13:50:50 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Grayscale]]></category>
		<category><![CDATA[image manipulation]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=318</guid>
		<description><![CDATA[This is an image manipulation script that makes the selected photos grayscale and in the case of mouseover the colors are restored. It is easy to use, just put &#8220;grayscale&#8221; as the classes of the images. It used PHP and JavaScript for developing the script. How To Use: 1. Include grayscale.js: &#60;script src=&#8221;grayscale/grayscale.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62; 2. [...]]]></description>
			<content:encoded><![CDATA[<p>This is an image manipulation script that makes the selected photos grayscale and in the case of mouseover the colors are restored. It is easy to use, just put &#8220;grayscale&#8221; as the classes of the images. It used PHP and JavaScript for developing the script.<span id="more-318"></span></p>
<h2>How To Use:</h2>
<p>1. Include grayscale.js:</p>
<div style="color: #993300">&lt;script src=&#8221;grayscale/grayscale.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</div>
<p>2. Put &#8220;grayscale&#8221; as the classes of the images.</p>
<h2>Demo:</h2>
<p><a href="http://rubensargsyan.com/demo/grayscale/" target="_blank">Demo</a></p>
<h2>Version:</h2>
<p>1.0</p>
<h2>License:</h2>
<p><a rel="license" href="http://creativecommons.org/licenses/by/3.0/us/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/us/88x31.png" /></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">Grayscale</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://rubensargsyan.com/" property="cc:attributionName" rel="cc:attributionURL">Ruben Sargsyan</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons Attribution 3.0 United States License</a>.<br />Based on a work at <a xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://rubensargsyan.com/grayscale/" rel="dc:source">rubensargsyan.com</a>.</p>
<h2>Download:</h2>
<p><a href="http://rubensargsyan.com/downloads/grayscale.zip">From rubensargsyan.com</a></p>
<h2>Donate:</h2>
<p>If you find this script useful to you, please consider making a small donation to assist in further development contribution. Thanks for your kind support!</p>
<form style="padding: 0px, margin: 0px" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="roobensargsyan@gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Ruben Sargsyan">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/grayscale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Text counter by JavaScript</title>
		<link>http://rubensargsyan.com/text-counter-by-javascript/</link>
		<comments>http://rubensargsyan.com/text-counter-by-javascript/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 10:36:47 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=270</guid>
		<description><![CDATA[This is an example for adding a counter to the inputing texts of tags &#60;textarea&#62; and &#60;input&#62;: &#60;html&#62; &#160; &#60;head&#62; &#60;title&#62;Text Counter&#60;/title&#62; &#160; &#60;script type=&#34;text/javascript&#34;&#62; function text_counter&#40;textfield_id,counter_id,count&#41;&#123; count = parseInt&#40;count&#41;; &#160; document.getElementById&#40;counter_id&#41;.innerHTML = count; &#160; document.getElementById&#40;textfield_id&#41;.onpropertychange = function&#40;&#41;&#123; text_count_changed&#40;textfield_id,counter_id,count&#41;; &#125; &#125; &#160; function text_count_changed&#40;textfield_id,counter_id,count&#41;&#123; if&#40;count-parseInt&#40;document.getElementById&#40;textfield_id&#41;.value.length&#41;&#60;0&#41;&#123; document.getElementById&#40;textfield_id&#41;.value = document.getElementById&#40;textfield_id&#41;.value.substr&#40;0,count&#41;; &#125; &#160; document.getElementById&#40;counter_id&#41;.innerHTML = count-parseInt&#40;document.getElementById&#40;textfield_id&#41;.value.length&#41;; &#125; &#60;/script&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>This is an example for adding a counter to the inputing texts of tags &lt;textarea&gt; and &lt;input&gt;:<span id="more-270"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;html&gt;
&nbsp;
&lt;head&gt;
  &lt;title&gt;Text Counter&lt;/title&gt;
&nbsp;
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
  <span style="color: #003366; font-weight: bold;">function</span> text_counter<span style="color: #009900;">&#40;</span>textfield_id<span style="color: #339933;">,</span>counter_id<span style="color: #339933;">,</span>count<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    count <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>counter_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> count<span style="color: #339933;">;</span>
&nbsp;
    document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">onpropertychange</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        text_count_changed<span style="color: #009900;">&#40;</span>textfield_id<span style="color: #339933;">,</span>counter_id<span style="color: #339933;">,</span>count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">function</span> text_count_changed<span style="color: #009900;">&#40;</span>textfield_id<span style="color: #339933;">,</span>counter_id<span style="color: #339933;">,</span>count<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>count<span style="color: #339933;">-</span>parseInt<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span>.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>counter_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> count<span style="color: #339933;">-</span>parseInt<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>textfield_id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/head&gt;
&nbsp;
&lt;body&gt;
&lt;p&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>inputtext_approving_chars_count <span style="color: #339933;">=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;input type=&quot;text&quot; id=&quot;inputtext&quot; oninput='text_count_changed(&quot;inputtext&quot;,&quot;inputtext_counter&quot;,inputtext_approving_chars_count);'&gt; &lt;span id=&quot;inputtext_counter&quot;&gt;&lt;/span&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>text_counter<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;inputtext&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;inputtext_counter&quot;</span><span style="color: #339933;">,</span>inputtext_approving_chars_count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/p&gt;
&nbsp;
&lt;p&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>textfield_approving_chars_count <span style="color: #339933;">=</span> <span style="color: #CC0000;">255</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;textarea id=&quot;textfield&quot; cols=&quot;50&quot; rows=&quot;10&quot; oninput='text_count_changed(&quot;textfield&quot;,&quot;textfield_counter&quot;,textfield_approving_chars_count);'&gt;&lt;/textarea&gt; &lt;span id=&quot;textfield_counter&quot;&gt;&lt;/span&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>text_counter<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textfield&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;textfield_counter&quot;</span><span style="color: #339933;">,</span>textfield_approving_chars_count<span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/p&gt;
&nbsp;
&lt;/body&gt;
&nbsp;
&lt;/html&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/text-counter-by-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Last Visited Pages</title>
		<link>http://rubensargsyan.com/the-last-visited-pages/</link>
		<comments>http://rubensargsyan.com/the-last-visited-pages/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 08:28:57 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[DOM]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[the last visited pages]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=239</guid>
		<description><![CDATA[Setting this script on your website will give your visitors the great opportunity to see their last visited pages of your website. The visited pages links are created by using DOM and JavaScript. Script is working by the Cookies (the visited pages are kept for example about a month &#8211; the period is decided by [...]]]></description>
			<content:encoded><![CDATA[<p>Setting this script on your website will give your visitors the great opportunity to see their last visited pages of your website. The visited pages links are created by using DOM and JavaScript. Script is working by the Cookies (the visited pages are kept for example about a month &#8211; the period is decided by you). The quantity of the shown links are set by you. So, this is a very effective and comfortable script, that will be very pleasant for the visitors of your website.<span id="more-239"></span></p>
<h2>How To Use:</h2>
<p>1. Copy the <a href="http://rubensargsyan.com/downloads/the_last_visited_pages/the_last_visited_pages.js">the_last_visited_pages.js</a> and <a href="http://rubensargsyan.com/downloads/the_last_visited_pages/the_last_visited_pages.css">the_last_visited_pages.css</a> into your website directory.</p>
<p>2. Write in the &lt;head&gt;&lt;/head&gt;<br />
<span style="color: #993300;">&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;the_last_visited_pages.css&#8221; type=&#8221;text/css&#8221; /&gt;<br />
&lt;script src=&#8221;the_last_visited_pages.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</span></p>
<p>3. Set <span style="color: #993300;">&lt;div id=&#8221;the_last_visited_pages&#8221;&gt;&lt;/div&gt;</span> where you want to show the last visited pages of the visitor.</p>
<p>4. Add <span style="color: #993300;">&lt;script type=&#8221;text/javascript&#8221;&gt;start_the_last_visited_pages();&lt;/script&gt;</span> just after &lt;/body&gt;</p>
<h2>How To Customize:</h2>
<p>You can use CSS to style it. Edit the code in the_last_visited_pages.css</p>
<h2>Version:</h2>
<p>1.0</p>
<h2>License:</h2>
<p><a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" /></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" property="dc:title">The Last Visited Pages</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://rubensargsyan.com/" property="cc:attributionName" rel="cc:attributionURL">Ruben Sargsyan</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.<br />Based on a work at <a xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://rubensargsyan.com/the-last-visited-pages/" rel="dc:source">rubensargsyan.com</a>.</p>
<h2>Donate:</h2>
<p>If you find this script useful to you, please consider making a small donation to assist in further development contribution. Thanks for your kind support!</p>
<form style="padding: 0px, margin: 0px" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="roobensargsyan@gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Ruben Sargsyan">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/the-last-visited-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable all links by javascript</title>
		<link>http://rubensargsyan.com/disable-all-links-by-javascript/</link>
		<comments>http://rubensargsyan.com/disable-all-links-by-javascript/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 16:45:25 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=232</guid>
		<description><![CDATA[To disable all links of a web page add the script bellow just after &#60;/body&#62; &#60;script type=&#34;text/javascript&#34;&#62; var all_links = document.getElementsByTagName&#40;&#34;a&#34;&#41;; &#160; for&#40;var i=0; i&#60;all_links.length; i++&#41;&#123; all_links&#91;i&#93;.removeAttribute&#40;&#34;href&#34;&#41;; &#125; &#60;/script&#62;]]></description>
			<content:encoded><![CDATA[<p>To disable all links of a web page add the script bellow just after &lt;/body&gt;<span id="more-232"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #003366; font-weight: bold;">var</span> all_links <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>all_links.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        all_links<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">removeAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/disable-all-links-by-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing time by JavaScript</title>
		<link>http://rubensargsyan.com/passing-time-by-javascript/</link>
		<comments>http://rubensargsyan.com/passing-time-by-javascript/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 08:00:11 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[passing time]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=182</guid>
		<description><![CDATA[This script shows the passing time from the date you wish. &#60;html&#62; &#60;head&#62; &#60;title&#62;Passing time&#60;/title&#62; &#160; &#60;script type=&#34;text/javascript&#34;&#62; var from_date = &#34;Dec 18, 2009 12:00:00&#34;; // Set the date from which the passing time will be shown &#160; var d = new Date&#40;&#41;; var current_time = d.getTime&#40;&#41;; &#160; var from_time = Date.parse&#40;from_date&#41;; &#160; var diference_in_milliseconds [...]]]></description>
			<content:encoded><![CDATA[<p>This script shows the passing time from the date you wish.<span id="more-182"></span></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>Passing time<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
&nbsp;
        <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
            var from_date <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Dec 18, 2009 12:00:00&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Set the date from which the passing time will be shown</span>
&nbsp;
            var d <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            var current_time <span style="color: #339933;">=</span> d.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            var from_time <span style="color: #339933;">=</span> <span style="color: #003399;">Date</span>.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span>from_date<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            var diference_in_milliseconds <span style="color: #339933;">=</span> current_time <span style="color: #339933;">-</span> from_time<span style="color: #339933;">;</span>
&nbsp;
            var passed_days <span style="color: #339933;">=</span> diference_in_milliseconds<span style="color: #339933;">/</span><span style="color: #cc66cc;">1000</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">;</span>
            passed_days <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>passed_days.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            rest_milliseconds <span style="color: #339933;">=</span> diference_in_milliseconds <span style="color: #339933;">-</span> passed_days<span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">1000</span><span style="color: #339933;">;</span>
&nbsp;
            var passed_hours <span style="color: #339933;">=</span> rest_milliseconds<span style="color: #339933;">/</span><span style="color: #cc66cc;">1000</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>
            passed_hours <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>passed_hours.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            rest_milliseconds <span style="color: #339933;">=</span> rest_milliseconds <span style="color: #339933;">-</span> passed_hours<span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">1000</span><span style="color: #339933;">;</span>
&nbsp;
            var passed_minutes <span style="color: #339933;">=</span> rest_milliseconds<span style="color: #339933;">/</span><span style="color: #cc66cc;">1000</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>
            passed_minutes <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>passed_minutes.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            rest_milliseconds <span style="color: #339933;">=</span> rest_milliseconds <span style="color: #339933;">-</span> passed_minutes<span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">1000</span><span style="color: #339933;">;</span>
&nbsp;
            var passed_seconds <span style="color: #339933;">=</span> rest_milliseconds<span style="color: #339933;">/</span><span style="color: #cc66cc;">1000</span><span style="color: #339933;">;</span>
            passed_seconds <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>passed_seconds.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            var t<span style="color: #339933;">;</span> 
&nbsp;
            function passing_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>passed_seconds<span style="color: #339933;">==</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                    passed_minutes <span style="color: #339933;">=</span> passed_minutes <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
                    passed_seconds <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>passed_minutes<span style="color: #339933;">==</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                    passed_hours <span style="color: #339933;">=</span> passed_hours <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
                    passed_minutes <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>passed_hours<span style="color: #339933;">==</span><span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                    passed_days <span style="color: #339933;">=</span> passed_days <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
                    passed_hours <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
&nbsp;
                document.<span style="color: #006633;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;passing_time&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">innerHTML</span> <span style="color: #339933;">=</span> passed_days<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; days, &quot;</span><span style="color: #339933;">+</span>passed_hours<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; hours, &quot;</span><span style="color: #339933;">+</span>passed_minutes<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; minutes, &quot;</span><span style="color: #339933;">+</span>passed_seconds<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; seconds.&quot;</span><span style="color: #339933;">;</span>
                passed_seconds <span style="color: #339933;">=</span> passed_seconds <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
                t <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;passing_time()&quot;</span>,<span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;passing_time&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>passing_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/passing-time-by-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check/uncheck checkboxes by JavaScript</title>
		<link>http://rubensargsyan.com/checkuncheck-checkboxes-by-javascript/</link>
		<comments>http://rubensargsyan.com/checkuncheck-checkboxes-by-javascript/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 13:34:40 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[check/uncheck]]></category>
		<category><![CDATA[checkboxes]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=149</guid>
		<description><![CDATA[The easy way to check/uncheck checkboxes. Insert into &#60;head&#62;&#60;/head&#62; this script &#60;script type=&#34;text/javascript&#34;&#62; function check_all&#40;&#41;&#123; var all_inputs = document.getElementsByTagName&#40;&#34;input&#34;&#41;; &#160; for&#40;i=0; i&#60;all_inputs.length; i++&#41;&#123; if&#40;all_inputs&#91;i&#93;.type==&#34;checkbox&#34; &#38;&#38; all_inputs&#91;i&#93;.className==&#34;check_uncheck&#34;&#41;&#123; all_inputs&#91;i&#93;.checked = &#34;checked&#34;; &#125; &#125; &#125; &#160; function uncheck_all&#40;&#41;&#123; var all_inputs = document.getElementsByTagName&#40;&#34;input&#34;&#41;; &#160; for&#40;i=0; i&#60;all_inputs.length; i++&#41;&#123; if&#40;all_inputs&#91;i&#93;.type==&#34;checkbox&#34; &#38;&#38; all_inputs&#91;i&#93;.className==&#34;check_uncheck&#34;&#41;&#123; all_inputs&#91;i&#93;.checked = &#34;&#34;; &#125; &#125; &#125; &#60;/script&#62; then set [...]]]></description>
			<content:encoded><![CDATA[<p>The easy way to check/uncheck checkboxes. Insert into &lt;head&gt;&lt;/head&gt; this script<span id="more-149"></span></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
function check_all<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   var all_inputs <span style="color: #339933;">=</span> document.<span style="color: #006633;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>all_inputs.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>all_inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">type</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;checkbox&quot;</span> <span style="color: #339933;">&amp;&amp;</span> all_inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">className</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;check_uncheck&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         all_inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">checked</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;checked&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
function uncheck_all<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   var all_inputs <span style="color: #339933;">=</span> document.<span style="color: #006633;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>all_inputs.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>all_inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">type</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;checkbox&quot;</span> <span style="color: #339933;">&amp;&amp;</span> all_inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">className</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;check_uncheck&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         all_inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">checked</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>then set &#8220;check_uncheck&#8221; the classes of checkboxes which must check/uncheck (Example: <span style="color: #993300;">&lt;input type=&#8221;checkbox&#8221; name=&#8221;checkbox&#8221;&gt;</span>) and set onclick=&#8221;check_all()&#8221; to element on click which the checkboxes will be checked and onclick=&#8221;uncheck_all()&#8221; to element on click which the checkboxes will be unchecked (Example: <span style="color: #993300;">&lt;input type=&#8221;button&#8221; value=&#8221;Check&#8221; onclick=&#8221;check_all()&#8221;&gt; &lt;input type=&#8221;button&#8221; value=&#8221;Uncheck&#8221; onclick=&#8221;uncheck_all()&#8221;&gt;</span>).</p>
]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/checkuncheck-checkboxes-by-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Domtooltips</title>
		<link>http://rubensargsyan.com/domtooltips/</link>
		<comments>http://rubensargsyan.com/domtooltips/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 19:15:00 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Domtooltips]]></category>
		<category><![CDATA[tooltips]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=71</guid>
		<description><![CDATA[Are you looking for a script which can show you the information about a part of your code when the mouse is over it? You have found that script! Domtooltips is a tooltips making script! It is very easy for use! How To Use: 1. Download domtooltips here. 2. Include domtooltips.css and domtooltips.js in your [...]]]></description>
			<content:encoded><![CDATA[<p>Are you looking for a script which can show you the information about a part of your code when the mouse is over it? You have found that script! Domtooltips is a tooltips making script! It is very easy for use!<span id="more-71"></span></p>
<h2>How To Use:</h2>
<p>1. Download domtooltips <a href="http://rubensargsyan.com/downloads/domtooltips.zip">here</a>.</p>
<p>2. Include domtooltips.css and domtooltips.js in your header<br />
<span style="color: #993300;">&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;domtooltips.css&#8221; type=&#8221;text/css&#8221; /&gt;<br />
&lt;script src=&#8221;domtooltips.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</span></p>
<p>3. Take the parts of the code, which must show tooltips, in &lt;span&gt; tags and set &#8220;domtooltips&#8221; the classes of the &lt;span&gt; tags. The values of &#8220;title&#8221; attributes of the &lt;span&gt; tags are the contents of the tooltips.</p>
<p>4. Add <span style="color: #993300;">&lt;script&gt; load_domtooltips(); &lt;/script&gt;</span> just after &lt;/body&gt;.</p>
<h2>How To Customize:</h2>
<p>You can use CSS to style the tooltips. Edit the code in domtooltips.css</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.domtooltips</span> div<span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#224578</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">justify</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">letter-spacing</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
   -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h2>Screenshot:</h2>
<p><img class="alignnone size-full wp-image-74" title="domtooltips_demo" src="http://rubensargsyan.com/wp-content/uploads/2009/11/domtooltips_demo.jpg" alt="domtooltips_demo" width="459" height="272" /></p>
<h2>Version:</h2>
<p>1.0</p>
<h2>License:</h2>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/"><img style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" alt="Creative Commons License" /></a><br />
Domtooltips by <a rel="cc:attributionURL" href="http://rubensargsyan.com/domtooltips/">Ruben Sargsyan</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License</a>.</p>
<h2>Donate:</h2>
<p>If you find this script useful to you, please consider making a small donation to assist in further development contribution. Thanks for your kind support!</p>
<form style="padding: 0px, margin: 0px" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="roobensargsyan@gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Ruben Sargsyan">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/domtooltips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lightbox 2 bugfix</title>
		<link>http://rubensargsyan.com/lightbox-2-bugfix/</link>
		<comments>http://rubensargsyan.com/lightbox-2-bugfix/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 19:07:47 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[bugfix]]></category>
		<category><![CDATA[lightbox 2]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=64</guid>
		<description><![CDATA[There is a bug in Lightbox 2 slideshow. When an image has no title during slideshow it shows the title of previous or next image title. To fix this problem add in lightbox.js else&#123; this.caption.update&#40;&#34;&#34;&#41;.show&#40;&#41;; &#125; after // if caption is not null if &#40;this.imageArray&#91;this.activeImage&#93;&#91;1&#93; != &#34;&#34;&#41;&#123; this.caption.update&#40;this.imageArray&#91;this.activeImage&#93;&#91;1&#93;&#41;.show&#40;&#41;; &#125;]]></description>
			<content:encoded><![CDATA[<p>There is a bug in Lightbox 2 slideshow. When an image has no title during slideshow it shows the title of previous or next image title. To fix this problem add in lightbox.js<span id="more-64"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">caption</span>.<span style="color: #660066;">update</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>after</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// if caption is not null</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageArray</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">activeImage</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">caption</span>.<span style="color: #660066;">update</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageArray</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">activeImage</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/lightbox-2-bugfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
