function FormCtl(e){
	if (e=="submit"){
		if(document.getElementById('name').value!=""){
			if(document.getElementById('email').value!=""){
					if(document.getElementById('naiyo').value!=""){
							if (!document.getElementById('email').value.match(/^[A-Za-z0-9]+[\w\.-]+@[\w\.-]+\.\w{2,}$/)){
								window.alert("アドレスを正しく入力して下さい");
							}else if(document.getElementById('confirm').value!=""){
								document.itaform.submit();
							}else{
								window.alert("個人情報保護法に同意された場合に限り送信されます。");
							}
					}else{
						window.alert("お問い合わせ内容を入力して下さい")
					}
			}else{
				window.alert("アドレスを入力して下さい")
			}
		}else{
			window.alert("お名前を入力して下さい")
		}		
	}else if(e=="reset"){
		document.itaform.reset();
	}else{
		history.back();
	}
}


function ChkHissu(e){
	var t = document.getElementById(e);
	if(t.value!=""){
		t.style.backgroundImage = "none";
	}
}

function ChkNull(e){
	var t = document.getElementById(e);
	var b = "url(image/contact/bgValue.gif)";
	if(t.value==""){
		if(t.style.backgroundImage != b){
			t.style.backgroundImage = b;
		}
    }
}


		   function slideSwitch() {
                var $active = $('#slideshow img.active');
                if ( $active.length == 0 ) $active = $('#slideshow img:last');
                var $next =  $active.next().length ? $active.next() : $('#slideshow img:first');
                $active.addClass('last-active');
                $next.css({opacity: 0.0})
                    .addClass('active')
                    .animate({opacity: 1.0}, 1000, function() {
                        $active.removeClass('active last-active');
                    });
            }
            $(function() {
                setInterval( "slideSwitch()", 4000 );
            });



function bgChange(i,e){
	var	y = document.getElementById(i);
	var u = "image/map/"+e+".jpg";
	y.style.background = 'url('+u+')';
}

function popupChange(e){
	var s = document.getElementById(e).src;
	var b = s.replace("/s/", "/");
	document.getElementById('changePics').src = b;
}
