var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}

function enlarge(which, e, wheight){// (내용,'event','풍선내용 줄수')
    if (ie||ns6){
    crossobj=document.getElementById? document.getElementById("balloon") : document.all.balloon
	wheight = wheight * 20 + 28;
    var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
    var vertpos=ns6? pageYOffset + e.clientY - wheight  : ietruebody().scrollTop+event.clientY - wheight

    crossobj.style.left=horzpos+"px"
    crossobj.style.top=vertpos+"px"

    crossobj.innerHTML='<div class="balloon_top"></div><div class="balloon_mid t_11">'+which+'</div><div class="balloon_bottom"></div>'
    crossobj.style.visibility="visible"

return false
}
else
return true
}


function enlargeL(which, e, wheight){// (내용,'event','풍선내용 줄수')
    if (ie||ns6){
    crossobj=document.getElementById? document.getElementById("balloon") : document.all.balloon
	//wheight = wheight * 20 + 28;
	if(wheight == 1){
		wheight = -10;
	}else if(wheight == 2){
		wheight = -5;
	}else if(wheight == 3){
		wheight = 0;
	}else if(wheight > 4){
		wheight = (wheight * 6);
	}
    var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
    var vertpos=ns6? pageYOffset + e.clientY -90 -(wheight)  : ietruebody().scrollTop+event.clientY  -90 -(wheight)

    crossobj.style.left=(horzpos - 290)+"px"
    crossobj.style.top=vertpos+"px"
	crossobj.style.zIndex = 1000000;
    crossobj.innerHTML='<div class="balloon_top2"></div><div class="balloon_mid t_11">'+which+'</div><div class="balloon_bottom2"></div>'
    crossobj.style.visibility="visible"

return false
}
else
return true
}


function enlargeR(which, e, wheight){// (내용,'event','풍선내용 줄수')
    if (ie||ns6){
    crossobj=document.getElementById? document.getElementById("balloon") : document.all.balloon
	wheight = wheight ;
    var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
    var vertpos=ns6? pageYOffset + e.clientY - wheight  : ietruebody().scrollTop+event.clientY - wheight

    crossobj.style.left=(horzpos + 5)+"px"
    crossobj.style.top=vertpos+"px"

    crossobj.innerHTML='<div class="balloon_top3 t_11">'+which+'</div><div class="balloon_bottom3"></div>'
    crossobj.style.visibility="visible"

return false
}
else
return true
}

function closepreview(){
    crossobj.style.visibility="hidden"
}

function drag_drop(e){
    if (ie&&dragapproved){
        crossobj.style.left=tempx+event.clientX-offsetx+"px"
        crossobj.style.top=tempy+event.clientY-offsety+"px"
    }
    else if (ns6&&dragapproved){
        crossobj.style.left=tempx+e.clientX-offsetx+"px"
        crossobj.style.top=tempy+e.clientY-offsety+"px"
    }
return false
}

function initializedrag(e){
    if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
        offsetx=ie? event.clientX : e.clientX
        offsety=ie? event.clientY : e.clientY
        tempx=parseInt(crossobj.style.left)
        tempy=parseInt(crossobj.style.top)
        dragapproved=true
        document.onmousemove=drag_drop
    }
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")


var	viewCount=0;
 
function expandView(contents,btnID) {
	obj_con = document.getElementById('' + contents + '');
	obj_btn = document.getElementById('' + btnID + '');
	obj_btnAll = document.getElementById('btn_Expand');
	
	//alert(btnID);
	if (obj_con.style.display=="none" || obj_con.style.display=="")	{
		obj_con.style.display="block";
		obj_btn.src="/ENG/image/common/btn_conClose.gif";
		obj_btnAll.src="/ENG/image/common/btn_allClose.gif";
		obj_btnAll.setAttribute("alt","Close All");
		
		viewCount=viewCount+1;
		//alert(viewCount);
	}
	else	{
		obj_con.style.display="none";
		obj_btn.src="/ENG/image/common/btn_conOpen.gif";
		
		viewCount=viewCount-1;
		//alert(viewCount);
		if(viewCount==0)	{
			obj_btnAll.src="/ENG/image/common/btn_allExpand.gif";
			obj_btnAll.setAttribute("alt","Expand All");
		}
	}
}

function	expandAll(altV)	{
	obj_btnAll = document.getElementById('btn_Expand');
	obj_wrap = document.getElementById('expandViewWrap');
	obj_dt = obj_wrap.getElementsByTagName("dt");
	obj_dd = obj_wrap.getElementsByTagName("dd");
	
	if(document.getElementById("expandGbn") != null){
		document.getElementById("expandGbn").value = altV;
	}
	
	/*
	obj_dtimg = obj_dt[0].getElementsByTagName("img");
	alert(obj_dtimg.length);
	*/

		if	(altV=="Expand All")	{
			obj_btnAll.src="/ENG/image/common/btn_allClose.gif";
			obj_btnAll.setAttribute("alt","Close All");		
			
			for(var i = 0; i < obj_dd.length ; i++) {
				obj_dd[i].style.display="block";
				obj_dtimg = obj_dt[i].getElementsByTagName("img");
				obj_dtimg[1].src="/ENG/image/common/btn_conClose.gif";
				viewCount= obj_dd.length
			}
		}
		else	{
			obj_btnAll.src="/ENG/image/common/btn_allExpand.gif";
			obj_btnAll.setAttribute("alt","Expand All");
			
			for(var i = 0; i < obj_dd.length ; i++) {
				obj_dd[i].style.display="none";
				obj_dtimg = obj_dt[i].getElementsByTagName("img");
				obj_dtimg[1].src="/ENG/image/common/btn_conOpen.gif"
				viewCount= 0
			}
		}
}

function spec_balloon(n) {
	for(var i = 1; i <= 10; i++) {
		obj_d = document.getElementById('spec_balloon_'+i);

		if ( n == i ) {
				obj_d.style.display = "block";
		} else {
				obj_d.style.display = "none";
		}
	}
}
function naviView(n) {
	obj_T = document.getElementById('naviTab');
	for(var i = 0; i < 7; i++) {
		obj_T.className ="naviL naviBG0" + n + "";
	}
}