var a = 0;
var x = 0;
var y = 0;
var w = 0;

// 占い
function uranai()
{

get_data();
calc();
check();

}

// チェックされた年月日を取得
function get_data()
{
	
	z = document.myform;
	a = get_data2(z.q1);
	x = get_data2(z.q2);
	y = get_data2(z.q3);

} 


// 
function get_data2( F )
{

	var temp;

	for (i=0; i < F.length; i++)
	{
		if (F.options[i].selected == true)
			{temp = parseInt( F[i].value) }
			
	}
	return temp;
}      


// 入力チェック
function check()
{
	if     ( a==0  ){alert("（年）を設定してね");}
	else if( x==0  ){alert("（月）を設定してね");}
	else if( y==0  ){alert("（日）を設定してね");}
	else{result()}
}


//計算処理
function calc()
{
	w = x * y + a;

	if( w%1000 == 0  ){ w=12;}
	else{w = w % 12;}
	

}


//
function result()
{

if     (w ==  0){document.location="bue.html";}
else if(w ==  1){document.location="pari.html";} 
else if(w ==  2){document.location="beijing.html";} 
else if(w ==  3){document.location="hong.html";} 
else if(w ==  4){document.location="tokyo.html";} 
else if(w ==  5){document.location="osaka.html";} 
else if(w ==  6){document.location="ny.html";} 
else if(w ==  7){document.location="soul.html";} 
else if(w ==  8){document.location="la.html";} 
else if(w ==  9){document.location="stoc.html";} 
else if(w == 10){document.location="lon.html";} 
else if(w == 11){document.location="mad.html";} 
else if(w == 12){document.location="moon.html";} 

}

