/* Author: 
	Hmmm? Scripts by Dru unless otherwise noted, "Check out the big brain on Brad!"
*/

$(function(){  //doc.ready
	$('.events-list.mini li').filter(':even').css('margin-right','0');
	$('.event-buttons li:first-child').addClass('first');
	$(".smd_cal_event a, .events-list.mini a[rel='bookmark'], .nat-reg-trigger, .career-center-trigger, .training-trigger").colorbox({width:'75%'});
	$('.menu ul li:first-child a').addClass('first');
	$('#par-nav').localScroll();
	$("#par-nav a[title]").tooltip({ position:'center left', effect: 'slide', offset: [10, 0]});
	$("#mask a[title]").tooltip({ tipClass: 'tooltip2', effect: 'slide', offset: [30, 17], predelay: 200 });
	$('.button-menu').click(function() {
		$('.menu').slideToggle('slow');
		$('.button-menu').toggleClass('selected');
		return false;  // don't follow the href link
	});
	
	function checkWidth() {   // script by Renobird 
 		var winWidth = $(window).width();
 		if ((winWidth) > '1024'){
 			// Do something here if greater than 1024
 			$.ajax({  // not Renobird's
			  url: "js/parallax-effect.js",
			  context: document.body
			});
 		}

		if ((winWidth) < '481'){
 			// Do something here if less than 481 (iPhone)
 			accordion = $('.accordion').classicAccordion({width:'98%', height:400, slideshow:false, shadow:true, alignType:'leftTop', closedPanelSize:0,
															captionWidth:295, captionHeight:380, captionTop:25, captionLeft:25 });
		}
				
		else {
		 		accordion = $('.accordion').classicAccordion({width:'98%', height:400, slideshow:false, shadow:true, alignType:'leftTop', closedPanelSize:0,
																captionWidth:295, captionHeight:380, captionTop:25, captionLeft:215
				});
				
				$(window).load(function() {
				// equal column heights.
					var leftCol = Math.max($('.left-col').height());
					var rightCol = Math.max($('.right-col').height());
					if (leftCol > rightCol){
					$('.right-col').height(leftCol);
					}
				});
		 	}
 	}
	//run this puppy when we load the page
 	checkWidth();     
	//run this puppy when the browser is resized
 	$(window).resize(function() {
  		checkWidth();
	});
	
}); // END doc.ready

function openPanel(index) { // final Accordion scripting for openPanel
       $('.accordion').classicAccordion().openPanel(index);
}


