function showMsg(x) {
    document.getElementById(x).style.display='';
    document.getElementById('wel').style.display='none';
}
function hideMsg(x) {
    document.getElementById(x).style.display='none';
    document.getElementById('wel').style.display='';
}

function showColours(x) {
	var clr = window.open("","Colour_Chart","scrollbars=yes");
		if(x==0) clr.location.href="http://www.nademoya.biz/216colours.htm";
		if(x==1) clr.location.href="http://www.nademoya.biz/140colours.htm";
		clr.moveTo(100,100);
		clr.resizeTo(650,550);
		clr.focus;
}

/* View cont Page */
function openWin(x)
{
	if (x == 0) {
	var cont = window.open("","Contact","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=300,top=0");	
		cont.location.href = "http://nademoya.biz/contact.htm";
	}
	else {
	var cont = window.open("","問い合わせ先","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=300,top=0");	
		cont.location.href = "http://www.nademoya.biz/jp/contact.htm";
	}
		cont.moveTo(300,0);
		cont.resizeTo(450,500);
		cont.focus();
	}

	/* Form Check for Contact Form */
function FormCheck()
{
	var z = document.contact;
	if (z.name.value=="")
		{
		alert("Please fill in your name!");
		z.name.focus();return false;
		}
	//checkEmail = /.+@.+\..+/;
	var regexp = new RegExp(".+@.+\..+")
	var Email = z.replyto.value;
	if (Email=="") 
		{
		alert("Please fill in your Email address!");
		z.replyto.focus();return false;
		}
	if (Email.indexOf(" ",0)!=-1)
		{
		alert("Please enter valid Email address!");
		z.replyto.focus();return false;
		}
	if (!(Email.match(regexp)) || Email.length < 6)
		{
		alert("Please enter Correct Email address!");
		z.replyto.focus();return false;
		}
	if (z.message.value=="") 
		{
		alert("We appreciate any comment from you.");
		z.message.focus();return false;
		}
}

/* Form Check for Japanese Contact Form */
function FormCheckJ()
{
	var z = document.contact;
	if (z.name.value=="")
		{
		alert("お名前を入力して下さい。(ハンドルネーム可)");
		z.name.focus();return false;
		}
	//checkEmail = /.+@.+\..+/;
	var regexp = new RegExp(".+@.+\..+")
	var Email = z.fmemail.value;
	if (Email=="") 
		{
		alert("Ｅメールアドレスを入力して下さい。何らかの理由で、ご自身のメールアドレスを入力することが出来ない場合は、システム上メールアドレスの入力が必要ですので、代わりに mail@nademoya.biz (当サイトを運営しているなぁでも屋が所有しているアドレス)を入力して下さい");
		z.fmemail.focus();return false;
		}
	if (Email.indexOf(" ",0)!=-1)
		{
		alert("有効なＥメールアドレスを入力していただけると…。何らかの理由で、ご自身のメールアドレスを入力することが出来ない場合は、システム上メールアドレスの入力が必要ですので、代わりに mail@nademoya.biz (当サイトを運営しているなぁでも屋が所有しているアドレス)を入力して下さい。");
		z.fmemail.focus();return false;
		}
	if (!(Email.match(regexp)) || Email.length < 6)
		{
		alert("お返事を差し上げる為にも、正しいアドレスを入力していただけると助かります。返信が必要無い場合で、何らかの理由で、ご自身のメールアドレスを入力することが出来ない場合は、システム上メールアドレスの入力が必要ですので、代わりに mail@nademoya.biz (当サイトを運営しているなぁでも屋が所有しているアドレス)を入力して下さい");
		z.fmemail.focus();return false;
		}
	if (z.message.value=="") 
		{
		alert("何でも結構ですので、何かメッセージをいただけると嬉しいです！");
		z.message.focus();return false;
		}
}

function LinkTo()
{
var num = document.quickLink.qLink.selectedIndex;
location.href = document.quickLink.qLink.options[num].value;
}

/* View Qualification Page */
function viewQuo()
{
	var quo = window.open("","Qualification","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=100,top=50");
		quo.location.href = "http://www.nademoya.biz/qualification.htm";
		quo.moveTo(100,50);
		quo.resizeTo(550,500);
		quo.focus();
	}
	
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}