function s_open() {
	$('#slidedown').slideDown(500, function() {
    $('#showflash').html('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="984" height="477" id="../../flash/slidedown" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="../../../flash/slidedown.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffb12c" />	<embed src="../../../flash/slidedown.swf" quality="high" bgcolor="#ffb12c" width="984" height="477" name="../../flash/slidedown" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /></object>');
    $('#showflash object').show();  
  });
}

function s_close() {
  $('#showflash object').remove();
  $('#slidedown').slideUp();
}

$(document).ready(function(){

	$("ul.dropdown").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

	$(".topnav li a").hover(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.dropdown").slideDown(100).show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.dropdown").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});


	$("#aboutVid").fancybox({
		'autoScale'			: false,
		'width'				: 470,
		'height'			: 340,
		'titleShow'			: false
	});
	
	$("#kits").fancybox({
		'frameWidth'		: 1024,
		'frameHeight'		: 786,
		'titleShow'			: false
	});
	
	$(".slider-video").fancybox({
		'titleShow'			: 'false'
	});
	
	$("#fancybox").fancybox({
		'frameWidth'		: 1024,
		'frameHeight'		: 786,
		'titleShow'			: false
	});
	
	$(".fancybox").fancybox({
		'frameWidth'		: 1024,
		'frameHeight'		: 786,
		'titleShow'			: false
	});
	

	$("#accordion").accordion({
		active: false,
		collapsible: true,
		autoHeight: false
	});
		
	$(".gal-thumb a").fancybox({
		'titleShow'			: false
	});
	
	$('#20').toggle(function() {
		$('#d20').show("slow");
		$('#d19').hide("slow");
	},
	function() {
		$('#d20').hide("slow");
	});
	
	$("div.slide-area").carousel({
    	autoSlide: true, 
	    autoSlideInterval: 5000,
        pagination: true,
		nextBtn: true,
		prevBtn: true
   	});
   	
   	$("a[rel=help]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
		}
	});
	
	$("#fancy-iframe").fancybox({
		'width'				: '75%',
		'height'			: '75%',
		'titleShow'			: false,
		'type'				: 'iframe'
	});
	
	$('#video1').fancybox({
			'scrolling'			: 'no',
	        'autoScale'     	: true,
	        'transitionIn'		: 'none',
			'transitionOut'		: 'none'
		});
		
	$("a[rel=kits]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">' + title + '</span>';
		}
	});
	
	$("a[rel=training1]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titleShow' 		: false,
		'titleFormat'       : function(currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over"></span>';
		}
	});
	
	$("a[rel=training2]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titleShow'			: false,
		'titleFormat'       : function(currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over"></span>';
		}
	});
});


$(function(){


	$('#date').change(function(){
  		var date = $("select#date").val();
		if (date == "") {
			$("select#date").focus();
        	return false;
		}
      	var dataString = 'data='+ date;
		$('#press').load('/admin/ajax?'+dataString);
	});
	
	$('#section').change(function(){
  		var section = $("select#section").val();
		if (section == "") {
			$("select#section").focus();
        	return false;
		}
      	var dataString = 'data=section';
      	var ds2 = 'section='+section
		$('.section').load('/admin/ajax?'+dataString+'&'+ds2);
	});
	
	
	$('#county').change(function(){
  		var county = $("select#county").val();
		if (county == "") {
			$("select#county").focus();
        	return false;
		}
      	var dataString = 'data=county';
      	var ds2 = 'county='+county;
		$('.county').load('/admin/ajax?'+dataString+'&'+ds2);
	});
	

});
