//**********************************************************************************************************************
/**
* DOCUMENT: /core/plugins/media/front/media.front.js
* DEVELOPED BY: Dustin Dikes
* COMPANY: Zipline Interactive
* EMAIL: dustin@gozipline.com
* PHONE: 509-321-2849
* DATE: 10/20/2010
* DESCRIPTION: This document has all of the javascript functions required for the media plugin.
*/
//***********************************************************************************************************************

var drop_state = 'closed';

//***********************************************************************************************************************
//ON DOCUMENT READY FUNCTIONS
//***********************************************************************************************************************
$(function() {

	$('.accordian_header').click(function() {
		$('.accordian_content').slideToggle(600);
		var stateclass = $('#arrow').attr('class');
		if (stateclass == 'off') {
			$('#arrow').removeClass('off');
			$('#arrow').addClass('on');
		}
		else {
			$('#arrow').removeClass('on');
			$('#arrow').addClass('off');
		}
		
	})

	$('#cur').live('click',function(){
	
		if(drop_state == 'closed') {
			$('#conditions-dropdown').slideDown(400);
			drop_state = 'open';
		}
		else {
			$('#conditions-dropdown').slideUp(400);
			drop_state = 'closed';
		}
		
	});

	$('.dropped').live('click',function(){
		
		var id = $(this).attr('rel');
		
		$.post("#", { action: 'update_conditions',id: id },function(data){
			$('#conditions').replaceWith(data);
		});
		
		drop_state = 'closed';
		
	});
		
});

