/*   street.js  */
    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_area(form_name) {

    var area;
    if(document.forms[form_name].elements['area'] != null){
        area = document.forms[form_name].elements['area'].value;
    }
    if(area) {
        document.forms[form_name].elements["areatab"].value = area;
    }
    if(document.forms[form_name].elements["areatab"].value == ""){
        document.forms[form_name].elements["areatab"].value = "kanto";
    }
}

function change_rr_area() {
    var rr_name = encodeURIComponent(document.form1.rr_name.value);
    var line_cd = document.form1.line_cd.value;
    try {
        url = "/common/rrarea/job.html?rr_name="+rr_name+"&line_cd="+line_cd;
        xmlHttp.open("GET", url , true);
        xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
        xmlHttp.onreadystatechange = change_rr_area_end;
        xmlHttp.send(null);
    } catch (e) {
       alert("Can't connect to server !" + e.toString());
    }
}
function change_rr_area_end() {
    setInterval("timeoutError()",60000);
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        var p = eval("("+xmlHttp.responseText+")");
        if(p != null){
            var area = p[0].area_name;
            //document.form1.action = "/" + area + "/index.html";
            document.form1.action = "/" + area + "/index.htm";
        }
    }
}


/* エリアから探す ここから*/
function change_pref(){
    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を空に

    var option0 = document.form1.pref_cd.options.length; //OPTION数取得
    for ( i=0 ; i <= option0 ; i++ ){
        document.form1.pref_cd.options[0]=null;
    }                                  
    document.form1.pref_cd.options[0] = new Option("都道府県を選択",""); //OPTIONを空に

    try {
        var area = document.form1.area.value;
        if(area == ""){return null;}
        url = "/common/area/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_pref2(){
  try {
    var area = document.form2.area.value;
    url = "/common/area/job.html?area="+area;
    xmlHttp.open("GET", url , true);
    xmlHttp.setRequestHeader("If-Modified-Since",last_modified);
    xmlHttp.onreadystatechange = change_pref_end2;
    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 optionIndex0 = document.form1.pref_cd.options.length; //沿線のOPTION数取得

        for ( i=0 ; i <= optionIndex0 ; i++ ){
            document.form1.pref_cd.options[0]=null;
        } //沿線削除
    
        document.form1.pref_cd.options[0] = new Option("都道府県を選択",""); //駅OPTIONを空に

        if(p != null){
            document.form1.pref_cd.options[0] = new Option("都道府県を選択",""); //OPTION1番目はNull
            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;
                
                document.form1.pref_cd.options[ii] = new Option(op_pref_name,op_pref_cd);
            }
        }
    }

}
function change_pref_end2() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        var optionIndex0 = document.form2.pref_cd.options.length;

        for ( i=0 ; i <= optionIndex0 ; i++ ){
            document.form2.pref_cd.options[0]=null;
        } //沿線削除
    
        document.form2.pref_cd.options[0] = new Option("都道府県を選択",""); //駅OPTIONを空に

        if(p != null){
            document.form2.pref_cd.options[0] = new Option("都道府県を選択",""); //OPTION1番目はNull
            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;
                
                document.form2.pref_cd.options[ii] = new Option(op_pref_name,op_pref_cd);
            }
        }
    }
}
function change_ward(){
  try {
    var pref_cd = document.form1.pref_cd.value;

    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を空に

    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_end;
    xmlHttp.send(null);
    } catch (e) {
       alert("Can't connect to server !" + e.toString());
    }
}

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){
    var optionIndex0 = document.form1.station_g_cd.options.length; //沿線のOPTION数取得
    for ( i=0 ; i <= optionIndex0 ; i++ ){
        document.form1.station_g_cd.options[0]=null;
    } //沿線削除
    document.form1.station_g_cd.options[0] = new Option("駅を選択",""); //駅OPTIONを空に

    if(document.form1.station_g_cd_2) {
        var optionIndex0 = document.form1.station_g_cd_2.options.length; //沿線のOPTION数取得
        for ( i=0 ; i <= optionIndex0 ; i++ ){
            document.form1.station_g_cd_2.options[0]=null;
        } //沿線削除
        document.form1.station_g_cd_2.options[0] = new Option("駅を選択",""); //駅OPTIONを空に
    }
    var option0 = document.form1.line_cd.options.length; //沿線のOPTION数取得
    for ( i=0 ; i <= option0 ; i++ ){
        document.form1.line_cd.options[0]=null;
    } //沿線削除
    document.form1.line_cd.options[0] = new Option("路線を選択",""); //駅OPTIONを空に
    try {
        var rr_name = encodeURIComponent(document.form1.rr_name.value);
        url = "/common/line/job.html?rr_name="+rr_name+"&areatab="+areatab;
        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+")");
        var optionIndex0 = document.form1.line_cd.options.length; //沿線のOPTION数取得

        for ( i=0 ; i <= optionIndex0 ; i++ ){
            document.form1.line_cd.options[0]=null;
        } //沿線削除
    
        document.form1.line_cd.options[0] = new Option("路線を選択",""); //駅OPTIONを空に

        if(p != null){
            document.form1.line_cd.options[0] = new Option("路線を選択",""); //OPTION1番目は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;
                document.form1.line_cd.options[ii] = new Option(op_line_name,op_line_cd);
            }
        }
    }

}

function change_station_g_cd(){
  try {
    var line_cd = document.form1.line_cd.value;
    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() {
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
        var optionIndex0 = document.form1.station_g_cd.options.length; //沿線のOPTION数取得

        for ( i=0 ; i <= optionIndex0 ; i++ ){
            document.form1.station_g_cd.options[0]=null;
        } //沿線削除
        document.form1.station_g_cd.options[0] = new Option("駅を選択",""); //駅OPTIONを空に
        if(p != null){
            document.form1.station_g_cd.options[0] = new Option("駅を選択",""); //OPTION1番目は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;
                
                document.form1.station_g_cd.options[ii] = new Option(op_station_name,op_station_g_cd);
            }
        }
        if (document.form1.station_g_cd_2) {
            var optionIndex = document.form1.station_g_cd_2.options.length; //沿線のOPTION数取得                      
            for ( i=0 ; i <= optionIndex ; i++ ){
                document.form1.station_g_cd_2.options[0]=null;
            }
            document.form1.station_g_cd_2.options[0] = new Option("駅を選択",""); //駅OPTIONを空に
            if(p != null){
                document.form1.station_g_cd_2.options[0] = new Option("駅を選択",""); //OPTION1番目は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;
                    document.form1.station_g_cd_2.options[ii] = new Option(op_station_name,op_station_g_cd);
                }   
            }
        }
    }

}
/* 駅・路線から探す ここまで*/
/* 職種から探す ここから*/
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();
}

window.onload=function() {
    check_ad_save();
}

$(document).ready(function() {
  $.ajaxSetup({cache: false });
  $.ajaxSetup({scriptCharset:'utf-8'});
  $.ajax({
    type: "GET",
    dataType: 'text',
    url: "/common/footprint/job.html",
    cache: false,
    error: function() {},
    success: function(msg){
        if(msg != null && msg != ""){
	        var ad_data = eval("("+msg+")");
	        var cnt = ad_data.length;
	        var urlhome = "/";
            for(var i=0; i < cnt; i++){
	            if (ad_data[i]['photo'] != undefined) {
	                $("#footprint" + i).html("<span class=\"photoFrame\"><a href=\"" + urlhome  + ad_data[i].id  + ".htm\"><img src=\"" + ad_data[i]['photo'][1].filename.replace(/\..*$|\..*$/, "_arbeit_03.jpg") + "\" alt=\"" + ad_data[i].store + "\" /></a></span><br><a href=\"" + urlhome + ad_data[i].id  + ".htm\">" + ad_data[i].store + "</a>");
	            }
            }
        }
    }
  });
});



function searchCount() {


  if (typeof document.getElementById('urge').textContent != "undefined") {
      document.getElementById('urge').textContent = "＜＜再検索後に変更した条件が一覧に反映されます";
  } else {
      document.getElementById('urge').innerText = "＜＜再検索後に変更した条件が一覧に反映されます";
  }

  var query = '';
  var index;
  var i;
  var forms = document.form1;
  var school_query = '';
  var special_query = '';
  for (var i = 0; i < forms.length; i++) {
      var elem = forms.elements[i];
      if(elem.name == 'action_search_list') {
          continue;
      }
      if(elem.name == "ad_searching_item_1[]" || elem.name == "ad_searching_item_4[]") {
          var index = elem.length;
          for(j=0;j<index;j++) {
              if(elem.options[j].selected){
                  query += '&' + elem.name + '=' + elem.options[j].value;
              }
          }
      }else if(elem.name == "haken_deny_flg") {
          if(elem.checked) {
              query += '&' + elem.name + '=' + elem.value;
          }
      }else if(elem.name == "newly_arrived[]") {
          if(elem.checked) {
              query += '&' + elem.name + '=' + elem.value;
          }
      }else if(elem.name == "use_school" || elem.name == "school_id" || elem.name == "campus_id" ) {
          school_query += '&' + elem.name + '=' + elem.value;
          if(elem.name == "use_school" && elem.checked == false){
              school_query = '';
          }
      }else if(elem.name == "use_special" || elem.name == "special" ) {
          special_query += '&' + elem.name + '=' + elem.value;
          if(elem.name == "use_special" && elem.checked == false){
              special_query = '';
          }
      } else {
          query += '&' + elem.name + '=' + elem.value;
      }
  }
  query += school_query;
  query += special_query;
  query = query.substring(1);
  $.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 = "counter" + (i+1);
          document.getElementById(counterId).src = "/commons/matchnum/arbeit_" + msg.charAt(i) + ".gif?" + +(new Date()).getTime();
          document.getElementById(counterId).alt = msg.charAt(i);
          document.getElementById(counterId).width = "36";
          document.getElementById(counterId).height = "54";
      }
      
      //カウンターをリセットしておく
      count = 0;
      countval0 = msg.charAt(1);
  }
  });
}
var count = 0;
var countval0 =0;
function Imageresize(){

       count++;
       if(count < 6){
          return null;
       }else if(count == 6){
          document.getElementById("counter1").src = "/commons/matchnum/arbeit_"+countval0+".gif?" + +(new Date()).getTime();
          return null;
       }
       _sleep(200);
       for(var i=0; i < 6; i++) {
          var counterId = "counter" + (i+1);
          document.getElementById(counterId).width = "24";
          document.getElementById(counterId).height = "36";
      }
      count = 0;
}

function _sleep(time){
var d1 = new Date().getTime();
var d2 = new Date().getTime();
while( d2 < d1 + time ){
d2=new Date().getTime();
}
}

function changeJobTime(imgId,num){
  var jobTime = document.getElementById(imgId);
  var now_src = jobTime.getAttribute("src");
  if(now_src.match("_color.")){
    jobTime.src = now_src.replace("_color.", "_gray.");
    document.form1["working_hours_for_search_" + num].value = "";
  }else{
    jobTime.src = now_src.replace("_gray.", "_color.");
    document.form1["working_hours_for_search_" + num].value = "1";
  }
  return false;
}

function limitChange(obj){
  var element = document.createElement('input');
  element.type = 'hidden';
  element.name = 'display_count';
  element.value = obj.value;
  var objform = document.getElementsByName("form1").item(0); 
  objform.appendChild(element);  
  
  document.form1.submit();
}

function orderChange(order_type){
  var element = document.createElement('input');
  element.type = 'hidden';
  element.name = 'orderby';
  element.value = order_type;
  var objform = document.getElementsByName("form1").item(0); 
  objform.appendChild(element);  
  
  document.form1.submit();
}

function check_ad_save(){
    var adSaves;
    url = "/common/checkadsave/job.html";
    $.ajaxSetup({cache: false });
    $.ajaxSetup({scriptCharset:'utf-8'});
    $.ajax({
    type: "GET",
    dataType: 'text',
    url: url,
    cache: false,
    error: function() {},
    success: function(data){
                adSaves  = eval("("+data+")");
                if(adSaves) {
                    for( i = 0 ; i < adSaves.length; i++) {
                        save = document.getElementById("save_btn"+adSaves[i]);
                        if(save) {
                            save.innerHTML = '';
                        }
                    }
                }
             }
       });

}


function ad_save(ad_id){
    url = "/common/adsave/job.html?ad_id=" + ad_id;
    $.ajaxSetup({cache: false });
    $.ajaxSetup({scriptCharset:'utf-8'});
    $.ajax({
    type: "GET",
    dataType: 'text',
    url: url,
    cache: false,
    error: function() {},
    success: function(msg){
       var save = document.getElementById("save_btn"+msg);
       save.innerHTML = '';
       }
       });
}

function ad_save_end(ad_id){
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        p = eval("("+xmlHttp.responseText+")");
    }
    save = document.getElementById("save_btn"+ad_id);
    save.innerHTML = '';
}

function form_save(areatab){
    var forms = document.form1;
    var array = [];
    for (var i = 0; i < forms.length; i++) {
        var elem = forms.elements[i];
        if(elem.name == "sticks_search_1[]" || elem.name == "sticks_search_2[]" || elem.name == "sticks_search_3[]" || elem.name == "sticks_search_4[]") {
            var index = elem.length;
            for(j=0;j<index;j++) {
                if(elem.options[j].selected){
                    array.push(elem.name + '=' + elem.options[j].value);
                }
            }
        }else if(elem.name == "haken_deny_flg") {
            if(elem.checked) {
                array.push(elem.name + '=' + elem.value);
            }
        } else {
            array.push(elem.name + '=' + elem.value);
        }
    }
    array.push('areatab='+areatab);

    try {
        url = "/common/formsave/job.html?cond_array=" + encodeURIComponent(array);
        $.ajaxSetup({cache: false });
        $.ajaxSetup({scriptCharset:'utf-8'});
        $.ajax({
            type: "GET",
            dataType: 'text',
            url: url,
            cache: false,
            error: function() {},
            success: function(){}
        });
        alert("検索条件を保存しました。\n\n保存した条件での検索は画面上部の\n検索履歴からご利用になれます。", 3);
    } catch (e) {
        alert("検索条件が保存できませんでした。\nもう一度保存ボタンを押してください。" + e.toString());
    }
}

function rankSubmit(){
    var obj = document.form1;
    var elm = document.createElement('input');
    elm.type= 'hidden';
    elm.name = 'action_pickup_ranking';
    elm.value = true;
    obj.appendChild(elm); 
    document.form1.action_search_list.value = false;
    document.form1.action="/pickup/ranking/job.html";
    document.form1.method="post";
//    document.form1.encoding="plain/text"; 
    document.form1.submit();
}

$(document).ready(function() {
    try {
    for(var i = 0; i < 100; i++){
        $('#photo'+i).loopedSlider(
			{containerClick: false}
		);
    }
    }catch (e){
    }

});

