$(document).ready(function() {
	
	//<![CDATA[

		if(typeof sIFR == "function"){
		
			sIFR.replaceElement(named({sSelector:"h3 .sifr", sFlashSrc:"/elmwoodBlog2/flash/sketchRockwell.swf", sCase:"upper", sColor:"#4a4949", sLinkColor:"#000000", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
		
		};
	
	//]]>
	
	$("a.boxxy").fancybox({
		'frameWidth': 250, 
		'frameHeight':	380,
		'hideOnContentClick':false
	});
	
	if ( $("#contactForm").length > 0 ) {

	  	$("#contactForm").validate({
			errorPlacement: function(error, element) { 
	            if ( element.is(":radio") ) 
	                error.appendTo( element.parent().next().next() ); 
	            else if ( element.is(":checkbox") ) 
	                error.appendTo ( element.next() ); 
	            else 
	                error.prependTo( element.parent().next() ); 
	        }
		});
		
	}
	
	if ( $("#OnlineApplication").length > 0 ) {

	  	$("#OnlineApplication").validate({
			errorPlacement: function(error, element) { 
	            if ( element.is(":radio") ) 
	                error.appendTo( element.parent().next().next() ); 
	            else if ( element.is(":checkbox") ) 
	                error.appendTo ( element.next() ); 
	            else 
	                error.prependTo( element.parent().next() ); 
	        }
		});
		
	}
	
	$("#socialNav a").tooltip({
	   showURL: false,
	   top:-10,
	   track: true
	});
	
	$('#navMyElmwoodTV').mouseover(function() {$(this).parent().addClass('myElmwoodTV');});
	$('#navMyElmwoodTV').mouseout(function() {$(this).parent().removeClass('myElmwoodTV');});
	
	$('#navPodcasts').mouseover(function() {$(this).parent().addClass('podcasts');});
	$('#navPodcasts').mouseout(function() {$(this).parent().removeClass('podcasts');});
	
	$('#navGallery').mouseover(function() {$(this).parent().addClass('gallery');});
	$('#navGallery').mouseout(function() {$(this).parent().removeClass('gallery');});
	
	$('#navBlogs').mouseover(function() {$(this).parent().addClass('blogs');});
	$('#navBlogs').mouseout(function() {$(this).parent().removeClass('blogs');});
	
	$('#navNews').mouseover(function() {$(this).parent().addClass('news');});
	$('#navNews').mouseout(function() {$(this).parent().removeClass('news');});
	
	$('#navLeadership').mouseover(function() {$(this).parent().addClass('leadership');});
	$('#navLeadership').mouseout(function() {$(this).parent().removeClass('leadership');});

	
	if ( getIE6 === true ) {
		DD_belatedPNG.fix('.png'); // Belated PNG fix by Drew Diller - http://www.dillerdesign.com/experiment/DD_belatedPNG/
		$("#mainNav").superfish({speed:0});
	}
	
	$(".vtabs").tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
	$(".vtabs li").removeClass('ui-corner-top').addClass('ui-corner-left');
	
	if ( $("#homeTabs").length > 0 ) {
		$("#homeTabs").tabs({ fx: { opacity: 'toggle' } });	
	};
	
	if ( $("#calloutTabs").length > 0 ) {
		$("#calloutTabs").tabs();	
	};
	
	//if ( $("#homeTabs").length > 0 ) {
	//	$("#homeTabs").tabs();	
	//};
	
	jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
	  return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);  
	};
	
	//$('#historyList dt').click(function() {$(this).next().slideFadeToggle('fast');});
	
	$(".historyList dd").addClass("hidden");
	
	$("ul.studentClubs").addClass("hidden");
	
	$("#content form").addClass("appnitro");
	
	$('.historyList dt').click(function() {$(this)});
	//$('.historyList dt').click(function() {
	//	$(this).next().toggle();
	//
	//});
	$('.historyList dt').click(function() {
		$(".historyList dd").addClass("hidden");
		if ($(this).next().is('.hidden')) {
			$(this).next().removeClass('hidden');
		} else {
			$(this).next().addClass('hidden');
		};
	});
	$('h4.studentClubs').click(function() {$(this).next().slideFadeToggle();});
	
	$('#categories a.toggleBtn').click(function() { slideCategories('#categoriesList'); return false; });

});
	
/* varying radii, "all" browsers */
DD_roundies.addRule('.formField', '5px', true);  
DD_roundies.addRule('.appnitro .text', '5px', true);  
DD_roundies.addRule('#contactForm span', '8px', true);
DD_roundies.addRule('span.formBorder', '8px', true);

DD_roundies.addRule('#tooltip', '5px', true);

var slideCategoriesActive = true;

