var checkoutYourInfo_handlers = {
	'.hndl_show_login': function(elem){
		elem.onclick = function(){
		
			getLayer('block-customerinfo').style.display = getElementComputedStyle('block-customerinfo', 'display')=='none'?"block":"none";
			getLayer('block-auth').style.display = getLayer('block-customerinfo').style.display=='none'?"block":"none";
			return false;
		}
	},
	'#hndl-show-billing-address': function(e){
		e.onclick = function(){
			getLayer('block-billing-address').style.display = this.checked?"none":"block";
		}
	},
	'#hndl-show-loginpass-fields': function(e){
		e.onclick = function(){
			getLayer('block-loginpass-fields').style.display = this.checked?"block":"none";
		}
	},
	'.country_box': function(e){
		e.onchange = function(){
			//var objForm = getFormByElem(this);
			//objForm['action'].value = 'update_form';
			//objForm.submit();
			
			var name_space = this.name.replace('[countryID]', '');
			var title = $(name_space+'_state_or_province');			
			
			if (this.value != 223)
			{
				if (title.innerHTML != 'State or Province:')
				{
					title.innerHTML = 'State or Province:';

					var input = $(name_space+'[zoneID]');
					input.disabled = 'disabled';
					input.style.display = 'none';

					input = $(name_space+'[state]');
					input.disabled = '';
					input.style.display = 'block';
				}				
			}
			else
			{
				title.innerHTML = 'State:';

				var input = $(name_space+'[state]');
				input.disabled = 'disabled';
				input.style.display = 'none';

				input = $(name_space+'[zoneID]');
				input.disabled = '';
				input.style.display = 'block';
			}
			
			return false;
		}
	},
	'.autofill': function(e){
		e.onfocus = function(){
			if(this.value)return;
			
			var obj = getLayer(this.getAttribute('rel'));
			if(!obj)return;
			
			this.value = obj.value;
		}
	}
}

Behaviour.register(checkoutYourInfo_handlers);