function base(){
	// add the background image
	$("body").prepend("<div class='bg'></div>");
	$("div.flash").prepend("<div class='shadow-right'></div><div class='shadow-left'></div>");
	$("div.banner").prepend("<div class='shadow-right'></div><div class='shadow-left'></div>");
	
	// main nav
	$("div.header ul li").hover(
		function () { $(this).addClass("active"); }, 
		function () { $(this).removeClass("active"); }
	);
		
	// news items
	$("div.subnav ul li:last").css({borderBottom:"0"});
	$("div.news div.news-item:last").css({borderBottom:"0"});
	$("div.news div.news-item").hover(
		function () { $(this).addClass("active"); }, 
		function () { $(this).removeClass("active"); }
	);
	$("div.news div.news-item").click(function () {
		var url = $(this).find("a").attr('href');
		window.location = url;
	}); 

	// footer links
	$("div.footer ul li").after("<li class='divider'>|</li>");
	$("div.footer ul li.divider:last").remove();
	
	// email form
	$("form.search-form input.search").val("Search...");
	$("form.search-form input.search").focus(function(){
		if ( $(this).val() == "Search..." ){
			$(this).val("");
		}
	});
	$("form.search-form input.search").blur(function(){
		if ( $(this).val() == "" ){
			$(this).val("Search...");
		}
	});
	
	$("div.subnav ul li").hover(function(){
		$(this).children("ul").show(); },
		function() { $(this).children("ul").hide(); });
	
}



var content=new Array("01", "02", "03", "04");
var cctr = 3;
var keepRunning = true;
		
// Rotate content prior to human interaction
function switchContent(){

	if (keepRunning){
		for (var rm in content){
			$("div#home-"+content[rm]+"-main").fadeOut(800);
			$("li#home-"+content[rm]).removeClass("active");
		}
		cctr = (cctr == 3) ? 0 : (cctr + 1);
		$("div#home-"+content[cctr]+"-main").fadeIn(800);
		$("li#home-"+content[cctr]).addClass("active");
		setTimeout('switchContent()', 7500);
	}
		
	$("div.flash ul li").hover(
		function () { $(this).addClass("active"); }, 
		function () { $(this).removeClass("active"); }
	);

	$("div.flash ul li").click(function(){
		keepRunning = false;
		$(this).siblings().removeClass("active");
		$(this).siblings().removeClass("sticky");
		$(this).addClass("sticky");
		$("div.innerfade").remove();
		$("div.rotate div").hide();
		$("div#"+this.id+"-main").show();
	});
	
	
}

function shades(){
	// Window Shades
	$("li.show").hide();
		$("li.main").css({cursor:"pointer"});
		$("li.main").click(function(){
			$(this).next("li.show").slideToggle();
		});
}

function popup(){
	$("div.wrapper").prepend("<a id='print' class='print' href='#'>Print</a>");
	$("a#print").click(function(){
			if($.browser.msie){
				$(".wrapper").jqprint();
			}
			else{
				$(".wrapper").printElement();
			}
		});
}

