// JavaScript Document

jQuery(function(){
	
	/**
	 * Handle a display states when country is set to united states 
	 *
	 * Author: waldemarm
	 */	
	$('#country_id').change(function(){
		if($('#country_id :selected').val()==221){
			/** display state select section **/
			if($('#country_state_section :hidden')){
				$('#country_state_section').slideDown();
			}
		}
		else{
			$('#country_state_id').val('Select');
			if($('#country_state_section :visible')){
				$('#country_state_section').slideUp();
		    }
		}
	});
	
	
	/** if user is logged in angd we populate his detail we have to check the country and display staate if user country is set to USA
	 that is why we trigger the country on chenge action when the page is load **/
	 $('#country_id').trigger('change');


});
