
jQuery(document).ready(function(){

//   if(document.getElementById('billing:country_id') == null)
//   {
       jQuery('body select').each(function(){
            if(!this.id){
                    this.id = 'jselect-id-' + parseInt(Math.random() * 10000)
            }
            if(!this.multiple){
                jQuery(this).parent().css({'position':'relative'});
                jQuery(this).parent().css({'display': 'block'});
                jQuery(this).selectbox();

                if('region_id' == this.id)
                {
                    if(1 == this.options.length)
                    {
                        jQuery('#region_id-input').hide();
                        jQuery('#region').show();
                    }
                }
		else if ('billing:region_id' == this.id ){
                    if(1 == this.options.length)
                    {
                        jQuery('#billing\\:region_id-input').hide();
                        jQuery('#billing\\:region').show();
                    }
                }
		else if ('shipping:region_id' == this.id ){
                    if(1 == this.options.length)
                    {
                        jQuery('#shipping\\:region_id-input').hide();
                        jQuery('#shipping\\:region').show();
                    }
                }
		else if ('billing:country_id' == this.id ){
                    if(1 == this.options.length)
                    {
                        jQuery('#billing\\:region_id-input').hide();
                        jQuery('#billing\\:region').show();
                    }
                }
		else if ('shipping:country_id' == this.id ){
                    if(1 == this.options.length)
                    {
                        jQuery('#shipping\\:region_id-input').hide();
                        jQuery('#shipping\\:region').show();
                    }
                }
            }

        });
//    }
//
});

