// JavaScript Document
//UTF-8保存用
function URLencode(str){
 // Unicode to URL encoded UTF-8
 var i, encoded_str, char_code, padded_str;
         encoded_str = "";
         for (i = 0; i < str.length; i++){
             char_code = str.charCodeAt(i);
             if (char_code == 0x20){
                // space -> "+"
                encoded_str += "+";}
             else { // else 1
                  if (((0x30 <= char_code) && (char_code <= 0x39)) || ((0x41 <= char_code) && (char_code <= 0x5a)) || ((0x61 <= char_code) && (char_code <= 0x7a))){
		     // [0-9a-z-A-Z]
                     // no escape
                     encoded_str += str.charAt(i);
                  }
		  else if ((char_code == 0x2a) || (char_code == 0x2e) || (char_code == 0x2d) || (char_code == 0x5f)) {
		     // [.-_]
                     // no escape
                     encoded_str += str.charAt(i);
		  }
                  else { // else 2
                       // for internal unicode to UTF-8
                       if ( char_code > 0xffff ) {
                          encoded_str += "%" + ((char_code >> 18) | 0xf0).toString(16).toUpperCase();
                          encoded_str += "%" + (((char_code >> 12) & 0x3f) | 0x80).toString(16).toUpperCase();
			  encoded_str += "%" + (((char_code >> 6) & 0x3f) | 0x80).toString(16).toUpperCase();
			  encoded_str += "%" + ((char_code & 0x3f) | 0x80).toString(16).toUpperCase();
		       }
                       else if ( char_code > 0x7ff ) {
                          encoded_str += "%" + ((char_code >> 12) | 0xe0).toString(16).toUpperCase();
			  encoded_str += "%" + (((char_code >> 6) & 0x3f) | 0x80).toString(16).toUpperCase();
			  encoded_str += "%" + ((char_code & 0x3f) | 0x80).toString(16).toUpperCase();
                       }
                       else if ( char_code > 0x7f ) {
		          encoded_str += "%" + (((char_code >> 6) & 0x1f) | 0xc0).toString(16).toUpperCase();
			  encoded_str += "%" + ((char_code & 0x3f) | 0x80).toString(16).toUpperCase();
                       }
                       else {
                          // for ascii
                          padded_str = "0" + char_code.toString(16).toUpperCase();
                          encoded_str += "%" + padded_str.substr(padded_str.length - 2, 2);
                       }
                    } // else 2
                } // else 1
        } // for
        return encoded_str;
}


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."));
				}
			}
		}

		var inp = document.getElementsByTagName("input");
		for (i = 0; i < inp.length; i++) {
			if((inp[i].src.match("_off."))&&(inp[i].getAttribute("type")=="image"))
			{
				inp[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				inp[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);
}



function m_win(url,SearchValue,id,windowname,width,height,max) {
 var features="location=no, menubar=no, status=no, scrollbars=yes, resizable=yes, toolbar=no";
 var SetValue = encodeURI(document.Form.elements[SearchValue].value);
 var SetID = id;
 var SetUrl = url + SetValue + '&max=' + max + '&SetID=' +SetID;
if(max<1){
max=1000;
}
 if (width) {
  if (window.screen.width > width)
   features+=", left="+(window.screen.width-width)/2;
  else width=window.screen.width;
  features+=", width="+width;
 }
 if (height) {
  if (window.screen.height > height)
   features+=", top="+(window.screen.height-height)/2;
  else height=window.screen.height;
  features+=", height="+height;
 }
 window.open(SetUrl,windowname,features);
}

function setReal(acode1,SetID){
  data1 = acode1;
  window.opener.document.Form.elements[SetID].value = data1;
  window.close();
}

function setRealB(acode1,acode2,SetID,SetIDB){
  data1 = acode1;
  data2 = acode2;
  window.opener.document.Form.elements[SetID].value = data1;
  window.opener.document.Form.elements[SetIDB].value = data2;
  window.close();
}

function setRealC(acode1,acode2,acode3,SetID,SetIDB,SetIDC){
  data1 = acode1;
  data2 = acode2;
  data3 = acode3;
  window.opener.document.Form.elements[SetID].value = data1;
  window.opener.document.Form.elements[SetIDB].value = data2;
  window.opener.document.Form.elements[SetIDC].value = data3;
  window.close();
}

// IE5.5+ PNG Alpha Fix v1.0RC4
// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com

// This is licensed under the CC-GNU LGPL, version 2.1 or later.
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/

if (typeof IEPNGFIX == 'undefined') {
//--============================================================================

var IEPNGFIX = {
	blank:  'http://www.isella.com/aod2/images/blank.gif',
	filter: 'DXImageTransform.Microsoft.AlphaImageLoader',

	fixit: function (elem, src, method) {
		if (elem.filters[this.filter]) {
			var filter = elem.filters[this.filter];
			filter.enabled = true;
			filter.src = src;
			filter.sizingMethod = method;
		}
		else {
			elem.style.filter = 'progid:' + this.filter +
				'(src="' + src + '",sizingMethod="' + method + '")';
		}
	},

	fixwidth: function(elem) {
		if (elem.currentStyle.width == 'auto' &&
			elem.currentStyle.height == 'auto') {
			elem.style.width = elem.offsetWidth + 'px';
		}
	},

	fixchild: function(elem, recursive) {
		if (!/MSIE (5\.5|6\.|7\.)/.test(navigator.userAgent)) return;

		for (var i = 0, n = elem.childNodes.length; i < n; i++) {
			var childNode = elem.childNodes[i];
			if (childNode.style) {
				if (childNode.style.position) {
					childNode.style.position = childNode.style.position;
				}
				else {
					childNode.style.position = 'relative';
				}
			}
			if (recursive && childNode.hasChildNodes()) {
				this.fixchild(childNode, recursive);
			}
		}
	},

	fix: function(elem) {
		if (!/MSIE (5\.5|6\.|7\.)/.test(navigator.userAgent)) return;

		var bgImg =
			elem.currentStyle.backgroundImage || elem.style.backgroundImage;

		if (elem.tagName == 'IMG') {
			if ((/\.png$/i).test(elem.src)) {
				this.fixwidth(elem);
				this.fixit(elem, elem.src, 'scale');
				elem.src = this.blank;
				elem.runtimeStyle.behavior = 'none';
			}
		}
		else if (bgImg && bgImg != 'none') {
			if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i)) {
				var s = RegExp.$1;
				this.fixwidth(elem);
				elem.style.backgroundImage = 'none';
				this.fixit(elem, s, 'scale'); // crop | image | scale

				if (elem.tagName == 'A' && elem.style) {
					if (!elem.style.cursor) {
						elem.style.cursor = 'pointer';
					}
				}

				this.fixchild(elem);
				elem.runtimeStyle.behavior = 'none';
			}
		}
	},

	hover: function(elem, hvImg) {
		var bgImg = elem.style.backgroundImage;

		if (!bgImg && elem.currentStyle) bgImg = elem.currentStyle.backgroundImage;

		if (elem.tagName == 'IMG' && hvImg) {
			var image = elem.src;
			elem.onmouseover = function() {
				elem.src = hvImg;
				IEPNGFIX.fix(elem);
			};
			elem.onmouseout = function() {
				elem.src = image;
				IEPNGFIX.fix(elem);
			};
		}
		else if (bgImg && bgImg != 'none' && hvImg) {
			elem.onmouseover = function() {
				elem.style.backgroundImage = 'url(' + hvImg + ')';
				IEPNGFIX.fix(elem);
			};
			elem.onmouseout = function() {
				elem.style.backgroundImage = bgImg;
				IEPNGFIX.fix(elem);
			};
		}

		IEPNGFIX.fix(elem);
	}
};

//--============================================================================
} // end if (typeof IEPNGFIX == 'undefined')

function inqCheck(){
if( !(document.form.agree.checked )){
window.alert("【「当社個人情報の取り扱い」に同意する】　　\nにチェックをしてからボタンをクリックしてください。　　");
return false;
}else{
document.form.action = "formCheck.php";
document.form.submit();
}
}