function onMouseOver(oj) {
	oj.src = "image/menu/concept_over.gif";
}

function onMouseOut(oj) {
	oj.src = "image/menu/concept.gif";
}

function onMouseOver2(oj) {
	oj.src = "image/menu/system_over.gif";
}

function onMouseOut2(oj) {
	oj.src = "image/menu/system.gif";
}

function onMouseOver3(oj) {
	oj.src = "image/menu/joining_introduction_over.gif";
}

function onMouseOut3(oj) {
	oj.src = "image/menu/joining_introduction.gif";
}

function onMouseOver4(oj) {
	oj.src = "image/menu/joining_voice_over.gif";
}

function onMouseOut4(oj) {
	oj.src = "image/menu/joining_voice.gif";
}

function onMouseOver5(oj) {
	oj.src = "image/menu/faq_over.gif";
}

function onMouseOut5(oj) {
	oj.src = "image/menu/faq.gif";
}

function onMouseOver6(oj) {
	oj.src = "image/menu/contact_over.gif";
}

function onMouseOut6(oj) {
	oj.src = "image/menu/contact.gif";
}

function onMouseOver7(oj) {
	oj.src = "image/menu/blog_over.gif";
}

function onMouseOut7(oj) {
	oj.src = "image/menu/blog_off.gif";
}

function onMouseOver8(oj) {
	oj.src = "image/menu/company_profile_over.gif";
}

function onMouseOut8(oj) {
	oj.src = "image/menu/company_profile.gif";
}

function onMouseOver9(oj) {
	oj.src = "image/menu/joining_recruitment_over.gif";
}

function onMouseOut9(oj) {
	oj.src = "image/menu/joining_recruitment_off.gif";
}

function onMouseOver10(oj) {
	oj.src = "image/syosai_over.gif";
}

function onMouseOut10(oj) {
	oj.src = "image/syosai.gif";
}

function onMouseOver11(oj) {
	oj.src = "image/menu/syllabus_over.gif";
}

function onMouseOut11(oj) {
	oj.src = "image/menu/syllabus.gif";
}


function onMouseOver12(oj) {
	oj.src = "image/seminarbutton_on.jpg";
}

function onMouseOut12(oj) {
	oj.src = "image/seminarbutton_off.jpg";
}

function onMouseOver13(oj) {
	oj.src = "image/seminarbutton2_on.jpg";
}

function onMouseOut13(oj) {
	oj.src = "image/bt_kainushi_off.jpg";
}

function onMouseOver14(oj) {
	oj.src = "image/bt_kainushi_on.jpg";
}

function onMouseOut14(oj) {
	oj.src = "image/bt_kainushi_off.jpg";
}

function onMouseOver15(oj) {
	oj.src = "image/bt_dogtrainer_on.jpg";
}

function onMouseOut15(oj) {
	oj.src = "image/bt_dogtrainer_off.jpg";
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function defaultSet() {
	document.form1.select.options[0].selected = "true";
}

function sendMailChk(){
	if(confirm("送信しますがよろしいですか？")){
		var bool = true;
		var msg = "";
		var bgcolor = "#FFA07A";
		document.getElementById("email").style.backgroundColor = "";
		document.getElementById("name").style.backgroundColor = "";
		document.getElementById("tel").style.backgroundColor = "";
		document.getElementById("address").style.backgroundColor = "";
		document.getElementById("detail").style.backgroundColor = "";
		document.getElementById("subject").style.backgroundColor = "";
		
		// 名前チェック
		var name = trim(document.getElementById("name").value);
		if(name == ""){
			bool = false;
			document.getElementById("name").style.backgroundColor = bgcolor;
			msg += "お名前は必須項目です.\n";
		}
		
		// メールアドレスチェック
		var email = trim(document.getElementById("email").value);
		if(email == ""){
			bool = false;
			document.getElementById("email").style.backgroundColor = bgcolor;
			msg += "メールアドレスは必須項目です.\n";
		}else if(!isEmail(email)){
			bool = false;
			document.getElementById("email").style.backgroundColor = bgcolor;
			msg += "メールアドレスは形式が不正です.\n";
		}
		
		// 住所チェック
		var name = trim(document.getElementById("address").value);
		if(name == ""){
			bool = false;
			document.getElementById("address").style.backgroundColor = bgcolor;
			msg += "住所は必須項目です.\n";
		}
		
		// 電話番号チェック
		var tell = trim(document.getElementById("tel").value);
		if(tell == ""){
			bool = false;
			document.getElementById("tel").style.backgroundColor = bgcolor;
			msg += "電話番号は必須項目です.\n";
		}else if(!isTell(tell)){
			bool = false;
			document.getElementById("tel").style.backgroundColor = bgcolor;
			msg += "電話番号の形式が不正です.\n";
		}
		
		// お問い合わせ件名チェック
		var detail = trim(document.getElementById("subject").value);
		if(detail == ""){
			bool = false;
			document.getElementById("subject").style.backgroundColor = bgcolor;
			msg += "お問い合わせ件名は必須項目です.\n";
		}
		
		// 詳細チェック
		var detail = trim(document.getElementById("detail").value);
		if(detail == ""){
			bool = false;
			document.getElementById("detail").style.backgroundColor = bgcolor;
			msg += "詳細は必須項目です.\n";
		}
		
		if(bool){
			//sendMailEx();
			
			return true;
		}else{
			alert(msg);
			
			return false;
		}
	}
}

function isEmail(param){
    if(param.match(/^[A-Za-z0-9\.-]+[\w-]+@[\w\.-]+\.\w{2,}$/)){
        return true;
    }else{
        return false;
    }
}

function isTell(param){
	if(param == "") return true;
	
    if(param.match(/^[0-9]{1,4}-[0-9]{4}$|^[0-9]{2,5}-[0-9]{1,4}-[0-9]{4}$/)){
        return true;
    }else{
        return false;
    }
}

function trim(value){
	return value.replace(/(^\s*)|(\s*$)/g, "");
}

function exMenu(tName){
	tMenu = document.getElementById(tName).style;
	if(tMenu.display == 'none') tMenu.display = "block";
	else tMenu.display = "none";
}


function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		var inputs = document.getElementsByTagName("input");
		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."));
				}
			}
		}

		for(var i=0; i < inputs.length; i++) {
			if(inputs[i].getAttribute("src") != null &&  inputs[i].getAttribute("src").match("_off."))
			{
				inputs[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				inputs[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);
}
