// JavaScript Document
function changeTab(i){
	$("#tab1").removeClass();
	$("#tab2").removeClass();
	$("#tab3").removeClass();
	if (i==1){
		$("#tab1").addClass("on");
		$("#tab1_content").attr("style", "display:block");
		$("#tab2_content").attr("style", "display:none");
		$("#tab3_content").attr("style", "display:none");
	}else if (i==2){
		$("#tab2").addClass("on");
		$("#tab1_content").attr("style", "display:none");
		$("#tab2_content").attr("style", "display:block");
		$("#tab3_content").attr("style", "display:none");
	}else{
		$("#tab3").addClass("on");
		$("#tab1_content").attr("style", "display:none");
		$("#tab2_content").attr("style", "display:none");		
		$("#tab3_content").attr("style", "display:block");		
	}
	return false;
}
function start_topnav(){
	$("ul#topnav li").hover(
		function() { //Hover over event on list item
			$(this).css({ 'background' : '#1376c9 url(../images/topnav_active.gif) repeat-x'}); //Add background color + image on hovered list item
			$(this).find("span").show(); //Show the subnav
		} , 
		function() { //on hover out...
			$(this).css({ 'background' : 'none'}); //Ditch the background
			$(this).find("span").hide(); //Hide the subnav
			$("#topnav_li_1").addClass("current");
			$("#topnav_span_1").show();
		}
	);
}
function setMenuClicked(i){
	var options = { path: '/', expires: 1 };
	$.cookie('menu_a_clicked', i, options);
}
function getMenuClicked(){
	return $.cookie('menu_a_clicked');
}
function deletetMenuClicked(){
	var options = { path: '/', expires: 1 };
	$.cookie('menu_a_clicked', null, options);
}
function setMenuActive(){
	var i;
	i = getMenuClicked();
	if (i==0 || i==null) i = 1;
	$("#menu_a_" + i).addClass("active");
}
function switchreadmore(id){
	$('#readmore'+id).toggle("fast");
}
function switchreadmore2(id){
	$('#readmore'+id).toggle("fast");
	$('#li'+id).toggleClass("expand_off");
}
function changeimage(imgid, src){
	$("#"+imgid).attr("src", src);	
}
