/*-----------------------------------------------------
  診断テスト2
  by Mamiko.M(http://www.nmt.ne.jp/~mamiko/) 2005/8/1
 -----------------------------------------------------*/


function test2(theForm){
	var radio_btn = 18;				//ラジオボタンの数をセット。

	var z_marks = 0;

	var cnt = 9;
	var z = new Array("Q1","Q2","Q3","Q4","Q5","Q6","Q7","Q8","Q9");

	
	var q_item = 9;				//問題の数をセット。
	var k = 0;
	
	for(var i=0; i<radio_btn; i++){		 //ラジオボタンの数だけ回す。
		if(theForm.elements[i].checked == true){
			k++;	//kにはチェック数が入る
			var radio_name = theForm.elements[i].name;
			var radio_mark = parseInt(theForm.elements[i].value);
			for(var j=0; j<cnt; j++){
				//z_marks,e_marks,s_marks,h_marks,n_marksには点数が入る。
				if(z[j] == radio_name){
					z_marks = z_marks + radio_mark;
					break;
				}
			}
		}
	}
	if(k<q_item){
		msg = "すべての質問に回答してください。";
		alert(msg);
	}else{
		//各点数を判定。
		newwindow(z_marks);
		return;
	}
}

function newwindow(z_marks){
	//結果を表示するウインドウ。
	normal = "";
	heavy = "";
	
	newWindow = window.open("","New_window","scrollbars=0,toolbars=0,width=400,height=400");
	newWindow.document.clear();

	newWindow.document.write("<html><body bgcolor=\"#ffffff\"><br><br>");
	newWindow.document.write("<blockquote><img src=images/db_title17.gif width=300 height=50><br></blockquote>\n");
	newWindow.document.write("<blockquote>\n")
	if(z_marks > 6){
		newWindow.document.write("<b><font color=#CC0000>●今すぐお電話下さい！</font></b><br>");
		
		newWindow.document.write("<br><small>\n");
		newWindow.document.write("データベースを使用することで業務効率が向上することは確実です。");
		newWindow.document.write("はじめからパーフェクトなものを求めるのではなく、基本的な機能に絞って開発して使ってみることが大切です。");
		newWindow.document.write("Microsoft Accessであれば機能追加等の改良も比較的簡単ですので、コスト的にも時間的にも満足のいく結果となります。");
newWindow.document.write("<br><br><br><br><SCRIPT language=JavaScript>function change(){window.opener.location.href='price.html';}</SCRIPT><INPUT type=button value='構築費が気になるならこちら' onClick=change()> <INPUT type=button value='閉じる' onClick=window.close()>");
		newWindow.document.write("</small><br>\n");
	}
else if(z_marks > 2){
		newWindow.document.write("<b><font color=#CC0000>●データベースをつくってみませんか？</font></b><br>");
		
		newWindow.document.write("<br><small>\n");
		newWindow.document.write("データベースを使用することで、業務効率は良くなります。");
		newWindow.document.write("もし御社の業務がマニュアル化出来るようであれば、データベースの導入効果が期待できます。");
		newWindow.document.write("はじめからパーフェクトなものを求めるのではなく、基本的な機能に絞って開発して使ってみることが大切です。");
newWindow.document.write("<br><br><br><br><SCRIPT language=JavaScript>function change(){window.opener.location.href='price.html';}</SCRIPT><INPUT type=button value='構築費が気になるならこちら' onClick=change()> <INPUT type=button value='閉じる' onClick=window.close()>");
		newWindow.document.write("</small><br>\n");
	}
else if(z_marks >= 0){
		newWindow.document.write("<b><font color=#CC0000>●すばらしい！</font></b><br>");
		
		newWindow.document.write("<br><small>\n");
		newWindow.document.write("データ管理について常にお考えのようですね。");
		newWindow.document.write("ニュースビットでは、御社の業務効率を更に上げるさまざまなソフトウェアをご用意しております。");
		newWindow.document.write("無料でダウンロードできますので、是非一度お試し下さい。");
newWindow.document.write("<br><br><br><br><SCRIPT language=JavaScript>function change(){window.opener.location.href='../software/trial_dl.html';}</SCRIPT><INPUT type=button value='お試しダウンロードはこちら' onClick=change()> <INPUT type=button value='閉じる' onClick=window.close()>");
		newWindow.document.write("</small><br>\n");
	}
	
	newWindow.document.write("</blockquote>\n");
	newWindow.document.write("</body></html>");
	newWindow.document.close();
	newWindow.focus();
	return;
}
