// JavaScript Document

function setOrdinallyaction()
{
	//	function 1
	if( document.getElementById("log_id") ){
		document.getElementById("log_id").focus();
	};

	$$("a").each(function(node){
		Event.observe(node, 'focus', function(){this.blur();}, false);
	 });

	//	function 2
	$$(".topnavi").each(function (hnode){
		hnode.originalSrc = hnode.src;
		hnode.rolloverSrc = hnode.originalSrc.replace('.gif', '2.gif');
		preloadImage(hnode.rolloverSrc);
			
		Event.observe(hnode, 'mouseover', function(){
			return this.src = this.rolloverSrc;
			},false);
			
		Event.observe(hnode, 'mouseout', function(){
			return this.src = this.originalSrc;
			},false);
	 });

	//	function 3
	$$(".slBt").each(function (slB){
		slB.originalSrc = slB.src;
		slB.mousedownSrc = slB.originalSrc.replace('.gif', '2.gif');
		slB.mouseupSrc = slB.mousedownSrc.replace('2.gif', '.gif');
		preloadImage(slB.mousedownSrc);
		preloadImage(slB.mouseupSrc);

		Event.observe(slB, 'mousedown', function(){
			return this.src = this.mousedownSrc;
			},false);
			
		Event.observe(slB, 'mouseup', function(){
			return this.src = this.mouseupSrc;
			},false);
		
		Event.observe(slB, 'mouseout', function(){
			return this.src = this.originalSrc;
			},false);
	 });

	//	function 4
	$$(".pointbt").each(function (pointB){
		pointB.originalSrc = pointB.src;
		pointB.mouseoverSrc = pointB.originalSrc.replace('1.gif', '2.gif');
		pointB.mousedownSrc = pointB.mouseoverSrc.replace('2.gif', '3.gif');
		pointB.mouseupSrc = pointB.mousedownSrc.replace('3.gif', '2.gif');
		preloadImage(pointB.mouseoverSrc);
		preloadImage(pointB.mousedownSrc);
		preloadImage(pointB.mouseupSrc);

		Event.observe(pointB, 'mouseover', function(){
			return this.src = this.mouseoverSrc;
			},false);
			
		Event.observe(pointB, 'mousedown', function(){
			return this.src = this.mousedownSrc;
			},false);

		Event.observe(pointB, 'mouseup', function(){
			return this.src = this.mouseupSrc;
			},false);

		Event.observe(pointB, 'mouseout', function(){
			return this.src = this.originalSrc;
			},false);
	 });

	//	function 5
	var conftable = {
		childNodeName : 'tr',
		oddClassName : 'oddlineLIST',
		evenClassName : 'evenlineLIST'
	};
	var tablesLine = $$(".BETcardList");
	tablesLine.each(function (tableLine){
		var lines = $A(tableLine.getElementsByTagName(conftable.childNodeName));
		lines.each(function (tr, row){
			if(row%2==0) {
				tr.className = conftable.oddClassName;
			} else {
				tr.className = conftable.evenClassName;
			}
		});
	});

	//	function 6
	var conftable = {
		childNodeName : 'tr',
		oddClassName : 'oddlineLIST',
		evenClassName : 'evenlineLIST'
	};
	var tablesLine = $$(".MatchOdds");
	tablesLine.each(function (tableLine){
		var lines = $A(tableLine.getElementsByTagName(conftable.childNodeName));
		lines.each(function (tr, row){
			if(row%2==0) {
				tr.className = conftable.oddClassName;
			} else {
				tr.className = conftable.evenClassName;
			}
		});
	});

	//	function 7
	$$(".IndOdds").each(function (inodds){
			
		Event.observe(inodds, 'mouseover', function(){
			this.style.backgroundcolor = "#1F72FF";
			this.style.color = "#FFFFFF";
			this.style.backgroundImage = "url(/support/image/obb2.gif)";
			},false);
			
		Event.observe(inodds, 'mouseout', function(){
			this.style.backgroundcolor = "#1FAAFF";
			this.style.color = "#333333";
			this.style.backgroundImage = "url(/support/image/obb1.gif)";
			},false);
	 });

	$$(".NoIndOdds").each(function (inodds){
			
		Event.observe(inodds, 'mouseover', function(){
			this.style.backgroundcolor = "#1F72FF";
			this.style.color = "#FFFFFF";
			this.style.backgroundImage = "url(/support/image/obb2.gif)";
			},false);
			
		Event.observe(inodds, 'mouseout', function(){
			this.style.backgroundcolor = "#1FAAFF";
			this.style.color = "#333333";
			this.style.backgroundImage = "url(/support/image/obb1.gif)";
			},false);
	 });

	//	function 8
	$$(".tbOd").each(function (tbOd){
			
		Event.observe(tbOd, 'mouseover', function(){
			this.style.backgroundColor = "#1F72FF";
			this.style.color = "#FFFFFF";
			this.style.backgroundImage = "url(/support/image/obb2.gif)";
			},false);
			
		Event.observe(tbOd, 'mouseout', function(){
			this.style.backgroundColor = "#1FAAFF";
			this.style.color = "#333333";
			this.style.backgroundImage = "url(/support/image/obb1.gif)";
			},false);
	 });
	//	function 9
	$$(".tbOt").each(function (tbOt){
			
		Event.observe(tbOt, 'mouseover', function(){
			this.style.backgroundColor = "#1F72FF";
			this.style.color = "#FFFFFF";
			this.style.backgroundImage = "url(/support/image/obb2.gif)";
			},false);
			
		Event.observe(tbOt, 'mouseout', function(){
			this.style.backgroundColor = "#1FAAFF";
			this.style.color = "#333333";
			this.style.backgroundImage = "url(/support/image/obb1.gif)";
			},false);
	 });
	

}

//	function 00
preloadImages = [];
function preloadImage(url){
	var p = preloadImages;
	var l = p.length;
	p[l] = new Image();
	p[l].src = url;
}


function gomatch(gameid,mainid,subid,oddsid){
	window.location.href = "match.html?num=" + gameid + "&kd=" + mainid + "&sbkd=" + subid + "&oid=" + oddsid;
}



Event.observe(window, 'load', setOrdinallyaction, false);

