
function getSidebarSection() {
	var url = window.location.href;
	if (url.indexOf('store')!=-1) 						{return 'store';}
	if (url.indexOf('updates')!=-1) 					{return 'updatepages';}
	if (url.indexOf('products/registrybooster')!=-1) 	{return 'rb';}
	if (url.indexOf('products/speedupmypc')!=-1) 		{return 'sp';}
	if (url.indexOf('products/spyeraser')!=-1) 		{return 'se';}
	if (url.indexOf('products/powersuite')!=-1) 		{return 'ps';}		
	if (url.indexOf('products/wintasksstd')!=-1) 		{return 'wtstd';}
	if (url.indexOf('products/wintaskspro')!=-1) 		{return 'wtpro';}
	if (url.indexOf('products/winbackuppro')!=-1) 		{return 'wbpro';}
	if (url.indexOf('products/winbackupserver')!=-1) 	{return 'wbser';}
	if (url.indexOf('products/winbackup')!=-1) 		{return 'wb';}
	if (url.indexOf('support')!=-1)			 		{return 'support';}
	return 'main';
}

function DoSidebar() {
	var currentSection = getSidebarSection();
	
	document.write("<div id='content' style='margin-top:10px;cursor:hand;'>");
	document.write("<div class='grid3cola' style='cursor:hand;'>");
	document.write("<div class='column last sidebar' style='cursor:hand;'>");
	document.write("<h2 id='titleessentials' style='margin:0 0 0 1px; padding:0;cursor:hand;'><img src='/assets/graphics/sidebar/header.gif'></h2>");
	document.write("<div id='essentials' class='sidebox' style='cursor:hand;'>");
	document.write("<ul class='drawers shingles'>");
	
	
	switch(currentSection) {
		case "store" : 
			writeStore();
			break;
		
		case "rb" :
			writeRB();
			break;
		
		case "sp" :
			writeSP();
			break;
		
		case "se" :
			writeSE();
			break;
		
		case "ps" :
			writePS();
			break;
			
		case "wtstd" :
			writeWTSTD();
			break;
		
		case "wtpro" :
			writeWTPRO();
			break;
		
		case "wbpro" :
			writeWBPRO();
			break;
		
		case "wbser" :
			writeWBSER();
			break;
		
		case "wb" :
			writeWB();
			break;
			
		case "support" :
			writeSupport();
			break;
		
		case "updatepages":
			writeUpdatePages()
			break;
			
		default :
			writeMain();			
	}
	
	document.write("</ul>");
	document.write("</div>");
	document.write("</div>");
	document.write("</div>");
	document.write("</div>");

}

function writeRB() {
	
	writeProductBottom();
}

function writeSP() {
	
	writeProductBottom();
}

function writeSE() {
	
	writeProductBottom();
}

function writePS() {
	
	writeProductBottom();
}

function writeWTSTD() {
	
	writeProductBottom();
}

function writeWTPRO() {
	
	writeProductBottom();
}

function writeWB() {
	
	writeProductBottom();
}

function writeWBPRO() {
	
	writeProductBottom();
}

function writeWBSER() {
	
	writeProductBottom();
}

function writeStore() {
	
	writeStoreBottom();
}

function writeSupport() {
	
	writeSupportBottom();
}

function writeUpdatePages() {
	
	writeUpdatePagesBottom();
}

function writeUpdatePagesBottom(){
	
	// ACTIVEPROTECTION
	document.write("<li style='z-index: 5;' class='first'>");
	document.write("<a class='thumbnail' href='http://active.uniblue.com' target='_blank'><div class='sidebarhero' id='side-activeprotection' style='height:95px;'></div></a>");
	document.write("<a class='handle' href='http://active.uniblue.com' style='cursor:hand; padding-bottom:35px;' target='_blank'>");
	document.write("<strong>Keep updated</strong>");
	document.write("<span class='description'>ActiveProtection gives you immediate access to all software updates and feature extensions.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");	
	
	// OK 2. Trusted
	document.write("<li style='top: 78px; z-index: 3;'  class='obscured'>");
	document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"MS\");'><div class='sidebarhero' id='side-partner'></div></a>");
	document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"MS\");'>");
	document.write("<strong>Trusted Partner</strong>");
	document.write("<span class='description'>A trusted software partner to millions of PC users.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");	
	
	// 3. Guarantee
	document.write("<li style='top: 156px; z-index: 2;' class='obscured'>");
	document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"Guarantee\");'><div class='sidebarhero' id='side-guarantee'></div></a>");
	document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"Guarantee\");' style='cursor:hand;'>");
	//document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"Guarantee\");'><div class='sidebarhero' id='side-guarantee'></div></a>");
	//document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"Guarantee\");'>");
	document.write("<strong>Guarantee</strong>");
	document.write("<span class='description'>All products guaranteed with a 30 day money-back policy.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");
		
}

function writeStoreBottom() {		
	// OK 2. Guarantee
	document.write("<li style='z-index: 5;'  class='first'>");
	document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"Guarantee\");'><div class='sidebarhero' id='side-guarantee'></div></a>");
	document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"Guarantee\");' style='cursor:hand;'>");
	//document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"Guarantee\");'><div class='sidebarhero' id='side-guarantee'></div></a>");
	//document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"Guarantee\");'>");
	document.write("<strong>Guarantee</strong>");
	document.write("<span class='description'>All products guaranteed with a 30 day money-back policy.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");
	
	// 3. Phone
	document.write("<li style='top: 78px; z-index: 2;' class='obscured'>");
	document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"Phone\");'><div class='sidebarhero' id='side-phone'></div></a>");
	document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"Phone\");' style='cursor:hand;'>");
	//document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"Guarantee\");'><div class='sidebarhero' id='side-guarantee'></div></a>");
	//document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"Guarantee\");'>");
	document.write("<strong>Order by Phone</strong>");
	document.write("<span class='description'>Easily order your solution without hassles.</span>");
	document.write("<span class='more'>View details</span>			</a>		</li>");
	
	// 4. Instant Delivery
	document.write("<li style='top: 156px;' class='obscured'>");
	document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"Delivery\");'><div class='sidebarhero' id='side-delivery'></div></a>");
	document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"Delivery\");' style='cursor:hand;'>");

	document.write("<strong>Instant Delivery</strong>");
	document.write("<span class='description'>Purchase and get your solution within minutes.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");
	
}

function writeSupportBottom() {		
	// OK 2. Trusted
	document.write("<li style='z-index: 5;'  class='first'>");
	document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"MS\");'><div class='sidebarhero' id='side-partner'></div></a>");
	document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"MS\");'>");
	document.write("<strong>Trusted Partner</strong>");
	document.write("<span class='description'>A trusted software partner to millions of PC users.</span>");
	document.write("<span class='more'>Read more</span>			</a>		</li>");
}

function writeProductBottom() {		

	// OK 2. Trusted
	document.write("<li style='z-index: 5;'  class='first'>");
	document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"MS\");'><div class='sidebarhero' id='side-partner'></div></a>");
	document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"MS\");'>");
	document.write("<strong>Trusted Partner</strong>");
	document.write("<span class='description'>A trusted software partner to millions of PC users.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");
	
	// 3. Guarantee
	document.write("<li style='top: 78px; z-index: 2;' class='obscured'>");
	document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"Guarantee\");'><div class='sidebarhero' id='side-guarantee'></div></a>");
	document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"Guarantee\");' style='cursor:hand;'>");
	//document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"Guarantee\");'><div class='sidebarhero' id='side-guarantee'></div></a>");
	//document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"Guarantee\");'>");
	document.write("<strong>Guarantee</strong>");
	document.write("<span class='description'>All products guaranteed with a 30 day money-back policy.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");

	// OK 3. Awards
	document.write("<li style='top: 156px;' class='obscured'>");
	document.write("<a class='thumbnail' href='/news/?show=news-awards'><div class='sidebarhero' id='side-awards'></div></a>");
	document.write("<a class='handle' href='/news/?show=news-awards'>");
	document.write("<strong>Awards</strong>");
	document.write("<span class='description'>Solutions that have received over 100 5-star awards.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");
}

function writeMain() {
	// OK 1. Trusted
	document.write("<li style='z-index: 5;' class='first'>");
	document.write("<a class='thumbnail' href='#' onclick='DoJoinPopup(\"MS\");'><div class='sidebarhero' id='side-partner'></div></a>");
	document.write("<a class='handle' href='#' onclick='DoJoinPopup(\"MS\");'>");
	document.write("<strong>Trusted Partner</strong>");
	document.write("<span class='description'>A trusted software partner to millions of PC users.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");
	
	// OK 2.  Awards
	document.write("<li style='top: 78px; z-index: 2;' class='obscured'>");
	document.write("<a class='thumbnail' href='/news/?show=news-awards'><div class='sidebarhero' id='side-awards'></div></a>");
	document.write("<a class='handle' href='/news/?show=news-awards'>");
	document.write("<strong>Awards</strong>");
	document.write("<span class='description'>Solutions that have received over 100 5-star awards.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");
	
	// OK 3.  Labs
	document.write("<li style='top: 156px;' class='obscured'>");
	document.write("<a class='thumbnail' href='/about/labs'><div class='sidebarhero' id='side-labs'></div></a>");
	document.write("<a class='handle' href='/about/labs'>");
	document.write("<strong>Uniblue Labs</strong>");
	document.write("<span class='description'>Innovation for the global computer user community.</span>");
	document.write("<span class='more'>Learn more</span>			</a>		</li>");

}