<!--
//////////////////////////////////////////////////////////////////////////
//																		//
//		LEE&H JAVA SCRIPT 정의 (WITHUPLUS, 2009-08-28, LSP)				//
//																		//
//////////////////////////////////////////////////////////////////////////


//======================================
//				Cookie 얻기
//======================================
function getCookie(name)
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie )
		{
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}

//======================================
// 게시판보기
//======================================

function read_board(no,board)
{
    var w=560;
    var h=400;
    var left_size = (screen.width-w)/2;
    var top_size = (screen.height-h)/2;        
    var url="/news/news.asp?num="+no+"&mode=read&page_part="+board ;
    
    if (no == "") {
		alert("No News");
	} else if (no == "undefined")  {
		alert("No News");
	} else {
		location.href = url;
		//window.open( url, "read_board", "width="+w+",height="+h+",top="+top_size+",left="+left_size+",status=no,scrollbars=yes");	
	}
}

function read_board2(no,SrchQuery)
{
    var w=560;
    var h=400;
    var left_size = (screen.width-w)/2;
    var top_size = (screen.height-h)/2;        
    var url="/community/community.asp?idx="+no+"&mode=view"+SrchQuery ;
    
    if (no == "") {
		alert("게시판정보가 없습니다.");
	} else {
		location.href = url;
		//window.open( url, "read_board", "width="+w+",height="+h+",top="+top_size+",left="+left_size+",status=no,scrollbars=yes");	
	}
}


function case_info(no)
{
     
    var url="/casestudy/casestudy.asp?mode=view&cs_id="+no ;
    
    if (no == "") {
		alert("게이스 정보가 없습니다.");
	} else {
		location.href = url;
	}
}


//--------------------------------------
//	Popup Window(LSP)
//--------------------------------------

function CenterPopupWin(URL, WindowName, aWidth, aHeight,scrollbar){
	var w = aWidth - 0;
	var h = aHeight - 0;
    
	if ((w == 0) || (w > window.screen.width)) {		w = window.screen.width;	}
	if ((h == 0) || (h > window.screen.height - 40)) {	h = window.screen.height - 40;	}
	var l = window.screen.width  / 2 - w / 2;
    var t = window.screen.height / 2 - h / 2 - 40;

	if (t < 0 ) {	t = 0;	}	
    window.open(URL, WindowName, "Width="+ w +",Height="+ (h+4) +",Left="+ l +",Top="+ t +",status=no,scrollbars="+scrollbar+"");
}


function Read(a){
   window.open(a, "popup","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width=600,height=600,top=50,left=50");
}

function _ID(obj){return document.getElementById(obj)}


function LayerPopupWin(s,w,h)
{
	if (!w) w = 600;
	if (!h) h = 400;

	var pixelBorder = 3;
	var titleHeight = 22;
	w += pixelBorder * 2;
	h += pixelBorder * 2 + titleHeight;

	var bodyW = document.body.clientWidth;
	var bodyH = document.body.clientHeight;
	var scrollPosY = document.body.scrollTop;

	//.documentElement.

	var posX = (bodyW - w) / 2;
	var posY = (bodyH - h) / 2;

	var obj = document.createElement("div");
	
	with (obj.style){
		position = "absolute";
		left = 0;
		top = 0;
		width = "100%";
		height = document.body.scrollHeight;
		backgroundColor = "#000000";
		filter = "Alpha(Opacity=65)";
		opacity = "0.4";
	}
	
	obj.id = "PopupLayerBg";
	document.body.appendChild(obj);

	var obj = document.createElement("div");
	with (obj.style){
		position = "absolute";
		left = posX + document.body.scrollLeft;
		top = posY + document.body.scrollTop;
		width = w;
		height = h;
		backgroundColor = "#111111";
		border = "1px solid #000000";		
	}
	obj.id = "PopupLayer";
	document.body.appendChild(obj);

	var bottom = document.createElement("div");
	with (bottom.style){
		position = "absolute";
		width = w - pixelBorder * 2;
		height = titleHeight;
		left = 0;
		top = h - titleHeight - pixelBorder * 3;
		padding = "0px 0 0 0";
		textAlign = "right";
		//backgroundColor = "#ffffff";
		background = "url('/images/btn_close_bg.gif')";
		color = "#ffffff";
		font = "bold 11px tahoma";		
	}
	bottom.innerHTML = "<a href='javascript:LayerPopupClose()'><IMG SRC='/images/btn_close.gif' ALT='창닫기' border='0'></a> ";
	obj.appendChild(bottom);

	var ifrm = document.createElement("iframe");
	with (ifrm.style){
		width = w - 6;
		height = h - pixelBorder * 2 - titleHeight - 3;
	}
	ifrm.frameBorder = 0;
	ifrm.src = s;
	obj.appendChild(ifrm);
}

function LayerPopupClose(){
	_ID('PopupLayer').parentNode.removeChild( _ID('PopupLayer') );
	_ID('PopupLayerBg').parentNode.removeChild( _ID('PopupLayerBg') );
}

//======================================
//		IFRAME RESIZE
//======================================

function frameResize(fname,mx,my) {
	var MinX = mx; //최소 가로폭
	var MinY = my; //최소 세로폭

	var Frame_Body = document.frames(fname).document.body;
	var Frame_Name = document.all(fname);
	var x = Frame_Body.scrollWidth + (Frame_Body.offsetWidth - Frame_Body.clientWidth);
	var y = Frame_Body.scrollHeight + (Frame_Body.offsetHeight - Frame_Body.clientHeight);
	Frame_Name.style.width = x;

	if (x < MinX) x = MinX;
	if (y < MinY) y = MinY;
	Frame_Name.style.width = x;
	Frame_Name.style.height = y+20;
}


//--------------------------------------
//	Photography Detail View
//--------------------------------------
function Photo_View(position,photo){
 
	window.open("/images/photo_view.asp?position="+position+"&photo="+photo , "imgview","directories=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,titlebar=no,toolbar=no,width=50,height=50,top=50,left50");
}


//--------------------------------------
//	Popup Message
//--------------------------------------

function msg(a){
   alert(a);
}

function msg2(){
   alert("DB이전중입니다.");
}

//--------------------------------------
//	Jump Menu
//--------------------------------------
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function jumpMenu(form) {
  selection = form.popupwin.options[form.popupwin.selectedIndex].value;
  win = window.open(selection, 'popupwinname', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=900,height=600,left=0,top=0');
  win.focus();
}

function goRead(url,tbl,idx){
	var form = document.isForm;
	form.tbl.value = tbl;
	form.idx.value = idx;
	form.action = url;
	form.submit();
}
function goUrl(url){
	if(url.length > 0){
		window.open(url,'');
	}
}

//--------------------------------------
//	SwapImage(Rollover)
//--------------------------------------

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//--------------------------------------
//	구.사이트 JS
//--------------------------------------

function imgResize(obj, limitW){//미리 보기 이미지 사이즈 일괄적으로
		var limitH	= isAgm(imgResize.arguments, 2, null);
		if(obj){
			var w, h, resizeW, resizeH
			if(obj.width && obj.height){
				w		= obj.width;
				h		= obj.height;
				if(w > h || !limitH){		//원본 이미즈 사이즈가 가로가 더 크면
					resizeW	= w > limitW ? limitW : w;
					resizeH = (resizeW * h) / w;
				}else{			//반대이면
					resizeH = h > limitH ? limitH : h;
					resizeW = (resizeH * w) / h;
				}
			}
			obj.width = resizeW;
			obj.height = resizeH;
		}
	};

//~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
		//showlayer & hidelayer
//~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
  function showlayer(lay) {
  			document.getElementById(lay).style.display = document.getElementById(lay).style.display == "none" ? "" : "none";
  		};
  function hidelayer(lay) {
  			document.getElementById(lay).style.display = document.getElementById(lay).style.display == "" ? "none" : "";
  		};



//---------------------------------------
//	FLASH ACTIVE-X EMBED(10.0 Version,LSP)
//---------------------------------------

function swf_include(url,widthNum,hightNum,Access,bgColor,wMode,vars){
	var codeStr = "";
	codeStr += "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"";
	codeStr += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0\" width=\""+widthNum+"\" height=\""+hightNum+"\">";
	codeStr += "<param name=\"allowScriptAccess\" value=\""+Access+"\" />";
	codeStr += "<param name=\"movie\" value=\""+url+"\" />";
	codeStr += "<param name=\"flashvars\" value=\""+vars+"\" />";	
	codeStr += "<param name=\"menu\" value=\"false\" />";
	codeStr += "<param name=\"quality\" value=\"high\" />";
	codeStr += "<param name=\"wmode\" value=\""+wMode+"\" />";
	codeStr += "<param name=\"bgcolor\" value=\""+bgColor+"\" />";
	codeStr += "<embed src=\""+url+"\" flashvars=\""+vars+"\" allowScriptAccess=\""+Access+"\" menu=\"false\" quality=\"high\" wmode=\""+wMode+"\"";
	codeStr += "devicefont=\"true\" bgcolor=\""+bgColor+"\"  width=\""+widthNum+"\" height=\""+hightNum+"\" align=\"middle\" type=\"application/x-shockwave-flash\"";
	codeStr += "pluginspage=\"http://www.adobe.com/go/getflashplayer\">";
	codeStr += "</embed>";
	codeStr += "</object>";
	document.write(codeStr);
}



//--------------------------------------====================
//	MENU URL 정의 JS
//--------------------------------------====================

/******* MAIN LINK *****************/
function menu0() { location.href = "/main.asp"; } //1.회사소개
function menu1() { location.href = "/aboutus/aboutus.asp?page_part=about"; } //1.회사소개
function menu2() { location.href = "/services/services.asp?page_part=biz"; } //2.서비스
function menu3() { location.href = "/clients/clients.asp?page_part=current"; } //3.클라이언트
function menu4() { location.href = "/casestudy/casestudy.asp"; } //4.케이스 스터디
function menu5() { location.href = "/news/news.asp"; } //5.뉴스
function menu6() { top.location.href = "/english/"; } //English

/******* ABOUT US(회사소개) LINK *****************/
function menu1sub1() { location.href = "/aboutus/aboutus.asp?page_part=about"; } //About Us
function menu1sub2() { location.href = "/aboutus/aboutus.asp?page_part=ceo"; } //Ceo
function menu1sub3() { location.href = "/aboutus/aboutus.asp?page_part=history"; } //Hustory
function menu1sub4() { location.href = "/aboutus/aboutus.asp?page_part=recruit"; } //Recruit
function menu1sub5() { location.href = "/aboutus/aboutus.asp?page_part=contactus"; } //Contact

/******* SERVICES(서비스) LINK *****************/
function menu2sub1() { location.href = "/services/services.asp?page_part=biz"; } //
function menu2sub2() { location.href = "/services/services.asp?page_part=infra"; } //

/******* CLIENTS(클라이언트) LINK *****************/
function menu3sub1() { location.href = "/clients/clients.asp?page_part=current"; } //
function menu3sub2() { location.href = "/clients/clients.asp?page_part=past"; } //

/******* CASE STUDTY(케이스터디) LINK *****************/
function menu4sub1() { location.href = "/casestudy/casestudy.asp"; } //

/******* NEWS(뉴스) LINK *****************/
function menu5sub1()  {location.href = "/news/news.asp"; } //

/******* ETC(기타메뉴) LINK *****************/
function menu6sub1() { location.href = "/etc/sitemap.asp"; } //사이트맵(필요시)

//-->