<!--



var data;



function init(){

    hanni('size_long');

    hanni('size_short');

    hanni('size_height');

    hanni('size_circle');

}



function hanni(f) {

    var compare_f = document.getElementById(f+'_compare');

    var allow_f = document.getElementById(f+'_allow');



    if(compare_f.value == "eq") {

	allow_f.style.display = 'inline';

    } else {

	allow_f.style.display = 'none';

    }

    return;

}



function do_input() {



    var action_f = document.getElementById('do_action');

    action_f.value = '';

    document.forms["search_form"] .submit();

}





function do_sort() {



    var page_f = document.getElementById('page');

    page_f.value = 1;

    var action_f = document.getElementById('do_action');

    action_f.value = 'do_search';

    document.forms["search_form"] .submit();

}



function do_search() {



    if(!check_input()) return;

    var action_f = document.getElementById('do_action');

    action_f.value = 'do_search';

    document.forms["search_form"] .submit();

}



function jump(page) {

    var page_f = document.getElementById('page');

    page_f.value = page;

    

    var action_f = document.getElementById('do_action');

    action_f.value = 'do_search';

    document.forms["search_form"] .submit();

}



function check_input() {

    

    var is_null = true;

    

    if($F('category_list') != 'undefined') is_null = false;

    if($F('gaikei_list') != 'undefined')  is_null = false;

    if($F('sozai_list') != 'undefined')  is_null = false;

    if($F('product') != '') is_null = false;

    if($F('gara') != '') is_null = false;

    if($F('product_code') != '') is_null = false;

    

    var gara_image = document.getElementById('gara_image_list');

    var gara_image_cbox  = gara_image.getElementsByTagName('input');

    for(i=0;i<gara_image_cbox.length;i++){

	if(gara_image_cbox[i].checked == true) {

	    is_null = false;

	}

    }

    

    if($F('size_long') != '' ) {

	is_null = false;

	if(!check_num($F('size_long'),'長辺')) return false;

    }

    if($F('size_short') != '' ) {

	is_null = false;

	if(!check_num($F('size_short'),'短辺')) return false;

    }

    if($F('size_height') != '' ) {

	is_null = false;

	if(!check_num($F('size_height'),'高さ')) return false;

    }

    if($F('size_circle') != '' ) {

	is_null = false;

	if(!check_num($F('size_circle'),'直径')) return false;

    }

    

    if(is_null) {

	alert('検索条件は何か必ず選択/入力するようにしてください');

	return false;

    }

    return true;

}



function check_num(value, name) {

    var str = value.toString();

    var regex = /[^0-9]/;

    if (str.match(regex)) {

	alert(name + 'は正の整数のみ入力するようにしてください');

	return false;

    }

    return true;

}



-->








