function form(myform, windowname)
{
if (! window.focus)return false;
window.open('', windowname, 'height=600,width=740,left=170,top=20,scrollbars=yes');
myform.target=windowname;
return true;
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

function select(id){
for(i=0;i<4;i++){
document.getElementById('type_'+i).style.borderColor= '#4a4a4a';
document.search.type[i].checked=false;
}
document.getElementById('type_'+id).style.borderColor= '#aa0000';
document.search.type[id].checked=true;
}

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length < MaxLen);
}

function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "block";
} else {
obj.style.display = "none";
}
}
}



$(document).ready(function(){



	$("#firstpane div.menu_head").click(function()
    {
		$(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
       	$(this).siblings();
	});
	
	
$(".main_image .desc").show(); //Show Banner
$(".main_image .block").animate({ opacity: 0.85 }, 1 ); $(".image_thumb ul li:first").addClass('active'); //runs function on click
$(".image_thumb ul li").click(function () {
var imgAlt = $(this).find('img').attr("alt");
var imgTitle = $(this).find('a').attr("href");
var imgLink = $(this).find('a').attr("alt");
var imgDesc = $(this).find('.block').html();
var imgDescHeight = $(".main_image").find('.block').height();

if ($(this).is(".active")) {
return false;
} else {
$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
$(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 );
$(".main_image img").attr({ src: imgTitle , alt: imgAlt});
$(".main_image #linkn").attr({ href: imgLink});
});
}

$(".image_thumb ul li").removeClass('active');
$(this).addClass('active');
return false;$active = $(this);
slideSwitchClick();
})
.hover(function(){

$(this).addClass('hover');
clearInterval(playSlideshow);
playSlideshow = setInterval('slideSwitchTimed()', 7000 );
}, function() {
$(this).removeClass('hover');
});

//runs function, set timer here
$(function() {
playSlideshow = setInterval('slideSwitchTimed()', 7000 );
});
});

function slideSwitchTimed() {
$active = $('.image_thumb ul li.active').next();
if ( $active.length == 0 ) $active = $('.image_thumb ul li:first');
slideSwitch();
}

function slideSwitchClick() {
slideSwitch();
}

function slideSwitch() {
var $prev = $('.image_thumb ul li.active');

//Show active list-item
$prev.removeClass('active');
$active.addClass('active');

//Set Variables
var imgAlt = $active.find('img').attr("alt");
var imgTitle = $active.find('a').attr("href");
var imgLink = $active.find('a').attr("alt");
var imgDesc = $active.find('.block').html();
var imgDescHeight = $(".main_image").find('.block').height();

if ($(this).is(".active")) {
return false;
} else {

$(".main_image img").animate({ opacity: 0}, 250 );
$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
$(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 );
$(".main_image img").attr({ src: imgTitle , alt: imgAlt}).animate({ opacity: 1}, 250 );
$(".main_image #linkn").attr({ href: imgLink});
});
}
return false;
}

//News
	  // When the document loads do everything inside here ...
	  $(document).ready(function(){
		
		// When a link is clicked
		$("span.tab").click(function () {
			
			
			// switch all tabs off
			$(".tactive").removeClass("tactive");
			
			// switch this tab on
			$(this).addClass("tactive");
			
			// slide all content up
			$(".content").hide();
			
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).fadeIn();
		  
		});
	
	  });
	  
	  
//Gallery
	  // When the document loads do everything inside here ...
	  $(document).ready(function(){
		
		// When a link is clicked
		$("span.tabg").click(function () {
			
			
			// switch all tabs off
			$(".tactiveg").removeClass("tactiveg");
			
			// switch this tab on
			$(this).addClass("tactiveg");
			
			// slide all content up
			$(".contentg").hide();
			
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).fadeIn();
		  
		});
	
	  });
	  
//Video
	  // When the document loads do everything inside here ...
	  $(document).ready(function(){
		
		// When a link is clicked
		$("span.tabv").click(function () {
			
			
			// switch all tabs off
			$(".tactivev").removeClass("tactivev");
			
			// switch this tab on
			$(this).addClass("tactivev");
			
			// slide all content up
			$(".contentv").hide();
			
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).fadeIn();
		  
		});
	
	  });
	  
//Matches
	  // When the document loads do everything inside here ...
	  $(document).ready(function(){
		
		// When a link is clicked
		$("span.tabm").click(function () {
			
			
			// switch all tabs off
			$(".tactivem").removeClass("tactivem");
			
			// switch this tab on
			$(this).addClass("tactivem");
			
			// slide all content up
			$(".contentm").hide();
			
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).fadeIn();
		  
		});
	
	  });
	  
//Standings
	  // When the document loads do everything inside here ...
	  $(document).ready(function(){
		
		// When a link is clicked
		$("span.tabh").click(function () {
			
			
			// switch all tabs off
			$(".tactiveh").removeClass("tactiveh");
			
			// switch this tab on
			$(this).addClass("tactiveh");
			
			// slide all content up
			$(".contenth").hide();
			
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).fadeIn();
		  
		});
	
	  });
	  
//Poll
	  // When the document loads do everything inside here ...
	  $(document).ready(function(){
		
		// When a link is clicked
		$("span.tabp").click(function () {
			
			
			// switch all tabs off
			$(".tactivep").removeClass("tactivep");
			
			// switch this tab on
			$(this).addClass("tactivep");
			
			// slide all content up
			$(".contentp").hide();
			
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).fadeIn();
		  
		});
	
	  });
	  
//Other
	  // When the document loads do everything inside here ...
	  $(document).ready(function(){
		
		// When a link is clicked
		$("span.tabo").click(function () {
			
			
			// switch all tabs off
			$(".tactiveo").removeClass("tactiveo");
			
			// switch this tab on
			$(this).addClass("tactiveo");
			
			// slide all content up
			$(".contento").hide();
			
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).fadeIn();
		  
		});
	  
	  
});
$(function(){
$("#text").css("font-size", "10pt");
                    $("#zoom a").click( function(){
                         var size = $("#text").css("font-size");
                         var num = parseFloat(size);
                         var me = size.slice(-2);

                         if (this.id=="big") {
                              if (num<64) {
                                   $("#text").css("font-size", num + 3 + me);
                              }
                         } else if (this.id=="small"){
                                   $("#text").css("font-size", num - 3 + me);
                         } else {
                              $("#text").css("font-size", "10pt");
                         }
                    });

});
