$(document).ready(function(){$('.subNavToggle').click(function(e){var el='#subNav_'+$(this).attr('rel');var mainEl=this;$('.subNav').hide();$('#subNav_'+$(this).attr('rel')).slideToggle();$('.menuOpen').removeClass('menuOpen');$('.hovAnimate').removeClass('current');$(el).addClass('menuOpen');$(this).addClass('current');return false;});$('.popup').click(function(e){$($(this).attr('href')).modal();$('#modalContainer').corners('12px');});$('#slideshow').slideShow();cornerSections();adjustColumnHeight();});$.fn.slideShow=function(options){var slideCount=$('#slideList a').length;var currentSlide=1;var margLeft=0;var autoPlay=true;if(slideCount>1){$("#slideshow").prepend("<a id='btnPrev'href='#' class='goToSlide' title='Previous Slide'>Previous</a><a id='btnNext'href='#' class='goToSlide' title='Next Slide'>Next</a>");$('#btnNext').click(function(){autoPlay=false;jumpSlide();return false;});$('#btnPrev').click(function(){autoPlay=false;if(currentSlide>1){currentSlide--;gotoSlide(currentSlide);}else if(currentSlide==1){currentSlide=slideCount;gotoSlide(currentSlide);}else if(slideCount==currentSlide){currentSlide=1;gotoSlide(currentSlide);}
return false;});setTimeout(function(){autoJump();},4000);}
$('.goToSlide').click(function(){autoPlay=false;gotoSlide($(this).attr('rel'));return false;});function jumpSlide(){if(currentSlide<slideCount){currentSlide++;gotoSlide(currentSlide);}else if(slideCount==currentSlide){currentSlide=1;gotoSlide(currentSlide);}}
function autoJump(){if(autoPlay){jumpSlide();}}
function gotoSlide(id){var el=$("#slideList");el.fadeOut("fast",function(){var margLeft="-"+((id-1)*555)+"px";el.css({marginLeft:margLeft});el.fadeIn("slow");});if(autoPlay){setTimeout(function(){autoJump();},3000);}}};function cornerSections(){var html="<div id='c_sec_ltop'></div><div id='c_sec_rtop'></div>";$(".section").prepend(html);var html="<div id='c_sec_lbot'></div><div id='c_sec_rbot'></div>";$(".section").append(html);}
function adjustColumnHeight(){var maxHeight=0;var height=0;$(".column").each(function(){height=$(this).height();if(height>maxHeight){maxHeight=height;}});$("#left").height((maxHeight-15)+"px");$("#middle").height(maxHeight+"px");$("#right").height(maxHeight+"px");height=maxHeight-($("#mainNav").height()+$("#searchform").height())-146;$("#c_left_lbot").css("marginTop",height+"px");$("#c_left_rbot").css("marginTop",height+"px");height=maxHeight-($("#sideAds").height()+$("#svcInfo").height())-12;$("#c_right_lbot").css("marginTop",height+"px");$("#c_right_rbot").css("marginTop",height+"px");}