//<!--
  function prepare() {

     var p_kind = new Ext.form.ComboBox({
            store: p_kind_store,
            width:200,
            displayField:'ptext',
            readOnly: true,
            mode: 'local',
            triggerAction: 'all',
            typeAhead:true,
            allowBlank:true,
            validateOnBlur:true,
            emptyText:'指定しない',
            selectOnFocus:true,
            resizable:false
        });
    p_kind.on('focus',function(e){p_kind.onTriggerClick();});
    p_kind.applyTo('p_kind');

    var p_sex = new Ext.form.ComboBox({
            store: sex_store,
            width:200,
            displayField:'ptext',
            readOnly: true,
            mode: 'local',
            triggerAction: 'all',
            allowBlank:true,
            emptyText:'こだわらない',
            selectOnFocus:true,
            resizable:false
        });
    p_sex.on('focus',function(e){p_sex.expand();});
    p_sex.applyTo('p_sex');

    var p_color = new Ext.form.TextField({
            width:200,
            allowBlank:true
        });
    p_color.applyTo('p_color');

    var p_locate = new Ext.form.ComboBox({
//            store: prefecture_store,
            store: pref_store,
            width:200,
            displayField:'ptext',
            readOnly: true,
            mode: 'local',
            triggerAction: 'all',
            allowBlank:true,
            emptyText:'こだわらない',
            selectOnFocus:true,
            resizable:false
    });
    p_locate.on('focus',function(e){p_locate.expand();});
    p_locate.applyTo('p_locate');

    var p_price = new Ext.form.ComboBox({
            store: price_store,
            width:200,
            displayField:'ptext',
            readOnly: true,
            mode: 'local',
            triggerAction: 'all',
            allowBlank:true,
            emptyText:'こだわらない',
            selectOnFocus:true,
            resizable:false
    });
    p_price.on('focus',function(e){p_price.expand();});
    p_price.applyTo('p_price');

    var p_photo = new Ext.form.ComboBox({
            store: photo_store,
            width:200,
            displayField:'ptext',
            readOnly: true,
            mode: 'local',
            triggerAction: 'all',
            allowBlank:true,
            emptyText:'写真あり',
            selectOnFocus:true,
            resizable:false
    });
    p_photo.on('focus',function(e){p_photo.expand();});
    p_photo.applyTo('p_photo');

    var p_age = new Ext.form.ComboBox({
            store: age_store,
            width:200,
            displayField:'ptext',
            readOnly: true,
            mode: 'local',
            triggerAction: 'all',
            allowBlank:true,
            emptyText:'こだわらない',
            selectOnFocus:true,
            resizable:false
    });
    p_age.on('focus',function(e){p_age.expand();});
    p_age.applyTo('p_age');

    var status = new Ext.form.ComboBox({
            store: status_store,
            width:200,
            displayField:'ptext',
            readOnly: true,
            mode: 'local',
            triggerAction: 'all',
            allowBlank:true,
            emptyText:'販売中',
            selectOnFocus:true,
            resizable:false
    });
    status.on('focus',function(e){status.expand();});
    status.applyTo('status');

    var p_month = new Ext.form.ComboBox({
            store: month_store,
            width:80,
            displayField:'ptext',
            readOnly: true,
            mode: 'local',
            triggerAction: 'all',
            allowBlank:true,
            emptyText:'',
            selectOnFocus:true,
            resizable:false
    });
    p_month.on('focus',function(e){p_month.expand();});
    p_month.applyTo('p_month');

    var p_day = new Ext.form.ComboBox({
            store: day_store,
            width:80,
            displayField:'ptext',
            readOnly: true,
            mode: 'local',
            triggerAction: 'all',
            allowBlank:true,
            emptyText:'',
            selectOnFocus:true,
            resizable:false
    });
    p_day.on('focus',function(e){p_day.expand();});
    p_day.applyTo('p_day');

    var p_id = new Ext.form.TextField({
            width:200,
            allowBlank:true
        });
    p_id.applyTo('p_id');


}

function puppy_search(start, sort){

    // 検索ボタン押下の場合はすべて(unit以外)初期化
    if(start==-1){
        document.f_puppy_search.desc.value="0";
        document.f_puppy_search.sort.value="";
        document.f_puppy_search.start.value=1;
        document.f_puppy_search.submit();
        return;
    }
    // 降順・昇順の入れ替え
    if(document.f_puppy_search.sort.value!=''
    && document.f_puppy_search.sort.value==sort
    && start==1
    && document.f_puppy_search.desc.value!=""){
        document.f_puppy_search.desc.value=1-document.f_puppy_search.desc.value;
    }
    if(document.f_puppy_search.sort.value!=sort){
        document.f_puppy_search.desc.value="";
    }

    if(start==0) start=1;
    document.f_puppy_search.start.value=start;
    document.f_puppy_search.sort.value=sort;
    document.f_puppy_search.submit();
}
function puppy_unitchange(unit){
    document.f_puppy_search.unit.value=unit;
    document.f_puppy_search.submit();
}
//--> end hide JavaScript
