// Hide And Show Toggle (숨기기/감추기)

var cc=0

function hideShow(id) 
{
    if (cc==0) 
    {
        cc=1
        document.getElementById(id).style.display="none";
    } 
    else 
    {
        cc=0
        document.getElementById(id).style.display="block";
    }
}

// Show And Hide Toggle

var cc=0

function showHide(id) 
{
    if (cc==0) {
        cc=1
        document.getElementById(id).style.display="block";
    } else {
        cc=0
        document.getElementById(id).style.display="none";
    }
}

// Local Navigation Toggle
function lnbToggle(id) {
	for(num=1; num<=3; num++) document.getElementById('D3MG'+num).style.display='none'; //D4MG1~D4MG3 까지 숨긴 다음
	document.getElementById(id).style.display='block'; //해당 ID만 보임
}

// IS (serch에서 사용한다.

function chkIsKind(key, value) 
{
    showHide('selectOrder');
    xGetElementById('search_target'+key).checked = true;
    xInnerHtml('search_target_label', value);
}

///////////////////////////////////////////////////////////////////////////
// 롤오버 2차메뉴 만들기


// Brower

var browserType='';

if(navigator.userAgent.indexOf("MSIE") >-1) 
{
   browserType = 'IE';
} 
else if(navigator.userAgent.indexOf("Firefox") >-1) 
{
   browserType = 'FF';
} 
else 
{
   browserType = 'OTHER';
}

// Sub Menu 시작 위치 인덱스 00--01--02--03--04--05--06--07--08--09--10--11--12--13--14--15
dica_left_pos_EE = new Array( 0, -5,106, 20,80,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);		// IE
dica_left_pos_FF = new Array( 0, -45,66, -20,40,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);		// Fire Fox 



function gnbinToggle(id, gnbblock) 
{
 	if(browserType == 'FF') 
 	{
  		gnbinToggleFF(id, gnbblock);
 	} 
 	else 
 	{
  	gnbinToggleIE(id, gnbblock);
 	}
}

// Local Navigation Toggle

function gnbinToggleIE(id, gnbblock) 
{
	for(num=0; num<gnb_count; num++) 
	{
		document.getElementById('gnb'+num).style.display='none';              	// 2차 메뉴
  		document.getElementById('gnbli'+num).setAttribute('className', 'off');  // 1차 메뉴
	}


 	var sub_1 = document.getElementById('gnbli'+id);     // 1 차메뉴
 	var sub_2 = document.getElementById('gnb'+id);       // 2 차메뉴
 
 	document.getElementById('gnb'+id).style.display = 'block';
 	gnbblock.className = "on";

	if (id == 0)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 1)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 2)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 3)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 4)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 5)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 6)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 7)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 8)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 9)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 10)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 11)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 12)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 13)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 14)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else if (id == 15)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[id]+'px';
	}
	else
	{
		sub_2.style.marginLeft = dica_left_pos_EE[0]+'px';
	}
}

// Local Navigation Toggle
function gnbinToggleFF(id, gnbblock) {

	for(var num=0; num<gnb_count; num++) 
	{
  		document.getElementById('gnb'+num).style.display='none'; // 2차 메뉴
  		document.getElementById('gnbli'+num).className = null;  // 1차 메뉴
 	}

 	var sub_1 = document.getElementById('gnbli'+id);     // 1 차메뉴
 	var sub_2 = document.getElementById('gnb'+id);     // 2 차메뉴
 	document.getElementById('gnb'+id).style.display = '';
 	gnbblock.className = "on";
  
	if (id == 0)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 1)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 2)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 3)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 4)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 5)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 6)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 7)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 8)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 9)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 10)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 11)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 12)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 13)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 14)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else if (id == 15)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[id]+'px';
	}
	else
	{
		sub_2.style.marginLeft = dica_left_pos_FF[0]+'px';
	}
}

function reset_menu()
{
	//alert('---'+browserType+'---'); 
	
 	if (browserType == 'FF') 	reset_menu_FF();
 	else 						reset_menu_IE();
}

function reset_menu_IE()
{
 	var sub_1 		= 0;
  	var sub_2 		= 0;

	var sub_1 = document.getElementById('gnbli'+gnb_count_now);     // 1 차메뉴
	var sub_2 = document.getElementById('gnb'+gnb_count_now);     	// 2 차메뉴
 
 
	if (gnb_count_now == 0)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 1)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 2)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 3)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 4)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 5)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 6)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 7)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 8)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 9)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 10)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 11)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 12)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 13)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 14)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 15)
	{
		sub_2.style.marginLeft = dica_left_pos_EE[gnb_count_now]+'px';
	}
	else
	{
		sub_2.style.marginLeft = dica_left_pos_EE[0]+'px';
	}
}

function reset_menu_FF()
{
 	var sub_1 		= 0;
  	var sub_2 		= 0;

	var sub_1 = document.getElementById('gnbli'+gnb_count_now);     // 1 차메뉴
	var sub_2 = document.getElementById('gnb'+gnb_count_now);     	// 2 차메뉴
 
 
	if (gnb_count_now == 0)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 1)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 2)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 3)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 4)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 5)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 6)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 7)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 8)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 9)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 10)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 11)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 12)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 13)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 14)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else if (gnb_count_now == 15)
	{
		sub_2.style.marginLeft = dica_left_pos_FF[gnb_count_now]+'px';
	}
	else
	{
		sub_2.style.marginLeft = dica_left_pos_FF[0]+'px';
	}
}




