var min=8;
var max=18;
var originalsize=11;

function resetFontSize() {
   var p = document.getElementsByTagName('*');
   for(i=0;i<p.length;i++) {
/*      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }*/
      p[i].style.fontSize = "11px"
   }
}

function increaseFontSize() {
   var p = document.getElementsByTagName('*');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('*');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}


$(document).ready(function() {


	// Set everything up - hide and show things	

 	$('input[type="text"]').addClass("idle");
 	$('textarea').addClass("idle");
 	
 	// This hides any blank paragraph tags at the top of a listings page, should such functionality be required...
 	
// 	$("#contentleft p:has(div#news_listing)").hide();
 	
	// Highlighting fields on forms when they have focus
	
	$('input[type="text"]:not(.search-input)').focus(function(){
		$(this).animate({
			borderTopColor:"#666",
			borderRightColor:"#666",
			borderBottomColor:"#666",
			borderLeftColor:"#666"},'fast');
     });  
     $('input[type="text"]:not(.search-input)').blur(function(){
     $(this).animate({
	     	borderTopColor:"#e4e4e4",
			borderRightColor:"#e4e4e4",
			borderBottomColor:"#e4e4e4",
			borderLeftColor:"#e4e4e4"},'fast');
     });
	$('textarea').focus(function() {  
		$(this).animate({
			borderTopColor:"#666",
			borderRightColor:"#666",
			borderBottomColor:"#666",
			borderLeftColor:"#666"},'fast');
     });  
     $('textarea').blur(function() {  
		$(this).animate({
			borderTopColor:"#e4e4e4",
			borderRightColor:"#e4e4e4",
			borderBottomColor:"#e4e4e4",
			borderLeftColor:"#e4e4e4"},'fast');
     });

	$("#box_projects").hide();
	$("#tab_latestnews").addClass("selected");
	$("#tab_projects").addClass("idle");
	$("#footer_projects").hide();
	
	$("#tab_projects").click(function(){
		$("#box_latestnews").hide();
		$("#box_projects").show();
		$("#tab_latestnews").removeClass("selected");
		$("#tab_latestnews").addClass("idle");
		$("#tab_projects").removeClass("idle");
		$("#tab_projects").addClass("selected");
		return false;
	});

	$("#tab_latestnews").click(function(){
		$("#box_projects").hide();
		$("#box_latestnews").show();
		$("#tab_projects").removeClass("selected");
		$("#tab_projects").addClass("idle");
		$("#tab_latestnews").removeClass("idle");
		$("#tab_latestnews").addClass("selected");
		return false;
	});

$("div.clip:even").css("margin-right","10px");	

$(".gallery_hover").hide();
$(".sponsor_hover").hide();

$("a.galleryitem").hover(function(){
	$(this).next(".gallery_hover").show();
	},
	function(){
		$(this).next(".gallery_hover").hide();
});

$(".gallery_hover").hover(function(){
	$(this).show();
	},
	function(){
		$(this).hide();
});

$(".imagelink").hover(function(){
	$(this).next(".sponsor_hover").show();
	},function(){
		$(this).next(".sponsor_hover").hide();
});

$(".sponsor_hover").hover(function(){
	$(this).show();
	},
	function(){
		$(this).hide();
});

});