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

<channel>
	<title>Web Design Blog &#187; Code</title>
	<atom:link href="http://www.northstarwebdesign.com/web-design-blog/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.northstarwebdesign.com/web-design-blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 07 Jun 2011 15:48:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Useful Javascript: Detect and Indicate Credit Card Type</title>
		<link>http://www.northstarwebdesign.com/web-design-blog/useful-javascript-detect-and-indicate-credit-card-type/</link>
		<comments>http://www.northstarwebdesign.com/web-design-blog/useful-javascript-detect-and-indicate-credit-card-type/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 14:45:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[credit card types]]></category>
		<category><![CDATA[ecommerce]]></category>

		<guid isPermaLink="false">http://www.northstarwebdesign.com/web-design-blog/?p=133</guid>
		<description><![CDATA[I added this useful bit of JavaScript code to an ecommerce project (www.vintagecellars.com) to detect the type of Credit Card someone is entering on a website. enjoy! This JavaScript needs to be added to the &#60;head&#62; of the document: &#60;script type="text/javascript"&#62; // &#60;![CDATA[ function SelectCC(ccnum) { var first = ccnum.charAt(0); var second = ccnum.charAt(1); var [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-135" title="JavaScript: Credit Card Type Detection" src="http://www.northstarwebdesign.com/web-design-blog/wp-content/uploads/2011/02/8.jpg" alt="JavaScript: Credit Card Type Detection" width="562" height="257" /></p>
<p>I added this useful bit of JavaScript code to an ecommerce project (<a href="http://www.vintagecellars.com">www.vintagecellars.com</a>) to detect the type of Credit Card someone is entering on a website.  enjoy!<span id="more-133"></span></p>
<p>This JavaScript needs to be added to the &lt;head&gt; of the document:<br />
<code style="width:552px; height:700px; color:#000; font-size:0.9em;"><br />
&lt;script type="text/javascript"&gt;<br />
// &lt;![CDATA[<br />
function SelectCC(ccnum) {<br />
	var first = ccnum.charAt(0);<br />
	var second = ccnum.charAt(1);<br />
	var third = ccnum.charAt(2);<br />
	var fourth = ccnum.charAt(3);<br />
	if (first == "4") {<br />
		//Visa<br />
		document.getElementById("mastercard").src="/images/mastercard-card-bw.png";<br />
		document.getElementById("amex").src="/images/amex-card-bw.png";<br />
		document.getElementById("discover").src="/images/discover-card-bw.png";<br />
		document.getElementById("visa").src="/images/visa-card.png";<br />
		document.getElementById("cctype").value="1";<br />
	}<br />
	else if ( (first == "3") &#038;&#038; ((second == "4") || (second == "7")) ) {<br />
		//American Express<br />
		document.getElementById("mastercard").src="/images/mastercard-card-bw.png";<br />
		document.getElementById("visa").src="/images/visa-card-bw.png";<br />
		document.getElementById("discover").src="/images/discover-card-bw.png";<br />
		document.getElementById("amex").src="/images/amex-card.png";<br />
		document.getElementById("cctype").value="3";<br />
	}<br />
	else if ( (first == "5") ) {<br />
		//Mastercard<br />
		document.getElementById("amex").src="/images/amex-card-bw.png";<br />
		document.getElementById("visa").src="/images/visa-card-bw.png";<br />
		document.getElementById("discover").src="/images/discover-card-bw.png";<br />
		document.getElementById("mastercard").src="/images/mastercard-card.png";<br />
		document.getElementById("cctype").value="2";<br />
	}<br />
	else if ( (first == "6") &#038;&#038; (second == "0") &#038;&#038; (third == "1") &#038;&#038; (fourth == "1")  ) {<br />
		//Discover<br />
		document.getElementById("amex").src="/images/amex-card-bw.png";<br />
		document.getElementById("visa").src="/images/visa-card-bw.png";<br />
		document.getElementById("mastercard").src="/images/mastercard-card-bw.png";<br />
		document.getElementById("discover").src="/images/discover-card.png";<br />
		document.getElementById("cctype").value="4";<br />
	}<br />
	else {<br />
		document.getElementById("amex").src="/images/amex-card-bw.png";<br />
		document.getElementById("visa").src="/images/visa-card-bw.png";<br />
		document.getElementById("mastercard").src="/images/mastercard-card-bw.png";<br />
		document.getElementById("discover").src="/images/discover-card-bw.png";<br />
		document.getElementById("cctype").value="";<br />
	}<br />
}<br />
// ]]&gt;&lt;/script&gt;<br />
</code></p>
<p>Then you need the credit card types indicated on the page in images:<br />
<code style="width:552px; height:100px; color:#000; font-size:0.9em;"><br />
&lt;div&gt;Card Type:<br />
&lt;img id="visa" src="/images/visa-card.png" alt="" /&gt;<br />
&lt;img id="mastercard" src="/images/mastercard-card.png" alt="" /&gt;<br />
&lt;img id="amex" src="/images/amex-card.png" alt="" /&gt;<br />
&lt;img id="discover" src="/images/discover-card.png" alt="" /&gt;&lt;/div&gt;<br />
</code></p>
<p>You will need to upload Credit Card Type image files, full color and black and white versions, to an &#8220;/images/&#8221; directory.</p>
<p>Lastly, you will need the input field with the user action code assigned:<br />
<code style="width:552px; height:50px; color:#000; font-size:0.9em;"><br />
&lt;input id="ccnum" onkeyup="SelectCC(this.value)" name="ccnum" /&gt;<br />
</code></p>
<p>You can see this script in action on <a href="http://www.vintagecellars.com">www.vintagecellars.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.northstarwebdesign.com/web-design-blog/useful-javascript-detect-and-indicate-credit-card-type/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Website Optimization + Server Optimization = Profits Soar!</title>
		<link>http://www.northstarwebdesign.com/web-design-blog/website-optimization-server-optimization-profits-soar/</link>
		<comments>http://www.northstarwebdesign.com/web-design-blog/website-optimization-server-optimization-profits-soar/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 17:58:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Optimization]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[promotion]]></category>
		<category><![CDATA[search engine optimization]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[televison]]></category>

		<guid isPermaLink="false">http://www.northstarwebdesign.com/web-design-blog/?p=119</guid>
		<description><![CDATA[One of my clients was on television. They did not bother to tell me this. Before being on TV, they were receiving an average of 3000 visitors per month and they were doing fine on a shared hosting account with about several other clients. A few more details on this client are that they were [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_122" class="wp-caption aligncenter" style="width: 572px"><img class="size-full wp-image-122" title="Oscommerce Sales Graph Profits go Ballistic" src="http://www.northstarwebdesign.com/web-design-blog/wp-content/uploads/2010/10/5.jpg" alt="Oscommerce Sales Graph Profits go Ballistic" width="562" height="257" /><p class="wp-caption-text">Oscommerce Sales Graph of client profits going through the roof.</p></div>
<p>One of my clients was on television.  They did not bother to tell me this.  Before being on TV, they were receiving an average of 3000 visitors per month and they were doing fine on a shared hosting account with about several other clients.  A few more details on this client are that they were running on 6 year old code and they had not invested in any upgrades since the website was originally designed.  That being the case, the code and the server was not optimized to handle the tsunami of traffic (100 times) that they had coming down the pipe.  This was made evident by the website going offline as soon as they went on air.  They called me and I dropped everything to jump on the problem right away.<span id="more-119"></span></p>
<p>I started making adjustments to the server to try and get it back online, but everything i tried to do was in vain and the server went offline within a few seconds of reboots.  I, immediately, started setting up a new server that i could move them to and they would not share with anyone else.  A couple minutes later i had the client off the shared server with the shared server fully operational again, and a couple hours later, moved the client to their own server where they were fully operational and no longer in a shared environment.  The server was optimized and they were back in business.  The server they were running on was a UNIX machine running Apache.  There were many optimizations we set on the server, however one very important setting that made a big difference was the &#8220;KeepAlive&#8221; Timeout.  We set that from 1600 seconds down to 300 seconds.  This made a big difference in the server performance along with the other server optimizations.</p>
<p>On another front, I attacked was the software side of things.  I setup some standard .htaccess code to optimize file handling along with other issues to improve the User Experience and then began to march through the code on the website looking for ways to improve the code.  I changed a majority of the code form Table based inline HTML to all Web 2.0 DIV based HTML/CSS.  This made a significant difference in this heavy database driven e-commerce website and furthered the website optimization necessary to maximize the profits for the client.</p>
<p>After all was said and done, the client was back online and doing business the same day at a minimum cost and as fast as possible.  This month they are expected to gross over $70K after having $300 monthly averages in the past.  Needless to say the Champagne is out and they are celebrating!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.northstarwebdesign.com/web-design-blog/website-optimization-server-optimization-profits-soar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful JavaScript: Toggle Div Show/Hide</title>
		<link>http://www.northstarwebdesign.com/web-design-blog/useful-javascript-toggle-div-showhide/</link>
		<comments>http://www.northstarwebdesign.com/web-design-blog/useful-javascript-toggle-div-showhide/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 21:59:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[web programming]]></category>

		<guid isPermaLink="false">http://www.northstarwebdesign.com/web-design-blog/?p=47</guid>
		<description><![CDATA[I was developing an e-commerce site today and I ran across a pretty light weight piece of JavaScript code to show and hide a DIVs. Here it is: &#60;script type="text/javascript"&#62; &#60;!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--&#62; &#60;/script&#62; Put that between your [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_53" class="wp-caption aligncenter" style="width: 572px"><img class="size-full wp-image-53" title="JavaScript: Show or Hide Elements" src="http://www.northstarwebdesign.com/web-design-blog/wp-content/uploads/2010/01/3.jpg" alt="JavaScript: Show or Hide Elements" width="562" height="257" /><p class="wp-caption-text">JavaScript: Show or Hide Elements</p></div>
<p>I was developing an e-commerce site today and I ran across a pretty light weight piece of JavaScript code to show and hide a DIVs.</p>
<p><span id="more-47"></span>Here it is:<br />
<code style="width:552px; height:200px; color:#000; font-size:0.9em;"><br />
&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
    function toggle_visibility(id) {<br />
       var e = document.getElementById(id);<br />
       if(e.style.display == 'block')<br />
          e.style.display = 'none';<br />
       else<br />
          e.style.display = 'block';<br />
    }<br />
//--&gt;<br />
&lt;/script&gt;<br />
</code></p>
<p>Put that between your HEAD tags and call it from your code with &#8220;onClick=&#8221;.</p>
<p>Simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.northstarwebdesign.com/web-design-blog/useful-javascript-toggle-div-showhide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Plugin: Posts By Category Widget</title>
		<link>http://www.northstarwebdesign.com/web-design-blog/wordpress-plugin-posts-by-category-widget-1-0/</link>
		<comments>http://www.northstarwebdesign.com/web-design-blog/wordpress-plugin-posts-by-category-widget-1-0/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 02:21:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.northstarwebdesign.com/web-design-blog/?p=17</guid>
		<description><![CDATA[This simple plugin is a widget that displays a list categories and the posts in those categories separated by category on your widgetized sidebar. Requires at least: 2.1 Tested up to: 2.9.1 Download WordPress Plugin: Posts By Category Widget Demo Free Design Resources Chapolito Creative Installation Upload `postbycategory.php` to the `/wp-content/plugins/` directory Activate the plugin [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_40" class="wp-caption aligncenter" style="width: 572px"><img class="size-full wp-image-40 " title="Wordpress Plugin: Posts By Category Widget" src="http://www.northstarwebdesign.com/web-design-blog/wp-content/uploads/2010/01/21.jpg" alt="Wordpress Plugin: Posts By Category Widget" width="562" height="257" /><p class="wp-caption-text">Wordpress Plugin: Posts By Category Widget</p></div>
<p>This simple plugin is a widget that displays a list categories and the posts in those categories separated by category on your widgetized sidebar.</p>
<p><span id="more-17"></span></p>
<p>Requires at least: 2.1<br />
Tested up to: 2.9.1</p>
<p><strong>Download</strong></p>
<ul>
<li><a href="http://www.northstarwebdesign.com/web-design-blog/wp-content/uploads/2010/01/posts-by-category-widget.1.zip">WordPress Plugin: Posts By Category Widget</a></li>
</ul>
<p><strong><br />
Demo</strong></p>
<ul>
<li><a title="Free Design Resources Chapolito Creative" href="http://chapolito.com/free-design-resources" target="_blank">Free Design Resources Chapolito Creative</a><strong><br />
</strong></li>
</ul>
<p><strong><br />
Installation</strong></p>
<ol>
<li>Upload `postbycategory.php` to the `/wp-content/plugins/` directory</li>
<li>Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress</li>
<li>Use your &#8216;Presentation&#8217;/'Sidebar Widgets&#8217; settings to drag and configure</li>
</ol>
<p><strong><br />
Configuration</strong></p>
<ul>
<li>Widget title: the title of the widget</li>
<li>List types: ul for bulleted list, p for paragraph, br for paragraph with line breaks</li>
<li>Post count: Number of random posts you would like to be displayed, must be a number</li>
<li>Category: Only this category will be selected as the source, must be the ID of the Category</li>
</ul>
<p><strong><br />
Change Log</strong></p>
<ul>
<li>1-January-2010: Plugin created</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.northstarwebdesign.com/web-design-blog/wordpress-plugin-posts-by-category-widget-1-0/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Launched! New NorthstarWebDesign.com</title>
		<link>http://www.northstarwebdesign.com/web-design-blog/new-northstarwebdesign-com-launched/</link>
		<comments>http://www.northstarwebdesign.com/web-design-blog/new-northstarwebdesign-com-launched/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 08:01:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Layout Design]]></category>
		<category><![CDATA[Multimedia Production]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[User Interface Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Website Optimization]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[New Website]]></category>
		<category><![CDATA[Norhtstar Web Design]]></category>
		<category><![CDATA[Northstar]]></category>

		<guid isPermaLink="false">http://www.northstarwebdesign.com/web-design-blog/?p=3</guid>
		<description><![CDATA[We have launched our new redesign of NorthstarWebDesign.com. With so much client work we had no time to re-brand for the last few years and thought it was well over due to be updated to reflect the level and style of our work. The new website will continue to change over the next few weeks [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_43" class="wp-caption aligncenter" style="width: 572px"><img class="size-full wp-image-43 " title="Launched! New NorthstarWebDesign.com" src="http://www.northstarwebdesign.com/web-design-blog/wp-content/uploads/2010/01/1.jpg" alt="New NorthstarWebDesign.com Screenshot" width="562" height="257" /><p class="wp-caption-text">Launched! New NorthstarWebDesign.com Screenshot</p></div>
<p><strong>We have launched our new redesign of NorthstarWebDesign.com.</strong> With so much client work we had no time to re-brand for the last few years and thought it was well over due to be updated to reflect the level and style of our work.</p>
<p><span id="more-3"></span></p>
<p>The new website will continue to change over the next few weeks and we will let you know about updates!  Thanks for your interest and continued support!</p>
<p><a href="http://www.northstarwebdesign.com" target="_self">http://www.northstarwebdesign.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.northstarwebdesign.com/web-design-blog/new-northstarwebdesign-com-launched/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

