window.addEvent('load', function(){
dbug.enable();
dbug.log('Hello.');


var statePair = new Class({

	initialize: function(options) {
		this.options = Object.extend({
			registry: [],
			state: false,
			target: false,
			title: false,
			dbn_server: '/_sns.0/w3n56e3e3e336c4a32f077534871a6f0/server.php',
			meow:true
		}, options || {});
		dbug.log();

		this.options.target.empty();
		this.options.selected_state = this.options.state
		this.options.ide = new Element('div',{'class': 'none'}).injectInside(this.options.target);

		this.options.state_container = new Element('div',{'class':'dbnt-choice-container'}).injectInside(this.options.ide);
		this.options.county_container = new Element('div',{'class':'dbnt-choice-container'}).injectInside(this.options.ide);

		dbug.log('Creating Selector from Class...');
		this.rebuild_ui();
		
	},

	rebuild_ui: function(){

	if(!this.options.selected_state){
	this._create_state();
	}

	if(this.options.selected_state){
		if(!this.options.selected_county){
			this._create_county();
		}
	}	


	// if((this.options.selected_state)&&(this.options.selected_county)){
		// var DBN = this.options.selected_county+this.options.selected_state+this.options.selected_school;
	// }
}, // end function

destroy_selections: function(level){ // 1 means school, 2 means county+school, 3 means all

	if(level > 1){
	this._destroy_state();
	dbug.log('Cleared [%s]','state');
	}
	if(level > 0){
	this._destroy_county();
	dbug.log('Cleared [%s]','county');
	}

},

_destroy_state: function(){
	this.options.state_container.empty();
	this.options.selected_state = null;
},

_destroy_county: function(){
	this.options.county_container.empty();
	this.options.selected_county = null;
},


_create_state: function(){
		this.options.state_container.setHTML('<img src="/ajax_loading.gif">');
		var url = 'http://www.nationalhomeoptions.com/_sns.0/36fa61b1378d5090380735846befb5ad/discovery.service.php?a=list.states';
		// Make the request
		var request = new Json.Remote(url, {

		onFailure: function(){
		this.options.state_container.empty();
		var retry_button = new Element('div',{'class':'dbnt-error-button'}).setHTML('please retry').injectInside(this.options.state_container)
			retry_button.addEvent('click', function(){
			this._create_state();
			}.bind(this));
		}.bind(this),

		onComplete: function(jsonObj){
		// Proccess JSON
			this.options.state_menu = new Element('select', {'name':'state', 'id':name});
			new Element('option', {'value': ""}).setHTML('(Please Select State)').injectInside(this.options.state_menu);
 			// Insert Data
			selectedCounter = 1;
			selectedIndex =  0;
			jsonObj.data.each(function(quark) {
				
			dbug.log('[%s] == [%s]', this.options.selected_state, quark.value);
				
			new Element('option', {'value': quark.value}).setHTML(quark.name).injectInside(this.options.state_menu);
			
			if(this.options.selected_state == quark.value){
			selectedIndex = selectedCounter;
			}
			selectedCounter++;
			}.bind(this));
	
			this.options.state_container.empty();
			this.options.state_menu.selectedIndex = selectedIndex;
			this.options.state_menu.injectInside(this.options.state_container);
			this.options.state_menu.addEvent('change', function(){
				this.options.selected_state = this.options.state_menu.getValue();
				this.destroy_selections(1);
				this.rebuild_ui();

			}.bind(this));
		}.bind(this) // end on complete
		}).send(); // end request
},

_create_county: function(){
		var url = '/_sns.0/36fa61b1378d5090380735846befb5ad/discovery.service.php?a=list.counties&state='+this.options.selected_state;
		this.options.county_container.setHTML('<img src="/ajax_loading.gif">');
		// Make the request
		var request = new Json.Remote(url, {

		onFailure: function(){
		this.options.county_container.empty();
		var retry_button = new Element('div',{'class':'dbnt-error-button'}).setHTML('please retry').injectInside(this.options.county_container)
			retry_button.addEvent('click', function(){
			this._create_county();
			}.bind(this));
		}.bind(this),

		onComplete: function(jsonObj){
		// Proccess JSON
			this.options.county_menu = new Element('select', {'name':'suburb', 'id':name});
			new Element('option', {'value': ""}).setHTML('(Please Select County)').injectInside(this.options.county_menu);
 			// Insert Data
			selectedCounter = 1;
			selectedIndex =  0;
			jsonObj.data.each(function(quark) {
			new Element('option', {'value': quark.value}).setHTML(quark.name).injectInside(this.options.county_menu);
			if(this.options.selected_county == quark.value){
			selectedIndex = selectedCounter;
			}
			selectedCounter++;
			}.bind(this));
			this.options.county_container.empty();
			this.options.county_menu.selectedIndex = selectedIndex;
			this.options.county_menu.injectInside(this.options.county_container);
			this.options.county_menu.addEvent('change', function(){
			this.options.selected_county = this.options.county_menu.getValue();
			this.destroy_selections(0);
			this.rebuild_ui();
			}.bind(this));
		}.bind(this) // end on complete
		}).send(); // end request
}

});








var nhoMapSelector = new Class({
	initialize: function(options) {
		this.options = Object.extend({
			base_path: 'http://www.nationalhomeoptions.com/templates/sagerank_realestate/',
			target: document.body,
			registry: [],
			title: false,
			main_id: 'nhomap-main-selector',
			main_target: document.getElementById('nhomap-main-selector'),
			sub_target:  $('nhomap-sub-selector'),
			
			meow:true
		}, options || {});

		dbug.log('Loading...');
		
		if(!this.options.main_target){
			dbug.log('ERROR: No main target');
			dbug.log(this.options.main_target);
			dbug.log('PROGRAM EXITED!');
			return;
		}
		
		this._setup_map();
	},

	_setup_map: function() {
	var state_hash = new Hash({
	'55,22,65,30,68,25,72,21,128,35,121,77,88,75,84,74,79,74,74,71,69,72,63,72,62,65,53,58,54,49,53,38,52,30': {name:'Washington', shape:'poly'},
	'129,35,136,36,134,48,137,55,137,59,145,72,148,74,145,88,145,92,151,91,159,111,173,109,178,111,172,147,109,137,115,101,126,86,120,78': {name:'Idaho', shape:'poly'},
	'53,58,31,115,107,137,114,101,125,88,121,77,80,74,69,73,63,69': {name:'Oregon', shape:'poly'},
	'32,116,75,131,65,171,115,243,118,258,110,271,110,280,80,276,67,253,59,246,44,237,41,220,37,209,38,201,35,194,35,187,40,181,34,181,31,177,24,166,30,155,22,139,28,134,33,124': {name:'California', shape:'poly'},
	'75,129,138,144,128,230,119,229,115,241,65,171': {name:'Nevada', shape:'poly'},
	'139,37,258,53,252,112,182,104,179,109,168,108,163,110,151,92,146,90,148,77,138,60,138,56,133,48,136,41': {name:'Montana', shape:'poly'},
	'181,104,251,113,248,171,171,164': {name:'Wyoming', shape:'poly'},
	'140,143,171,148,171,162,192,168,185,226,130,218': {name:'Utah', shape:'poly'},
	'194,168,272,174,269,234,185,227': {name:'Colorado', shape:'poly'},
	'129,217,186,227,173,310,153,310,109,283,110,278,110,270,118,258,116,243,121,229': {name:'Arizona', shape:'poly'},
	'186,227,258,234,258,239,251,307,209,304,207,307,187,305,185,311,175,308': {name:'New Mexico', shape:'poly'},
	'258,53,324,55,328,59,326,62,330,74,331,89,334,97,333,102,256,100': {name:'North Dakota', shape:'poly'},
	'254,99,332,102,332,106,333,111,335,137,332,140,335,144,333,149,322,145,318,147,315,145,250,142': {name:'South Dakota', shape:'poly'},
	'252,141,311,145,318,148,323,145,332,150,339,161,337,167,341,168,343,180,346,190,273,190,273,174,250,170': {name:'Nebraska', shape:'poly'},
	'272,190,347,191,353,193,352,196,357,203,356,236,270,234': {name:'Kansas', shape:'poly'},
	'259,234,259,239,291,243,293,271,301,273,308,278,313,279,319,280,327,282,330,279,336,283,339,281,346,283,351,281,358,284,357,236': {name:'Oklahoma', shape:'poly'},
	'259,241,288,243,290,270,305,279,318,281,327,284,330,282,338,284,349,284,363,287,368,308,369,315,371,319,369,332,371,336,367,342,353,352,328,374,323,383,326,395,325,400,314,398,303,393,298,382,298,376,294,374,287,365,285,359,281,354,275,346,267,341,257,342,251,348,248,349,235,344,229,337,225,323,216,315,210,306,250,307': {name:'Texas', shape:'poly'},
	'326,56,343,56,347,50,350,57,357,59,370,60,373,66,378,63,384,67,389,64,403,67,394,71,384,79,377,88,378,99,372,100,372,108,372,116,378,124,389,128,390,135,336,136,337,109,334,104': {name:'Minnesota', shape:'poly'},
	'337,136,392,137,392,144,396,150,403,156,402,164,394,166,394,172,391,181,345,184,339,165,333,151,336,144': {name:'Iowa', shape:'poly'},
	'348,185,388,182,391,189,403,201,408,204,406,211,418,223,418,229,422,231,422,236,418,239,418,246,411,247,411,240,359,240,358,204,354,193,349,190': {name:'Missouri', shape:'poly'},
	'358,241,358,286,363,286,365,295,401,293,404,288,401,284,402,277,404,272,407,272,407,267,414,259,413,253,419,247,411,245,406,240': {name:'Arkansas', shape:'poly'},
	'365,294,369,311,369,315,371,319,369,332,371,335,366,342,375,342,377,341,389,347,393,346,391,342,395,342,402,345,406,344,405,349,411,351,413,349,419,349,419,346,428,350,431,349,427,344,427,339,423,336,423,331,420,327,421,324,399,324,398,316,401,309,402,305,406,304,401,294': {name:'Louisiana', shape:'poly'},
	'377,87,393,83,394,88,398,88,401,94,408,94,414,97,419,96,421,99,425,101,428,107,424,113,426,118,432,107,430,117,433,122,428,134,430,141,429,148,396,149,392,143,391,137,390,131,384,126,378,122,373,117,373,102,378,98,378,92': {name:'Wisconsin', shape:'poly'},
	'460,95,464,92,469,95,479,95,478,100,481,102,480,108,477,112,474,116,474,120,480,119,484,116,488,116,493,121,493,129,486,139,485,146,472,152,449,152,453,140,451,127,449,118,451,113,451,107,456,101': {name:'Michigan', shape:'poly'},
	'395,148,427,147,437,160,436,190,437,197,434,199,437,204,435,211,431,213,433,218,432,222,429,227,429,230,424,228,419,228,406,212,409,206,392,186,393,180,395,172,394,165,401,163,403,156,398,151': {name:'Illinois', shape:'poly'},
	'437,160,449,153,468,152,465,156,470,196,468,200,463,200,464,202,463,207,460,210,459,214,454,212,453,215,449,214,447,217,440,217,435,217,432,213,439,205,435,199,438,194,436,189,437,166': {name:'Indiana', shape:'poly'},
	'421,237,420,227,428,231,433,224,433,216,450,217,455,213,460,214,468,202,470,194,475,197,482,200,484,199,488,199,491,197,496,199,497,207,504,213,492,228,440,234,433,235,426,237': {name:'Kentucky', shape:'poly'},
	'419,238,433,239,435,234,509,226,509,234,502,238,497,240,491,246,486,247,483,251,483,255,467,257,438,261,416,260,414,253,419,248': {name:'Tennessee', shape:'poly'},
	'413,263,407,266,407,272,404,274,403,278,402,282,404,289,402,295,406,302,404,307,399,315,399,322,420,323,423,331,425,333,433,332,440,329,438,261': {name:'Mississippi', shape:'poly'},
	'438,262,466,258,478,290,481,295,480,304,482,307,481,310,483,315,451,319,452,327,447,330,445,325,440,330': {name:'Alabama', shape:'poly'},
	'467,257,497,253,497,257,501,262,516,274,521,279,523,285,526,288,529,293,528,303,529,309,528,314,523,315,522,320,517,319,483,318,482,307,479,296': {name:'Georgia', shape:'poly'},
	'480,150,490,157,498,154,508,147,516,173,515,179,505,186,506,192,502,193,497,201,493,197,487,199,480,198,472,196,465,160,466,154': {name:'Ohio', shape:'poly'},
	'511,147,517,142,521,144,567,134,575,142,570,147,571,153,578,156,573,165,568,166,565,169,519,178,511,153': {name:'Pennsylvania', shape:'poly'},
	'530,176,530,182,546,173,550,178,543,180,541,186,537,189,535,193,531,193,526,206,527,213,521,213,517,217,508,218,504,214,498,206,498,199,505,193,507,187,516,179': {name:'West Virginia', shape:'poly'},
	'494,228,503,215,509,217,519,218,520,214,526,214,527,206,532,194,542,187,544,181,549,179,558,183,556,189,560,191,560,195,571,201,572,208,576,209,580,214,552,220,523,226': {name:'Virginia', shape:'poly'},
	'509,228,510,236,500,240,491,245,485,248,484,254,497,255,505,251,522,246,527,252,539,250,552,260,563,259,567,250,571,245,579,244,578,239,573,236,572,234,580,234,581,226,575,225,581,218,578,215': {name:'North Carolina', shape:'poly'},
	'498,254,521,246,528,252,539,250,553,261,548,269,550,272,543,281,534,284,536,289,530,292,524,283,510,270,500,259': {name:'South Carolina', shape:'poly'},
	'452,320,454,328,447,331,457,326,459,329,464,327,468,326,469,328,476,328,482,336,491,332,495,327,498,329,502,330,511,338,513,339,518,343,518,355,520,358,522,356,522,360,522,364,527,373,531,370,532,376,536,384,543,386,548,393,557,390,556,377,556,367,542,343,544,341,529,321,528,312,523,318,485,319,480,314,457,318': {name:'Florida', shape:'poly'},
	'565,169,568,174,564,177,566,191,561,193,557,191,558,184,552,180,547,173': {name:'Maryland', shape:'poly'},
	'567,171,574,172,582,180,581,191,576,202,576,194,571,190': {name:'Delaware', shape:'poly'},
	'578,158,575,164,569,168,567,170,574,170,583,177,588,167,588,158,588,154,584,152,586,149,594,148,606,139,603,139,593,142,584,143,577,141,572,144,572,149,575,153': {name:'New Jersey', shape:'poly'},
	'502,96,523,114': {name:'New Jersey', shape:'rect'},
	'518,142,529,132,525,123,537,119,543,119,555,115,554,107,550,104,564,86,578,86,582,92,580,97,582,100,582,105,586,116,589,141,576,142,566,135': {name:'New York', shape:'poly'},
	'589,128,604,124,607,133,590,142,588,132': {name:'Connecticut', shape:'poly'},
	'521,77,542,93': {name:'Connecticut', shape:'rect'},
	'605,123,609,123,612,130,608,132,606,128': {name:'Rhode Island', shape:'poly'},
	'633,121,655,134': {name:'Rhode Island', shape:'rect'},
	'588,115,589,127,606,122,613,126,622,124,616,119,612,114,610,108': {name:'Massachusetts', shape:'poly'},
	'528,62,550,77': {name:'Massachusetts', shape:'rect'},
	'579,85,596,80,597,85,594,91,594,95,594,102,595,112,588,116,587,108,585,104,581,96': {name:'Vermont', shape:'poly'},
	'544,48,567,62': {name:'Vermont', shape:'rect'},
	'597,78,598,73,612,103,610,108,596,114,595,102,595,89': {name:'New Hampshire', shape:'poly'},
	'570,38,590,53': {name:'New Hampshire', shape:'rect'},
	'600,74,605,72,605,66,607,62,605,46,610,36,611,39,619,34,627,39,631,57,637,58,636,63,640,64,641,68,638,73,635,74,634,78,630,80,624,79,624,86,619,92,614,92,614,103': {name:'Maine', shape:'poly'},
	'399,86,406,93,409,91,418,96,429,104,435,96,442,93,447,93,450,90,452,91,458,89,460,89,466,89,469,89,472,89,470,84,470,79,458,79,455,74,448,76,436,77,429,81,427,77,421,75,428,70,423,68,408,77': {name:'Michigan', shape:'poly'},
	'560,196,567,192,569,200': {name:'District of Columbia', shape:'poly'},
	'604,142,623,155': {name:'New Jersey', shape:'rect'},
	'602,157,626,172': {name:'Maryland', shape:'rect'},
	'591,188,616,203': {name:'District of Columbia', shape:'rect'},
	'601,174,626,188': {name:'Delaware', shape:'rect'}
	}); // End state Hash

	var map_tag = new Element('map',{'name':'imgmap','id':'imgmap'});
	
	state_hash.each(function(val,key){
		var area = new Element('area',
		{'href':'http://www.nationalhomeoptions.com/find-a-rent-to-own-home/state-selector-18-32.html#',
		'foo':'moo',
		'shape':val.shape,
		'coords': key,
		'alt': val.name,
		'title': val.name,
		'events':{
			'click':function(e){
				new Event(e).stop(); // stop the map click (ie bug)
				document.searchfrm.state.value = val.name; // Set state name
					this.options.slide = new Fx.Slide(this.options.main_id);
					this.options.slide.slideOut();
					this.options.sub_target.setStyle('display','block'); // show the sub selector area
					var state_county_selector = new statePair({'state':val.name, 'target':$('nhomap-states-suburb-pair')});
			}.bind(this) // end click function
		}} // end tag extended options
		).injectInside(map_tag); // New Element area.
	}.bind(this)); // state hash each

	map_tag.injectInside(this.options.main_target);
	this.options.main_target.setStyle('display','block'); // show the map not that it is setup
	} // _setup_map: function() {
});

 

	
var map = new nhoMapSelector();

/*
	<div id="nhomap-states-selector"></div>
	<div id="nhomap-suburb-selector"></div>
*/


}) // document load;


// 
//	//try{
//	moogick = $E('div', '#insert-state-map');
//	var mapx = new Element('map',{'name':'imgmap','id':'imgmap'})
//	state_hash.each(function(val, key){
//	area = new Element('area',{'href':'http://www.nationalhomeoptions.com/find-a-rent-to-own-home/state-selector-18-32.html#', 'foo':'moo', 'shape':val.shape, 'coords': key, 'alt': val.name, 'title': val.name, 'events':{'click':function(e){
//new Event(e).stop();
//document.searchfrm.state.value = val.name;
//
//
//var mySlide = new Fx.Slide('insert-state-map');
// 
// 
//	mySlide.slideOut();
// $('xxx').setStyle('display','block');
// 
//
//
////document.searchfrm.submit();
//
//
//}}}).injectInside(mapx);
//	});
//	// }catch(e){}
//	mapx.injectInside(moogick);
//	
// 
//
//
// /*
//MOOdalBox.open( // case matters
//"http://www.nationalhomeoptions.com/map.html", // the link URL
//"Select Location", // the caption (link's title) - can be blank
//"700 500" // width and height of the box - can be left blank
//);
// */
//
//});
//
//
//	</script>
//<form action="http://www.nationalhomeoptions.com/index.php?option=com_hotproperty&task=asearch&Itemid=26" method="POST" name="searchfrm">
//
//<div id='insert-state-map' style="width: 670px; height: 438px;">
//<img src="b.jpg" usemap="#imgmap" name="mapimg" id="mapimg" border='0'>
//</div>
//
//
// 
//
//<div id="xxx" style="display:none;">
//			<SELECT id="suburb" name="suburb" size="1">
//				<option label="- Select County -" value="" selected >- Select County -</option>
//
//				<option label="Alcona" value="Alcona">Alcona</option>
//				<option label="Alger" value="Alger">Alger</option>
//				<option label="Allegan" value="Allegan">Allegan</option>
//				<option label="Alpena" value="Alpena">Alpena</option>
//				<option label="Antrim" value="Antrim">Antrim</option>
//				<option label="Arenac" value="Arenac">Arenac</option>
//
//				<option label="Baraga" value="Baraga">Baraga</option>
//				<option label="Barry" value="Barry">Barry</option>
//				<option label="Bay" value="Bay">Bay</option>
//				<option label="Benzie" value="Benzie">Benzie</option>
//				<option label="Berrien" value="Berrien">Berrien</option>
//				<option label="Branch" value="Branch">Branch</option>
//
//				<option label="Calhoun" value="Calhoun">Calhoun</option>
//				<option label="Cass" value="Cass">Cass</option>
//				<option label="Charlevoix" value="Charlevoix">Charlevoix</option>
//				<option label="Cheboygan" value="Cheboygan">Cheboygan</option>
//				<option label="Chippewa" value="Chippewa">Chippewa</option>
//				<option label="Clare" value="Clare">Clare</option>
//
//				<option label="Clinton" value="Clinton">Clinton</option>
//				<option label="Crawford" value="Crawford">Crawford</option>
//				<option label="Delta" value="Delta">Delta</option>
//				<option label="Dickinson" value="Dickinson">Dickinson</option>
//				<option label="Eaton" value="Eaton">Eaton</option>
//				<option label="Emmet" value="Emmet">Emmet</option>
//
//				<option label="Genesee" value="Genesee">Genesee</option>
//				<option label="Gladwin" value="Gladwin">Gladwin</option>
//				<option label="Gogebic" value="Gogebic">Gogebic</option>
//				<option label="Grand Traverse" value="Grand Traverse">Grand Traverse</option>
//				<option label="Gratiot" value="Gratiot">Gratiot</option>
//				<option label="Hillsdale" value="Hillsdale">Hillsdale</option>
//
//				<option label="Houghton" value="Houghton">Houghton</option>
//				<option label="Huron" value="Huron">Huron</option>
//				<option label="Ingham" value="Ingham">Ingham</option>
//				<option label="Ionia" value="Ionia">Ionia</option>
//				<option label="Iosco" value="Iosco">Iosco</option>
//				<option label="Iron" value="Iron">Iron</option>
//
//				<option label="Isabella" value="Isabella">Isabella</option>
//				<option label="Jackson" value="Jackson">Jackson</option>
//				<option label="Kalamazoo" value="Kalamazoo">Kalamazoo</option>
//				<option label="Kalkaska" value="Kalkaska">Kalkaska</option>
//				<option label="Kent" value="Kent">Kent</option>
//				<option label="Lake" value="Lake">Lake</option>
//
//				<option label="Lapeer" value="Lapeer">Lapeer</option>
//				<option label="Lenawee" value="Lenawee">Lenawee</option>
//				<option label="Livingston" value="Livingston">Livingston</option>
//				<option label="Luce" value="Luce">Luce</option>
//				<option label="Mackinac" value="Mackinac">Mackinac</option>
//				<option label="Macomb" value="Macomb">Macomb</option>
//
//				<option label="Manistee" value="Manistee">Manistee</option>
//				<option label="Marquette" value="Marquette">Marquette</option>
//				<option label="Mason" value="Mason">Mason</option>
//				<option label="Mecosta" value="Mecosta">Mecosta</option>
//				<option label="Menominee" value="Menominee">Menominee</option>
//				<option label="Midland" value="Midland">Midland</option>
//
//				<option label="Missaukee" value="Missaukee">Missaukee</option>
//				<option label="Monroe" value="Monroe">Monroe</option>
//				<option label="Montcalm" value="Montcalm">Montcalm</option>
//				<option label="Montmorency" value="Montmorency">Montmorency</option>
//				<option label="Muskegon" value="Muskegon">Muskegon</option>
//				<option label="Newaygo" value="Newaygo">Newaygo</option>
//
//				<option label="Oakland" value="Oakland">Oakland</option>
//				<option label="Oceana" value="Oceana">Oceana</option>
//				<option label="Ogemaw" value="Ogemaw">Ogemaw</option>
//				<option label="Osceola" value="Osceola">Osceola</option>
//				<option label="Oscoda" value="Oscoda">Oscoda</option>
//				<option label="Otsego" value="Otsego">Otsego</option>
//
//				<option label="Ottawa" value="Ottawa">Ottawa</option>
//				<option label="Presque Isle" value="Presque Isle">Presque Isle</option>
//				<option label="Roscommon" value="Roscommon">Roscommon</option>
//				<option label="Saginaw" value="Saginaw">Saginaw</option>
//				<option label="Saint Clair" value="Saint Clair">Saint Clair</option>
//				<option label="Saint Joseph" value="Saint Joseph">Saint Joseph</option>
//
//				<option label="Sanilac" value="Sanilac">Sanilac</option>
//				<option label="Schoolcraft" value="Schoolcraft">Schoolcraft</option>
//				<option label="Shiawassee" value="Shiawassee">Shiawassee</option>
//				<option label="Tuscola" value="Tuscola">Tuscola</option>
//				<option label="Van Buren" value="Van Buren">Van Buren</option>
//				<option label="Washtenaw" value="Washtenaw">Washtenaw</option>
//
//				<option label="Wayne" value="Wayne">Wayne</option>
//				<option label="Wexford" value="Wexford">Wexford</option>
//			</select>
//
//
//				 
//
//<input type="submit" value="Search" class="inputbox" />
//</div>
//
//<table cellpadding="3" cellspacing="0" border="0" width="100%" style="display: none;">
//<tr class="hp_asearch_row0">
//<td valign="top"><strong>Name</strong></td><td>
//<input type="hidden" name="name" size="35" class="inputbox" />
//</td></tr><tr class="hp_asearch_row1"><td valign="top">
//<strong>Property Type</strong></td><td>
//<!--
//<select name="type" class="inputbox" size="1">
//	<option value="0" selected="selected">All Types</option>
//	<option value="1">Rent to Own Home</option>
//</select> -->
//</td></tr>
//<tr class="hp_asearch_row0">
//<td valign="top"><strong>County</strong>
//</td><td> <input type="hidden" name="xsuburb" size="35" class="inputbox" />
//</td></tr><tr class="hp_asearch_row1"><td valign="top"><strong>State</strong>
//</td><td> <input type="hidden" name="state" size="35" class="inputbox" /> </td></tr>
//<tr class="hp_asearch_row0"><td valign="top"><strong>Postcode</strong></td><td>
//<input type="hidden" name="postcode" size="35" class="inputbox" /> </td></tr><tr class="hp_asearch_row1">
//<td valign="top"><strong>Monthly Payment</strong></td>
//<td>From  <input type="hidden" name="price_from" size="8" class="inputbox" />To
//<input type="hidden" name="price_to" size="8" class="inputbox" /></td></tr>
//<tr class="hp_asearch_row0"><td colspan="2" align="center"><!-- <input type="reset" class="inputbox" value="Reset" /> -->
// </td></tr>
//</table>
//</form>


//var DEBUG;
//window.addEvent('load', function() {
//
//
//
////This it the dbug function
//var deb = function(d) {
//	try{
//	//var newOption = new Element('li').setHTML(d).injectInside($('dbugT'));
//	}
//	catch(err){
//	}
//}
//deb('System Loaded');
//
//
//
//
//
//
//
////if(document.forms.adminForm.verbose.checked){
////	DEBUG = 1;
////	}else{
////	DEBUG = 0;
////}
////deb('DEBUG is set to:'+DEBUG);
//
//
//
//
//
//
//
//$$('input', 'select', 'button', 'select', 'optgroup', 'textarea', 'isindex').addEvent('change',function(event){
//	deb("There has been a change in the DOM form elements. ELEMENT: "+this.name+" has value "+sageFormReturnValue(this));
//
//	/*
//	if(document.forms.adminForm.verbose.checked){
//	DEBUG = 1;
//	}else{
//	DEBUG = 0;
//	}
//	*/
//
//	var con; 
//	$$('div').each(function(el){
//        var sCondition = el.getProperty('sageForm:showif');
//       	if(sCondition){
//	con++;
//       	sageFormEvaluateSoup(el,sCondition);
//	}
//	});
//	deb(con + " conditionals found")
//
//}); // end add event
//deb('Attached the on change events.')
//
//
//
//
//
//var sageFormElementVisible = function(isOn,target) {
//	if(DEBUG){
//		if(isOn){
//        	target.setStyles({'border':'3px solid black','background-color':'#cdffdc', 'opacity':'1','display':'block' });
//		}else{
//        	target.setStyles({'border':'3px solid black','background-color':'gray', 'opacity':'0.50','display':'block' });
//		}//on/off
//
//	}
//	else{
//
//		if(isOn){
//        	target.setStyles({ 'border':'0px solid black', 'background-color':'white', 'opacity':'1','display':'block' });
//        	}else{
//        	target.setStyles({ 'border':'0px solid black', 'background-color':'white', 'opacity':'1','display':'none' });
//        	}//on/off
//	}
//
//
//
//
//
//	// If the field is disabled by the means of the fanciful unicorn then reset all values inside to zero
//	// and! disable field validation debug
//		var elTypes = ['input', 'select', 'textarea'];
//		var domLocations;
//                for (i=0; i<elTypes.length; ++i) {
//                	elType = elTypes[i];
//                        try{
//                        domLocations = target.getElements(elType);
//			}
//			catch(err){
//			dbug.log(err.message)
//			}
//
//			if(domLocations){
//			domLocations.each(function(domLocation){
//
//
//			if(isOn){ // Then en able	
//			dbug.log('x');
//				if(domLocation.getProperty('disabled_paf')){
//				if(elType == 'input'){
//				try{domLocation.setProperty('paf', domLocation.getProperty('disabled_paf'));}catch(err){}
//				try{domLocation.removeProperty('disabled_paf');}catch(err){}			
//				}
//				if(elType == 'textarea'){
//                                try{domLocation.setProperty('paf', domLocation.getProperty('disabled_paf'));}catch(err){}
//                                try{domLocation.removeProperty('disabled_paf');}catch(err){}
//				}
//				if(elType == 'select'){
//                                try{domLocation.setProperty('paf', domLocation.getProperty('disabled_paf'));}catch(err){}
//                                try{domLocation.removeProperty('disabled_paf');}catch(err){}
//				}
//				}
//			}else{ // if is on then dis able
//                        	if(elType == 'input'){
//                                try{ domLocation.value = "";}catch(err){}
//                                try{domLocation.setProperty('disabled_paf', domLocation.getProperty('paf'));}catch(err){}
//                                try{domLocation.removeProperty('paf');}catch(err){}
//                        	}
//                        	if(elType == 'textarea'){
//                                try{ domLocation.value = "";}catch(err){}
//                                try{domLocation.setProperty('disabled_paf', domLocation.getProperty('paf'));}catch(err){}
//                                try{domLocation.removeProperty('paf');}catch(err){}
//                         	}
//                        	if(elType == 'select'){
//                                try{domLocation.value = "";}catch(err){}
//                                try{domLocation.setProperty('disabled_paf', domLocation.getProperty('paf'));}catch(err){}
//                                try{domLocation.removeProperty('paf');}catch(err){}
//                        	}
//			} // end isOncheck
//
//
//			}); // for each element
//                        }// if element locations were found
//		} //for
//	
//
//
//}
//
//
//
//
//
//
//
//
//
//
//
//var sageFormReturnValue = function(target) {
//	if(target){
//	var elemValue;
//                try{
//                elemValue = target.getValue();
//		if(elemValue == undefined ){elemValue = '';}
//		if(elemValue == true ){elemValue = 'true';}
//		if(elemValue == false){elemValue = 'false';}
//                }
//                catch(err){
//		deb(err.message)
//                }
//	        //deb('The value of:'+target.name+' is '+elemValue);
//	return(elemValue);
//	}else{
//	return "";
//	}
//}
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//var sageFormEvaluateSoup = function(target,code) {
//	code = code.replace(/\n|\r/g, ' ');
//	//deb('Evaluating:'+code);
//	target.setStyles({
//        'margin-top':'8px',
//        'padding':'8px',
//        'border':'3px solid red',
//        'background-color':'#ffdede'
//        });
//
//
//
//	// Setup the targetDbugBox
//	var targetDbugBox = target.getElement('div[class=DbugBox]');
//	if(!targetDbugBox){
//        targetDbugBox = new Element('div',{'class':'DbugBox'});
//        targetDbugBox.injectTop(target);
//        targetDbugBox = target.getElement('div[class=DbugBox]');
//        targetDbugBox.setStyles({
//	'margin-bottom':'4px',
//	'padding':'4px',
//	'text-align':'left',
//	'border':'1px solid #dddddd',
//	'background-color':'#f9f9f9',
//	'display':'block'
//        });
//	}else{
//	targetDbugBox.empty();
//	}
//	if(!DEBUG){
//        targetDbugBox.setStyles({
//        'display':'none',
//        'text-align':'left'
//        });
//	}else{
//        targetDbugBox.setStyles({
//        'display':'block',
//        'text-align':'left'
//        });
//	}
//
//
//	var codes = code.split(';');
//	for(var code in codes){
//	if(codes[code].constructor == String && codes[code] != ""){
//
//	        codes[code] = codes[code].replace(/^ /,'');	
//		var tempa = codes[code].split(" ");
//		var tempb = codes[code].split(tempa[1]);
//		var formElement = tempb[0];
//		var testOperator = tempa[1]; 
//		var testCondition = tempb[1];
//		formElement   = formElement.replace(/(^ *| *?$)/g,'');		
//		testOperator  = testOperator.replace(/(^ *| *?$)/g,'');
//		testCondition = testCondition.replace(/(^ *| *?$)/g,'');
//		var elemValue = "not computed";
//		var sourceElement = $('adminForm');
//
//
//		/*
//		if(elemValue.constructor == Array){
//		elemValue = elemValue.join(", ");
//		}
//		*/	
//		var soupMessage =
//				'Element being tested: ['+formElement+'],<br>'+
//				'Condition Operator: ['+testOperator + '],<br>'+
//				'Condition:['+testCondition+'],<br>'+
//				'Tested Value: ['+elemValue+']';
//		
//
//		// THIS IS THE EVALUATION AREA
//		// THis is oring for every comma separated, if 1 then return 1
//		formElement = formElement+',';
//		var formElements = formElement.split(',');
//
//        		for(var commaElement in formElements){
//        			if(formElements[commaElement].constructor == String && formElements[commaElement] != ""){
//					// dbug.log('Checking element %s',formElements[commaElement]);
//					var elemValue;
//					var testResult;
//					var elemValue = "";
//
//					// And here lies the IE bug.
//					// It is the selector of an form element
//					var formElementName = formElements[commaElement];
//
//					var domLocation;
//					
//					var elTypes = ['input', 'select', 'textarea'];
//
//					for (i=0; i<elTypes.length; ++i) {
//					elType = elTypes[i];
//					try{
//					domLocation = sourceElement.getElement(elType+'[name='+formElementName+']');
//					}catch(err){}
//					if(!domLocation){
//						//deb('Unable to locate a form element named ['+formElementName+']')
//					}else{
//						//deb('I found the form element named ['+formElementName+']')
//						break;
//					}
//					}
//					
//					elemValue = sageFormReturnValue(domLocation);
//					testResult = elemValue.match(testCondition);
//					if(testResult){ // At least one true value, success, exiting
//						break;
//					}
//				} // if constructor
//			} // for each name
//
//
//		var result;
//		if(testResult){
//			result = 1;
//			var soupMessageEnglish = 'This area is ENABLED  because ' + formElement + ' contains ' + testCondition;// + ' (' + testOperator + ')'; 
//			if(testOperator == '!=' ){
//			var soupMessageEnglish = 'This area is DISABLED  because ' + formElement + ' contains ' + testCondition;// + ' (' + testOperator + ')'; 
//			result = 0
//			};
//			sageFormElementVisible(result,target);
//		}else{
//			result = 0;
//			soupMessageEnglish = 'This area is DISABLED  because ' + formElement + ' does not contain  ' + testCondition;// + ' (' + testOperator + ')';
//			if(testOperator == '!=' ){
//			result = 1
//			soupMessageEnglish = 'This area is ENABLED because ' + formElement + ' does not contain  ' + testCondition;// + ' (' + testOperator + ')';
//			};
//			sageFormElementVisible(result,target);
//		}
//
//
//		if(DEBUG){
//		targetDbugBox.appendText(soupMessageEnglish);
//		}
//	}//if
//	}// foreach
//}
//
//
//
//
//
//
//
//
//
//
//function runMe(){
//
//	var con = 0;
//	var ConArr = $ES('div');
//	//var ConArr = $('adminForm').getElements('div[sageForm:showif!=0]')
//
//	ConArr.each(function(el){
//		var sCondition = el.getProperty('sageForm:showif');
//		if(sCondition){
//		con = con + 1;
//		sageFormEvaluateSoup(el,sCondition);
//		}
//	});
//	deb(con + " conditionals found in runMe");
//	deb('runME ran');
//}
//
//runMe();
//
///*
//$$('input', 'select', 'button', 'select', 'optgroup', 'textarea', 'isindex').each(function(atag){
//        var href = atag.getProperty('href');
//        var titl = atag.getProperty('title');
//        var popu = titl + href + "this is a test";
//
//        atag.setProperty('title', 'Element Name :: ' + atag.getProperty('name').replace(/_/g," " ) );
//        //popupMetricsClickCount(href,atag);
//
//        var tips = new Tips(atag, {
//
//        initialize:function(){
//                this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
//        },
//        onShow: function(toolTip) {
//                //dbug.log(this.toolTip); 
//                this.fx.start(1);
//        },
//        onHide: function(toolTip) {
//                this.fx.start(0);
//        }
//
//        });
//});
//*/
//
//
//
//function selectSample_Logic(){
//	jsonObj =	{
//			"nycConfiguration":{
//				"memberCount":"3",
//				"uniqueIdent":"abcdef1234567890",
//				"timeStamp":"Monday"
//					   },
//
//			"nycMember":[
//				{"name":"PAF_TSA_DBN",		"value":"00O000",	"type":""},
//				{"name":"PAF_TSA_School_Name",	"value":"NYC School",	"type":""},
//				{"name":"PAF_TSA_SSO",		"value":"SSOID",		"type":""},
//				{"name":"PAF_TSA_SAF",		"value":"Jane SAF",		"type":""},
//				{"name":"PAF_TSA_Grades",	"value":"Debug:Unset",		"type":""}
//				    ]
//			};
//
//	
//	jsonObj.nycMember[4].value = "" + ($('selectSample').getValue());
//
//		jsonObj.nycMember.each(function(field) {
//		        try{
//		        eval('var objx = document.forms.adminForm.'+field.name);
//		        objx.value = field.value;
//		        }catch(err){}
//
//		        try{
//		        $('txt'+field.name).empty();
//		        var newText = new Element('div').setHTML(field.value).injectInside('txt'+field.name);
//		        }catch(err){}
//
//		}); // each fields
//
//	$('the_form').setStyle('display', 'block');
//	runMe();
//}
//
//
//
//function selectSampleSystem(){
//	jsonObj = 	{"nycRoute":[
//        		{"name":"Elementary",	"value":"PK-8"},
//        		{"name":"Middle",	"value":"9-12"}
//			]};
//
//	dbug.log('Populating Sample System Element v2');
//	$('kwick_borough_content').empty();
//	$('kwick_district_content').empty();
//	$('kwick_school_content').empty();
//	$('kwick_member_content').empty();
//	$('the_form').setStyle('display', 'none'); // The form should be invisible until the last moment
//
//	var name = 'selectSample';
//	var newSelect = new Element('select', {'name':name, 'id':name});
//	var newOption = new Element('option', {'value': ""}).setHTML('(Please Select School Type)').injectInside(newSelect);
//
//	jsonObj.nycRoute.each(function(quark) {
//	var newOption = new Element('option', {'value': quark.value}).setHTML(quark.name).injectInside(newSelect);
//	});
//
//	$('kwick_borough_content').empty();
//	newSelect.injectInside($('kwick_borough_content'));
//	$('selectSample').addEvent('change', function(){selectSample_Logic();});
//}
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//var GID;
//var ROOT_SERVER = "/modules/mod_Wendel-3.php";
//
//// populateDropDown_a();
//selectSampleSystem();
//
//
//function populateDropDown_a(){
//	return;
//	var name = 'selectBorough';
//
//	dbug.log('Populating Borough (1st) Element');
//        // The top element is changing
//        // At this point we need to reset elements below
//        $('kwick_borough_content').empty();
//        $('kwick_district_content').empty();
//        $('kwick_school_content').empty();
//        $('kwick_member_content').empty();
//	$('the_form').setStyle('display', 'none'); // The form should be invisible until the last moment
//
//	var url = ROOT_SERVER + "?execute=get_borough";
//
//	$('kwick_borough_content').setHTML('<img src="/ajax_loading.gif">Loading...');
//	var request = new Json.Remote(url, {
//
//	onComplete: function(jsonObj){
//		var newSelect = new Element('select', {'name':name, 'id':name});
//		var newOption = new Element('option', {'value': ""}).setHTML('(Please Select Borough)').injectInside(newSelect);
//
//		jsonObj.nycRoute.each(function(quark) {
//		var newOption = new Element('option', {'value': quark.value}).setHTML(quark.name).injectInside(newSelect);
//		});
//
//	$('kwick_borough_content').empty();
//	newSelect.injectInside($('kwick_borough_content'));
//	$('selectBorough').addEvent('change', function(){populateDropDown_b()});
//
//	} // end on complete
//	}).send(); // end request
//	return;
//} // end function
//
//
//
//
//
//
//
//
//
//function populateDropDown_b(){
//	var name = 'selectDistrict';
//
//	dbug.log('Populating District (2nd) Element');
//        // The top element is changing
//        // At this point we need to reset elements below
//        // We cannot clear this because user selected it above $('kwick_borough_content').empty();
//        $('kwick_district_content').empty();
//        $('kwick_school_content').empty();
//        $('kwick_member_content').empty();
//	$('the_form').setStyle('display', 'none'); // The form should be invisible until the last moment
//
//
//	var borough = document.forms.adminForm.selectBorough.options[document.forms.adminForm.selectBorough.selectedIndex].value;
//
//	// If no selection was made ABOVE THIS ONE, if someone selected a null option, simply return from this subreoutine
//	// Having cleared, self and the options below. Only boxes b and down are affected by this, the first box
//	// Does not clear its self for obvious reasons.
//	if(!borough){return;} 	
//
//	var url = ROOT_SERVER + "?execute=get_district&borough="+borough;
//
//	$('kwick_district_content').setHTML('<img src="/ajax_loading.gif" class="ajax_loading">Loading School District Information...');
//	var request = new Json.Remote(url, {
//	onComplete: function(jsonObj){
//	var newSelect = new Element('select', {'name':name, 'id':name});
//	var newOption = new Element('option', {'value': ""}).setHTML('(Please Select District)').injectInside(newSelect);
//	jsonObj.nycRoute.each(function(quark) {
//	var newOption = new Element('option', {'value': quark.value}).setHTML(quark.name).injectInside(newSelect);
//	});	
//
//	$('kwick_district_content').empty();
//	newSelect.injectInside($('kwick_district_content'));
//	$('selectDistrict').addEvent('change', function(){populateDropDown_c()});
//
//
//	} // end on complete
//	}).send(); // end request
//	
//
//	return;
//}
//
//function populateDropDown_c(){
//	var name = 'selectSchool';
//
//	dbug.log('Populating School (3rd) Element');
//        // The top element is changing
//        // At this point we need to reset elements below
//        // We cannot clear this because user selected it above $('kwick_borough_content').empty();
//        // We cannot clear this because user selected it above $('kwick_district_content').empty();
//        $('kwick_school_content').empty();
//        $('kwick_member_content').empty();
//	$('the_form').setStyle('display', 'none'); // The form should be invisible until the last moment
//
//	var borough = document.forms.adminForm.selectBorough.options[document.forms.adminForm.selectBorough.selectedIndex].value;
//	var district = document.forms.adminForm.selectDistrict.options[document.forms.adminForm.selectDistrict.selectedIndex].value;
//
//        // If no selection was made ABOVE THIS ONE, if someone selected a null option, simply return from this subreoutine
//        // Having cleared, self and the options below. Only boxes b and down are affected by this, the first box
//        // Does not clear its self for obvious reasons.
//        if(!district){return;}
//
//
//	var url = ROOT_SERVER + "?execute=get_school&borough="+borough+"&district="+district;
//
//
//	$('kwick_school_content').setHTML('<img src="/ajax_loading.gif" class="ajax_loading">Loading School Information...');
//	var request = new Json.Remote(url, {
//	onComplete: function(jsonObj){
//	var newSelect = new Element('select', {'name':name, 'id':name});
//	var newOption = new Element('option', {'value': ""}).setHTML('(Please Select School)').injectInside(newSelect);
//	jsonObj.nycRoute.each(function(quark) {
//	var newOption = new Element('option', {'value': quark.value}).setHTML(quark.name).injectInside(newSelect);
//	});	
//
// 	$('kwick_school_content').empty();
//	newSelect.injectInside($('kwick_school_content'));
//	$('selectSchool').addEvent('change', function(){prePopB();});
//
//
//	} // end on complete
//	}).send(); // end request
//	
//
//	return;
//}
//
//function prePopB(){
//
//var borough = document.forms.adminForm.selectBorough.options[document.forms.adminForm.selectBorough.selectedIndex].value;
//var district = document.forms.adminForm.selectDistrict.options[document.forms.adminForm.selectDistrict.selectedIndex].value;
//var school = document.forms.adminForm.selectSchool.options[document.forms.adminForm.selectSchool.selectedIndex].value;
//var dbn = district+borough+school;
//
//dbug.log('System Core Entered, fetching sub information');
//
//        var url =  ROOT_SERVER;
//            url += '?';
//            url += 'execute=get_sub_details';
//            url += String.fromCharCode(38);
//            url += 'gid='+dbn;
//
//	var request = new Json.Remote(url,{onComplete:function(jsonObj){
//
//        jsonObj.nycMember.each(function(field) {
//	
//	try{
//        eval('var objx = document.forms.adminForm.'+field.name);
//        objx.value = field.value;
//	}catch(err){}
//
//        try{
//        $('txt'+field.name).empty();
//        var newText = new Element('div').setHTML(field.value).injectInside('txt'+field.name);
//        }catch(err){}
//
//
//        }); // each fields
//
//        $('the_form').setStyle('display', 'block');
//	runMe();
//        }}).send();
//}
//
//
//
//
//
//
//function populateDropDown_d(){
//	name = 'selectMember';
//
//        dbug.log('Populating Team Members (4th) Element');
//        // The top element is changing
//        // At this point we need to reset elements below
//        // We cannot clear this because user selected it above $('kwick_borough_content').empty();
//        // We cannot clear this because user selected it above $('kwick_district_content').empty();
//        // We cannot clear this because user selected it above $('kwick_school_content').empty();
//        $('kwick_member_content').empty();
//	$('the_form').setStyle('display', 'none'); // The form should be invisible until the last moment
//	
//	var borough = document.forms.adminForm.selectBorough.options[document.forms.adminForm.selectBorough.selectedIndex].value;
//	var district = document.forms.adminForm.selectDistrict.options[document.forms.adminForm.selectDistrict.selectedIndex].value;
//	var school = document.forms.adminForm.selectSchool.options[document.forms.adminForm.selectSchool.selectedIndex].value;
//	var GID = district+borough+school;
//
//        // If no selection was made ABOVE THIS ONE, if someone selected a null option, simply return from this subreoutine
//        // Having cleared, self and the options below. Only boxes b and down are affected by this, the first box
//        // Does not clear its self for obvious reasons.
//        if(!school){return;}
//
//	var url =  ROOT_SERVER;
//	    url += '?';
//	    url += 'execute=get_member_list';
//	    url += String.fromCharCode(38);
//	    url += 'gid='+GID;
//
//	$('kwick_member_content').setHTML('<img src="/ajax_loading.gif" class="ajax_loading">Loading Member List...');
//	var request = new Json.Remote(url, {
//		onComplete: function(jsonObj){
//
//		//dbug.log('Status of jsonObj:'+jsonObj);
//	
//if(jsonObj.nycMembers){	
//		var newSelect = new Element('select', {'name':name, 'id':name});
//		var newOption = new Element('option', {'value': ""}).setHTML('(Please Select Your Name)').injectInside(newSelect);
//
//		jsonObj.nycMembers.each(function(quark) {
//		if(quark){
//		var newOption = new Element('option', {'value': quark.value}).setHTML(quark.name).injectInside(newSelect);
//		}else{
//		var newOption = new Element('option', {'value': 'nonames'}).setHTML('No Names On File').injectInside(newSelect);
//		}
//		}); // Each
//		$('kwick_member_content').empty();
//		newSelect.injectInside($('kwick_member_content'));
//		$('selectMember').addEvent('change', function(){mmx()});
//}else{ // NO MEMBER DATA
//		dbug.log('No member data');
//		$('kwick_member_content').empty();
//		$('kwick_member_content').setHTML('Our records indicate that your school did not participate in the initial web survey.');
//
//}
//
//
//	} // end on complete
//
//	}).send(); // end request
//	
//	return;
//}
// 
// 
//
//
//function mmx(){
//	dbug.log('Intermediate Function, About to enter the core...');
//	var borough = document.forms.adminForm.selectBorough.options[document.forms.adminForm.selectBorough.selectedIndex].value;
//	var district = document.forms.adminForm.selectDistrict.options[document.forms.adminForm.selectDistrict.selectedIndex].value;
//	var school = document.forms.adminForm.selectSchool.options[document.forms.adminForm.selectSchool.selectedIndex].value;
//	var member = document.forms.adminForm.selectMember.options[document.forms.adminForm.selectMember.selectedIndex].value
//	memberRun(district+borough+school,member);
//	return;
//}
//
//
//
//
//
//
//
//
//
//
//function memberRun(GID,MID){
//	dbug.log('System Core Entered, memberRun, executing...');
//
//	var url =  '/modules/mod_Wendel2.php';
//	    url += '?';
//	    url += 'execute=get_member_details';
//	    url += String.fromCharCode(38);
//	    url += 'gid='+GID;
//	    url += String.fromCharCode(38);
//	    url += 'mid='+MID;
//
//var request = new Json.Remote(url,{onComplete:function(jsonObj){
//	dbug.log(jsonObj.nycMember.email)
//
//	/*
//	$('kwick_message_content').setHTML(
//	'<div>'+
//	'<b>' + jsonObj.nycMember.first_name + ' ' +  jsonObj.nycMember.last_name + '</b><br>Preferred e-mail address: ' + jsonObj.nycMember.email+
//	'</div>'
//	);
//
//	document.forms.adminForm.PAF_DC_SCHOOL_ID.value = jsonObj.nycMember.school_id;
//	document.forms.adminForm.PAF_DC_EMAIL.value = jsonObj.nycMember.email;
//	document.forms.adminForm.PAF_DC_FIRST_NAME.value = jsonObj.nycMember.first_name;
//	document.forms.adminForm.PAF_DC_LAST_NAME.value = jsonObj.nycMember.last_name;
//	*/
//
//	$('the_form').setStyle('display', 'block');
//		
//
//	}}).send();
//
//	/*
//	var nycMemberFormPrepopulation = function(fields) {
//	fields.each(function(field) {
//	eval('var objx = document.forms.adminForm.'+field.name);
//	objx.value = field.value;
//	}); // each fields
//	}
//	*/
//
//
//	/*
//	function nycMemberFormMemberDisplay(memberCount){
//	dbug.log('nycMemberFormMemberDisplay: got '+ memberCount+'.'+GID);
//	// UNHIDE SECTIONS AS NEEDED
//	var nycMembers = $$("#nycMembersList .nycMember");
//	nycMembers.each(function(nycMember, i){
//	if(i <= (memberCount -1)){
//	nycMember.setStyle('display', 'block');
//	}
//	}); // End each member
//	$('the_form').setStyle('display', 'block');
//	}// End form logic function
//	*/
//
//
//} // End Member run
//
//
//
//
//
//}); // Window load
//
//
//





