    var xmlHttp = createXmlHttpRequestObject();
    var last_modified = "Thu, 01 Jun 1970 00:00:00 GMT";
function createXmlHttpRequestObject() {
    if( window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }else if( window.ActiveXObject) {
        try {
            xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
        }
        catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    if( !xmlHttp) {
        alert("Error creating the XMLHttpRequest object.");
    }
    return xmlHttp;
}
function change_ward3(pref_cd,pref_checked){
	var elem = document.form1.elements['pref_cd'];
    var elem_ward = document.form1.elements['ward_cd[]'];
	var default_pref_cd = document.form1.elements['default_pref_cd'].value;
    var count = elem.length;	// チェックボックスの数(pref)
    if("" != default_pref_cd && elem_ward != null){
        var count_w = elem_ward.length;    // チェックボックスの数(ward)
        for( i=0 ; i<count_w ; i++ ) {
            elem_ward[i].checked = false;
        }
        document.form1.elements['default_pref_cd'].value = "";
    }
    document.getElementById("default_pref").style.display = "none";
    if(pref_checked) { // checkがされている場合のみON・OFFを切り替える
	    for( i=0 ; i<count ; i++ ) {
	      	if (elem[i].value != pref_cd) {
	       		elem[i].checked = false; // ON・OFFを切り替え
	       	}
        }
        try {
            url = "/common/prefecture/job.html?pref_cd="+pref_cd;
            xmlHttp.open("GET", url , true);
            xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
            xmlHttp.onreadystatechange = change_ward_end3;
            xmlHttp.send(null);
        } catch (e) {
            alert("Can't connect to server !" + e.toString());
        }
    }
    else
    {
        document.getElementById("ward_area").innerHTML = "";
    }
}
function change_ward_end3() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        str = "";
        for( i=0; i<p.length; i++){
            ii = i + 1 ;    //OPTIONは2番目から表示
            var op_ward_name = p[i].ward_name;
            var op_ward_cd = p[i].ward_cd;
            if (op_ward_cd.length == 4) {
            	pref_cd = op_ward_cd.substring(0,1);
            } else {
            	pref_cd = op_ward_cd.substring(0,2);
            }
            str += "<li class='city02'><label name=" + op_ward_cd + "><input type='checkbox' name='ward_cd[]' value='" + op_ward_cd + "' id='ward_cd_{" + op_ward_cd + "}'></input>" + op_ward_name + "</label></li>";
        }
        document.getElementById('ward_area').innerHTML = str;
    }
}
function change_pref(){
     elem = document.form1.elements['area'];
     elemPref = document.form1.elements['pref_cd'];
     elemPref.options[elemPref.selectedIndex].selected = false;
     elemPref.length = 1;
     elemPref.options[0].value = "";
     elemPref.options[0].text = "都道府県を選択";
     try {
         var area = elem.value;
         url = "/common/prefecture/job.html?area="+area;
         xmlHttp.open("GET", url , true);
         xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
         xmlHttp.onreadystatechange = change_pref_end;
         xmlHttp.send(null);
     } catch (e) {
         alert("Can't connect to server !" + e.toString());
     }
}
function change_pref_end() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        var str;
        elem = document.form1.elements['pref_cd'];
        for( i=0; i<p.length; i++){
            ii = i + 1 ;    //OPTIONは2番目から表示
            var op_pref_name = p[i].pref_name;
            var op_pref_cd = p[i].pref_cd;
            if (op_pref_cd.length == 4) {
            	pref_cd = op_pref_cd.substring(0,1);
            } else {
            	pref_cd = op_pref_cd.substring(0,2);
            }
	        elem.length++;
	        elem.options[i+1].value = op_pref_cd;
	        elem.options[i+1].text = op_pref_name;
        }
    }
}
function change_ward4(){
	elem = document.form1.elements['pref_cd'];
	elemWard = document.form1.elements['ward_cd[]'];
	elemWard.options[elemWard.selectedIndex].selected = false;
	elemWard.length = 1;
	elemWard.options[0].value = "";
	elemWard.options[0].text = "市区町村を選択";
	try {
		var pref_cd = elem.value;
		url = "/common/prefecture/job.html?pref_cd="+pref_cd;
		xmlHttp.open("GET", url , true);
		xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
		xmlHttp.onreadystatechange = change_ward_end4;
		xmlHttp.send(null);
       } catch (e) {    
           alert("Can't connect to server !" + e.toString());
       } 
}
function change_ward_end4() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        str = "";
        elem = document.form1.elements['ward_cd[]'];
        for( i=0; i<p.length; i++){
            ii = i + 1 ;    //OPTIONは2番目から表示
            var op_ward_name = p[i].ward_name;
            var op_ward_cd = p[i].ward_cd;
            if (op_ward_cd.length == 4) {
            	pref_cd = op_ward_cd.substring(0,1);
            } else {
            	pref_cd = op_ward_cd.substring(0,2);
            }
	        elem.length++;
	        elem.options[i+1].value = op_ward_cd;
	        elem.options[i+1].text = op_ward_name;
        }
    }
}
function change_ward_end() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        var optionIndex0 = document.form1.ward_cd.options.length; //沿線のOPTION数取得
        for ( i=0 ; i <= optionIndex0 ; i++ ){
            document.form1.ward_cd.options[0]=null;
        } //沿線削除
    
        document.form1.ward_cd.options[0] = new Option("市区町村を選択",""); //駅OPTIONを空に
        if(p != null){
            document.form1.ward_cd.options[0] = new Option("市区町村を選択",""); //OPTION1番目はNull
            for( i=0; i<p.length; i++){
                ii = i + 1 ;    //OPTIONは2番目から表示
                var op_ward_name = p[i].ward_name;
                var op_ward_cd = p[i].ward_cd;
                
                document.form1.ward_cd.options[ii] = new Option(op_ward_name,op_ward_cd);
            }
        }
    }
}
function change_ward2(){
  try {
    var pref_cd = document.form2.pref_cd.value;
    url = "/common/prefecture/job.html?prefecture_cd="+pref_cd;
    xmlHttp.open("GET", url , true);
    xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
    xmlHttp.onreadystatechange = change_ward_end2;
    xmlHttp.send(null);
    } catch (e) {
       alert("Can't connect to server !" + e.toString());
    }
}
function change_ward_end2() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        var optionIndex0 = document.form2.ward_cd.options.length; //沿線のOPTION数取得
        for ( i=0 ; i <= optionIndex0 ; i++ ){
            document.form2.ward_cd.options[0]=null;
        } //沿線削除
        document.form2.ward_cd.options[0] = new Option("市区町村を選択",""); //駅OPTIONを空に
        if(p != null){
            document.form2.ward_cd.options[0] = new Option("市区町村を選択",""); //OPTION1番目はNull
            for( i=0; i<p.length; i++){
                ii = i + 1 ;    //OPTIONは2番目から表示
                var op_ward_name = p[i].ward_name;
                var op_ward_cd = p[i].ward_cd;
                document.form2.ward_cd.options[ii] = new Option(op_ward_name,op_ward_cd);
            }
        }
    }
}
/* エリアから探す ここまで*/
/* 駅・路線から探す ここから*/
function change_line(areatab, rr_name){
    elem = document.form1.elements['rr_name[]'];
    var count = elem.length;	// チェックボックスの数
    for( i=0 ; i<count ; i++ ) {
        if (elem[i].value != rr_name) {
            elem[i].checked = false; // ON・OFFを切り替え
        }
        if (elem[i].value == rr_name && elem[i].checked == false) {
            rr_name = null;
            areatab = null;
        }
    }
    document.getElementById("line_area").innerHTML = "";
    document.getElementById("station1_area").innerHTML = "";
    document.getElementById("station2_area").innerHTML = "";
    try {
        url = "/common/line/job.html?rr_name="+rr_name+"&areatab="+areatab;
        url = encodeURI(url);
        xmlHttp.open("GET", url , true);
        xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
        xmlHttp.onreadystatechange = change_line_end;
        xmlHttp.send(null);
    } catch (e) {
       alert("Can't connect to server !" + e.toString());
    }
}
function change_line_end() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        str = "";
        if(p != null){
            for( i=0; i<p.length; i++){
                ii = i + 1 ;    //OPTIONは2番目から表示
                var op_line_name = p[i].line_name;
                var op_line_cd = p[i].line_cd;
                str += "<label name=" + op_line_cd + "><input type='checkbox' name='line_cd' value='" + op_line_cd + "' id='line_cd_" + op_line_cd + "' onclick='javasctipt:change_station_g_cd(" + op_line_cd + ")' />&nbsp;&nbsp;<!--a href='/search/list/job.html?line_cd=" + op_line_cd + "'-->" + op_line_name + "<!--/a--></label><br />";
            }
        }
        document.getElementById("line_area").innerHTML = str;
    }
}
function change_line2(areatab){
    elem = document.form1.elements['rr_name[]'];
    var rr_name = elem.value;
    elemLine = document.form1.elements['line_cd'];
    elemLine.options[elemLine.selectedIndex].selected = false;
    elemLine.length = 1;
    elemLine.options[0].value = "";
    elemLine.options[0].text = "指定しない";
    elemLine.options[0].selected = true;
    elemStation1 = document.form1.elements['station_g_cd_1[]'];
    elemStation1.options[elemStation1.selectedIndex].selected = false;
    elemStation1.length = 1;
    elemStation1.options[0].value = "";
    elemStation1.options[0].text = "指定しない";
    elemStation1.options[0].selected = true;
    elemStation2 = document.form1.elements['station_g_cd_2[]'];
    elemStation2.options[elemStation2.selectedIndex].selected = false;
    elemStation2.length = 1;
    elemStation2.options[0].value = "";
    elemStation2.options[0].text = "指定しない";
    elemStation2.options[0].selected = true;
    if(rr_name) {
        try {
            url = "/common/line/job.html?rr_name="+rr_name+"&areatab="+areatab;
            url = encodeURI(url);
            xmlHttp.open("GET", url , false);
            xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
            xmlHttp.onreadystatechange = change_line_end2;
            xmlHttp.send(null);
        } catch (e) {
            alert("Can't connect to server !" + e.toString());
        }
    }
}
function change_line_end2() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        str = "";
        if(p != null){
	        elem = document.form1.elements['line_cd'];
            for( i=0; i<p.length; i++){
                ii = i + 1 ;    //OPTIONは2番目から表示
                var op_line_name = p[i].line_name;
                var op_line_cd = p[i].line_cd;
		        elem.length++;
		        elem.options[i+1].value = op_line_cd;
		        elem.options[i+1].text = op_line_name;
            }
        }
    }
}
function change_station_g_cd(line_cd){
    elem = document.form1.elements['line_cd'];
    var count = elem.length;	// チェックボックスの数
    for( i=0 ; i<count ; i++ ) {
        if (elem[i].value != line_cd) {
            elem[i].checked = false; // ON・OFFを切り替え
        }
        if (elem[i].value == line_cd && elem[i].checked == false) {
            line_cd = null;
        }
    }
    try {
        url = "/common/station/job.html?flg=2&line_cd="+line_cd;
        xmlHttp.open("GET", url , true);
        xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
        xmlHttp.onreadystatechange = change_station_g_cd_end;
        xmlHttp.send(null);
    } catch (e) {
        alert("Can't connect to server !" + e.toString());
    }
}
function change_station_g_cd_end() {
    document.getElementById("station1_area").innerHTML = "";
    document.getElementById("station2_area").innerHTML = "";
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        str1 = "";
        str2 = "";
        if(p != null){
            for( i=0; i<p.length; i++){
                ii = i + 1 ;    //OPTIONは2番目から表示
                var op_station_name = p[i].station_name;
                var op_station_g_cd = p[i].station_g_cd;
                str1 += "<label name=" + op_station_g_cd + "><input type='checkbox' name='station_g_cd_1[]' value='" + op_station_g_cd + "' id='station_g_cd_1_" + op_station_g_cd + "' onclick=\"javasctipt:clickStation('station_g_cd_1[]', " + op_station_g_cd + ")\" />&nbsp;&nbsp;<!--a href='/search/list/job.html?station_g_cd=" + op_station_g_cd + "'-->" + op_station_name + "<!--/a--></label><br />";
                str2 += "<label name=" + op_station_g_cd + "><input type='checkbox' name='station_g_cd_2[]' value='" + op_station_g_cd + "' id='station_g_cd_2_" + op_station_g_cd + "' onclick=\"javasctipt:clickStation('station_g_cd_2[]', " + op_station_g_cd + ")\" />&nbsp;&nbsp;<!--a href='/search/list/job.html?station_g_cd=" + op_station_g_cd + "'-->" + op_station_name + "<!--/a--></label><br />";
            }
        }
        document.getElementById("station1_area").innerHTML = str1;
        document.getElementById("station2_area").innerHTML = str2;
        document.getElementById("searchStationDotLine").style.display = "block";
        document.getElementById("searchStation1").style.display = "block";
        document.getElementById("searchStation2").style.display = "block";
    }
}
function change_station_g_cd2(){
    elem = document.form1.elements['line_cd'];
    var line_cd = elem.value;
    elemStation1 = document.form1.elements['station_g_cd_1[]'];
    elemStation1.options[elemStation1.selectedIndex].selected = false;
    elemStation1.length = 1;
    elemStation1.options[0].value = "";
    elemStation1.options[0].text = "指定しない";
    elemStation1.options[0].selected = true;
    elemStation2 = document.form1.elements['station_g_cd_2[]'];
    elemStation2.options[elemStation2.selectedIndex].selected = false;
    elemStation2.length = 1;
    elemStation2.options[0].value = "";
    elemStation2.options[0].text = "指定しない";
    elemStation2.options[0].selected = true;
    try {
        url = "/common/station/job.html?flg=2&line_cd="+line_cd;
        xmlHttp.open("GET", url , false);
        xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
        xmlHttp.onreadystatechange = change_station_g_cd_end2;
        xmlHttp.send(null);
    } catch (e) {
        alert("Can't connect to server !" + e.toString());
    }
}
function change_station_g_cd_end2() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        str1 = "";
        str2 = "";
        if(p != null){
	        elem1 = document.form1.elements['station_g_cd_1[]'];
	        elem2 = document.form1.elements['station_g_cd_2[]'];
            for( i=0; i<p.length; i++){
                ii = i + 1 ;    //OPTIONは2番目から表示
                var op_station_name = p[i].station_name;
                var op_station_g_cd = p[i].station_g_cd;
		        elem1.length++;
		        elem1.options[i+1].value = op_station_g_cd;
		        elem1.options[i+1].text = op_station_name;
		        elem2.length++;
		        elem2.options[i+1].value = op_station_g_cd;
		        elem2.options[i+1].text = op_station_name;
            }
        }
    }
}
function clickStation(form_name, station_g_cd){
    elem = document.form1.elements[form_name];
    var count = elem.length;	// チェックボックスの数
    for( i=0 ; i<count ; i++ ) {
        if (elem[i].value != station_g_cd) {
            elem[i].checked = false; // ON・OFFを切り替え
        }
    }
}
/* 駅・路線から探す ここまで*/
/* 職種から探す ここから*/
function change_business_type(){
    var optionIndex0 = document.form1.occupational_category.options.length; //OPTION数取得
    for ( i=0 ; i <= optionIndex0 ; i++ ){
        document.form1.occupational_category.options[0]=null;
    } //沿線削除
    document.form1.occupational_category.options[0] = new Option("職種詳細を選択",""); //OPTIONを空に
    var option0 = document.form1.business_type.options.length; //OPTION数取得
    for ( i=0 ; i <= option0 ; i++ ){
        document.form1.business_type.options[0]=null;
    } //沿線削除
    document.form1.business_type.options[0] = new Option("職種を選択",""); //OPTIONを空に
    try {
        var genre_cd = document.form1.genre_cd.value;
        url = "/common/business/job.html?genre_cd="+genre_cd;
        xmlHttp.open("GET", url , true);
        xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
        xmlHttp.onreadystatechange = change_business_type_end;
        xmlHttp.send(null);
    } catch (e) {
       alert("Can't connect to server !" + e.toString());
    }
}
function change_business_type_end() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        var optionIndex0 = document.form1.business_type.options.length; //沿線のOPTION数取得
        for ( i=0 ; i <= optionIndex0 ; i++ ){
            document.form1.business_type.options[0]=null;
        } //沿線削除
        document.form1.business_type.options[0] = new Option("職種を選択",""); //駅OPTIONを空に
        if(p != null){
            document.form1.business_type.options[0] = new Option("職種を選択",""); //OPTION1番目はNull
            for( i=0; i<p.length; i++){
                ii = i + 1 ;    //OPTIONは2番目から表示
                var op_business_name = p[i].business_name;
                var op_business_type = p[i].business_type;
                document.form1.business_type.options[ii] = new Option(op_business_name,op_business_type);
            }
        }
    }
}
function change_occupational_category(){
  try {
    var business_type = document.form1.business_type.value;
    url = "/common/occupational/job.html?flg=2&business_type="+business_type;
    xmlHttp.open("GET", url , true);
    xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
    xmlHttp.onreadystatechange = change_occupational_category_end;
    xmlHttp.send(null);
    } catch (e) {
       alert("Can't connect to server !" + e.toString());
    }
}
function change_occupational_category_end() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        var optionIndex0 = document.form1.occupational_category.options.length; //沿線のOPTION数取得
        for ( i=0 ; i <= optionIndex0 ; i++ ){
            document.form1.occupational_category.options[0]=null;
        } //沿線削除
        document.form1.occupational_category.options[0] = new Option("職種詳細を選択",""); //駅OPTIONを空に
        if(p != null){
            document.form1.occupational_category.options[0] = new Option("職種詳細を選択",""); //OPTION1番目はNull
            for( i=0; i<p.length; i++){
                ii = i + 1 ;    //OPTIONは2番目から表示
                var op_occupational_name = p[i].occupational_name;
                var op_occupational_cd = p[i].occupational_cd;
                
                document.form1.occupational_category.options[ii] = new Option(op_occupational_name,op_occupational_cd);
            }
        }
    }
}
/* 職種から探す ここまで*/
function changeBox(boxName){
    var areabox = document.getElementById('areaBox');
    var workbox = document.getElementById('workBox');
    var stationbox = document.getElementById('stationBox');
    var areabtn = document.getElementById("areaBtn");
    var jobbtn = document.getElementById("jobBtn");
    var stationbtn = document.getElementById("stationBtn");
    if(boxName == "area") {
        //フォーム
        areabox.style.display = "block";
        workbox.style.display = "none";
        stationbox.style.display = "none";
        areabtn.src = "/images/arbeit_btn_toparea_fix.gif";
        jobbtn.src = "/images/arbeit_btn_topjob_off.gif";
        stationbtn.src = "/images/arbeit_btn_topstation_off.gif";
        areabtn.style.cursor = "default";
        jobbtn.style.cursor = "pointer";
        stationbtn.style.cursor = "pointer";
    }else if(boxName == "work") {
        //フォーム
        areabox.style.display = "none";
        workbox.style.display = "block";
        stationbox.style.display = "none";
        areabtn.src = "/images/arbeit_btn_toparea_off.gif";
        jobbtn.src = "/images/arbeit_btn_topjob_fix.gif";
        stationbtn.src = "/images/arbeit_btn_topstation_off.gif";
        areabtn.style.cursor = "pointer";
        jobbtn.style.cursor = "default";
        stationbtn.style.cursor = "pointer";
    }else if(boxName == "station") {
        //フォーム
        areabox.style.display = "none";
        workbox.style.display = "none";
        stationbox.style.display = "block";
        areabtn.src = "/images/arbeit_btn_toparea_off.gif";
        jobbtn.src = "/images/arbeit_btn_topjob_off.gif";
        stationbtn.src = "/images/arbeit_btn_topstation_fix.gif";
        areabtn.style.cursor = "pointer";
        jobbtn.style.cursor = "pointer";
        stationbtn.style.cursor = "default";
    }
    smartRollover();
}
function showAddCondition(time) {
}
function hideAddCondition(time) {
}
function showBusinessTypeAd(time) {
    $('div#business_type_tmp').slideDown(time);
    $('div#business_type_show').hide();
    $('div#business_type_hide').show();
}
function hideBusinessTypeAd(time) {
    $('div#business_type_tmp').hide(time);
    $('div#business_type_hide').hide();
    $('div#business_type_show').show();
}
function showCond(time) {
    $('div#cond_tmp').slideDown(time);
    $('div#cond_hide').show();
    $('div#cond_show').hide();
}
function hideCond(time) {
    $('div#cond_tmp').hide(time);
    $('div#cond_hide').hide();
    $('div#cond_show').show();
}
function showSearchForm(time) {
    $('div#reSearch div#narrowingArea').slideDown(time);
    $('div.openNarrowingArea > a.btn_close_narrowing').show();
    $('div.openNarrowingArea > a.btn_open_narrowing').hide();
}
function hideSearchForm(time) {
    $('div#reSearch div#narrowingArea').hide(time);
    $('div.openNarrowingArea > a.btn_close_narrowing').hide();
    $('div.openNarrowingArea > a.btn_open_narrowing').show();
}
function searchCount(ward_string) {
  var query = '';
  var index;
  var i;
  var forms = document.form1;
  for (var i = 0; i < forms.length; i++) {
      var elem = forms.elements[i];
      if(elem.name == 'action_search_list') {
          continue;
      }
      if(elem.name == "occupational_category[]") {
          if (elem.checked == true) {
              query += '&' + elem.name + '=' + elem.value;
          }
      }
      else if(elem.name == "business_type_ad[]") {
          if (elem.checked == true) {
              query += '&' + elem.name + '=' + elem.value;
          }
      }
      else if(elem.name == "employment_type_search[]") {
          if (elem.checked == true) {
              query += '&' + elem.name + '=' + elem.value;
          }
      }
      else if(elem.name == "cond_type[]") {
          if (elem.checked == true) {
              query += '&' + elem.name + '=' + elem.value;
          }
      }
      else if(elem.name == "pref_cd") {
          if (elem.selectedIndex) {
             selectedValue = elem.options[elem.selectedIndex].value;
             if(selectedValue != "") {
                query += '&' + elem.name + '=' + elem.value;
             }
          }
      }
      else if(elem.name == "ward_cd[]") {
           if (elem.checked == true) {
             query += '&' + elem.name + '=' + elem.value;
          }
      }
      else {
          query += '&' + elem.name + '=' + elem.value;
      }
  }
  if(ward_string != null) {
      query += decodeURIComponent(ward_string);
  } else {
      var ward_area = document.getElementById("ward_area");
      if(ward_area != null) {
          query += ward_area.value;
      }
  }
  query = query.substring(1);
  query = encodeURI(query);
  $.ajaxSetup({cache: false });
  $.ajaxSetup({scriptCharset:'utf-8'});
  $.ajax({
    type: "GET",
    dataType: 'text',
    url: "/search/count/job.html",
    data: query,
    cache: false,
    error: function() {
    },
    success: function(msg){
      var strLength = msg.length;
      for(var i=0; i < strLength; i++) {
          var counterId = "cntJobNrwDetFig0" + (6 - i);
          document.getElementById(counterId).className = "c" + msg.charAt(i);
      }
    }
  });
}
function searchSubmit() {
    document.form1.submit();
}
/*
 * 初期処理
 */
$(function(){
    //画像url：検討中リストに追加済
    var imgAdded = '<img src="/images_rev/list_result/btnAddCsd_of.png" alt="この求人は検討リストに追加済みです" class="addlistBtn">';
    //「検討リストに入れる」ボタン
    $('a[id^="ad_save_button_"], a[id^="company_save_button_"]').each(function(i){
    }).click(function(e){
        //検討中リストに追加
        var elmId = $(this).attr('id');
        var dataId = elmId.substr(elmId.lastIndexOf("_") + 1);
        var target = $(this); //successコールバック内では$(this)はundefinedなので
        //リクエストURLセット
        var requestUrl;
        if (elmId.indexOf("ad") == 0) {
            //通常の求人
            requestUrl = "/common/adsave/job.html?ad_id=" + dataId;
        } else {
            //求人リクエスト案件
            requestUrl = "/common/companysave/job.html?company_id=" + dataId;
        }
        $.ajaxSetup({cache: false });
        $.ajaxSetup({scriptCharset:'utf-8'});
        $.ajax({
            type: "GET",
            dataType: 'text',
            url: requestUrl,
            cache: false,
            error: function() {
            },
            success: function(msg){
                //画像変更
                target.before(imgAdded);
                target.remove();
            }
        });
    });
});
function heafPramChange(pref_cd, ward_param, load_flg) {
    if(pref_cd != '' && ward_param) {
        document.getElementById('ward_popup').href = "/popup/ward/job.html?pref_cd=" + pref_cd + ward_param;
    } else if(pref_cd != ''){
        document.getElementById('ward_popup').href = "/popup/ward/job.html?pref_cd=" + pref_cd;
    } else {
        document.getElementById('ward_popup').href = "/popup/ward/job.html";
    }
    if(!load_flg && !ward_param) {
        document.getElementById('ward_select_list').innerHTML = "";
        document.getElementById('ward_select_list').className = "txt_close";
    }
}
function wardSelectEnd(ward_str) {
    var elem = document.getElementsByName('ward[]');
    var ward_cd = document.getElementById('ward_cd');
    var pref_cd = document.form1.pref_cd.value;
    var innerStr = '';
    var hiddenStr = '';
    var ward_param = '';
    var ward_strings = '';
    var w_value = '';
    var wards;
    wards = ward_str.split(",");
    if(0 < elem.length) {
        innerStr = '<label>';
        for(i=0;i<elem.length;i++) {
            if(elem[i].checked == true) {
                innerStr += wards[i] + ",";
                hiddenStr += "<input type='hidden' id='ward_cd' name='ward_cd[]' value="+elem[i].value+">";
                ward_param += '&ward[]=' + elem[i].value;
                ward_strings += '&ward_cd[]=' + elem[i].value;
            }
        }
        innerStr = innerStr.substring(0, innerStr.length - 1);
        innerStr += '</label>';
    }
    if(ward_param != '') {
        heafPramChange(pref_cd, ward_param, false);
        searchCount(ward_strings);
        document.getElementById('ward_select_list').innerHTML = innerStr + '<input type="hidden" id="ward_area" readonly="readonly" value="'+ward_strings+'"/>';
        document.getElementById('ward_select_list').className = "txt_open";
        document.getElementById('hidden_ward_cd').innerHTML = hiddenStr;
    } else {
        heafPramChange(pref_cd, null, false);
        searchCount();
        document.getElementById('ward_select_list').innerHTML = "";
        document.getElementById('hidden_ward_cd').innerHTML = "";
        document.getElementById('ward_select_list').className = "txt_close";
    }
}
function load_wradList(select_value, load_flg) {
    var pref_cd = document.form1.pref_cd.value
    var ward_param = '';
    var wards = null;
    if(select_value) {
        wards = select_value.split(",");
    }
    if(pref_cd && wards) {
        for(i=0;i<wards.length;i++) {
            if(wards[i] != '') {
                ward_param += '&ward[]=' + wards[i];
            }
        }
        heafPramChange(pref_cd, ward_param, load_flg);
    } else if(pref_cd) {
        heafPramChange(pref_cd, null, load_flg);
    } 
}
function ChDsp(id){
    var tabs = document.getElementById('tabMenu').getElementsByTagName('li');
    var pages = new Array('tab1','tab2','tab3','tab4','tab5','tab6','tab7');
    var num = id - 1 ;
    for(var i=0; i<pages.length; i++) {
        if(i == num) {
            document.getElementById(pages[num]).style.display = 'block';
            tabs[num].className = 'selected';
        }
        else{
            document.getElementById(pages[i]).style.display = 'none';
            tabs[i].className = null;
        }
    }    
}

