//πυ

	// Zbg{^ 2010/07/14 S.Yamaguchi
     function btnReset() {
         document.fmNewIndex.selKen.selectedIndex = 0;
         document.fmNewIndex.Bosyu.selectedIndex = 0;
         document.fmNewIndex.Koyou.selectedIndex = 0;
         document.fmNewIndex.Yakin[0].checked = true;
         document.fmNewIndex.Gyousyu.selectedIndex = 0;

         // υΪΗΑ 2010/09/02 H.Nagafuku
         document.fmNewIndex.Hospital.value = "";
         document.fmNewIndex.HospitalV.value = "";
         document.fmNewIndex.Takujisyo[0].checked = true;

         selKenChange(document.fmNewIndex.selKen);
     }

	// υ{^ 2010/08/31 H.Nagafuku
     function btnSubmit() {

         //Ά»―Ξτ 2010/09/01 S.Yamaguchi
         var char1 = "\\\\\\\\\\\\\\\\\\\\\\\\\\\ΰ\α\β\γ\δ\ε\ζ\η\θ\ι\κ\ϊxϋx";
         var hospital = document.fmNewIndex.HospitalV.value;
         
         hospital2 = '';          
         for (i = 0; i < hospital.length; i++) {
            s = hospital.charAt(i);
            for (j = 0; j < char1.length; j++) {
                if (s == char1.charAt(j)) {
                    s = s + '\\';
                }
            }
            hospital2 = hospital2 + s;
         }
         document.fmNewIndex.Hospital.value = hospital2;
         
         document.charset = 'Shift_JIS';

         switch(document.fmNewIndex.Koyou.value) {    // εWEν
             case '10':      // h­i[X
                 location.href="http://www.nursepower.co.jp/haken_new.htm";
                 break;
             case '11':      // ssZϊi[X
                 location.href="http://www.nursepower.co.jp/city_search.htm";
                 break;
             case '12':      // «κZϊi[X
                 location.href="http://www.nursepower.co.jp/cgi-bin/sel_kango_o.cgi";
                 break;
             case '13':      // £Zϊi[X
                 location.href="http://www.nursepower.co.jp/cgi-bin/sel_kango_r.cgi";
                 break;
             default:        // νΞAρνΞAϊΞp[gAιΞp[g
                 document.fmNewIndex.action="http://www.nursepower.co.jp/cgi-bin/sel_kango2.cgi"; 
                 document.fmNewIndex.submit(); 
         }
     }

	// υ{^Q 2010/09/27 H.Nagafuku
     function btnSubmit2() {

         switch(document.fm.Koyou.value) {    // εWEν
             case '10':      // h­i[X
                 location.href="http://www.nursepower.co.jp/haken_new.htm";
                 break;
             case '11':      // ssZϊi[X
                 location.href="http://www.nursepower.co.jp/city_search.htm";
                 break;
             case '12':      // «κZϊi[X
                 location.href="http://www.nursepower.co.jp/cgi-bin/sel_kango_o.cgi";
                 break;
             case '13':      // £Zϊi[X
                 location.href="http://www.nursepower.co.jp/cgi-bin/sel_kango_r.cgi";
                 break;
             default:        // νΞAρνΞAϊΞp[gAιΞp[g
                 document.fm.action="http://www.nursepower.co.jp/cgi-bin/sel_kango2.cgi"; 
                 document.fm.submit(); 
         }
     }

     // sΉ{§Iπ 2010/07/14 S.Yamaguchi

     function selKenChange(obj) {

         arrCheckboxName = new Array("Chiiki1", "Chiiki2", "Chiiki3", "Chiiki4", "Chiiki5",
            "Chiiki6", "Chiiki7", "Chiiki8", "Chiiki9", "Chiiki10",
            "Chiiki11", "Chiiki12", "Chiiki13", "Chiiki14", "Chiiki15",
            "Chiiki16", "Chiiki17", "Chiiki18", "Chiiki19", "Chiiki20",
            "Chiiki21", "Chiiki22", "Chiiki23", "Chiiki24", "Chiiki25",
            "Chiiki26", "Chiiki27", "Chiiki28", "Chiiki29", "Chiiki30",
            "Chiiki31", "Chiiki32", "Chiiki34", "Chiiki33", "Chiiki35",
            "Chiiki36", "Chiiki37", "Chiiki38", "Chiiki39", "Chiiki40",
            "Chiiki40_k", "Chiiki41", "Chiiki42", "Chiiki43", "Chiiki44",
            "Chiiki45", "Chiiki46", "Chiiki47", "Chiiki48");

         arrCheckboxValue = new Array("7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
            "17", "18", "19", "20", "21", "22", "23", "24", "25", "26",
            "27", "28", "29", "30", "31", "32", "33", "34", "35", "36",
            "37", "38", "39", "6", "40", "41", "42", "43", "44", "4",
            "4", "45", "46", "1", "2", "47", "48", "49", "50");

         for (var i = 0; i < 49; i++) {
             if (obj.selectedIndex == 0 || obj.selectedIndex == i + 1) {
                 document.fmNewIndex.elements[arrCheckboxName[i]].value = arrCheckboxValue[i];
             } else {
                 document.fmNewIndex.elements[arrCheckboxName[i]].value = '';
             }
         }

         document.fmNewIndex.Chiiki33_h.value = '';
         if (document.fmNewIndex.selKen.selectedIndex == 34) { // L
             document.fmNewIndex.Chiiki33_h.value = '5';
         }

         document.fmNewIndex.Chiiki40_h.value = '';
         document.fmNewIndex.sibori.value = '';
         if (document.fmNewIndex.selKen.selectedIndex == 40) { // ͺ
             document.fmNewIndex.Chiiki40_h.value = '3';
             document.fmNewIndex.sibori.value = 'fukuoka';
         }

         if (document.fmNewIndex.selKen.selectedIndex == 41) { // kγB
             document.fmNewIndex.Chiiki40_h.value = '3';
             document.fmNewIndex.sibori.value = 'kitakyusyuu';
         }

     }

     // ͺEF{
     function selKenChange2(obj) {

         arrCheckboxName = new Array("Chiiki1", "Chiiki2", "Chiiki3", "Chiiki4", "Chiiki5",
            "Chiiki6", "Chiiki7", "Chiiki8", "Chiiki9", "Chiiki10",
            "Chiiki11", "Chiiki12", "Chiiki13", "Chiiki14", "Chiiki15",
            "Chiiki16", "Chiiki17", "Chiiki18", "Chiiki19", "Chiiki20",
            "Chiiki21", "Chiiki22", "Chiiki23", "Chiiki24", "Chiiki25",
            "Chiiki26", "Chiiki27", "Chiiki28", "Chiiki29", "Chiiki30",
            "Chiiki31", "Chiiki32", "Chiiki34", "Chiiki33", "Chiiki35",
            "Chiiki36", "Chiiki37", "Chiiki38", "Chiiki39", "Chiiki40",
            "Chiiki41", "Chiiki42", "Chiiki43", 
            "Chiiki45", "Chiiki46", "Chiiki47", "Chiiki48");

         arrCheckboxValue = new Array("7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
            "17", "18", "19", "20", "21", "22", "23", "24", "25", "26",
            "27", "28", "29", "30", "31", "32", "33", "34", "35", "36",
            "37", "38", "39", "6", "40", "41", "42", "43", "44", "4",
            "45", "46", "1", "47", "48", "49", "50");

         for (var i = 0; i < 48; i++) {
             if (obj.selectedIndex == 0 || obj.selectedIndex == i + 1) {
                 document.fmNewIndex.elements[arrCheckboxName[i]].value = arrCheckboxValue[i];
             } else {
                 document.fmNewIndex.elements[arrCheckboxName[i]].value = '';
             }
         }

         document.fmNewIndex.Chiiki33_h.value = '';
         if (document.fmNewIndex.selKen.selectedIndex == 34) { // L
             document.fmNewIndex.Chiiki33_h.value = '5';
         }

         document.fmNewIndex.Chiiki40_h.value = '';
         document.fmNewIndex.sibori.value = '';
         if (document.fmNewIndex.selKen.selectedIndex == 40) { // ͺ
             document.fmNewIndex.Chiiki40_h.value = '3';
             document.fmNewIndex.sibori.value = '';
         }

//         if (document.fmNewIndex.selKen.selectedIndex == 41) { // kγB
//             document.fmNewIndex.Chiiki40_h.value = '3';
//             document.fmNewIndex.sibori.value = 'kitakyusyuu';
//         }

     }

     function btnSearch() {

         arrCheckboxName = new Array("Chiiki1", "Chiiki2", "Chiiki3", "Chiiki4", "Chiiki5",
            "Chiiki6", "Chiiki7", "Chiiki8", "Chiiki9", "Chiiki10",
            "Chiiki11", "Chiiki12", "Chiiki13", "Chiiki14", "Chiiki15",
            "Chiiki16", "Chiiki17", "Chiiki18", "Chiiki19", "Chiiki20",
            "Chiiki21", "Chiiki22", "Chiiki23", "Chiiki24", "Chiiki25",
            "Chiiki26", "Chiiki27", "Chiiki28", "Chiiki29", "Chiiki30",
            "Chiiki31", "Chiiki32", "Chiiki34", "Chiiki33", "Chiiki35",
            "Chiiki36", "Chiiki37", "Chiiki38", "Chiiki39", "Chiiki40",
            "Chiiki40_k", "Chiiki41", "Chiiki42", "Chiiki43", "Chiiki44",
            "Chiiki45", "Chiiki46", "Chiiki47", "Chiiki48");

         for (var i = 0; i < 5; i++) {
             if (document.fmNewIndex.selKen.selectedIndex != 0 && document.fmNewIndex.selKen.selectedIndex != i + 1) {
                 alert(document.fmNewIndex.selKen.selectedIndex);
                 document.fmNewIndex.elements[arrCheckboxName[i]].value = '';
             }
         }

         if (document.fmNewIndex.selKen.selectedIndex == 34) { // L
             document.fmNewIndex.Chiiki33_h.value = '5';
         }

         if (document.fmNewIndex.selKen.selectedIndex == 40) { // ͺ
             document.fmNewIndex.Chiiki40_h.value = '3';
             document.fmNewIndex.sibori.value = 'fukuoka';
         }

         if (document.fmNewIndex.selKen.selectedIndex == 41) { // kγB
             document.fmNewIndex.Chiiki40_h.value = '3';
             document.fmNewIndex.sibori.value = 'kitakyusyuu';
         }

         document.fmNewIndex.submit();
     } 
  
  
  
  
//IE6ζΏηΒ«  
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

  
//TABΟXΜJavascript  
  
$(function(){
	$(".TabAreaSet").each(function(){
		var TabAreaAmount = $(this).find(".TabAreaChgMenu").children("li").length;
		var ActiveTabNo;
		for(i=0;i<TabAreaAmount;i++){
			if($(this).find(".TabAreaChgMenu li").eq(i).attr("class") == "On"){
				ActiveTabNo = i;
			}
		}
		for(i=0;i<TabAreaAmount;i++){
			if(i!=ActiveTabNo){
				// $(this).find(".TabAreaContents").eq(i).hide();
			}
		}
		$(this).find(".TabAreaChgMenu li a").click(function(){
			$(this).parents("li").eq(0).addClass("Clicked");
			var ClickedTabNo;
			for(i=0;i<TabAreaAmount;i++){
				if(
					$(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).attr("class")!=null
					&& $(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).attr("class").indexOf("Clicked")!=-1
				){
					ClickedTabNo = i;
					$(this).parents("li").eq(0).removeClass("Clicked");
					$(this).parents("li").eq(0).addClass("On");
				}else if($(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).attr("class")!=null){
					$(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).removeClass("On");
				}
			}
			for(i=0;i<TabAreaAmount;i++){
				if(i!=ClickedTabNo){
					// $(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgContents").eq(0).find(".TabAreaContents").eq(i).hide();
				}
			}
			// $(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgContents").eq(0).find(".TabAreaContents").eq(ClickedTabNo).show();
			// return false;
		});
	});
});



function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

// popUpj[ 2010/08/19 S.Yamaguchi

function popUp(obj, id, x) {

    var elm = document.getElementById(id);
    var elmOya = obj;
    var popTop = 0;
    var popLeft = 0;
    
    elm.style.display = 'block';
    elm.style.position = 'absolute';

    // offsetTop ΎΖΈκιͺ Α½ΜΕ getBoundingClientRect ΙΟX 2010/08/24 S.Yamaguchi

    /*
    
    do {
        popTop += elmOya.offsetTop || 0;
        popLeft += elmOya.offsetLeft || 0;
        elmOya = elmOya.offsetParent;
    } while (elmOya);

    elm.style.top = popTop + 'px';
    elm.style.left = (popLeft + x) + 'px';

    */

    var pos = obj.getBoundingClientRect();
    var html = document.documentElement;
    var body = document.body;

    elm.style.top = (pos.top + (body.scrollTop || html.scrollTop) - html.clientTop - 30) + 'px';
    // pos.topͺ+30ΩΗΈκιΒ«ͺ ι½ίAΕθlΙΟX 2010/08/24 S.Yamaguchi
    elm.style.top = '90px';
    elm.style.left = (pos.left + ((body.scrollLeft || html.scrollLeft) - html.clientLeft) + x) + 'px';
}

function popDown(id) {
    document.getElementById(id).style.display = 'none';
}


function toiawase_open(){
window.open('../toiawase.html','','width=760,height=500');
}


function toiawase_open2(){
window.open('../../toiawase.html','','width=760,height=500');
}


function toiawase_open3(){
window.open('../../../toiawase.html','','width=760,height=500');
}



