//<![CDATA[
 
if(typeof ($.AWA) == "undefined") {
 jQuery.AWA = Object;
}
 
//Simple gallery
jQuery.AWA.buildGallery = {
 init: function(){
	$(".gallery .thumb-image").click(function() {
		var location = $(this).attr("href");
		$('.slide-frame').fadeOut('slow', function() { window.location.href=location; });
   		$('.slide-frame').fadeIn('slow');
		return false;
    });
 } // End init
} 
 
//Build accordion
jQuery.AWA.buildAccordion = {
 init: function(){
  $('.accordion dd').hide();
  $('.accordion').addClass('active');
  $('.accordion dt').click(function() {
  	$(this).next('dd').slideToggle('fast');
  	$(this).toggleClass('open');
  });
 } // End init
}

//Create hide/show
jQuery.AWA.buildHideShow = {
 init: function(){
  $('.expand-panel .expand-content').hide();
  $('.expand-panel').addClass('active');
  $('.expand-panel .trigger').click(function() {
  	$(this).next('.expand-content').slideToggle('fast');
  	$(this).toggleClass('open');
  });
 } // End init
}


// Embed JW player
jQuery.AWA.buildVideoPlayer = {
 init: function(videoPath,imagePath){
		var playerFlv = new SWFObject("/content/player.swf","myplayer","294","244","9");
		playerFlv.addVariable('file',videoPath);
		playerFlv.addVariable("screencolor","black");
		playerFlv.addVariable('image',imagePath); 
		playerFlv.addVariable('backcolor','000000');
		playerFlv.addVariable('frontcolor','979797');
		playerFlv.addVariable('icons','false');
		playerFlv.write("player");
		
		var player = document.getElementById("myplayer");
	
		$("a.video").click(function(e){
			e.preventDefault();
			var videofile = $(this).attr("href");
			player.sendEvent("LOAD",videofile);
			window.location.href="#player";
		});
 } // End init
}


jQuery(document).ready(function(){
 jQuery.AWA.buildGallery.init();								
 jQuery.AWA.buildAccordion.init();
 jQuery.AWA.buildHideShow.init();

 $("input[name='large_media_type']").change(
	function()
	{
		if ($("input[name='large_media_type']:checked").val() == 'jpg')
		{
			$('#option_large_media_jpg').show();
			$('#option_large_media_swf').hide();
		}
		else
		{
			$('#option_large_media_jpg').hide();
			$('#option_large_media_swf').show();
		}
		$(this).blur();
	});
	$("input[name='large_media_type']").change();
}); 


function show_search_form()
{
	document.getElementById("show_search_form").style.display = 'none';
	document.getElementById("searchOptions").style.display = 'block';
	document.getElementById("hide_search_form").style.display = 'block';
}

function hide_search_form()
{
	document.getElementById("show_search_form").style.display = 'block';
	document.getElementById("searchOptions").style.display = 'none';
	document.getElementById("hide_search_form").style.display = 'none';
}



//]]>


