function setPng24(obj) {
  obj.width=obj.height=1;
  obj.className=obj.className.replace(/\bpng24\b/i,'');
  obj.style.filter =
  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');";
  obj.src=''; 
  return '';
}

// Äü¸Þ´º (IE6, IE7, FF1.5, Opera9, Safari2¿¡¼­ Å×½ºÆ® ¿Ï·á)
function initMoving(target, topPosition, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = topPosition;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 500;
		}
	}
	obj.move = setInterval(function() {
		//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		pos = obj.getTop() + topPosition;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}



// ºê¶ó¿ìÀú Å×½ºÆ® 
var Browser = {
	isIE : navigator.userAgent.toLowerCase().indexOf("msie")!=-1,
	isIE_6 : navigator.userAgent.toLowerCase().indexOf("msie 6")!=-1,
	isIE_7 : navigator.userAgent.toLowerCase().indexOf("msie 7")!=-1,
	isIE_8 : navigator.userAgent.toLowerCase().indexOf("msie 8")!=-1,
	isFirefox : navigator.userAgent.toLowerCase().indexOf("firefox")!=-1,
	isSafari : navigator.userAgent.toLowerCase().indexOf("safari")!=-1 && navigator.userAgent.toLowerCase().indexOf("chrome")==-1,
	isOpera : navigator.userAgent.toLowerCase().indexOf("opera")!=-1,
	isChrome : navigator.userAgent.toLowerCase().indexOf("safari")!=-1 && navigator.userAgent.toLowerCase().indexOf("chrome")!=-1,
	isNetscape : navigator.userAgent.toLowerCase().indexOf("netscape")!=-1,
	isEtc : navigator.userAgent.toLowerCase().indexOf("gecko")!=-1 && navigator.userAgent.toLowerCase().indexOf("firefox")==-1 && navigator.userAgent.toLowerCase().indexOf("netscape")==-1
};

// getId : ID°¡ idÀÎ [object] °Ë»ö
function getId(id){
	return document.getElementById(id);
}

// obj_checker : [object] || [object].id °Ë»ö
function obj_checker(obj){
	if (!obj.tagName){ // obj°¡ [object]°¡ ¾Æ´Ï°í
		if (getId(obj)){ // obj°¡ [object].idÀÎ °æ¿ì
			obj = getId(obj);
		} else { // object Id ÀÔ·Â ¿À·ù
			return false;
		}
	} // obj°¡ [object]ÀÎ °æ¿ì´Â ±×´ë·Î Àü´Þ
	return obj;
}

// getTagName: [object] ³» TagNameÀÌ nameÀÎ °³Ã¼ °Ë»ö
function getTagName(name,obj){
	if (!obj){
		if (name == "body"){
			obj = document;
		} else {
			obj = document.body;
		}
	} else {
		obj = obj_checker(obj);
	}
	return obj.getElementsByTagName(name);
}

// bodyBrowserType_Set : body class¿¡ ºê¶ó¿ìÀúÅ¸ÀÔ ¼ÂÆÃ
function bodyBrowserType_Set(){
	var bodyObj = getTagName('body')[0];

	var browtype;
	if (Browser.isIE){
		if (Browser.isIE_6){ browtype = "ie_6"; }
		else if (Browser.isIE_7){ browtype = "ie_7"; }
		else if (Browser.isIE_8){ browtype = "ie_8"; }
		else {browtype = "ie";}
	} else if (Browser.isFirefox){ browtype = "firefox"; 
	} else if (Browser.isSafari){ browtype = "safari"; 
	} else if (Browser.isOpera){ browtype = "opera"; 
	} else if (Browser.isChrome){ browtype = "chrome"; 
	} else if (Browser.isNetscape){ browtype = "netscape"; 
	} else if (Browser.isEtc){ browtype = "etc"; }
	bodyObj.className = browtype;
}

addLoadEvent(function(){
	// common
	bodyBrowserType_Set();
})

// addLoadEvent
function addLoadEvent(func) {
	var oldload = window.onload;
	if(typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldload();
			func();
		}
	}
}


/*
 * @title : ÀÌ¹ÌÁö on´ëÃ¼
 * @version : 1.0
 * @what's new :
 */
function menuOn(imgEl)
{
  if(imgEl.src.indexOf("_on") < 0) imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}

/*
 * @title : ÀÌ¹ÌÁö off´ëÃ¼
 * @version : 1.0
 * @what's new :
 */
function menuOut(imgEl)
{
  imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}

function openLayerOver() {
	if (document.getElementById("layerInfo").style.display = "none")
	{
		document.getElementById("layerInfo").style.display = "block"
	}
}

function openLayerOut() {
	if (document.getElementById("layerInfo").style.display = "block")
	{
		document.getElementById("layerInfo").style.display = "none"
	}
}

 function setPng24(obj) {
        obj.width=obj.height=1;
        obj.className=obj.className.replace(/\bpng24\b/i,'');
        obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+obj.src+"',sizingMethod='image');"
        obj.src='';
        return '';
    }


////////////////////////////////////////////////////////////////////////////////////
// flash ¿¬µ¿ °ü·Ã function
////////////////////////////////////////////////////////////////////////////////////
//
// Flash Grid Component µ¿ÀÛ °³°ý
//
// 1. flash°¡ ·ÎµùÀÌ ¿Ï·áµÇ¸é flash ==> script dataGridLoadOk() È£Ãâ
// 2. ·Îµù Á÷ÈÄ Object ÅÂ±×ÀÇ param¿¡¼­ flashVars¼Ó¼ºÀÇ requestUrlÀÌ Á¸ÀçÇÏ¸é flash ==> script flash_enc() È£Ãâ
// 3. ·Îµù Á÷ÈÄ Object ÅÂ±×ÀÇ param¿¡¼­ flashVars¼Ó¼ºÀÇ requestUrlÀÌ Á¸ÀçÇÏÁö ¾ÊÀ¸¸é ¸ØÃã
// 4. Àü¼Û ¹öÆ°À» Å¬¸¯ ½Ã¿¡ flashDataGridSend()¸¦ È£ÃâÇÏ¸é flash ==> script flash_enc() È£Ãâ
////////////////////////////////////////////////////////////////////////////////////

// Flash Grid load ¿Ï·á ¿©ºÎ
var isFlashGridLoadOk = false;

// Flash Grid ÀÛ¾÷Áß ¿©ºÎ
var isFlashGridWorkingOk = false;

// flashLoad(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)
function flashLoad(url,w,h,id,bg,vars,win) {
	
	win = "transparent";
	
	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='base' value='.'>"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' base='.' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
	
	//FlashÀÇ ExternalInterface°¡ Form Tag³»¿¡¼­ ¿À·ù³ª´Â ¹ö±×¸¦ ÇØ°áÇÏ´Â ÄÚµå     
	eval("window." + id + " = document.getElementById('" + id + "');");

}
// »õÃ¢ ¸®»çÀÌÂ¡ ÆË¾÷¿ë
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//¸¶ÀÌ¿ÀÇÇ½º Á¶Á÷°ü¸® ¼­Ä¡¹Ú½º ÅÜ¸Þ´º
function Tab_searchbox(tabnum)
{	
	var TopMenuList = new Array('tab1','tab2');
 
	for (var i=0; i<TopMenuList.length; i++)
	{
		document.getElementById("topmenu_"+ TopMenuList[i]).src = "/kor/img/myoffice/searchbox_" + TopMenuList[i] + "_off.gif";
		document.getElementById("topmenu_"+ TopMenuList[i]).value= "0";
		document.getElementById("search_"+ TopMenuList[i]).style.display="none";
	}
 
	document.getElementById("topmenu_"+tabnum).src = "/kor/img/myoffice/searchbox_" + tabnum + "_on.gif";
	document.getElementById("topmenu_"+tabnum).value= "1";
	document.getElementById("search_"+ tabnum).style.display="block";
}

