$(document).ready( function() {
	//toggle the display property of the 'if other' field, just in case we are doing a post-back
	toggleIfOther();
	
	//setup the event to toggle the 'if other' field 
	$('#type').change( function() {
		toggleIfOther();
	 } );
	 
	//this was copied from 'fabler_editprofile.js'
	$('#groups-create').append('<input type="submit" title="Submit" id="submit_btn" value="" />');
	$('#submit_btn').click(function() {
		$('#groups-create').submit();
	});
	
	//if the change email button has been clicked then show the input box.
//	$('#change-email').bind( 'click', function() {
//		$("#editemail").show();
//		$('#displayemail').hide();
//	} ); 
	//if the cancel change email button has been clicked then hide the input box and show the static text again.
//	$('#cancel-email').bind( 'click', function() {
//		$("#editemail").hide();
//		$('#displayemail').show();
//	} );
	
 } );
 /**
  * If the 'other' option has been selected then show the 'if other' input box. 
  * Otherwise hide the 'if other' box
  */
 function toggleIfOther() {
 	var opt = $("#type option:selected").val();
	if( opt == 'other' ) {
		$('#if_other').css('display','block');
	}else
		$('#if_other').css('display','none');
 }
 
 


