function SubCateObject( n, c ,s) {
	this.name = n;
	this.code = c;
	this.sub_code =s;
}


var cate_s = new Array();

cate_s[0] = new SubCateObject("回路・制御設計","electronics","circuit");
cate_s[1] = new SubCateObject("半導体設計","electronics","semiconductor");
cate_s[2] = new SubCateObject("光学機器設計","electronics","optical");
cate_s[3] = new SubCateObject("無線・通信機器設計","electronics","network");
cate_s[4] = new SubCateObject("生産・製造技術開発","electronics","manufacture");
cate_s[5] = new SubCateObject("生産管理/品質管理","electronics","management");
cate_s[6] = new SubCateObject("セールスエンジニア/FAE","electronics","fae");
cate_s[7] = new SubCateObject("基礎・応用研究/分析","electronics","randd");
cate_s[8] = new SubCateObject("その他電子・半導体技術者","electronics","other");
cate_s[9] = new SubCateObject("自動車・輸送機器-設計開発","machinery","automobile");
cate_s[10] = new SubCateObject("家電・PC-設計開発","machinery","computer");
cate_s[11] = new SubCateObject("機構・金型・その他機械-設計開発","machinery","sother");
cate_s[12] = new SubCateObject("生産・製造技術開発","machinery","manufacture");
cate_s[13] = new SubCateObject("生産管理/品質管理","machinery","management");
cate_s[14] = new SubCateObject("セールスエンジニア/FAE","machinery","fae");
cate_s[15] = new SubCateObject("CAD/CAMオペレーター","machinery","cad");
cate_s[16] = new SubCateObject("基礎・応用研究/分析","machinery","randd");
cate_s[17] = new SubCateObject("その他機械・自動車技術者","machinery","other");
cate_s[18] = new SubCateObject("製品開発","chemistry","product");
cate_s[19] = new SubCateObject("生産・製造技術開発","chemistry","manufacture");
cate_s[20] = new SubCateObject("生産管理/品質管理","chemistry","management");
cate_s[21] = new SubCateObject("セールスエンジニア/FAE","chemistry","fae");
cate_s[22] = new SubCateObject("基礎・応用研究/分析","chemistry","randd");
cate_s[23] = new SubCateObject("その他化学・化成品・素材技術者","chemistry","other");
cate_s[24] = new SubCateObject("設計・積算・測量","estate","survey");
cate_s[25] = new SubCateObject("施工管理","estate","construction");
cate_s[26] = new SubCateObject("設備保全/環境管理","estate","preserve");
cate_s[27] = new SubCateObject("不動産・店舗・立地開発","estate","lot");
cate_s[28] = new SubCateObject("プロパティ・アセットマネジメント","estate","property");
cate_s[29] = new SubCateObject("不動産鑑定/デューデリジェンス","estate","estimation");
cate_s[30] = new SubCateObject("CAD/CAMオペレーター","estate","cad");
cate_s[31] = new SubCateObject("その他建築・土木・不動産専門職","estate","other");
cate_s[32] = new SubCateObject("医薬品営業(MR/MS)","medical","mr");
cate_s[33] = new SubCateObject("医療・介護機器営業","medical","instrument");
cate_s[34] = new SubCateObject("創薬・治験・臨床開発","medical","clinical");
cate_s[35] = new SubCateObject("医療・介護機器-設計開発","medical","randd");
cate_s[36] = new SubCateObject("食品開発","medical","foods");
cate_s[37] = new SubCateObject("基礎・応用研究/分析","medical","research");
cate_s[38] = new SubCateObject("薬事申請","medical","pharmaceutical");
cate_s[39] = new SubCateObject("PMS/安全性情報担当","medical","pms");
cate_s[40] = new SubCateObject("学術・テクニカルサポート","medical","scientific");
cate_s[41] = new SubCateObject("生産管理/品質管理","medical","management");
cate_s[42] = new SubCateObject("医師/歯科医師/獣医師","medical","doctor");
cate_s[43] = new SubCateObject("看護師/助産師","medical","nurse");
cate_s[44] = new SubCateObject("管理薬剤師/薬剤師","medical","pharmacist");
cate_s[45] = new SubCateObject("介護福祉士/ケアマネージャー/ホームヘルパー","medical","care");
cate_s[46] = new SubCateObject("管理栄養士/栄養士","medical","dietitian");
cate_s[47] = new SubCateObject("理学療法士/作業療法士/言語聴覚士","medical","therapist");
cate_s[48] = new SubCateObject("臨床検査技士・臨床工学技士","medical","exam");
cate_s[49] = new SubCateObject("医療事務","medical","office");
cate_s[50] = new SubCateObject("その他医薬・医療/介護・福祉関連職","medical","other");
cate_s[51] = new SubCateObject("金融-法人営業","finance","corporation");
cate_s[52] = new SubCateObject("金融-リテール営業","finance","retail");
cate_s[53] = new SubCateObject("金融事務/バック・ミドルオフィス業務","finance","backmiddle");
cate_s[54] = new SubCateObject("アクチュアリー/金融商品開発","finance","actually");
cate_s[55] = new SubCateObject("投資銀行業務","finance","investment");
cate_s[56] = new SubCateObject("ファンドマネージャー","finance","fundmanager");
cate_s[57] = new SubCateObject("トレーダー/ディーラー","finance","trader");
cate_s[58] = new SubCateObject("アナリスト/エコノミスト/ストラテジスト","finance","analyist");
cate_s[59] = new SubCateObject("債権回収/サービシング","finance","obligation");
cate_s[60] = new SubCateObject("その他金融専門職","finance","other");
cate_s[61] = new SubCateObject("ソフトウェア/通信","sales","itnetwork");
cate_s[62] = new SubCateObject("電気/電子/半導体","sales","elesemi");
cate_s[63] = new SubCateObject("機械/自動車","sales","mechcar");
cate_s[64] = new SubCateObject("化学/化成品/素材","sales","chemistry");
cate_s[65] = new SubCateObject("住宅/不動産","sales","realestate");
cate_s[66] = new SubCateObject("建築/土木/環境設備","sales","construction");
cate_s[67] = new SubCateObject("食品","sales","foods");
cate_s[68] = new SubCateObject("サービス","sales","service");
cate_s[69] = new SubCateObject("インターネット/広告/PR","sales","advertise");
cate_s[70] = new SubCateObject("人材/教育","sales","human");
cate_s[71] = new SubCateObject("営業マネージャー・管理職","sales","salesmanager");
cate_s[72] = new SubCateObject("代理店営業/ルートセールス","sales","agency");
cate_s[73] = new SubCateObject("内勤営業/カウンターセールス","sales","telesales");
cate_s[74] = new SubCateObject("海外営業","sales","oversea");
cate_s[75] = new SubCateObject("その他営業関連職","sales","other");
cate_s[76] = new SubCateObject("店舗・エリア管理/スーパーバイザー","service","storemanage");
cate_s[77] = new SubCateObject("店長/店長候補","service","manager");
cate_s[78] = new SubCateObject("販売・接客","service","sales");
cate_s[79] = new SubCateObject("調理師/調理スタッフ","service","cook");
cate_s[80] = new SubCateObject("小売/外食/アミューズメント","service","retail");
cate_s[81] = new SubCateObject("アパレル/ファッション","service","fashion");
cate_s[82] = new SubCateObject("交通/運輸/倉庫","service","transport");
cate_s[83] = new SubCateObject("教育/インストラクター","service","school");
cate_s[84] = new SubCateObject("旅行/ホテル/ブライダル","service","travel");
cate_s[85] = new SubCateObject("理容/美容/エステ","service","beauty");
cate_s[86] = new SubCateObject("警備/清掃/設備管理","service","security");
cate_s[87] = new SubCateObject("通訳/翻訳/テクニカルライター","service","interpret");
cate_s[88] = new SubCateObject("カウンセラー/アドバイザー","service","counselor");
cate_s[89] = new SubCateObject("その他サービス/販売/フード関連職","service","other");
cate_s[90] = new SubCateObject("経営企画/事業企画/CXO","marketing","strategy");
cate_s[91] = new SubCateObject("販売促進企画/営業企画","marketing","sales");
cate_s[92] = new SubCateObject("商品・サービス・ブランド企画","marketing","product");
cate_s[93] = new SubCateObject("広告宣伝","marketing","advertisement");
cate_s[94] = new SubCateObject("リサーチ/分析","marketing","research");
cate_s[95] = new SubCateObject("バイヤー/マーチャンダイザー","marketing","buyer");
cate_s[96] = new SubCateObject("カスタマーサポート/コールセンター","marketing","callcenter");
cate_s[97] = new SubCateObject("その他企画/マーケティング関連職","marketing","other");
cate_s[98] = new SubCateObject("経理/財務/税務/監査","backoffice","accounting");
cate_s[99] = new SubCateObject("法務","backoffice","law");
cate_s[100] = new SubCateObject("特許/知的財産","backoffice","patent");
cate_s[101] = new SubCateObject("総務/株式公開総務","backoffice","general");
cate_s[102] = new SubCateObject("人事/労務/採用/教育","backoffice","personnel");
cate_s[103] = new SubCateObject("広報/IR","backoffice","public");
cate_s[104] = new SubCateObject("物流/購買/貿易","backoffice","physical");
cate_s[105] = new SubCateObject("生産管理/品質管理","backoffice","management");
cate_s[106] = new SubCateObject("海外拠点管理・支援","backoffice","oversea");
cate_s[107] = new SubCateObject("秘書/セクレタリー","backoffice","secretary");
cate_s[108] = new SubCateObject("一般事務/営業事務/貿易事務","backoffice","office");
cate_s[109] = new SubCateObject("学校事務/特許事務","backoffice","financial");
cate_s[110] = new SubCateObject("受付","backoffice","assistant");
cate_s[111] = new SubCateObject("その他管理部門専門職/事務","backoffice","other");
cate_s[112] = new SubCateObject("Webプロデューサー・ディレクター","creative","webdirector");
cate_s[113] = new SubCateObject("Webデザイナー/コンテンツ企画","creative","webcreator");
cate_s[114] = new SubCateObject("広告デザイン/コピーライター","creative","advertisement");
cate_s[115] = new SubCateObject("ゲーム・CGクリエイター","creative","game");
cate_s[116] = new SubCateObject("パタンナー/ファッションデザイナー","creative","fashion");
cate_s[117] = new SubCateObject("インテリア・工業デザイナー","creative","interior");
cate_s[118] = new SubCateObject("出版/印刷/DTP/編集","creative","publish");
cate_s[119] = new SubCateObject("映像/音響/イベント/芸能","creative","television");
cate_s[120] = new SubCateObject("新聞・通信記者","creative","newspaper");
cate_s[121] = new SubCateObject("その他クリエイター/デザイナー","creative","other");
cate_s[122] = new SubCateObject("経営戦略・ビジネスコンサルタント","consultant","strategy");
cate_s[123] = new SubCateObject("IT・システムコンサルタント","consultant","ebusiness");
cate_s[124] = new SubCateObject("ERP・CRM・SCM導入コンサルタント","consultant","itpackage");
cate_s[125] = new SubCateObject("金融/企業再生/リスクマネジメント","consultant","financial");
cate_s[126] = new SubCateObject("財務/税務/会計コンサルタント","consultant","accounting");
cate_s[127] = new SubCateObject("組織開発・人事コンサルタント","consultant","organization");
cate_s[128] = new SubCateObject("マーケティングコンサルタント","consultant","marketing");
cate_s[129] = new SubCateObject("リサーチャー/研究員","consultant","research");
cate_s[130] = new SubCateObject("その他コンサルタント","consultant","other");
cate_s[131] = new SubCateObject("公認会計士/税理士","specialist","cpa");
cate_s[132] = new SubCateObject("弁理士/特許技術者","specialist","patent");
cate_s[133] = new SubCateObject("司法書士/行政書士","specialist","scrivener");
cate_s[134] = new SubCateObject("弁護士","specialist","lawyer");
cate_s[135] = new SubCateObject("その他会計・法律専門職","specialist","other");
cate_s[136] = new SubCateObject("オープン系システム開発","software","open");
cate_s[137] = new SubCateObject("Webサイト・アプリ開発","software","web");
cate_s[138] = new SubCateObject("モバイルサイト・アプリ開発","software","mobile");
cate_s[139] = new SubCateObject("汎用機系システム開発","software","general");
cate_s[140] = new SubCateObject("データベース設計・開発","software","database");
cate_s[141] = new SubCateObject("制御・ファームウェア・組込系システム開発","software","control");
cate_s[142] = new SubCateObject("プロジェクトマネージャー","software","pmpl");
cate_s[143] = new SubCateObject("プリセールス/セールスエンジニア","software","consuls");
cate_s[144] = new SubCateObject("OS・パッケージソフト開発","software","package");
cate_s[145] = new SubCateObject("ローカライズ・テストエンジニア","software","localize");
cate_s[146] = new SubCateObject("社内システム企画・社内SE","software","sis");
cate_s[147] = new SubCateObject("ヘルプデスク/テクニカルサポート","software","support");
cate_s[148] = new SubCateObject("その他ソフトウェア関連技術者","software","other");
cate_s[149] = new SubCateObject("ネットワーク設計・構築","network","network");
cate_s[150] = new SubCateObject("ネットワーク運用・監視","network","operation");
cate_s[151] = new SubCateObject("通信技術開発","network","randd");
cate_s[152] = new SubCateObject("サーバー設計・構築・運用","network","server");
cate_s[153] = new SubCateObject("プロジェクトマネージャー","network","pm");
cate_s[154] = new SubCateObject("プリセールス/セールスエンジニア","network","presales");
cate_s[155] = new SubCateObject("ヘルプデスク/テクニカルサポート","network","support");
cate_s[156] = new SubCateObject("ネットワークコンサルタント","network","consuls");
cate_s[157] = new SubCateObject("その他通信・ネットワーク関連技術者","network","other");

function SetSubCate(cat){
	$("select[name='data[jkm][jt]']").children().remove();
	$("select[name='data[jkm][jt]']").append('<option value="">&lt;職種を指定する&gt;</option>');
	if(cat==""){
		$("select[name='data[jkm][jt]']").attr('disabled','disabled');
	}
	for (var i = 0; i < cate_s.length; i++){
		if(cate_s[i].code ==cat){
			$("select[name='data[jkm][jt]']").append('<option value="'+cate_s[i].sub_code+'">'+ cate_s[i].name +'</option>');
		}
	}
}

function SetCareerSubCate(cat,tgt){
	$(tgt).children().remove();
	$(tgt).append('<option value="">&lt;職種を指定する&gt;</option>');
	if(cat==""){
		$(tgt).attr('disabled','disabled');
	}
	for (var i = 0; i < cate_s.length; i++){
		if(cate_s[i].code ==cat){
			$(tgt).append('<option value="'+cate_s[i].sub_code+'">'+ cate_s[i].name +'</option>');
		}
	}
}

function changeCareerJobType(tgt){
	var tgt_nm = $(tgt).attr("name");
	var tgt_jt = tgt_nm.substr(tgt_nm.lastIndexOf("[jc]")-2,1);
	var jt = tgt.closest("table.sc_career_inside").find("select[name$='"+tgt_jt+"][jt]']");
	$(jt).val($(tgt).children(':selected').val());
	if($(tgt).children(':selected').val()!=""){
		$(jt).removeAttr('disabled');
	}
	SetCareerSubCate(tgt.children(':selected').val(),$(jt));
}

$(function(){
	function changeJobType(){
		$("select[name='data[jkm][jt]']").val($(this).children(':selected').val());
		
		if($("select[name='data[jkm][jc]']").children(':selected').val()!=""){
			$("select[name='data[jkm][jt]']").removeAttr('disabled');
		}
		SetSubCate($("select[name='data[jkm][jc]']").children(':selected').val());
	}
	if($("select[name='data[jkm][jc]']").children(':selected').val()==""){
		$("select[name='data[jkm][jt]']").attr('disabled','disabled');
	}
	
	$("select[name='data[jkm][jc]']").change(function(){
		changeJobType();
	})
	
	
	//キャリアサーチの職種小の初期設定
	$("#si_career_jobs select[name$='[jt]'], #si_career_jobs2 select[name$='[jt]']").each(function(){
		if($(this).children(':selected').val()==""){
			$(this).attr('disabled','disabled');
		}
	})
	
	$("#si_career_jobs select[name$='[jc]'], #si_career_jobs2 select[name$='[jc]']").change(function(){
		changeCareerJobType($(this));
	})
	
})

/**
 * 県オブジェクト
 * @param {Object} n
 * @param {Object} a
 * @param {Object} p
 */
function PrefObject( n, a ,p) {
	this.name = n;
	this.a_code = a;
	this.p_code =p;
}

var pref=new Array();

pref[0] = new PrefObject("北海道","hokkaidotohoku","hokkaidou");
pref[1] = new PrefObject("青森県","hokkaidotohoku","aomori");
pref[2] = new PrefObject("岩手県","hokkaidotohoku","iwate");
pref[3] = new PrefObject("宮城県","hokkaidotohoku","miyagi");
pref[4] = new PrefObject("秋田県","hokkaidotohoku","akita");
pref[5] = new PrefObject("山形県","hokkaidotohoku","yamagata");
pref[6] = new PrefObject("福島県","hokkaidotohoku","fukushima");
pref[7] = new PrefObject("茨城県","kanto","ibaraki");
pref[8] = new PrefObject("栃木県","kanto","tochigi");
pref[9] = new PrefObject("群馬県","kanto","gunma");
pref[10] = new PrefObject("埼玉県","kanto","saitama");
pref[11] = new PrefObject("千葉県","kanto","chiba");
pref[12] = new PrefObject("東京都","kanto","tokyo");
pref[13] = new PrefObject("神奈川県","kanto","kanagawa");
pref[14] = new PrefObject("新潟県","hokushinetu","niigata");
pref[15] = new PrefObject("富山県","hokushinetu","toyama");
pref[16] = new PrefObject("石川県","hokushinetu","ishikawa");
pref[17] = new PrefObject("福井県","hokushinetu","fukui");
pref[18] = new PrefObject("山梨県","hokushinetu","yamanashi");
pref[19] = new PrefObject("長野県","hokushinetu","nagano");
pref[20] = new PrefObject("岐阜県","toukai","gifu");
pref[21] = new PrefObject("静岡県","toukai","shizuoka");
pref[22] = new PrefObject("愛知県","toukai","aichi");
pref[23] = new PrefObject("三重県","toukai","mie");
pref[24] = new PrefObject("滋賀県","kansai","shiga");
pref[25] = new PrefObject("京都府","kansai","kyoto");
pref[26] = new PrefObject("大阪府","kansai","osaka");
pref[27] = new PrefObject("兵庫県","kansai","hyogo");
pref[28] = new PrefObject("奈良県","kansai","nara");
pref[29] = new PrefObject("和歌山県","kansai","wakayama");
pref[30] = new PrefObject("鳥取県","nisinippon","tottori");
pref[31] = new PrefObject("島根県","nisinippon","shimane");
pref[32] = new PrefObject("岡山県","nisinippon","okayama");
pref[33] = new PrefObject("広島県","nisinippon","hiroshima");
pref[34] = new PrefObject("山口県","nisinippon","yamaguchi");
pref[35] = new PrefObject("徳島県","nisinippon","tokushima");
pref[36] = new PrefObject("香川県","nisinippon","kagawa");
pref[37] = new PrefObject("愛媛県","nisinippon","ehime");
pref[38] = new PrefObject("高知県","nisinippon","kochi");
pref[39] = new PrefObject("福岡県","nisinippon","fukuoka");
pref[40] = new PrefObject("佐賀県","nisinippon","saga");
pref[41] = new PrefObject("長崎県","nisinippon","nagasaki");
pref[42] = new PrefObject("熊本県","nisinippon","kumamoto");
pref[43] = new PrefObject("大分県","nisinippon","oita");
pref[44] = new PrefObject("宮崎県","nisinippon","miyazaki");
pref[45] = new PrefObject("鹿児島県","nisinippon","kagoshima");
pref[46] = new PrefObject("沖縄県","nisinippon","okinawa");
pref[47] = new PrefObject("全国","","all");
pref[48] = new PrefObject("海外","oversea","foreign");
pref[49] = new PrefObject("その他","oversea","etc");
