<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>WebSewak's Techjunk</title>
	
	<link>http://techjunk.websewak.com</link>
	<description>Technology, Code, Tips &amp; Tricks and lots of weird stuff...</description>
	<pubDate>Mon, 18 Feb 2008 16:36:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/techjunk" type="application/rss+xml" /><item>
		<title>How to install WAMP5</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/237048637/</link>
		<comments>http://techjunk.websewak.com/how-to-install-wamp5/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 16:28:57 +0000</pubDate>
		<dc:creator>Srikanta</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[LAMP]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/how-to-install-wamp5/</guid>
		<description><![CDATA[

How to intall WAMP5 for PHP,Apache,Mysql,Phpmyadmin &#38; SQLitemanager


Step 1 : To install PHP + PECL,Apache,SQLitemanager,MySQL,Phpmyadmin all at once, instead of downlaoding all these individually, you can just download one file from WAMPSERVER.com named, WAMP5(size: 21 MB). The link to download is http://www.wampserver.com/en/download.php
  This server works on windows Xp and later versions operating system.


Step2:Now goto [...]]]></description>
			<content:encoded><![CDATA[<table width="100%" border="0">
<tr>
<td><strong>How to intall WAMP5 for PHP,Apache,Mysql,Phpmyadmin &amp; SQLitemanager</strong></td>
</tr>
<tr>
<td>Step 1 : To install PHP + PECL,Apache,SQLitemanager,MySQL,Phpmyadmin all at once, instead of downlaoding all these individually, you can just download one file from WAMPSERVER.com named, WAMP5(size: 21 MB). The link to download is <a href="http://www.wampserver.com/en/download.php">http://www.wampserver.com/en/download.php</a><br />
  <strong>This server works on windows Xp and later versions operating system.</strong></td>
</tr>
<tr>
<td>Step2:Now goto the link provided above and download wamp5 from it.</td>
</tr>
<tr>
<td>Step3:After downloading it,double click on it(Icon shown below)
</td>
</tr>
<tr>
<td>
<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/0.jpg' title='0.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/0.thumbnail.jpg' alt='0.jpg' /></a>
</td>
</tr>
<tr>
<td>
You&#8217;ll see a window with welcome message and next and cancel buttons
</td>
</tr>
<tr>
<td>
<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/1.jpg' title='1.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/1.thumbnail.jpg' alt='1.jpg' /></a>Click on next.</td>
</tr>
<tr>
<td>Step4:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/21.jpg' title='21.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/21.thumbnail.jpg' alt='21.jpg' /></a>Read the agreement and if its right for you then click on the radio button next to &quot;I accept the agreement.&quot; Click on next.</td>
</tr>
<tr>
<td>  step5:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/31.jpg' title='31.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/31.thumbnail.jpg' alt='31.jpg' /></a>Select your destination location.click on next.</td>
</tr>
<tr>
<td>Step6:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/41.jpg' title='41.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/41.thumbnail.jpg' alt='41.jpg' /></a>Select the destination for the program&#8217;s shotcuts.By default it saves it in start menu folder.click on next.</td>
</tr>
<tr>
<td>Step7:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/51.jpg' title='51.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/51.thumbnail.jpg' alt='51.jpg' /></a>On checking this check box your wamp server will start with your PC if not checked then everytime when you start your PC you have to double click on the shortcuts.Click on next.</td>
</tr>
<tr>
<td>Step8:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/61.jpg' title='61.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/61.thumbnail.jpg' alt='61.jpg' /></a>Now click on install. this will start installing all your files on their specified locations.</td>
</tr>
<tr>
<td>Step9:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/71.jpg' title='71.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/71.thumbnail.jpg' alt='71.jpg' /></a>It will ask for the folder where you wish to keep all your PHP files.By default WWW is selected</td>
</tr>
<tr>
<td>Step10:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/81.jpg' title='81.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/81.thumbnail.jpg' alt='81.jpg' /></a>Now it will ask you to provide the SMTP server to be used by PHP.By default its localhost.click on next.</td>
</tr>
<tr>
<td>Step11:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/91.jpg' title='91.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/91.thumbnail.jpg' alt='91.jpg' /></a>Now it will ask for your default Email ID.Whenever you&#8217;ll send any mail from this server this Email ID will be in &#8216;From:&#8217; column.</td>
</tr>
<tr>
<td> Step12:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/101.jpg' title='101.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/101.thumbnail.jpg' alt='101.jpg' /></a>Now it will ask for your prefered browser.Setup will show your systems default browser,if you want to keep it then click on &#8216;Yes&#8217; else &#8216;No&#8217; and select the .exe of your prefered browser.</td>
</tr>
<tr>
<td>Step13:<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/111.jpg' title='111.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/111.thumbnail.jpg' alt='111.jpg' /></a>Now the last window will show &#8216;Finish&#8217; button and a check box next to &#8216;Launch WAMP5 now&#8217;.If you want to run the WAMP5 now then check it else uncheck it.</td>
</tr>
<tr>
<td>Step14:After finishing the setup you can see in your system tray(Near Clock) a semicircle with filled center<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/121.jpg' title='121.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/121.jpg' alt='121.jpg' /></a>.If the colour of the semicircle is white then its working correct.If the color is yellow then either Apache or Mysql is not running on your system.If the color is red then none of them are running on your PC.If any of the services are not working then first close all similar applications and then restart WAMP5.For example,if you are running IIS on your PC then it will not run Apache on your PC,so stop the IIS server and then restart WAMP5.</td>
</tr>
<tr>
<td>Step15:On clicking the semicircle you&#8217;ll see a pop up menu.In this menu the last option is &#8216;Put Online&#8217;.<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/14.jpg' title='14.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/14.thumbnail.jpg' alt='14.jpg' /></a>This will make your server public.And the filled semicircle will now turn into a white filled semicircle.<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/131.jpg' title='131.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/131.jpg' alt='131.jpg' /></a> Now your WAMP5 is ready to use.</td>
</tr>
<tr>
<td>
When using WAMP5, store all your PHP files in a folder in &#8216;:\wamp\WWW&#8217; and when you want to browse your files as webpages then open your browser and type in address bar &#8216;<strong>localhost</strong>&#8216;.This will open an index page.<a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/index.jpg' title='index.jpg'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/index.thumbnail.jpg' alt='index.jpg' /></a> In that, under &#8216;<strong>Your Projects</strong>&#8216;, you&#8217;ll see your folder,on clicking it will shaw the list of your PHP files. Now click on your file. It will be shown as a webpage.
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/how-to-install-wamp5/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/how-to-install-wamp5/</feedburner:origLink></item>
		<item>
		<title>Handling SERVER, LOCAL and GMT Times in PHP</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/130984456/</link>
		<comments>http://techjunk.websewak.com/handling-server-local-and-gmt-times-in-php/#comments</comments>
		<pubDate>Fri, 06 Jul 2007 04:33:19 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
		
		<category><![CDATA[LAMP]]></category>

		<category><![CDATA[PHP Code Samples]]></category>

		<category><![CDATA[Technology Junk]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/handling-server-local-and-gmt-times-in-php/</guid>
		<description><![CDATA[Code (php)
&#60;?
function getLocaltime&#40;$GMT,$dst&#41;&#123;
&#160; &#160; &#160; &#160; if&#40;preg_match&#40;'/-/i',$GMT&#41;&#41;
&#160; &#160; &#160; &#160; &#123;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $sign = &#34;-&#34;;
&#160; &#160; &#160; &#160; &#125;
&#160; &#160; &#160; &#160; else
&#160; &#160; &#160; &#160; &#123;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $sign = &#34;+&#34;;
&#160; &#160; &#160; &#160; &#125;

&#160; &#160; &#160; &#160; $h = round&#40;&#40;float&#41;$GMT,2&#41;;

&#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (php)</div><br />
<span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #000000; font-weight: bold;">function</span> getLocaltime<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$GMT</span>,<span style="color: #0000ff;">$dst</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/preg_match"><span style="color: #000066;">preg_match</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'/-/i'</span>,<span style="color: #0000ff;">$GMT</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$sign</span> = <span style="color: #ff0000;">&quot;-&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$sign</span> = <span style="color: #ff0000;">&quot;+&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$h</span> = <a href="http://www.php.net/round"><span style="color: #000066;">round</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>float<span style="color: #66cc66;">&#41;</span><span style="color: #0000ff;">$GMT</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$dst</span> = <span style="color: #ff0000;">&quot;true&quot;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$dst</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$daylight_saving</span> = <a href="http://www.php.net/date"><span style="color: #000066;">date</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'I'</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$daylight_saving</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$sign</span> == <span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #0000ff;">$h</span>=<span style="color: #0000ff;">$h</span><span style="color: #cc66cc;">-1</span>;&nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0000ff;">$h</span>=<span style="color: #0000ff;">$h</span><span style="color: #cc66cc;">+1</span>; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// FIND DIFFERENCE FROM GMT</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$hm</span> = <span style="color: #0000ff;">$h</span> * <span style="color: #cc66cc;">60</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$ms</span> = <span style="color: #0000ff;">$hm</span> * <span style="color: #cc66cc;">60</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// SET CURRENT TIME</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$sign</span> == <span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #0000ff;">$timestamp</span> = <a href="http://www.php.net/time"><span style="color: #000066;">time</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>-<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$ms</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0000ff;">$timestamp</span> = <a href="http://www.php.net/time"><span style="color: #000066;">time</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$ms</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// SAMPLE OUTPUT</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$gmdate</span> = <a href="http://www.php.net/gmdate"><span style="color: #000066;">gmdate</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;F d, Y - g:i A&quot;</span>, <span style="color: #0000ff;">$timestamp</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$gmdate</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">' Server Time: '</span>.<a href="http://www.php.net/date"><span style="color: #000066;">date</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;F d, Y - g:i A&quot;</span>,<a href="http://www.php.net/time"><span style="color: #000066;">time</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;;<br />
<br />
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot; || GMT Time: &quot;</span> . <a href="http://www.php.net/gmdate"><span style="color: #000066;">gmdate</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;F d Y - g:i A&quot;</span>, <a href="http://www.php.net/time"><span style="color: #000066;">time</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">' ||&nbsp; Localtime: '</span>.getLocaltime<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'+5.5'</span>,<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/handling-server-local-and-gmt-times-in-php/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/handling-server-local-and-gmt-times-in-php/</feedburner:origLink></item>
		<item>
		<title>Make text or image blink using CSS and Javascript</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/126700307/</link>
		<comments>http://techjunk.websewak.com/make-text-or-image-blink-using-css-and-javascript/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 12:44:25 +0000</pubDate>
		<dc:creator>Srikanta</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Javascript Code Samples]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/make-text-or-image-blink-using-css-and-javascript/</guid>
		<description><![CDATA[This code will make your desired HTML tag blink within your given time interval. 
Just put your content between &#60;p&#62; tags. Also, call blinky() function on body onload event. Put blink delay variable in the function. 1000 is equal to 1 sec, 5000 = 5 secs. Click here for a demo of blink function.
Code (javascript)
&#60;html&#62;
&#60;head&#62;
&#60;script [...]]]></description>
			<content:encoded><![CDATA[<p>This code will make your desired HTML tag blink within your given time interval. </p>
<p>Just put your content between &lt;p&gt; tags. Also, call blinky() function on body onload event. Put blink delay variable in the function. 1000 is equal to 1 sec, 5000 = 5 secs. <a href="http://techjunk.websewak.com/codesamples/blink.php">Click here for a demo of blink function.</a></p>
<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (javascript)</div><br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;script language=<span style="color: #3366CC;">&quot;javascript&quot;</span>&gt;<br />
<span style="color: #003366; font-weight: bold;">function</span> blinky<span style="color: #66cc66;">&#40;</span>delay<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
<br />
<span style="color: #003366; font-weight: bold;">var</span> el = document.<span style="color: #006600;">body</span>.<span style="color: #006600;">getElementsByTagName</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'p'</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i = <span style="color: #CC0000;">0</span>; i &lt; el.<span style="color: #006600;">length</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>el<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">className</span> == <span style="color: #3366CC;">'blink'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
<br />
el<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">visibility</span> = el<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">visibility</span> == <br />
<br />
<span style="color: #3366CC;">'hidden'</span> ? <span style="color: #3366CC;">'visible'</span> : <span style="color: #3366CC;">'hidden'</span>;<br />
<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
setTimeout<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'blinky('</span> + delay + <span style="color: #3366CC;">')'</span>, delay<span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
&lt;/script&gt;<br />
&lt;style&gt;<br />
<br />
#container<br />
<span style="color: #66cc66;">&#123;</span><br />
position:absolute;<br />
top:<span style="color: #CC0000;">0</span>%;<br />
left:<span style="color: #CC0000;">0</span>%;<br />
background:#3366FF;<br />
border:1px solid #FF0000;<br />
height:<span style="color: #CC0000;">100</span>%;<br />
width:<span style="color: #CC0000;">100</span>%;<br />
<span style="color: #66cc66;">&#125;</span><br />
#container h1<br />
<span style="color: #66cc66;">&#123;</span><br />
text-align:center;<br />
background:#00FF00;<br />
<span style="color: #66cc66;">&#125;</span><br />
&lt;/style&gt;<br />
<br />
&lt;/head&gt;<br />
&lt;body <span style="color: #000066;">onload</span>=<span style="color: #3366CC;">&quot;blinky(1000)&quot;</span>&gt;<br />
&lt;div id=<span style="color: #3366CC;">&quot;container&quot;</span>&gt;<br />
&lt;h1&gt;<br />
&lt;p <span style="color: #003366; font-weight: bold;">class</span>=<span style="color: #3366CC;">&quot;blink&quot;</span>&gt;Blinking Headline<br />
&lt;/h1&gt;<br />
<br />
&lt;center&gt;<br />
&lt;p <span style="color: #003366; font-weight: bold;">class</span>=<span style="color: #3366CC;">&quot;blink&quot;</span>&gt;&lt;img <span style="color: #003366; font-weight: bold;">class</span>=<span style="color: #3366CC;">&quot;blink&quot;</span> src=<span style="color: #3366CC;">&quot;smiley.jpg&quot;</span>&gt;<br />
<br />
&lt;/center&gt;<br />
&lt;/div&gt;<br />
<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&nbsp;</div>
<p>Hopefully this function may be of some use to you ever.</p>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/make-text-or-image-blink-using-css-and-javascript/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/make-text-or-image-blink-using-css-and-javascript/</feedburner:origLink></item>
		<item>
		<title>PHP Function to validate username</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/125487965/</link>
		<comments>http://techjunk.websewak.com/php-function-to-validate-username/#comments</comments>
		<pubDate>Sun, 17 Jun 2007 06:33:06 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
		
		<category><![CDATA[PHP Code Samples]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/php-function-to-validate-username/</guid>
		<description><![CDATA[Code (php)
&#60;?php

//This function can be used to validate usernames
//The maximum and minimum length of the username can be set. Also you are allowed to set the allowed characters.

function is_valid_username&#40;$username, $valid_chars, $min_length, $max_length&#41;
&#123;
&#160; &#160; if&#40;!eregi&#40;&#34;^[a-z0-9$valid_chars]{&#34;.$min_length.&#34;,&#34;.$max_length.&#34;}$&#34;,$username&#41;&#41;&#123;
&#160; &#160; &#160; &#160; return false;
&#160; &#160; &#125;
&#160; &#160; return true;
&#125;

// Usage Example

$username = &#34;DFKGJDF04FL&#34;;
$valid_chars = &#34;._+?&#34;;
$min_length = 5;
$max_length = 15;
if&#40;is_valid_username&#40;$username, $valid_chars, [...]]]></description>
			<content:encoded><![CDATA[<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (php)</div><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<br />
<span style="color: #808080; font-style: italic;">//This function can be used to validate usernames</span><br />
<span style="color: #808080; font-style: italic;">//The maximum and minimum length of the username can be set. Also you are allowed to set the allowed characters.</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> is_valid_username<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$username</span>, <span style="color: #0000ff;">$valid_chars</span>, <span style="color: #0000ff;">$min_length</span>, <span style="color: #0000ff;">$max_length</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>!<a href="http://www.php.net/eregi"><span style="color: #000066;">eregi</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;^[a-z0-9$valid_chars]{&quot;</span>.<span style="color: #0000ff;">$min_length</span>.<span style="color: #ff0000;">&quot;,&quot;</span>.<span style="color: #0000ff;">$max_length</span>.<span style="color: #ff0000;">&quot;}$&quot;</span>,<span style="color: #0000ff;">$username</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
<span style="color: #808080; font-style: italic;">// Usage Example</span><br />
<br />
<span style="color: #0000ff;">$username</span> = <span style="color: #ff0000;">&quot;DFKGJDF04FL&quot;</span>;<br />
<span style="color: #0000ff;">$valid_chars</span> = <span style="color: #ff0000;">&quot;._+?&quot;</span>;<br />
<span style="color: #0000ff;">$min_length</span> = <span style="color: #cc66cc;">5</span>;<br />
<span style="color: #0000ff;">$max_length</span> = <span style="color: #cc66cc;">15</span>;<br />
<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>is_valid_username<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$username</span>, <span style="color: #0000ff;">$valid_chars</span>, <span style="color: #0000ff;">$min_length</span>, <span style="color: #0000ff;">$max_length</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;$username is valid&quot;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #b1b100;">else</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;$username is invalid&quot;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/php-function-to-validate-username/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/php-function-to-validate-username/</feedburner:origLink></item>
		<item>
		<title>PHP Function to apply text (Watermark) on an Image</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/124842861/</link>
		<comments>http://techjunk.websewak.com/php-function-to-apply-text-watermark-on-an-image/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 16:48:57 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
		
		<category><![CDATA[PHP Code Samples]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/php-function-to-apply-text-watermark-on-an-image/</guid>
		<description><![CDATA[Code (php)
&#60;?
function applytext&#40;$file,$text,$Position,$fontsize,$font,$newfile,$Margin = 5&#41;
&#123;
&#160; &#160; &#160; &#160; if&#40;$newfile == ''&#41;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $newfile = $file;

&#160; &#160; &#160; &#160; $fontangle = 0;

&#160; &#160; &#160; &#160; $Type&#160; = strtolower&#40;strrchr&#40;$file,'.'&#41;&#41;;
&#160; &#160; &#160; &#160; if&#40;$Type == '.jpg' &#124;&#124; $Type == '.jpeg'&#41;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $simg = @imagecreatefromjpeg&#40; $file &#41;;
&#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (php)</div><br />
<span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #000000; font-weight: bold;">function</span> applytext<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span>,<span style="color: #0000ff;">$text</span>,<span style="color: #0000ff;">$Position</span>,<span style="color: #0000ff;">$fontsize</span>,<span style="color: #0000ff;">$font</span>,<span style="color: #0000ff;">$newfile</span>,<span style="color: #0000ff;">$Margin</span> = <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$newfile</span> == <span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$newfile</span> = <span style="color: #0000ff;">$file</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$fontangle</span> = <span style="color: #cc66cc;">0</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$Type</span>&nbsp; = <a href="http://www.php.net/strtolower"><span style="color: #000066;">strtolower</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/strrchr"><span style="color: #000066;">strrchr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span>,<span style="color: #ff0000;">'.'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Type</span> == <span style="color: #ff0000;">'.jpg'</span> || <span style="color: #0000ff;">$Type</span> == <span style="color: #ff0000;">'.jpeg'</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$simg</span> = @imagecreatefromjpeg<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$file</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Type</span> == <span style="color: #ff0000;">'.gif'</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$simg</span> = @imagecreatefromgif<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$file</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Type</span> == <span style="color: #ff0000;">'.png'</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$simg</span> = @imagecreatefrompng<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$file</span> <span style="color: #66cc66;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>!<span style="color: #0000ff;">$simg</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$currwidth</span> = imagesx<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$simg</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$currheight</span> = imagesy<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$simg</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$im</span> = imagecreatetruecolor<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$currwidth</span>, <span style="color: #0000ff;">$currheight</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$Imah</span> = imagecopyresampled<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$im</span>, <span style="color: #0000ff;">$simg</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #0000ff;">$currwidth</span>, <span style="color: #0000ff;">$currheight</span>, <span style="color: #0000ff;">$currwidth</span>, <span style="color: #0000ff;">$currheight</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// Get exact dimensions of text string</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$box</span> = @imageTTFBbox<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fontsize</span>,<span style="color: #0000ff;">$fontangle</span>,<span style="color: #0000ff;">$font</span>,<span style="color: #0000ff;">$text</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// Get width and height of text from dimensions</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$textwidth</span> = <a href="http://www.php.net/abs"><span style="color: #000066;">abs</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$box</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#93;</span> - <span style="color: #0000ff;">$box</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$textheight</span> = <a href="http://www.php.net/abs"><span style="color: #000066;">abs</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$box</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#93;</span> - <span style="color: #0000ff;">$box</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$FW</span> = <span style="color: #0000ff;">$textwidth</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$FH</span> = <span style="color: #0000ff;">$textheight</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Position</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;center&quot;</span> :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$xcord</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$currwidth</span>/<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>- <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$FW</span>/<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$ycord</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$currheight</span>/<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>- <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$FH</span>/<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;top-left&quot;</span> :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$xcord</span> = <span style="color: #0000ff;">$Margin</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$ycord</span> = <span style="color: #0000ff;">$FH</span>+<span style="color: #0000ff;">$Margin</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;top-right&quot;</span> :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$xcord</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$currwidth</span>- <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$FW</span>+<span style="color: #0000ff;">$Margin</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$ycord</span> = <span style="color: #0000ff;">$FH</span>+<span style="color: #0000ff;">$Margin</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;bottom-left&quot;</span> :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$xcord</span> = <span style="color: #0000ff;">$Margin</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$ycord</span> = <span style="color: #0000ff;">$currheight</span> - <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$FH</span>+<span style="color: #0000ff;">$Margin</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;bottom-right&quot;</span> :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$xcord</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$currwidth</span>- <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$FW</span>+<span style="color: #0000ff;">$Margin</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$ycord</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$currheight</span> - <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$FH</span>+<span style="color: #0000ff;">$Margin</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$color</span> = imagecolorallocate<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$im</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; imagettftext <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$im</span>, <span style="color: #0000ff;">$fontsize</span>, <span style="color: #0000ff;">$fontangle</span>, <span style="color: #0000ff;">$xcord</span><span style="color: #cc66cc;">+2</span> , <span style="color: #0000ff;">$ycord</span><span style="color: #cc66cc;">+1</span>&nbsp; , <span style="color: #0000ff;">$fontcolor</span>, <span style="color: #0000ff;">$font</span>, <span style="color: #0000ff;">$text</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$color</span> = imagecolorallocate<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$im</span>, <span style="color: #cc66cc;">255</span>, <span style="color: #cc66cc;">255</span>, <span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; imagettftext <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$im</span>, <span style="color: #0000ff;">$fontsize</span>, <span style="color: #0000ff;">$fontangle</span>, <span style="color: #0000ff;">$xcord</span>, <span style="color: #0000ff;">$ycord</span>, <span style="color: #0000ff;">$color</span>, <span style="color: #0000ff;">$font</span>, <span style="color: #0000ff;">$text</span> <span style="color: #66cc66;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Type</span> == <span style="color: #ff0000;">'.jpg'</span> || <span style="color: #0000ff;">$Type</span> == <span style="color: #ff0000;">'.jpeg'</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; imagejpeg<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$im</span>, <span style="color: #ff0000;">&quot;$newfile&quot;</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Type</span> == <span style="color: #ff0000;">'.gif'</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; imagegif<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$im</span>, <span style="color: #ff0000;">&quot;$newfile&quot;</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Type</span> == <span style="color: #ff0000;">'.png'</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; imagepng<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$im</span>, <span style="color: #ff0000;">&quot;$newfile&quot;</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; imagedestroy<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$im</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">1</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
<span style="color: #0000ff;">$iscreated</span> = applytext<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;clippart.jpg&quot;</span>,<span style="color: #ff0000;">'www.teckjunk.websewak.com'</span>,<span style="color: #ff0000;">'center'</span>,<span style="color: #ff0000;">'15'</span>,<span style="color: #ff0000;">'arial.ttf'</span>,<span style="color: #ff0000;">'new.jpg'</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #808080; font-style: italic;">//applytext('[targetimagefile]','[text to apply]','[position]','[font size]','[font]','[saveas]','[margin]');</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/php-function-to-apply-text-watermark-on-an-image/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/php-function-to-apply-text-watermark-on-an-image/</feedburner:origLink></item>
		<item>
		<title>How to create a pre-loading effect using Javascript</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/124274316/</link>
		<comments>http://techjunk.websewak.com/how-to-create-a-pre-loading-effect-using-javascript/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 18:12:11 +0000</pubDate>
		<dc:creator>Srikanta</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Javascript Code Samples]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/how-to-create-a-pre-loading-effect-using-javascript/</guid>
		<description><![CDATA[This code is to show your images or objects only after they are fully loaded in the background. Whenever a page is downloaded on user&#8217;s browser and if the user is having slow internet speed or if the image size is too large then we see that the image is shown in parts. To avoid [...]]]></description>
			<content:encoded><![CDATA[<p>This code is to show your images or objects only after they are fully loaded in the background. Whenever a page is downloaded on user&#8217;s browser and if the user is having slow internet speed or if the image size is too large then we see that the image is shown in parts. To avoid this, you may find this code useful. With this code, if the image is not fully loaded then it will show a waiting/loading message and when the image is loaded, it shows the whole image. For a live working example, <a href="http://techjunk.websewak.com/codesamples/onload.htm">click here for demo</a>.</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (javascript)</div><br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;<br />
Object <span style="color: #000066;">OnLoad</span><br />
&lt;/title&gt;<br />
&lt;script&gt;<br />
<span style="color: #003366; font-weight: bold;">function</span> toggleBox<span style="color: #66cc66;">&#40;</span>szDivID, iState<span style="color: #66cc66;">&#41;</span> <span style="color: #009900; font-style: italic;">// 1 visible, 0 hidden</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">layers</span><span style="color: #66cc66;">&#41;</span>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #009900; font-style: italic;">//NN4+</span><br />
<span style="color: #66cc66;">&#123;</span><br />
document.<span style="color: #006600;">layers</span><span style="color: #66cc66;">&#91;</span>szDivID<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">visibility</span> = iState ? <span style="color: #3366CC;">&quot;show&quot;</span> : <span style="color: #3366CC;">&quot;hide&quot;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #009900; font-style: italic;">//gecko(NN6) + IE 5+</span><br />
<span style="color: #66cc66;">&#123;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> obj = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span>szDivID<span style="color: #66cc66;">&#41;</span>;<br />
obj.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = iState ? <span style="color: #3366CC;">&quot;block&quot;</span> : <span style="color: #3366CC;">&quot;none&quot;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">all</span><span style="color: #66cc66;">&#41;</span>&nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// IE 4</span><br />
<span style="color: #66cc66;">&#123;</span><br />
document.<span style="color: #006600;">all</span><span style="color: #66cc66;">&#91;</span>szDivID<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">visibility</span> = iState ? <span style="color: #3366CC;">&quot;visible&quot;</span> : <span style="color: #3366CC;">&quot;hidden&quot;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;table width=<span style="color: #3366CC;">&quot;100%&quot;</span> align=<span style="color: #3366CC;">&quot;center&quot;</span>&gt;<br />
&lt;tr&gt;<br />
&lt;td align=<span style="color: #3366CC;">&quot;center&quot;</span>&gt;<br />
&lt;div id=<span style="color: #3366CC;">&quot;wait&quot;</span> style=<span style="color: #3366CC;">'display:block; color:red; font-size:30px;'</span>&gt;<br />
<br />
&lt;img src=<span style="color: #3366CC;">&quot;loaded.gif&quot;</span>&gt;Loading&nbsp; . . .<br />
&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td align=<span style="color: #3366CC;">&quot;center&quot;</span>&gt;<br />
&lt;div id=<span style="color: #3366CC;">'check'</span> style=<span style="color: #3366CC;">'display:none;'</span>&gt;<br />
&lt;img src=<span style="color: #3366CC;">&quot;smiley.jpg&quot;</span> <span style="color: #000066;">onload</span>=<span style="color: #3366CC;">'toggleBox(&quot;wait&quot;,0);toggleBox(&quot;check&quot;,1);'</span>&gt;<br />
&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&nbsp;</div>
<p>Please make sure you put the images in the same folder from where you are running the above code.</p>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/how-to-create-a-pre-loading-effect-using-javascript/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/how-to-create-a-pre-loading-effect-using-javascript/</feedburner:origLink></item>
		<item>
		<title>CSS properties with description and example</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/123722596/</link>
		<comments>http://techjunk.websewak.com/css-properties-with-description-and-example/#comments</comments>
		<pubDate>Sun, 10 Jun 2007 18:37:21 +0000</pubDate>
		<dc:creator>Srikanta</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/css-properties-with-description-and-example/</guid>
		<description><![CDATA[Here are some CSS properties with their descriptions and examples.

 
Property
Description
Value
Example
     

color
Used to describe the text
      (foreground) color of an element.
Name: aqua, black, blue, fuchsia,
      gray, green, lime, maroon, navy,
      olive, purple, red, silver, teal,
  [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some CSS properties with their descriptions and examples.</p>
<table width="89%" border="1">
<tr><b> </p>
<td width="12%"><strong>Property</strong></td>
<td width="31%"><strong>Description</strong></td>
<td width="33%"><strong>Value</strong></td>
<td width="24%"><strong>Example</strong></td>
<p>    </b> </tr>
<tr>
<td>color</td>
<td>Used to describe the text<br />
      (foreground) color of an element.</td>
<td>Name: aqua, black, blue, fuchsia,<br />
      gray, green, lime, maroon, navy,<br />
      olive, purple, red, silver, teal,<br />
      white, yellow RGB: color: #0000FF;<br />
      color: #00F; color: rgb(0,0,255);<br />
      color: rgb(0%, 0%, 100%)</td>
<td>h1 {color: #666633;}</td>
</tr>
<tr>
<td>font-weight</td>
<td>Specifies the weight, or boldness,<br />
      of the type.</td>
<td>Descriptive: normal, bold, bolder,<br />
      lighter Numeric: 100, 200. .<br />
      .900</td>
<td>strong {font-weight: 700;}</td>
</tr>
<tr>
<td>font-size</td>
<td>Specifies the size of the text element.<br />
      There are four methods for<br />
      specifying font size.</td>
<td>Absolute: xx-small, x-small, small,<br />
      medium, large, x-large, xx-large<br />
      Relative: larger, smaller Length:<br />
      number + em, ex, px, pt, pc, mm,<br />
      cm, in Percentage: n%</td>
<td>h1 {font-size: large;}<br />
      h1 {font-size: larger;}<br />
      h1 {font-size: 24pt;}<br />
      h1 {font-size: 125%;}</td>
</tr>
<tr>
<td>font-sizeadjust</td>
<td>Allows authors to specify the<br /> &#8220;aspect value&#8221; that they<br />
      wish to<br />
      maintain. It becomes helpful when<br />
      a specified font is unavailable and<br />
      the system needs hints to<br />
      determine the most suitable<br />
      substitute.</td>
<td>inherit, none, number</td>
<td>h5.med {font-sizeadjust:<br />
      0.58;}</td>
</tr>
<tr>
<td>font-variant</td>
<td>Determines if the font is to display<br />
      in normal font or SMALL-CAPS</td>
<td>normal, small-caps</td>
<td>p {font-variant: small-caps;}</td>
</tr>
<tr>
<td>font-style</td>
<td>Specifies that the font be displayed<br />
      in one of three ways: normal,<br />
      italic,oroblique (slanted).</td>
<td>normal, italic, oblique</td>
<td>h1 {font-style: italic;}</td>
</tr>
<tr>
<td>font-stretch</td>
<td>This is the CSS indication of the<br />
      condensed or expanded nature of<br />
      the face relative to others in the<br />
      same font family.</td>
<td>condensed, normal, expanded</td>
<td>h2 {<br />
      font-stretch: expanded; }</td>
</tr>
<tr>
<td>text-decoration</td>
<td>Allows text to be decorated<br />
      through one of five properties.</td>
<td>none (default), underline, overline,<br />
      line-through, blink</td>
<td>a: link {text-decoration:<br />
      underline;}</td>
</tr>
<tr>
<td>text-transform</td>
<td>Affects the capitalization of the<br />
      element.</td>
<td>none, capitalize, lowercase,<br />
      uppercase</td>
<td>h1.title {text-transform:<br />
      capitalize;}</td>
</tr>
<tr>
<td>text-shadow</td>
<td>Specifies one or more commaseparated<br />
      shadow effects to be<br />
      applied to the text content of the<br />
      current element.</td>
<td>inherit, none, [shadow effects]</td>
<td>blockquote {text-shadow:<br />
      black 3px 3px, yellow<br />
      -3px -3px;}</td>
</tr>
<tr>
<td>letter-spacing</td>
<td>Specifies an amount of space to be<br />
      added between characters.</td>
<td>normal, length</td>
<td>h5.close {letter-spacing:<br />
      0.1cm;}</td>
</tr>
<tr>
<td>word-spacing</td>
<td>Specifies an additional amount of<br />
      space to be placed between words<br />
      of the text element.</td>
<td>normal, length</td>
<td>h3 {word-spacing: .5em;}</td>
</tr>
<tr>
<td>line-height</td>
<td>Will accept a value to control the<br />
      spacing between baselines of text.</td>
<td>normal, number, length, percentage</td>
<td>p {line-height: 200%}<br />
      p {line-height: 1.2em;}</td>
</tr>
<tr>
<td>vertical-align</td>
<td>Affects the vertical alignment of an<br />
      element.</td>
<td>baseline (default), bottom, middle,<br />
      sub, super, text-bottom, text-top,<br />
      top, percentage</td>
<td>p.opener {vertical-align:<br />
      text-top;}</td>
</tr>
<tr>
<td>text-indent</td>
<td>Specifies an amount of indentation<br />
      (from the left margin) to appear in<br />
      the first line of text in an element.</td>
<td>length, percentage</td>
<td>p.first {text-indent: 3em;}</td>
</tr>
<tr>
<td>text-align</td>
<td>Affects the horizontal alignment of<br />
      the contained text elements.</td>
<td>center, justify, left, right</td>
<td>div.center {text-align:<br />
      center;}</td>
</tr>
<tr>
<td>direction</td>
<td>Specifies the direction of text.</td>
<td>ltr, rtl, inherit</td>
<td>div {unicode-bidi: embed;<br />
      direction: rtl;}</td>
</tr>
<tr>
<td>unicode-bidi</td>
<td>Defines levels of embedding with<br />
      regard to Unicode bidirectional<br />
      algorithm.</td>
<td>inherit, normal, embed,<br />
      bidi-override</td>
<td>div {unicode-bidi: embed;<br />
      direction: rtl}</td>
</tr>
<tr>
<td>background-color</td>
<td>Sets the background color of an<br />
      element.</td>
<td>color name or<br />
      transparent</td>
<td>p.warning {backgroundcolor:<br />
      red;}</td>
</tr>
<tr>
<td>background-image</td>
<td>Sets a background image for the<br />
      element.</td>
<td>URL, none</td>
<td>body {background-image:<br />
      url(stripes.gif);}</td>
</tr>
<tr>
<td>background-attachment</td>
<td>Determines whether the<br />
      background image scrolls along<br />
      with the document or remains<br />
      in a fixed position.</td>
<td>scroll (default), fixed</td>
<td>body {background-image:<br />
      url(stripes.gif); backgroundattachment:<br />
      scroll;}</td>
</tr>
<tr>
<td>background-repeat</td>
<td>When a background image is<br />
      specified, this property specifies<br />
      whether and how the image is<br />
      repeated.</td>
<td>repeat, repeat-x,<br />
      repeat-y, no-repeat</td>
<td>body {background-image:<br />
      url(stripes.gif); backgroundrepeat:<br />
      no-repeat;}</td>
</tr>
<tr>
<td>background-position</td>
<td>When a background image has been<br />
      specified, this property specifies its<br />
      initial position relative to the box that<br />
      surrounds the content of the element<br />
      (not including its padding, border, or<br />
      margin).</td>
<td>percentage, length,<br />
      top/center/bottom,<br />
      left/center/right</td>
<td>body {background-image:<br />
      url(stripes.gif); background-position:<br />
      bottom left;}</td>
</tr>
<tr>
<td>background</td>
<td>Shorthand property for specifying<br />
      all the individual background<br />
      properties in a single declaration.</td>
<td>background-color,<br />
      background-image,<br />
      background-repeat,<br />
      background-attachment,<br />
      background-position</td>
<td>body {background: aqua<br />
      url(stars.gif) no-repeat fixed;}</td>
</tr>
<tr>
<td>border-width</td>
<td>Shorthand property for specifying<br />
      the width of the border for all four<br />
      sides of the element box.</td>
<td>thin, medium, thick,<br />
      length</td>
<td>p.header {border-width: thin}</td>
</tr>
<tr>
<td>border-top-width,<br />
      border-left-<br />
      width,<br />
      border-bottom-<br />
      width,<br />
      border-right-width</td>
<td>Specifies the border widths of the<br />
      respective sides of an element&#8217;s box.</td>
<td>thin, medium, thick,<br />
      length</td>
<td>p.sidebar {border-right-width:<br />
      medium; border-bottom-width:<br />
      thick}</td>
</tr>
<tr>
<td>border-color</td>
<td>Sets the border color for each of the<br />
      four sides of an element box.</td>
<td>color name,<br />
      RGB value</td>
<td>blockquote {border-color: red<br />
      blue green yellow}</td>
</tr>
<tr>
<td>border-top-color,<br />
      border-right-<br />
      color,<br />
      border-bottom<br />
      -color, border-left-<br />
      color</td>
<td>Specifies the border colors of the<br />
      respective sides of an element&#8217;s box</td>
<td>inherit, transparent, color,<br />
      -moz-use-text-color</td>
<td>div {border-top-color: green}</td>
</tr>
<tr>
<td>border-style</td>
<td>Sets the style of border for an<br />
      element&#8217;s box.</td>
<td>inherit, none, dotted,<br />
      dashed, solid, double,<br />
      groove, ridge, inset,<br />
      outset, -moz-bg-inset,<br />
      -moz-bg-outset,</td>
<td>p.example {border-style: solid<br />
      dashed}</td>
</tr>
<tr>
<td>border-top-style,<br />
      border-right-<br />
      style,<br />
      border-bottom-style,<br />
      border-left-<br />
      style</td>
<td>Specifies the border style of the<br />
      respective sides of an element&#8217;s box.</td>
<td>inherit, none, dotted,<br />
      dashed, hidden, solid,<br />
      groove, ridge, inset,<br />
      outset, double,<br />
      -moz-bg-inset,<br />
      -moz-bg-outset,</td>
<td>strong {border-top-style: groove}</td>
</tr>
<tr>
<td>border-top,<br />
      border-left,<br />
      border-bottom,<br />
      border-right</td>
<td>Each of these is a shorthand<br />
      property for setting the width, style,<br />
      and color of a specific side of a box.</td>
<td>border-top-width,<br />
      border-style, border-color</td>
<td>h1 {border-left: .5em solidblue}</td>
</tr>
<tr>
<td>border</td>
<td>Shorthand property for setting the<br />
      border width, style, and color for all<br />
      four sides of an element box.</td>
<td>border-width, border-style,<br />
      border-color</td>
<td>p.example {border: 2 px dotted<br />
      #663333}</td>
</tr>
<tr>
<td>margin</td>
<td>Shorthand property for specifying<br />
      all the margins of an element.</td>
<td>length, percentage, auto</td>
<td>img {margin: 0px 12px 0px 12px}</td>
</tr>
<tr>
<td>margin-top,<br />
      margin-left,<br />
      margin-bottom,<br />
      margin-right</td>
<td>These properties specify the<br />
      amount of margin on specific<br />
      sides of the element.</td>
<td>length, percentage, auto</td>
<td>img {margin-top: 0px}</td>
</tr>
<tr>
<td>padding </td>
<td>Shorthand property for specifying the<br />
      padding for all sides of an element.</td>
<td>length, percentage</td>
<td>p.sidebar {padding: 1em}</td>
</tr>
<tr>
<td>padding-top,<br />
      padding-left,<br />
      paddingbottom,<br />
      padding-right</td>
<td>These properties specify an amount<br />
      of padding to be added around the<br />
      respective sides of an element&#8217;s<br />
      contents.</td>
<td>length, percentage</td>
<td>p.sidebar {padding-top: 1em}</td>
</tr>
<tr>
<td>position</td>
<td>Determines whether normal, relative, or absolute<br />
      positioning methods are used to render the current<br />
      element box.</td>
<td>inherit, static,<br />
      relative,<br />
      absolute, fixed</td>
<td>h2 {position: absolute; top:<br />
      20px; right: 50px; bottom:<br />
      20px; left: 50px;}</td>
</tr>
<tr>
<td>direction</td>
<td>Specifies the base direction (reading order) for text<br />
      content in an element. It is also meant to control the<br />
      directionality of table columns, text overflow, and<br />
      positioning of justified text.</td>
<td>inherit, ltr, rtl</td>
<td>div {direction: ltr;}</td>
</tr>
<tr>
<td>top</td>
<td>Describes the vertical offset for the top edge of the<br />
      absolutely positioned element box from the top edge<br />
      of the element&#8217;s containing block.</td>
<td>inherit, auto,<br />
      length,<br />
      percentage</td>
<td>h2 {top:20px; right: 50px;<br />
      bottom: 20px; left: 50px;}</td>
</tr>
<tr>
<td>left</td>
<td>Describes the horizontal offset for the left edge of the<br />
      absolutely positioned element box from the left edge<br />
      of the element&#8217;s containing block.</td>
<td>inherit, auto,<br />
      length,<br />
      percentage</td>
<td>h2 {top:20px; right: 50px;<br />
      bottom: 20px; left: 50px;}</td>
</tr>
<tr>
<td>bottom</td>
<td>Describes the vertical offset for the bottom edge of the<br />
      absolutely positioned element box from the bottom<br />
      edge of the element&#8217;s containing block.</td>
<td>inherit, auto,<br />
      length,<br />
      percentage</td>
<td>h2 {top:20px; right: 50px;<br />
      bottom: 20px; left: 50px;}</td>
</tr>
<tr>
<td>right</td>
<td>Describes the horizontal offset for the right edge of the<br />
      absolutely positioned element box from the right edge<br />
      of the element&#8217;s containing block.</td>
<td>inherit, auto,<br />
      length,<br />
      percentage</td>
<td>h2 {top:20px; right: 50px;<br />
      bottom: 20px; left: 50px;}</td>
</tr>
<tr>
<td>width</td>
<td>Sets the width of the element. It can be applied to text<br />
      elements or as a way to resize images.</td>
<td>length,<br />
      percentage, auto</td>
<td>img.photo<br />
      {width: 75%;}</td>
</tr>
<tr>
<td>min-width</td>
<td>Allows a minimum width to be set for an element box.</td>
<td>inherit, length,<br />
      percentage</td>
<td>h5 {min-width: 100px;}</td>
</tr>
<tr>
<td>max-width</td>
<td>Allows a maximum width to be set for an element box</td>
<td>inherit, none,<br />
      length,<br />
      percentage</td>
<td>h5 {max-width: 150px;}</td>
</tr>
<tr>
<td>height</td>
<td>Sets the height of the element.</td>
<td>length,<br />
      percentage, auto</td>
<td>img.photo {height: 75%;}</td>
</tr>
<tr>
<td>min-height</td>
<td>Allows a<br />
      minimum height to be set for an element box.</td>
<td>inherit, length,<br />
      percentage</td>
<td>h5 {min-height: 100px;}</td>
</tr>
<tr>
<td>max-height</td>
<td>Allows a maximum height to be set for an element box.</td>
<td>inherit, none,<br />
      length,<br />
      percentage</td>
<td>h5 {max-height: 150px;}</td>
</tr>
<tr>
<td>z-index</td>
<td>Controls the placement of elements along the z-axis.</td>
<td>inherit, auto,<br />
      integer</td>
<td>h2 {position: absolute; top:<br />
      20px; right: 50px; bottom:<br />
      20px; left: 50px; z-index: 3;}</td>
</tr>
<tr>
<td>visibility</td>
<td>Controls whether the content of an element box is<br />
      rendered (including the borders and backgrounds).</td>
<td>inherit, visible,<br />
      hidden, collapse,<br />
      hide, show</td>
<td>p {visibility: hidden;}</td>
</tr>
<tr>
<td>overflow </td>
<td>In cases where content in an element falls outside the<br />
      element&#8217;s rendering box (due to negative margins,<br />
      absolute positioning, content exceeding the width/<br />
      height set for an element, etc.), the overflow property<br />
      describes what to do.</td>
<td>inherit, visible,<br />
      hidden, scroll,<br />
      auto, -mozscrollbars-<br />
      none,<br />
      -moz-scrollbarshorizontal,<br />
      -moz-scrollbarsvertical</td>
<td>blockquote {width: 50px;<br />
      height: 50px; overflow:<br />
      scroll;}</td>
</tr>
<tr>
<td>float</td>
<td>Positions an element against the left or right border<br />
      and allows text to flow around it.</td>
<td>left, right, none</td>
<td>p.sidebar {float: right}</td>
</tr>
<tr>
<td>clear</td>
<td>Specifies whether to allow floating elements on an<br />
      image&#8217;s sides.</td>
<td>none, left,<br />
      right, both</td>
<td>h1, h2, h3 {clear: left;}</td>
</tr>
<tr>
<td>clip</td>
<td>A clipping area describes the portions of an element&#8217;s<br />
      rendering box that are visible (when an element&#8217;s<br /> &#8220;overflow&#8221;<br />
      property is not set to &#8220;visible&#8221;).</td>
<td>inherit, auto,<br />
      shape</td>
<td>p {overflow: scroll;<br />
      position: absolute; width:<br />
      50px; height: 50px; clip:<br />
      rect(5px 40px 40px 5px);}</td>
</tr>
<tr>
<td>display</td>
<td>Defines how and specifies if an element<br />
      is displayed.</td>
<td>block, inline, list-item,<br />
      none</td>
<td>p {display: block;}</td>
</tr>
<tr>
<td>white-space</td>
<td>Defines how white space in the source for<br />
      the element is handled.</td>
<td>normal, pre, nowrap</td>
<td>p.haiku {whitespace:<br />
      pre;}</td>
</tr>
<tr>
<td>list-style-type</td>
<td>Specifies the appearance of the automatic<br />
      numbering or bulleting of lists.</td>
<td>disc, circle, square,<br />
      decimal, lower-roman,<br />
      upper-roman, lower-alpha,<br />
      upper-alpha, none</td>
<td>ol {list-style-type:<br />
      upper-roman;}<br />
      (A., B., C., D., etc)</td>
</tr>
<tr>
<td>list-style-image</td>
<td>Specifies a graphic to be used as a<br />
      list-item marker (bullet).</td>
<td>url, none</td>
<td>ul {list-style-image:<br />
      url(3dball.gif);}</td>
</tr>
<tr>
<td>list-style-position</td>
<td>Specifies whether list items should be<br />
      set with a hanging indent.</td>
<td>inside, outside</td>
<td>ol {list-style-position:<br />
      outside;}</td>
</tr>
<tr>
<td>list-style</td>
<td>Shorthand property for setting the<br />
      list-style type, image, and position<br />
      (inside, outside) in one declaration.</td>
<td>list-style-type,<br />
      list-style-image,<br />
      list-style-position</td>
<td>ul {list-style: list-item<br />
      url(3dball.gif) disc<br />
      inside;}</td>
</tr>
<tr>
<td>table-layout</td>
<td>Controls the layout algorithm used to<br />
      render table structures.</td>
<td>inherit, auto, fixed</td>
<td>table {table-layout:<br />
      fixed;}</td>
</tr>
<tr>
<td>border-collapse</td>
<td>The rendering of table borders is divided<br />
      into two categories in CSS2&#8212;collapsed<br />
      and separated. This property specifies<br />
      which border rendering mode to use.</td>
<td>inherit, collapse, separate</td>
<td>table {border-collapse:<br />
      separate;}</td>
</tr>
<tr>
<td>border-spacing</td>
<td>Specifies the distance between the borders<br />
      of adjacent table cells in the &#8220;separated<br />
      borders&#8221; model.</td>
<td>inherit, length</td>
<td>table {border-spacing:<br />
      10pt 5pt;}</td>
</tr>
<tr>
<td>cursor</td>
<td>Controls the type of cursor<br />
      that is used when a pointing<br />
      device is over an element</td>
<td>inherit, default, auto, url, n-resize,<br />
      ne-resize, e-resize, se-resize, s-resize,<br />
      sw-resize, w-resize, nw-resize, crosshair,<br />
      pointer, move, text, wait, help, hand,<br />
      all-scroll, col-resize, row-resize, no-drop,<br />
      not-allowed, progress, vertical-text, alias,<br />
      cell, copy, count-down, count-up,<br />
      count-up-down, grab, grabbing, spinning</td>
<td>blockquote<br />
      {cursor: help;}</td>
</tr>
<tr>
<td>outline</td>
<td>Shorthand method for specifying<br />
      the outline-color, outline-style,<br />
      and outline-width properties<br />
      using a<br />
      single property notation</td>
<td>inherit, outline-color, outline-style,<br />
      outline-width</td>
<td>button {outline: red<br />
      solid thick;}</td>
</tr>
<tr>
<td>outline-width</td>
<td>Specifies the width<br />
      for the outline of an element</td>
<td>inherit, thin, medium, thick, length</td>
<td>input {outlinewidth:<br />
      thin;}</td>
</tr>
<tr>
<td>outline-color</td>
<td>Specifies a color for the outline<br />
      for an element</td>
<td>inherit, invert, color</td>
<td>img {outline-color:<br />
      black;}</td>
</tr>
<tr>
<td>outline-style</td>
<td>Specifies an outline line style for<br />
      the current element</td>
<td>inherit, none, dotted, dashed, solid,<br />
      groove, ridge, inset, outset, double</td>
<td>button {outline-style:<br />
      groove;}</td>
</tr>
<tr>
<td>content </td>
<td>Automatically generates content to<br />
      attach before/after a CSS selector<br />
      (using the :before and :after<br />
      pseudo-elements.)</td>
<td>inherit, string, url, counter(),<br />
      open-quote, close-quote,<br />
      no-open-quote, no-closequote,<br />
      attr(x)</td>
<td>em:before {content:<br />
      url(&quot;head.gif&quot;);}</td>
</tr>
<tr>
<td>quotes</td>
<td>This property determines the type<br />
      of quotation marks that will be<br />
      used in a document.</td>
<td>inherit, none, ([string][string])</td>
<td>blockquote: before {content:<br />
      open-quote} blockquote:after<br />
      {content: close-quote}</td>
</tr>
<tr>
<td>counter-reset</td>
<td>The counter-reset property acts<br />
      like a variable assignment in a<br />
      programming language&#8212;it sets a<br />
      new value for the specified counter<br />
      whenever the current CSS selector<br />
      is encountered.</td>
<td>inherit, none, [<br />
      identifier integer]</td>
<td>h1:before {counter-increment:<br />
      main-heading; counter-reset:<br />
      sub-heading;}</td>
</tr>
<tr>
<td>counter-increment</td>
<td>The counter-increment property<br />
      acts like an incremented variable in<br />
      a programming language&#8212;it<br />
      specifies the amount to increment<br />
      the specified counter by when the<br />
      current CSS selector is encountered.</td>
<td>inherit, none, [<br />
      identifier integer]</td>
<td>h1:before {counter-increment:<br />
      main-heading; counter-reset:<br />
      sub-heading}</td>
</tr>
<tr>
<td>@page</td>
<td>Sets page rules.</td>
<td>&nbsp;</td>
<td>@page doublepage {size:<br />
      8.5in 11in;<br />
      page-break-after: left;}</td>
</tr>
<tr>
<td>page</td>
<td>Used to specify a specific page type to use<br />
      when displaying an element box.</td>
<td>auto, identifier</td>
<td>body {page: doublepage;<br />
      page-break-after: right;}</td>
</tr>
<tr>
<td>size</td>
<td>Describes the orientation or dimensions of the<br />
      page box.</td>
<td>inherit, auto, portrait,<br />
      landscape, length</td>
<td>body {size 8.5in 11in;}</td>
</tr>
<tr>
<td>marks</td>
<td>Printed documents in the printing industry<br />
      often carry marks on the page outside the<br />
      content area. These marks are used to align<br />
      and trim groups of papers. This property<br />
      specifies what sort of marks should be<br />
      rendered just outside the rendered page box.</td>
<td>inherit, none, crop,<br />
cross</td>
<td>body {marks:<br />
      crop cross;}</td>
</tr>
<tr>
<td>margin</td>
<td>Shorthand property which allows an<br />
      author to specify margin-top, margin-right,<br />
      margin-bottom, and margin-left, properties<br />
      using a single property and value notation.</td>
<td>inherit, auto, length,<br />
      percentage</td>
<td>body {margin: 5px 0px<br />
      2px 25px;}</td>
</tr>
<tr>
<td>margin-top,<br />
      margin-left,<br />
      margin-bottom,<br />
      margin-right</td>
<td>Specifies the margin properties of the<br />
      respective sides of an element&#8217;s box.</td>
<td>inherit, auto, length,<br />
      percentage</td>
<td>address {margin-top:<br />
      33%;}</td>
</tr>
<tr>
<td>page-break-before</td>
<td>Specifies the page-breaking behavior that<br />
      should occur before an element box and on<br />
      what side of the page the content that follows<br />
      should resume on.</td>
<td>inherit, auto, avoid,<br />
      left, right, always,<br />
      empty string</td>
<td>p {page-break-before:<br />
      always;}</td>
</tr>
<tr>
<td>page-breakafter</td>
<td>Specifies the page-breaking behavior that<br />
      should occur after an element box and on<br />
      what side of the page the content that follows<br />
      should resume on.</td>
<td>inherit, auto, avoid,<br />
      left, right, always,<br />
      empty string</td>
<td>p {page-break-after:<br />
      always;}</td>
</tr>
<tr>
<td>page-break-inside</td>
<td>Specifies the page-breaking behavior<br />
      that should occur inside an element&#8217;s<br />
      rendering box.</td>
<td>inherit, auto, avoid</td>
<td>p {page-break-inside:<br />
      avoid;}</td>
</tr>
<tr>
<td>orphans</td>
<td>Specifies the minimum number of lines of<br />
      content for the current element that must be<br />
      left at the bottom of a page in a paged display<br />
      environment.</td>
<td>inherit, integer</td>
<td>p {orphans: 4;}</td>
</tr>
<tr>
<td>windows</td>
<td>Specifies the minimum number of lines of<br />
      content for the current element that must be<br />
      left at the top of a page in a paged display<br />
      environment.</td>
<td>inherit, integer</td>
<td>p{windows: 1;}</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/css-properties-with-description-and-example/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/css-properties-with-description-and-example/</feedburner:origLink></item>
		<item>
		<title>Handling Screen Resolution Issues in Javascript</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/123721857/</link>
		<comments>http://techjunk.websewak.com/handling-screen-resolution-issues-in-javascript/#comments</comments>
		<pubDate>Sun, 10 Jun 2007 18:32:48 +0000</pubDate>
		<dc:creator>Srikanta</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Javascript Code Samples]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/handling-screen-resolution-issues-in-javascript/</guid>
		<description><![CDATA[Handling Screen Resolution Issues
Browser differences are only half the problem you&#8217;ll encounter when attempting to create a universally viewable Webpage. The conditions in which the browser is running, operating system and screen resolution to name a couple, also create problems. Luckily, there is a built-in JavaScript object, Screen, which will help you with this. The [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Handling Screen Resolution Issues</strong><br />
Browser differences are only half the problem you&#8217;ll encounter when attempting to create a universally viewable Webpage. The conditions in which the browser is running, operating system and screen resolution to name a couple, also create problems. Luckily, there is a built-in JavaScript object, Screen, which will help you with this. The Screen object contains information on the display screen&#8217;s size and color depth.</p>
<p><strong>Screen Properties</strong><br />
There are several properties that are built into the Screen object in order for you to more effectively use it. Here is a complete list of their names and descriptions of each:</p>
<p><strong>availHeight</strong> : This property returns the height of the screen in pixels. The height of any components of the operating system&#8217;s interfaceâ€”such as those of the Windows Taskbarâ€”are subtracted automatically.</p>
<p><strong>availWidth</strong> : This property returns the width of the screen in pixels. The width of any components of the operating system&#8217;s interfaceâ€”such as those of the Windows Taskbarâ€”are subtracted automatically.</p>
<p><strong>colorDepth</strong> : This property represents the color depth of a color table, if one is in use. If no color table is being used, this property is the Screen.pixelDepth property.</p>
<p><strong>height</strong> : This property returns the height of the screen in pixels.</p>
<p><strong>pixelDepth</strong> : This property returns the color resolution of the display screen in bits per pixel.</p>
<p><strong>width</strong> : This property returns the width of the screen in pixels.</p>
<p>Even though the Screen object is available to return information about the client&#8217;s screen, it is not a good idea to give the user a message informing him that he&#8217;s not viewing your Web page under ideal conditions. It&#8217;s your responsibility as the programmer to make your Web pages work with as many screen variations as possible.</p>
<p><strong>Working with Different Screen Settings</strong></p>
<p>How to get all of your content on the page and how your images will look when they are displayed are two of the most important issues you&#8217;ll encounter when dealing with different screen settings.</p>
<p>Getting all of your content onto a page is relatively easy because HTML has built-in features that can be used to create content that fits on any resolution. The best way to make sure that all of a page&#8217;s content fits in any screen resolution is to enclose the entire content in a table (which may or not have a border) and set its width property to 600 pixels.</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (javascript)</div><br />
&lt;html&gt;<br />
<br />
&nbsp; &lt;head&gt;<br />
&nbsp; &nbsp; &lt;title&gt;<br />
&nbsp; &nbsp; &nbsp; Containing Content<br />
&nbsp; &nbsp; &lt;/title&gt;<br />
&nbsp; &lt;/head&gt;<br />
<br />
&nbsp; &lt;body&gt;<br />
&lt;table width=<span style="color: #3366CC;">&quot;600&quot;</span>&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;center&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;font size=<span style="color: #CC0000;">6</span>&gt;JavaScript&lt;/font&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;/center&gt;<br />
<br />
&nbsp; &nbsp; &nbsp; &lt;code&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">If</span> you place all your pages content into a table that has a<br />
&nbsp; &nbsp; &nbsp; &nbsp; defined width of <span style="color: #CC0000;">600</span> pixels, it will all fit into a browser<br />
&nbsp; &nbsp; &nbsp; &nbsp; that <span style="color: #000066; font-weight: bold;">is</span> being used under any screen resolution &lt;b&gt;and&lt;/b&gt; it<br />
&nbsp; &nbsp; &nbsp; &nbsp; will look exactly the same under any of the many screen<br />
&nbsp; &nbsp; &nbsp; &nbsp; resolutions.<br />
&nbsp; &nbsp; &nbsp; &lt;/code&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
&nbsp; &lt;/body&gt;<br />
<br />
&lt;/html&gt;<br />
&nbsp;</div>
<p>Because the smallest standard screen resolution is 640Ã—480 pixels, your Web page will fit into any browser running under any of the many screen resolutions. Not only will all your content fit on the page, but it will also look exactly the same under any condition. The only adverse side effect of using this technique occurs when the user is viewing your Web page in a browser window that is not maximized. If this is the case, some of the content of your page will be hidden, and the user will have to use the scroll bar to view it. Fortunately, with your knowledge of the window and screen objects, this side effect can easily be avoided. </p>
<p>Here&#8217;s how:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (javascript)</div><br />
&lt;html&gt;<br />
<br />
&nbsp; &lt;head&gt;<br />
&nbsp; &nbsp; &lt;title&gt;<br />
&nbsp; &nbsp; &nbsp; Resizing Small Windows<br />
&nbsp; &nbsp; &lt;/title&gt;<br />
<br />
&nbsp; &nbsp; &lt;script language=<span style="color: #3366CC;">&quot;JavaScript&quot;</span>&gt;<br />
&nbsp; &nbsp; &lt;!--<br />
&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #000066;">onLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; self.<span style="color: #006600;">moveTo</span><span style="color: #66cc66;">&#40;</span> <span style="color: #CC0000;">0</span>, <span style="color: #CC0000;">0</span> <span style="color: #66cc66;">&#41;</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; self.<span style="color: #006600;">resizeTo</span><span style="color: #66cc66;">&#40;</span> screen.<span style="color: #006600;">availWidth</span>, screen.<span style="color: #006600;">availHeight</span> <span style="color: #66cc66;">&#41;</span>; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// --&gt;</span><br />
&nbsp; &nbsp; &lt;/script&gt;<br />
<br />
&nbsp; &lt;/head&gt;<br />
<br />
&nbsp; &lt;body <span style="color: #000066;">onLoad</span>=<span style="color: #3366CC;">&quot;JavaScript: onLoad();&quot;</span>&gt;<br />
&lt;table width=<span style="color: #3366CC;">&quot;600&quot;</span>&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;center&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;font size=<span style="color: #CC0000;">6</span>&gt;JavaScript&lt;/font&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;/center&gt;<br />
<br />
&nbsp; &nbsp; &nbsp; &lt;code&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">If</span> you place all your pages content into a table that has a<br />
&nbsp; &nbsp; &nbsp; &nbsp; defined width of <span style="color: #CC0000;">600</span> pixels, it will all fit into a browser<br />
&nbsp; &nbsp; &nbsp; &nbsp; that <span style="color: #000066; font-weight: bold;">is</span> being used under any screen resolution &lt;b&gt;and&lt;/b&gt; it<br />
&nbsp; &nbsp; &nbsp; &nbsp; will look exactly the same under any of the many screen<br />
&nbsp; &nbsp; &nbsp; &nbsp; resolutions.<br />
&nbsp; &nbsp; &nbsp; &lt;/code&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
&nbsp; &lt;/body&gt;<br />
<br />
&lt;/html&gt;<br />
&nbsp;</div>
<p>This example resizes the window as soon as it loads to make sure it is big enough to hold all of the horizontal content without scroll bars. As most users will become annoyed by having their windows resized unnecessarily, it&#8217;s a good idea to put a check in the onLoad() function above, so that the window will only resize if it is necessary in order to show all of the content:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (javascript)</div><br />
<span style="color: #003366; font-weight: bold;">function</span> <span style="color: #000066;">onLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> self.<span style="color: #006600;">innerWidth</span> &lt; <span style="color: #CC0000;">600</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;self.<span style="color: #006600;">moveTo</span><span style="color: #66cc66;">&#40;</span> <span style="color: #CC0000;">0</span>, <span style="color: #CC0000;">0</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp;self.<span style="color: #006600;">resizeTo</span><span style="color: #66cc66;">&#40;</span> screen.<span style="color: #006600;">availWidth</span>, screen.<span style="color: #006600;">availHeight</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
&nbsp;</div>
<p>As a last resort, you can always display a message for the user if he is using a screen resolution that you feel your content or images just cannot accommodate. Here is a modified onLoad() function again that does just that:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (javascript)</div><br />
<span style="color: #003366; font-weight: bold;">function</span> <span style="color: #000066;">onLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> self.<span style="color: #006600;">innerWidth</span> &lt; <span style="color: #CC0000;">600</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; self.<span style="color: #006600;">moveTo</span><span style="color: #66cc66;">&#40;</span> <span style="color: #CC0000;">0</span>, <span style="color: #CC0000;">0</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; self.<span style="color: #006600;">resizeTo</span><span style="color: #66cc66;">&#40;</span> screen.<span style="color: #006600;">availWidth</span>, screen.<span style="color: #006600;">availHeight</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; <span style="color: #66cc66;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> self.<span style="color: #006600;">innerWidth</span> &lt; <span style="color: #CC0000;">600</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">&quot;This Web page was designed to be viewed using a&quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">&quot; screen resolution of 640x480 or larger.&quot;</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
&nbsp;</div>
<p>This function attempts to resize the window, but if it&#8217;s still not large enough, a message is displayed explaining the problem.</p>
<p>Another important thing to remember when writing a Web page for different screen resolutions is that images will appear larger on smaller resolutions. Fortunately, the width and height properties of the HTML <IMG> tag allow you to dynamically set the size of the image. Here is a typical image tag that dynamically sizes the image to the screen:<br />
(UPDATED: Thanks to <strong>Laurie Erickson</strong>)</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (javascript)</div><br />
&lt;img src=<span style="color: #3366CC;">&quot;image.jpg&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066;">onload</span>=<span style="color: #3366CC;">&quot;this.width=getWidth( 150 );this.height=getHeight( 200 );&quot;</span>&gt;<br />
&nbsp;</div>
<p>That statement, in combination with the following two functions:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;"><div style="">Code (javascript)</div><br />
<span style="color: #003366; font-weight: bold;">function</span> getWidth<span style="color: #66cc66;">&#40;</span> width <span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">return</span><span style="color: #66cc66;">&#40;</span> width * screen.<span style="color: #006600;">width</span> / <span style="color: #CC0000;">1024</span> <span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #003366; font-weight: bold;">function</span> getHeight<span style="color: #66cc66;">&#40;</span> height <span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">return</span><span style="color: #66cc66;">&#40;</span> height * screen.<span style="color: #006600;">height</span> / <span style="color: #CC0000;">768</span> <span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
&nbsp;</div>
<p>will dynamically resize the image so that it will look the same on any screen resolution. These two functionsâ€”getWidth() and getHeight()â€”assume that the image was designed for screen resolution 1024 Ã— 768, but you can change that by changing the resolution width and height in the return statements.</p>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/handling-screen-resolution-issues-in-javascript/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/handling-screen-resolution-issues-in-javascript/</feedburner:origLink></item>
		<item>
		<title>Google acquires FeedBurner RSS feeder for $100 million</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/122079911/</link>
		<comments>http://techjunk.websewak.com/google-acquires-feedburner-rss-feeder-for-100-million/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 15:34:15 +0000</pubDate>
		<dc:creator>Virender</dc:creator>
		
		<category><![CDATA[Announcements]]></category>

		<category><![CDATA[Technology Junk]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/google-acquires-feedburner-rss-feeder-for-100-million/</guid>
		<description><![CDATA[FeedBurner, a company that distributes syndicated content for blogs and other media Web sites has been purchased in about $100 million. Terms has not yet been disclosed.
Google, the king of paid search advertising and has very vast network of websites that host ads. According to Google, they are very much sure that this area is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.feedburner.com/">FeedBurner</a>, a company that distributes syndicated content for blogs and other media Web sites has been purchased in about $100 million. Terms has not yet been disclosed.</p>
<p><a href="http://www.google.com/">Google</a>, the king of paid search advertising and has very vast network of websites that host ads. According to Google, they are very much sure that this area is full of opportunities. With FeedBurner it can expand its <a href="http://www.google.co.in/intl/en/ads/">AdSense</a> reach.</p>
<p>Now Google&#8217;s advertiser can advertise even on feeds. Also Google will integrate FeedBurner technology with its <a href="http://www.google.com/reader/view/">Google Reader</a>.</p>
<p>RSS feeds enable media Websites, bloggers and podcasters to shoot their content directly to readers through RSS readers. FeedBurner helps publishers deliver the RSS feeds, as well as manage the feeds, track the subscribers and also serve ads. </p>
<p>Although the technology is not mainstream, but Google showing interest shows that it&#8217;s future is bright.</p>
<p>Google has acquired many technologies. In April, Google said it planned to spend $3.1 billion to buy Online ads firm <a href="http://www.doubleclick.com/us/">DoubleClick</a>.</p>
<p>Letâ€™s wait for the Googleâ€™s Next Dealâ€¦â€¦</p>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/google-acquires-feedburner-rss-feeder-for-100-million/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/google-acquires-feedburner-rss-feeder-for-100-million/</feedburner:origLink></item>
		<item>
		<title>Setup S3 sleep state in Windows Vista for significant power savings</title>
		<link>http://feeds.feedburner.com/~r/techjunk/~3/121458815/</link>
		<comments>http://techjunk.websewak.com/setup-s3-sleep-state-in-windows-vista-for-significant-power-savings/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 19:21:32 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
		
		<category><![CDATA[Technology Junk]]></category>

		<guid isPermaLink="false">http://techjunk.websewak.com/setup-s3-sleep-state-in-windows-vista-for-significant-power-savings/</guid>
		<description><![CDATA[With the newer technologies, power consumption of computers are increasing day by day. Manufacturers are continuously working on reducing the power consumption. Popular OS like Windows XP, provides us many features to save power such as Stand By, Hard Disk Turn Off, Monitor Off and Hibernate etc. With the release of Vista, Microsoft has introduced, [...]]]></description>
			<content:encoded><![CDATA[<p>With the newer technologies, power consumption of computers are increasing day by day. Manufacturers are continuously working on reducing the power consumption. Popular OS like Windows XP, provides us many features to save power such as Stand By, Hard Disk Turn Off, Monitor Off and Hibernate etc. With the release of Vista, Microsoft has introduced, S3 Sleep state. </p>
<p>In the older power-saving modes (S1 sleep state), the computer could only shut down some components, such as the hard drives and monitors, after a period of time to reduce power usage. However, the CPU, fans, and other internal components continues to run at their full speed. With the new S3 power management, your computer is nearly sleeping. It maintains a minimum amount of alertness, just enough to wait for you to wake it up at any moment.</p>
<p><a href='http://techjunk.websewak.com/wp-content/uploads/2007/05/66757.png' title='66757.png'><img src='http://techjunk.websewak.com/wp-content/uploads/2007/05/66757.png' alt='66757.png' /></a></p>
<p>For more information about S3 Sleep state and to know how to enable S3 state in Window XP, Visit http://content.zdnet.com/2346-9595_22-66750.html?tag=gald</p>
]]></content:encoded>
			<wfw:commentRss>http://techjunk.websewak.com/setup-s3-sleep-state-in-windows-vista-for-significant-power-savings/feed/</wfw:commentRss>
		<feedburner:origLink>http://techjunk.websewak.com/setup-s3-sleep-state-in-windows-vista-for-significant-power-savings/</feedburner:origLink></item>
	</channel>
</rss>
