var currentObj = null;  //ÇÏ³ª¸¸ ¼±ÅÃÇÏ±â À§ÇÑ °Í.
var colorOn = '#EEEEEE'; //
var colorOn2 = '#8DD0D4'; //
var colorOut = ''; //

//Å¬¸¯ÇÒ °æ¿ì ¹è°æ»öÀ» È¸»öÀ¸·Î ¹Ù²Ù°í ´Ù½Ã Å¬¸¯ÇÏ¸é ¿ø·¡´ë·Î ÇÑ´Ù.
function mouseClick(obj) {
	if(currentObj != null){
		currentObj.style.background=colorOut;
	}
   if(obj != currentObj){
		obj.style.background=colorOn;
		currentObj = obj;
   }
   else{
   	currentObj = null;
   }
}

//¸¶¿ì½º¸¦ °®´Ùµ¨ ¶§ ¹è°æ»öÀÌ ¹Ù²îµµ·Ï ÇÑ´Ù.
function mouseOut(obj) {
	obj.style.background=colorOut;
   if(currentObj != null){
      currentObj.style.background=colorOn;      
   }
}

//¸¶¿ì½º¸¦ ¶ª ¶§ ¹è°æ»öÀÌ µ¹¾Æ¿Àµµ·Ï ÇÑ´Ù.
function mouseOn(obj) {
	obj.style.background=colorOn;
}

//¸¶¿ì½º¸¦ ¶ª ¶§ ¹è°æ»öÀÌ µ¹¾Æ¿Àµµ·Ï ÇÑ´Ù.
function mouseOn2(obj) {
	obj.style.background=colorOn2;
}



//¹Ø¿¡ °ÍµéÀº ÇÑ¹ø¿¡ µÎ°³°¡ ¼±ÅÃµÇµµ·Ï ÇÏ±â À§ÇÔÀÌ´Ù. 
function mouseClick2_top(obj) {		
	if(currentObj != null){
		currentObj.style.background=colorOut;
		currentObj.parentElement.rows[currentObj.rowIndex+1].style.background = colorOut;
	}
   if(obj != currentObj){
   	//alert(obj);
		obj.style.background=colorOn;
		obj.parentElement.rows[obj.rowIndex+1].style.background = colorOn;
		currentObj = obj;
   }
   else{
   	currentObj = null;
   }
}

function mouseClick2_bottom(obj) {
   if(currentObj != null){
		currentObj.style.background=colorOut;
		currentObj.parentElement.rows[currentObj.rowIndex+1].style.background = colorOut;
	}
   if(obj.parentElement.rows[obj.rowIndex-1] != currentObj){
		obj.style.background=colorOn;
		obj.parentElement.rows[obj.rowIndex-1].style.background = colorOn;
		currentObj = obj.parentElement.rows[obj.rowIndex-1];
   }
   else{
   	currentObj = null;
   }
}

function mouseOn2_top(obj) {
	obj.style.background = colorOn;
   obj.parentElement.rows[obj.rowIndex+1].style.background = colorOn;
}

function mouseOn2_bottom(obj) {
   obj.style.background = colorOn;
	obj.parentElement.rows[obj.rowIndex-1].style.background = colorOn;
}

function mouseOut2_top(obj) {
	if(obj != currentObj){
      obj.style.background = colorOut;
      obj.parentElement.rows[obj.rowIndex+1].style.background = colorOut;
   }
}
function mouseOut2_bottom(obj) {
	if(obj.parentElement.rows[obj.rowIndex-1] != currentObj){
      obj.style.background = colorOut;
      obj.parentElement.rows[obj.rowIndex-1].style.background = colorOut;
   }
}