//現在の時間を取得



//日付関数
function getDateString() {
	    var d = new Date();
	    var wday    = new Array('日','月','火','水','木','金','土');
	    var year    = d.getYear();
	    var month   = d.getMonth() + 1;
	    var days    = d.getDate();
	    var iDay    = d.getDay();
	    var sDate = 'MM月dd日（ddd）';
	    sDate = sDate.replace('MM', month);
	    sDate = sDate.replace('dd', days);
	    sDate = sDate.replace('ddd', wday[iDay]);
	    sDate = sDate.replace('yyyy', year);
	    return sDate;
	}

//iFrame設定	
function showFrame(turl){	
		document.getElementById("subwin").style.visibility = "hidden";
		document.getElementById("subwin").src=turl;
		document.getElementById("subwin-s").style.visibility = "visible";		
}

//払戻リンク設定
function f_harai(tYobi){
			
	if (tYobi == 1){
		var theIndex=document.harai1.jyo.selectedIndex;	
		theForm=thisKaisaiDateCode1[theIndex];		
	}else if (tYobi == 2){
		var theIndex=document.harai2.jyo.selectedIndex;
		theForm=thisKaisaiDateCode2[theIndex];
	}else{
		var theIndex=document.harai3.jyo.selectedIndex;
		theForm=thisKaisaiDateCode3[theIndex];
	}
	window.open("http://www.jrdb.com/h_j/hj_"+theForm+".html","harai");
}
	  
//リーディングリンク設定
function OpenLeading(tJT){
	
	if (tJT == "JK"){
		theURL=document.jocky_d.jyo.value;		
	}else if (tJT == "TR"){
		theURL=document.tranner_d.jyo.value;
	}	
	//window.open("http://home.jrdb.com/lead/"+theURL+".html","jtLeading");
	window.open("http://www.jrdb.com/leading/"+theURL+".html","jtLeading");
}

//馬場詳細リンク設定
function OpenCourse(){
	
	var theURL=document.baba_d.jyo.value;		
	window.open(" http://www.jrdb.com/kenkai/"+theURL+".html","babasa");
}

//カーソル変更
function f_ChangeCursor(tObj){
	tObj.style.cursor = 'hand';
}


function MM_openBrWindow(theURL,winName,feathers){//v2.0

	window.open(theURL,winName,feathers);
	
	var nSizeWidth = 2;		//うごかしたい位置（横）
	var nSizeHeight = 2;		//うごかしたい位置（高さ）
	
	//移動
	window.moveTo(0, 0);

}
//yyyymmdd~yyyymmdd~→yyyy/mm/dd~yyyy/mm/ddに日付変換
function f_setDate(tdate){

	myDel = "/";
	myDate = new Array()
	myDate = tdate.split("〜")
	
	myNen = new Array();
	myTsuki = new Array();
	myNichi = new Array();
	for (var i=0;i<myDate.length;i++){
		myNen[i] = myDate[i].substr(0,4);
		myTsuki[i] = myDate[i].substr(4,2);
		myNichi[i] = myDate[i].substr(6,2);
		
	}

	retDate = myNen[0] + myDel + myTsuki[0] + myDel + myNichi[0] +"〜"+myNen[1] + myDel + myTsuki[1] + myDel + myNichi[1];
	
	return retDate;
}

//ホームページに追加
/*
function f_setStartPage(o){

var ua = navigator.userAgent;
var ie = ua.indexOf("MSIE");
var iever = parseInt(ua.substring(ie+5, ie+6));
var os = ua.indexOf("Windows");

	if(ie > 0 && iever >= 5 && os > 0){
		document.body.style.behavior = "url('#default#homepage')";
		document.body.setHomePage("http://www.jrdb.com/");
	}else {
		alert("お使いのブラウザでは設定できません。")
		//location.href="http://help.msn.co.jp/www.htm#6";
	}
}
*/