$(document).ready(function(){
    /**  
    * @ workarea.js 
    *    ucan/common/search/workarea.html を利用の際は必ず読み込む事。
    *    ・地域ごとの開閉
    *    ・地域タイトルアイコンの変更
    *    必須プラグイン
    *    js/jquery.js
    *    js/plugin/jquery.openContainer.js
    *    js/plugin/jquery.changeImg.js		// +/-の画像がなくなり、不要になりました 2010.08.17 改定
     **/
    var speed = "";
    var name, title;
    var def = "CLOSE";
    var bool, id;


    $(".allCheck").click(function(){
        id = "#" + $(this).val();
        if ( $(this).attr("checked") == true ) {
            bool = true;
        } else {
            bool = false;
        }

        $(id +"_detail input").each(function(obj){
            $(this).attr("checked", bool);
        });
    });

    $(".soloCheck").click(function(){
        id = "#" + $(this).attr("param");
        bool = false;
        if ( $(this).attr("checked") == true ) {
            bool = true;
            $(id +"_detail input").each(function(obj){
                if ( $(this).attr("checked") == false ) {
                    bool = false;
                }
            });
        }

        id = id.replace("area","CHECK");
        $(id).attr("checked", bool);

    });

    for (i=2; i<=9; i++) {
        tmp = i + "";
        tmp = "000".substr(0,("000".length-tmp.length) )+tmp;
        title  = "#area"+ tmp +"_title";
        target = "#area"+ tmp +"_detail";
        $(title).openContainer(target,speed,def);
    }




});
