var replaceSpaces = "";

function base(){
	// add shadows and set heights1
	$("div.wrapper").prepend("<div class='bg-shadow-bottom'></div>");
	
	if ( $("div.search").height() > $("div.spotlight").height() ){
		columnHeight = $("div.search").height();
		$("div.spotlight").css({height:columnHeight});
	}

	if ( $("div.spotlight").height() > $("div.search").height() ){
		columnHeight = $("div.spotlight").height();
		$("div.search").css({height:columnHeight});
	}
	
	if( $("div#phpworx_product_search").height()+40 > $("div.search").height() ){
		columnHeight = $("div#phpworx_product_search").height()+40;
		$("div.search").css({height:columnHeight});
		$("div.spotlight").css({height:columnHeight});
	}

	$("div.header ul li").hover(
		function () {
			$(this).addClass("active"); 
			$(this).children("ul").show();
		}, 
		function () {
			$(this).removeClass("active");
			$(this).children("ul").hide();
		}
	);
	
	// replace all neccessary spaces with &nbsp; (like for nav drop downs)
	$("div.header ul li ul li a").each(function(){
		replaceSpaces = $(this).text().replace(/ /g,'\u00a0');
		$(this).text(replaceSpaces);
	});

	$("a.more").append("&nbsp;&raquo;");
	
	$("table.chart tr:odd").addClass("odd");	
	$("table.chart tr:even").addClass("even");	
	$("table.chart tr").hover(
		function () { $(this).addClass("active"); }, 
		function () { $(this).removeClass("active"); }
	);
}


function innerfade(){
	if($("div.flash").height() > 0)
	{
		$("div.flash div.flash-innerfade img").css({ visibility:"visible" }); 
		$("div.flash div.flash-innerfade").innerfade({ speed: 750, timeout: 999999, type: 'random', containerheight: '267px' }); 
	}
	
	if($("div.spotlight").height() > 0)
	{
		$("div.spotlight div.spotlight-innerfade").innerfade({ speed: 750, timeout: 5000, type: 'random', containerheight: '189px' }); 
	}
}