
	function makeMyChildren( command, me ){
		var commandsType = convertMeToArray( command, ',' );
		if( commandsType.length > 1 ){
			for( var x = 0; x < commandsType.length; x ++ ){
				var commands = convertMeToArray( commandsType[x], '$' );
				if( commands.length > 1 ){
					executeMyCommand (commands[0], commands[1], me );
				}
			}
		
		if(getDDSelectedValue( me ) == 'SC')
			hideLateTestSecForm('districtobjdiv-Y', document.organizationForm.independentCharter);
	
		}
		//alert( me.options( me.selectedIndex).value );


	}
	
	function executeMyCommand (ctype, command, me ){
		
		var divcmd = convertMeToArray( command, '-' );

		if( ctype == 'label' ){
			processMyDiv( divcmd[0], divcmd[1], me, true );
		}else if( ctype == 'hide' ){
			//alert( 'hide : ' + divcmd[0] );
			processMyDiv( divcmd[0], divcmd[1], me, false );
		}		
		
		
	}
	
	function hideLateTestSecForm(command, me ){
		executeMyCommand('hide',command,me);
	}
		
	function processMyDiv( id, values, me, label ){
		//alert( 'code values : ' + values);
		var options = convertMeToArray( values, '|' );
		//alert( 'processMyDiv b4 if' );
		if ( ! isExists( options, getDDSelectedValue( me ) )){
			//alert( 'save' );
			saveMeByMyId(id, label);
			//alert( 'after save ' + id );
			document.getElementById(id).innerHTML = sHtml;
			if( label == true ){
				document.getElementById(id + 'label').innerHTML = sHtml;
			}
		}else{
			//alert('disp');
			redisplayMe( id, label );
		}
	}
	
	function isExists( options, val ){
		for ( var i =0; i < options.length; i ++ ){
			if( options[i] == val )
				return true;
		}
		return false;
	}
	
	ids = new Array(0);
	htmls = new Array(0);
	lblhtmls = new Array(0);

	function redisplayMe( id, label ){
		var pos = findMyPosition( id );
		//alert ( 'redisplay : ' + id );
		if( pos >= 0 ){
			document.getElementById(id).innerHTML = htmls[pos];
			//alert( 'redisplay ' + id + ' from pos : ' + pos + '\n\n ' + document.getElementById(id).innerHTML );
			if( label == true ){
				document.getElementById(id + 'label').innerHTML = lblhtmls[pos];
			}
		}
	}
		
	function saveMeByMyId( id, label ){
		var pos = findMySavePos( id );
		//alert( 'save ' + id + ' to pos : ' + pos + '\n\n ' + document.getElementById(id).innerHTML );
		if(document.getElementById(id).innerHTML != sHtml ){
			//alert( 'save ' + document.getElementById(id).innerHTML );
			htmls[pos] = document.getElementById(id).innerHTML;
			if( label == true ){
				lblhtmls[pos] = document.getElementById(id + 'label').innerHTML;
			}
		}
		//alert('after save');
		
		
	}
	
	function findMySavePos ( id ){
	
		var pos = findMyPosition( id );
		if( pos == -1 ){
			pos = ids.length;
			ids[pos] = id;
		}
		
		return pos;
	}
	function findMyPosition( id ){
		for ( var i = 0; i < ids.length; i ++){
			if( ids[i] == id )
				return i;
		}
		
		return -1;
	}
	
	function getDDSelectedValue( me ){
		 if (me.selectedIndex == undefined) {
		  return 'DT'; 
		 }
		 else 
		 {		    
		    return me.options( me.selectedIndex).value;       
		 }
	}


	function convertMeToArray( commands, delim ){
	
  		//alert( 'convert : ' + commands + ',' + delim);
		var index = commands.indexOf(delim);
		var ar = new Array(0);
		if( index == -1 ){
			 ar[0] = commands;
		}else{
			var prevIndex = 0;
			var i = 0
			for(; index != -1 ; i ++ ) {
				ar[i] = commands.substring(prevIndex, index );
				//alert( ar[i]);
				prevIndex = index + 1;
				index = commands.indexOf(delim, index + 1); // start search after last match found
			}
			ar[i] = commands.substring( prevIndex );
			//alert( ar[i]);
			
		}
  

		return ar;
	}
	
	function createDistrictList(county){
		var county = county.options[county.selectedIndex].value;
		if( null == county || county.length == 0 ){
			county = 'empty';
		}
		var distDiv = document.getElementById("districtdiv");
		var newDistDiv = document.getElementById(county);
		if( sHtml != distDiv.innerHTML ){
			distDiv.innerHTML = newDistDiv.innerHTML;
		}
	}
	
	function submitMe(){
		var distDiv = document.getElementById("countyDistrictList");
		distDiv.parentNode.removeChild( distDiv );
		submitForm();
		
	}
	
	function disableSchool(){
	
		var orgtype = document.getElementsByName( "orgRoleRelationship.organizationRole.orgRoleType.primaryKey" );
		if( (orgtype != null ) && (orgtype.length > 0) ){
			var select = orgtype[0];
			removeOptionValue( select, "ST" );
		}
	}
	
	function removeOptionValue( select, value ){
		if(( null != select ) && ( null != value ) ){
			var options = select.options;
			for( var i = 0; i < options.length; i ++ ){
				var option = options[i];
				if( option.value == value ){
					options.remove(i);
					return;
				}
			}
		}
	}	

