function getState( obj, target ) {
	var countryIdentity = obj.options[ obj.selectedIndex ].value;
	doDisplayWait( target );
	var handleSuccess = function( o ) {
		var root = o.responseXML.documentElement;
		var myArray = root.getElementsByTagName( 'state' );
		var myTarget = document.getElementById( target );
		myTarget.options.length = 0;
		if ( myArray.length == 0 ) {
			var myOption = new Option( "No records found", 0 );
			myTarget.options[ myTarget.options.length ] = myOption;
			return false;
		}
		myTarget.disabled = false;
		for ( var i = 0; i < myArray.length; i++ ) {
			var myOption = new Option( myArray[ i ].getAttribute( "title" ), myArray[ i ].getAttribute( "identity" ) );
			myTarget.options[ myTarget.options.length ] = myOption;
		}
	}

	var handleFailure = function( o ) {
		alert( o.statusText );
		document.write( o.responseText );
		//alert( o.responseText );
	}

	var callback = {
		success: handleSuccess,
		failure: handleFailure
	};

	var request = YAHOO.util.Connect.asyncRequest( 'GET', 'getState.cfm?countryIdentity=' + countryIdentity + '&d', callback ); 
}

function doDisplayWait( target ) {
	// get a reference to the target
	var myTarget = document.getElementById( target );
	// remove all options
	myTarget.options.length = 0;
	// disable the dropdown
	myTarget.disabled = true;
	var myOption = new Option( "Please wait while loading...", 0 );
	myTarget.options[ myTarget.options.length ] = myOption;
}
