var agent=navigator.userAgent;
if (agent.indexOf('Win') != -1) {
document.write('<link rel="stylesheet" TYPE="text/css" href="css/win.css" TITLE="WIN CSS">');
document.close();
}

/* 
//スワップイメージスクリプト（現在未使用）
function MM_findObj(n, d) { //v3.0
  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); return x;
}
Functions that swaps images. 
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;
}

// Functions that handle preload. 
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];}}
}
*/




//別windows表示スクリプト(safariで動かないのを直したバージョン)
/* 現在未使用
var HELPWin=null;
var HELPHref1="";
function HelpWinOpen(HELPHref1,WinNo,W,H){
	WinNo="_blank";
	HELPWin=window.open(
		HELPHref1,WinNo,
		'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+W+',height='+H
	);
};
*/



var HELPWin=null;//サブウインドウ
var HELPHref1="";//読み込むページ
function HelpWinOpen(HELPHref1,WinNo,W,H){
	HELPWin=window.open(HELPHref1,WinNo,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+W+',height='+H+'');
	//N2.0バグ回避用リピート
	if(navigator.appVersion.charAt(0)==2){
	HELPWin=window.open(HELPHref1,WinNo,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+W+',height='+H+'');}
	//サブウインドウが開いたとき前面へフォーカスする。NN3.0~
	if(navigator.appVersion.charAt(0)>=3){HELPWin.focus()}
	};
function HelpWinOpen2(HELPHref1,WinNo,W,H){
	HELPWin=window.open(HELPHref1,WinNo,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='+W+',height='+H+'');
	//N2.0バグ回避用リピート
	if(navigator.appVersion.charAt(0)==2){
	HELPWin=window.open(HELPHref1,WinNo,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='+W+',height='+H+'');}
	//サブウインドウが開いたとき前面へフォーカスする。NN3.0~
	if(navigator.appVersion.charAt(0)>=3){HELPWin.focus()}
	};




//ドメイン検索窓用スクリプト
//【未確認エラー情報】
//(1)：複数のフォームから同じスクリプトを起動するために、引数にformを参照渡しする形に変更
//(2)：(1)の変更後、「setTimeout」内でのオブジェクト参照がWin IEおよびネスケでエラー（動的結合失敗）？
//
//
function checkvalue(theForm)	//←(1)：複数のフォームから同じスクリプトを起動するために、引数にformを参照渡しする形に変更
{
	if (theForm.domain.value == ""){
		alert("ドメイン名を入力してください");
		theForm.domain.focus(); 
		return false;
	}
	
	if (theForm.domain.value == ""){
		alert("ドメイン名を入力してください");
		theForm.domain.focus();
		return false;
	}
	
	if (theForm.domain.value.length <=2){
		alert("ドメイン名は少なくとも3文字以上（半角英数字のみ）を入力してください。");
		theForm.domain.focus();
		return false;
	}

	if (theForm.domain.value.length <= 0) return;
	L = theForm.domain.value.length;
	for(i=0;i<L;i++){
		cc = theForm.domain.value.charAt(i);
		if (((cc < "a") || ("z" < cc))&&((cc < "0") || ("9" < cc))&&(cc != "-") ) {
				alert("ドメイン名は半角英数字、英字は小文字で入力してください");
					theForm.domain.value = "";
					//setTimeout('theForm.domain.focus()',100);//←(2)：(1)の変更後、Win IEおよびネスケでエラー？
				return false;
		}
	}

	L=theForm.domain.value.length;
	for(i=0;i<L;i++){
		cc = theForm.domain.value.charAt(i);
		if (i==0 || i==L-1){
		if  (cc == "-")  {
			alert("ドメイン名は半角英数字、英字は小文字で入力してください");
			theForm.domain.value = "";
			//setTimeout('theForm.domain.focus()',100);//←(2)：(1)の変更後、Win IEおよびネスケでエラー？
			return false;
		}
	}
  }
  }
  
  
  
  
//メール送信用スクリプト



function Alphanumeric2(theelement){//chinese char true
	text="abcdefghijklmnopqrstuvwxyz1234567890-";
	for(i=0;i<=theelement.length-1;i++){
		char1=theelement.charAt(i);
		index=text.indexOf(char1);
		if(index==-1){
			return true;//have chinese
			}
		//no chinese
		}
	return false;
	}

function checkEmal(theelement)
{   var emal="@";   for(i=0;i<=theelement.length-1;i++)   {     char1=theelement.charAt(i);
     if(char1==emal)
     {        return true;
     }   }     return false;
}

function FrontPage_Form1_Validator(theForm)
{

  if (theForm.fname.value == "")
  {
    alert("氏名「姓」を入力してください");
    theForm.fname.focus();
    return false;
  }

  if (theForm.lname.value == "")
  {
    alert("氏名「名」を入力してください");
    theForm.lname.focus();
    return false;
  }

  if (theForm.user_name.value == "")
  {
    alert("ニックネームを入力してください");
    theForm.user_name.focus();
    return false;
  }
  
  
  if (Alphanumeric2(theForm.user_name.value)){
	alert("ニックネームが正しく入力されているかご確認ください。");
	theForm.user_name.focus();
	return (false);
	}
  

  if (theForm.ReEmail.value == "")
  {
    alert("Eメールアドレスを入力してください");
    theForm.ReEmail.focus();
    return (false);
  }

  if(!checkEmal(theForm.ReEmail.value))
  {
    alert("Eメールアドレスを正しく入力してください");
    theForm.ReEmail.focus();
    return (false);
  }



  return (true);

}

  
  
  
  

