//**********************************************************************************************************************
/**
* DOCUMENT: /core/plugins/account/back/account.back.js
* DEVELOPED BY: Ryan Stemkoski
* COMPANY: Zipline Interactive
* EMAIL: ryan@gozipline.com
* PHONE: 509-321-2849
* DATE: 4/28/2010
* DESCRIPTION: This document has all of the javascript functions required for the account plugin.
*/
//***********************************************************************************************************************

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

	//*******************************************************************************************************************
	// MULTI SELECT TRANSFER
	//******************************************************************************************************************* 
	$('#add').click(function() {
		return !$('#select1 option:selected').remove().appendTo('#select2');
	});
	$('#remove').click(function() {
		return !$('#select2 option:selected').remove().appendTo('#select1');
	});
	$('#post_new_thread').submit(function() {
		$('#select1 option').each(function(i) {
			$(this).attr("selected", "selected");
		});
		$('#select2 option').each(function(i) {
			$(this).attr("selected", "selected");
		});
	});
	
	//***********************************************************************************************************************
	//SHOW/HIDE USER MULTI SELECT
	//***********************************************************************************************************************
	$('#type').bind('change', function() {
		var type = $(this).val();
		if(type != '') {
			$("#individual").hide();
		} else {
			$("#individual").show();
		}
	});
	
	$('#mobile_page_select').change(function() {
		window.location = $(this).val();
	});

});
