// reset search field
function clearSearch()
{
	document.getElementById('searchField').value = '';
}
					
// populate search field
function addSearchTxt()
{
	var srchFld = document.getElementById('searchField').value;
	if (srchFld == '')
		{
			document.getElementById('searchField').value = 'Site search...';
		}
}

function setFont(fontSize)
{
	$("body").css("font-size", fontSize + "px");
}


function mainmenu(){
$(" #mainNav ul.horisontalNav ").css({display: "none"}); // Opera Fix
$(" #mainNav li").hover(function(){
	$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(200);
	},function(){
	$(this).find('ul:first').css({visibility: "hidden"});
	});
}

function sidemenu(){
	$('ul.sideNav ul.menuBody').css({display: "none"}); // Opera Fix	
	$('ul.sideNav ul.menuBodyCurrent').show(); // Opera Fix	
	$('ul.sideNav li.menuHeader').click(function() {
		$(this).next("ul.menuBody").toggle();
	}).next("ul.menuBody").hide();
}

function getStoryId()
{
	currentStory++;										
	if (currentStory > topStoryTotal)	currentStory = 1;
	switchStory(currentStory);
}
function switchStory(storyid)
{
	$("div#banner > img").hide();
	$("#banner"+storyid).show();
}

var topStoryTotal;
var topStoryTimer;
var currentStory = 1; 

$(document).ready(function(){
	mainmenu();
	sidemenu();
	topStoryTimer = setInterval("getStoryId()", 5000);
	topStoryTotal = $("div#banner").children().size(); 
	$("div#banner > img").hide();
	$("#banner1").show();
});
 
