
/*
CSS Browser Selector v0.3.5 (Feb 05, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);		





	function show (e) {
		for (i in e) {
			if (e[i].getAttribute) {
				var current = e[i].getAttribute("class");
				if (current == "productBlurb") {
					e[i].setAttribute("class", "productBlurb show");
				}
				if (current == "product") {
					e[i].setAttribute("class", "product show");
				}
			}
		}
	}
	
	function hide (e) {
		var current = e.getAttribute("class");
		if (current == "productBlurb show") {
			e.setAttribute("class", "productBlurb");
		}
		if (current == "product show") {
			e.setAttribute("class", "product");
		}
	}
	
	function hideIfNotEqual(e, b) {
		var bb = document.getElementById(b);
		if (!bb)
			return;
			
		for (i in e) {
			if (e[i] == bb)
				return;
		}	
		hide(bb);
	}
	
	function hideAllExcept (e) {
		var allElements = [
			"stacksBlurb",
			"blocksBlurb",
			"collageBlurb",
			"carouselBlurb",
			"kwixBlurb",
			"kiwiBlurb",
			"accordionBlurb",
			"stacksProduct",
			"blocksProduct",
			"collageProduct",
			"carouselProduct",
			"kwixProduct",
			"kiwiProduct",
			"accordionProduct"
		];
		show (e);
		for (i in allElements) {
			hideIfNotEqual (e, allElements[i]);
		}
		
	}
	
	var yhCurrent = new Array;
	var yhTimer = 0;
	function over (e) {
		if (yhTimer) {
			clearTimeout(yhTimer);
			yhTimer = setTimeout("yhNext()", 5000);
			yhCurrent = new Array;
		}
		var b = document.getElementById(e + "Blurb");
		var p = document.getElementById(e + "Product");
		var a = [b, p];
		hideAllExcept (a);
	}
	
	function yhNext() {
		
		if (yhCurrent[0] == accordionBlurb)
			yhCurrent = [collageBlurb, collageProduct];

		else if (yhCurrent[0] == collageBlurb)
			yhCurrent = [blocksBlurb, blocksProduct];

		else if (yhCurrent[0] == blocksBlurb)
			yhCurrent = [kiwiBlurb, kiwiProduct];

		else if (yhCurrent[0] == kiwiBlurb)
			yhCurrent = [stacksBlurb, stacksProduct];

		else if (yhCurrent[0] == stacksBlurb)
			yhCurrent = [kwixBlurb, kwixProduct];

		else if (yhCurrent[0] == kwixBlurb)
			yhCurrent = [carouselBlurb, carouselProduct];

		else if (yhCurrent[0] == carouselBlurb)
			yhCurrent = [accordionBlurb, accordionProduct];

		else
			yhCurrent = [kiwiBlurb, kiwiProduct];

		hideAllExcept (yhCurrent);
		yhTimer = setTimeout("yhNext()", 3000);
	}
	
	function setupHome () {
		var stacksBlurb = document.getElementById('stacksBlurb');
		var blocksBlurb = document.getElementById('blocksBlurb');
		var collageBlurb = document.getElementById('collageBlurb');
		var carouselBlurb = document.getElementById('carouselBlurb');
		var kiwiBlurb = document.getElementById('kiwiBlurb');
		var kwixBlurb = document.getElementById('kwixBlurb');
		var accordionBlurb = document.getElementById('accordionBlurb');

		var stacksProduct = document.getElementById('stacksProduct');
		var blocksProduct = document.getElementById('blocksProduct');
		var collageProduct = document.getElementById('collageProduct');
		var carouselProduct = document.getElementById('carouselProduct');
		var kiwiProduct = document.getElementById('kiwiProduct');
		var kwixProduct = document.getElementById('kwixProduct');
		var accordionProduct = document.getElementById('accordionProduct');

		document.getElementById('stacksProduct').onmouseover = function () {over("stacks");}
		document.getElementById('blocksProduct').onmouseover = function () {over("blocks");}
		document.getElementById('collageProduct').onmouseover = function () {over("collage");}
		document.getElementById('carouselProduct').onmouseover = function () {over("carousel");}
		document.getElementById('kwixProduct').onmouseover = function () {over("kwix");}
		document.getElementById('kiwiProduct').onmouseover = function () {over("kiwi");}
		document.getElementById('accordionProduct').onmouseover = function () {over("accordion");}
		
		yhTimer = setTimeout("yhNext()", 500);
	}
	
