<!--

// 2010 F1 Countdown
// Copyright (C) CASTLING
// http://castling.blog108.fc2.com/

var year     = 2010;

var country  = [];
country[0]   = "アブダビGP";
country[1]   = "バーレーンGP";
country[2]   = "オーストラリアGP";
country[3]   = "マレーシアGP";
country[4]   = "中国GP";
country[5]   = "スペインGP";
country[6]   = "モナコGP";
country[7]   = "トルコGP";
country[8]   = "カナダGP";
country[9]   = "EUGP（バレンシア）";
country[10]  = "イギリスGP";
country[11]  = "ドイツGP";
country[12]  = "ハンガリーGP";
country[13]  = "ベルギーGP";
country[14]  = "イタリアGP";
country[15]  = "シンガポールGP";
country[16]  = "日本GP";
country[17]  = "韓国GP";
country[18]  = "アブダビGP";
country[19]  = "バーレーンGP";

var flg      = [];
flg[0]       = "ae.png";
flg[1]       = "bh.png";
flg[2]       = "au.png";
flg[3]       = "my.png";
flg[4]       = "cn.png";
flg[5]       = "es.png";
flg[6]       = "mc.png";
flg[7]       = "tr.png";
flg[8]       = "ca.png";
flg[9]       = "es.png";
flg[10]      = "gb.png";
flg[11]      = "de.png";
flg[12]      = "hu.png";
flg[13]      = "be.png";
flg[14]      = "it.png";
flg[15]      = "sg.png";
flg[16]      = "jp.png";
flg[17]      = "kr.png";
flg[18]      = "ae.png";
flg[19]      = "bh.png";

var sche     = [11,1,3,14,3,28,4,4,4,18,5,9,5,23,5,30,6,13,6,27,7,11,7,25,8,1,8,29,9,12,9,26,10,17,10,31,11,14,3,14];

var imgurl   = "<img src=http://blog-imgs-19.fc2.com/c/a/s/castling/";
var w_hon    = "　<font color=red>本日開催</font>";

var now      = new Date();
var Daybyu   = 24*60*60*1000;

x00day       = new Date(year-1,sche[0]-1,sche[1]);
xday00       = (x00day.getTime() - now.getTime())/Daybyu;
count00      = Math.ceil(xday00);

x01day       = new Date(year,sche[2]-1,sche[3]);
xday01       = (x01day.getTime() - now.getTime())/Daybyu;
count01      = Math.ceil(xday01);

x02day       = new Date(year,sche[4]-1,sche[5]);
xday02       = (x02day.getTime() - now.getTime())/Daybyu;
count02      = Math.ceil(xday02);

x03day       = new Date(year,sche[6]-1,sche[7]);
xday03       = (x03day.getTime() - now.getTime())/Daybyu;
count03      = Math.ceil(xday03);

x04day       = new Date(year,sche[8]-1,sche[9]);
xday04       = (x04day.getTime() - now.getTime())/Daybyu;
count04      = Math.ceil(xday04);

x05day       = new Date(year,sche[10]-1,sche[11]);
xday05       = (x05day.getTime() - now.getTime())/Daybyu;
count05      = Math.ceil(xday05);

x06day       = new Date(year,sche[12]-1,sche[13]);
xday06       = (x06day.getTime() - now.getTime())/Daybyu;
count06      = Math.ceil(xday06);

x07day       = new Date(year,sche[14]-1,sche[15]);
xday07       = (x07day.getTime() - now.getTime())/Daybyu;
count07      = Math.ceil(xday07);

x08day       = new Date(year,sche[16]-1,sche[17]);
xday08       = (x08day.getTime() - now.getTime())/Daybyu;
count08      = Math.ceil(xday08);

x09day       = new Date(year,sche[18]-1,sche[19]);
xday09       = (x09day.getTime() - now.getTime())/Daybyu;
count09      = Math.ceil(xday09);

x10day       = new Date(year,sche[20]-1,sche[21]);
xday10       = (x10day.getTime() - now.getTime())/Daybyu;
count10      = Math.ceil(xday10);

x11day       = new Date(year,sche[22]-1,sche[23]);
xday11       = (x11day.getTime() - now.getTime())/Daybyu;
count11      = Math.ceil(xday11);

x12day       = new Date(year,sche[24]-1,sche[25]);
xday12       = (x12day.getTime() - now.getTime())/Daybyu;
count12      = Math.ceil(xday12);

x13day       = new Date(year,sche[26]-1,sche[27]);
xday13       = (x13day.getTime() - now.getTime())/Daybyu;
count13      = Math.ceil(xday13);

x14day       = new Date(year,sche[28]-1,sche[29]);
xday14       = (x14day.getTime() - now.getTime())/Daybyu;
count14      = Math.ceil(xday14);

x15day       = new Date(year,sche[30]-1,sche[31]);
xday15       = (x15day.getTime() - now.getTime())/Daybyu;
count15      = Math.ceil(xday15);

x16day       = new Date(year,sche[32]-1,sche[33]);
xday16       = (x16day.getTime() - now.getTime())/Daybyu;
count16      = Math.ceil(xday16);

x17day       = new Date(year,sche[34]-1,sche[35]);
xday17       = (x17day.getTime() - now.getTime())/Daybyu;
count17      = Math.ceil(xday17);

x18day       = new Date(year,sche[36]-1,sche[37]);
xday18       = (x18day.getTime() - now.getTime())/Daybyu;
count18      = Math.ceil(xday18);

x19day       = new Date(year,sche[38]-1,sche[39]);
xday19       = (x19day.getTime() - now.getTime())/Daybyu;
count19      = Math.ceil(xday19);


if(count00>=0){
	if(count00==0){
		document.write(imgurl+flg[0]+"><br />最終戦 "+country[0]+"<br />"+sche[0]+"/"+sche[1]+w_hon);
	}else{
		document.write(imgurl+flg[0]+"><br />最終戦 "+country[0]+"<br />"+sche[0]+"/"+sche[1]+"まであと<font color=red>"+count00+"</font>日");
	}
}

else if(count01>=0){
	if(count01==0){
		document.write(imgurl+flg[1]+"><br />開幕戦 "+country[1]+"<br />"+sche[2]+"/"+sche[3]+w_hon);
	}else{
		document.write("<font color=red>F1 "+(year-1)+" シリーズ閉幕</font><br />"+imgurl+flg[1]+"><br />F1 "+year+" 開幕戦 "+country[1]+"<br />"+sche[2]+"/"+sche[3]+"まであと<font color=red>"+count01+"</font>日");
//		document.write(imgurl+flg[1]+"><br />開幕戦 "+country[1]+"<br />"+sche[2]+"/"+sche[3]+"まであと<font color=red>"+count01+"</font>日");
	}
}

else if(count02>=0){
	if(count02==0){
		document.write(imgurl+flg[2]+"><br />第02戦 "+country[2]+"<br />"+sche[4]+"/"+sche[5]+w_hon);
	}else{
		document.write(imgurl+flg[2]+"><br />第02戦 "+country[2]+"<br />"+sche[4]+"/"+sche[5]+"まであと<font color=red>"+count02+"</font>日");
	} 
}
 
else if(count03>=0){
	if(count03==0){ 
		document.write(imgurl+flg[3]+"><br />第03戦 "+country[3]+"<br />"+sche[6]+"/"+sche[7]+w_hon);
	}else{
		document.write(imgurl+flg[3]+"><br />第03戦 "+country[3]+"<br />"+sche[6]+"/"+sche[7]+"まであと<font color=red>"+count03+"</font>日");
	} 
}
 
else if(count04>=0){
	if(count04==0){ 
		document.write(imgurl+flg[4]+"><br />第04戦 "+country[4]+"<br />"+sche[8]+"/"+sche[9]+w_hon);
	}else{
		document.write(imgurl+flg[4]+"><br />第04戦 "+country[4]+"<br />"+sche[8]+"/"+sche[9]+"まであと<font color=red>"+count04+"</font>日");
	}
}

else if(count05>=0){
	if(count05==0){
		document.write(imgurl+flg[5]+"><br />第05戦 "+country[5]+"<br />"+sche[10]+"/"+sche[11]+w_hon);
	}else{
		document.write(imgurl+flg[5]+"><br />第05戦 "+country[5]+"<br />"+sche[10]+"/"+sche[11]+"まであと<font color=red>"+count05+"</font>日");
	}
}

else if(count06>=0){
	if(count06==0){
		document.write(imgurl+flg[6]+"><br />第06戦 "+country[6]+"<br />"+sche[12]+"/"+sche[13]+w_hon);
	}else{
		document.write(imgurl+flg[6]+"><br />第06戦 "+country[6]+"<br />"+sche[12]+"/"+sche[13]+"まであと<font color=red>"+count06+"</font>日");
	}
}

else if(count07>=0){
	if(count07==0){
		document.write(imgurl+flg[7]+"><br />第07戦 "+country[7]+"<br />"+sche[14]+"/"+sche[15]+w_hon);
	}else{
		document.write(imgurl+flg[7]+"><br />第07戦 "+country[7]+"<br />"+sche[14]+"/"+sche[15]+"まであと<font color=red>"+count07+"</font>日");
	}
}

else if(count08>=0){
	if(count08==0){
		document.write(imgurl+flg[8]+"><br />第08戦 "+country[8]+"<br />"+sche[16]+"/"+sche[17]+w_hon);
	}else{
		document.write(imgurl+flg[8]+"><br />第08戦 "+country[8]+"<br />"+sche[16]+"/"+sche[17]+"まであと<font color=red>"+count08+"</font>日");    
	} 
}   
    
else if(count09>=0){
	if(count09==0){   
		document.write(imgurl+flg[9]+"><br />第09戦 "+country[9]+"<br />"+sche[18]+"/"+sche[19]+w_hon);
	}else{ 
		document.write(imgurl+flg[9]+"><br />第09戦 "+country[9]+"<br />"+sche[18]+"/"+sche[19]+"まであと<font color=red>"+count09+"</font>日");
	}
}

else if(count10>=0){
	if(count10==0){
		document.write(imgurl+flg[10]+"><br />第10戦 "+country[10]+"<br />"+sche[20]+"/"+sche[21]+w_hon);
	}else{
		document.write(imgurl+flg[10]+"><br />第10戦 "+country[10]+"<br />"+sche[20]+"/"+sche[21]+"まであと<font color=red>"+count10+"</font>日");
	}
}

else if(count11>=0){
	if(count11==0){
		document.write(imgurl+flg[11]+"><br />第11戦 "+country[11]+"<br />"+sche[22]+"/"+sche[23]+w_hon);
	}else{
		document.write(imgurl+flg[11]+"><br />第11戦 "+country[11]+"<br />"+sche[22]+"/"+sche[23]+"まであと<font color=red>"+count11+"</font>日");
	}
}

else if(count12>=0){
	if(count12==0){
		document.write(imgurl+flg[12]+"><br />第12戦 "+country[12]+"<br />"+sche[24]+"/"+sche[25]+w_hon);
	}else{
		document.write(imgurl+flg[12]+"><br />第12戦 "+country[12]+"<br />"+sche[24]+"/"+sche[25]+"まであと<font color=red>"+count12+"</font>日");
	}
}

else if(count13>=0){
	if(count13==0){
		document.write(imgurl+flg[13]+"><br />第13戦 "+country[13]+"<br />"+sche[26]+"/"+sche[27]+w_hon);
	}else{
		document.write(imgurl+flg[13]+"><br />第13戦 "+country[13]+"<br />"+sche[26]+"/"+sche[27]+"まであと<font color=red>"+count13+"</font>日");
	}
}

else if(count14>=0){
	if(count14==0){
		document.write(imgurl+flg[14]+"><br />第14戦 "+country[14]+"<br />"+sche[28]+"/"+sche[29]+w_hon);
	}else{
		document.write(imgurl+flg[14]+"><br />第14戦 "+country[14]+"<br />"+sche[28]+"/"+sche[29]+"まであと<font color=red>"+count14+"</font>日");
	}
}

else if(count15>=0){
	if(count15==0){
		document.write(imgurl+flg[15]+"><br />第15戦 "+country[15]+"<br />"+sche[30]+"/"+sche[31]+w_hon);
	}else{
		document.write(imgurl+flg[15]+"><br />第15戦 "+country[15]+"<br />"+sche[30]+"/"+sche[31]+"まであと<font color=red>"+count15+"</font>日");
	}
}

else if(count16>=0){
	if(count16==0){
		document.write(imgurl+flg[16]+"><br />第16戦 "+country[16]+"<br />"+sche[32]+"/"+sche[33]+w_hon);
	}else{
		document.write(imgurl+flg[16]+"><br />第16戦 "+country[16]+"<br />"+sche[32]+"/"+sche[33]+"まであと<font color=red>"+count16+"</font>日");
	}
}

else if(count17>=0){
	if(count17==0){
		document.write(imgurl+flg[17]+"><br />第17戦 "+country[17]+"<br />"+sche[34]+"/"+sche[35]+w_hon);
	}else{
		document.write(imgurl+flg[17]+"><br />第17戦 "+country[17]+"<br />"+sche[34]+"/"+sche[35]+"まであと<font color=red>"+count17+"</font>日");
	}
}

else if(count18>=0){
	if(count18==0){
		document.write(imgurl+flg[18]+"><br />第18戦 "+country[18]+"<br />"+sche[36]+"/"+sche[37]+w_hon);
	}else{
		document.write(imgurl+flg[18]+"><br />第18戦 "+country[18]+"<br />"+sche[36]+"/"+sche[37]+"まであと<font color=red>"+count18+"</font>日");
	}
}

else if(count19>=0){
	if(count19==0){
		document.write(imgurl+flg[19]+"><br />最終戦 "+country[19]+"<br />"+sche[38]+"/"+sche[39]+w_hon);
	}else{
		document.write(imgurl+flg[19]+"><br />最終戦 "+country[19]+"<br />"+sche[38]+"/"+sche[39]+"まであと<font color=red>"+count19+"</font>日");
	}
}

else{
	document.write("<font color=red>F1 "+year+" シリーズ閉幕</font><br />"+imgurl+flg[19]+"><br />F1 "+(year+1)+" 開幕戦 "+country[19]+"<br />"+sche[39]+"/"+sche[40]+"まであと<font color=red>"+count19+"</font>日");
}

//-->
