// ¸µÅ© Á¡¼± ¾ø¾Ö±â
function bluring(){ 
//	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
	} 
//document.onfocusin=bluring;

// »óÅÂ¹Ù °¨Ãß±â ½ºÅ©¸³Æ®
function hidestatus()
{
	window.status=''
	return true
}
if (document.layers)
document.captureEvents(Event.mouseover | Event.mouseout)
document.onmouseover=hidestatus
document.onmouseout=hidestatus

// ÆË¾÷Ã¢
function ShowOpenWin( sName, sUrl, nLeft, nTop, nWidth, nHeight, nType)
{
	var sFeatures;
	// È­¸é °¡¿îµ¥ Ã¢ ¶ç¿ì±â
	if( nType == 0){
		sFeatures = "left="+ nLeft +", top="+ nTop +", width="+ nWidth +", height="+ nHeight;
	// »õÃ¢
	} else if ( nType == 1) {
		sFeatures = "fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes, left="+ nLeft +", top="+ nTop +", width="+ nWidth +", height="+ nHeight;
	} else if ( nType == 2) {
		nLeft	= ( window.screen.availWidth - nWidth) / 2;
		nTop	= ( window.screen.availHeight - nHeight) / 2;
		if (nLeft < 0)	nLeft	= 0;
		if (nTop < 0)	nTop	= 0;
		sFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes, left="+ nLeft +", top="+ nTop +", width="+ nWidth +", height="+ nHeight;
	} else if ( nType == 5) {
		sFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes, left="+ nLeft +", top="+ nTop +", width="+ nWidth +", height="+ nHeight;
	} else if ( nType == 3) { 
		sFeatures = "fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, left="+ nLeft +", top="+ nTop +", width="+ nWidth +", height="+ nHeight;
	// ¸ð´Þ Ã¢
	} else if ( nType == 4) { 
		if (document.all&&window.print) //if ie5
			sFeatures = "dialogWidth:"+nWidth+"px; dialogHeight: "+nHeight+"px; center: no; help: no; resizable: yes; status: no; scroll: yes;"; 
		else
			nType = 3	;
	} else {
		sFeatures = "fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes, left="+ nLeft +", top="+ nTop +", width="+ nWidth +", height="+ nHeight;
	}
	if( nType == 4){
// ¸ð´Þ¼³Á¤
//		CreateWin = showModalDialog(sUrl,window,'status:no;resizable:yes');
		CreateWin = window.showModelessDialog(sUrl, self, sFeatures);
//		CreateWin.focus();
	}else{
		CreateWin = window.open( sUrl, sName, sFeatures);
		CreateWin.focus();
	}
}

// IE ¼³°æ º¯°æ ´ëÃ³
function Embed_Media(obj) { 
	document.write(document.getElementById(obj).value);
}

function Embed_Edit(obj) {
//	str_Obj = document.getElementById(obj).value;
//	string  str_Obj1 = str_Obj.value.Replace("?2;"," ");
//	document.write(str_Obj1);
	document.write(document.getElementById(obj).value);
}

// ¼¼ÀÚ¸® ÄÞ¸¶ Âï±â
function makeCurrency(obj) { 
          var tmp = new Array(); 
          var c = 1; 
          var coma = ','; 
          var val = obj.value, val2 = ""; 
          var len = val.length; 

          for(i = len; i > -1; i--) { 
                    if(val.charAt(i) != coma) { 
                              val2 = val.charAt(i) + val2; 
                    } 
          } 
           
          val = val2; 
          len = val.length; 

          for(i = len; i > -1; i--) { 
                    c++; 

                    if((c % 3 == 0) && (i != len - 1)) { 
                              tmp[i] = val.charAt(i) + coma; 
                    } else { 
                              tmp[i] = val.charAt(i); 
                    } 
          } 
          obj.value = tmp.join(''); 
} 

// ¼ýÀÚ¸¸ ÀÔ·Â
function chkNum(key) {

    if ((key >= 48 && key <= 57) // Å°º¸µå »ó´Ü ¼ýÀÚÅ°
       || (key >= 96 && key <= 105) // Å°ÆÐµå ¼ýÀÚÅ°
       || key == 8  // ¹é½ºÆäÀÌ½º Å°
       || key == 37 // ¿ÞÂÊ È­»ìÇ¥ Å°
       || key == 39 // ¿À¸¥ÂÊ È­»ìÇ¥ Å°
       || key == 46 // DEL Å°
       || key == 13 // ¿£ÅÍ Å°
       || key == 9  // Tab Å°
       ) {
           return ;
      } else {
           alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
          return ;
     }
}

// ¼ýÀÚ Ã¼Å©
function checkNum(key)
{
    if ((key >= 48 && key <= 57)    || (key >= 96 && key <= 105)   || key == 8  || key == 37  || key == 39  || key == 46  || key == 13 || key == 9 )
    {
           return true;
      } else {
          alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù!");
          return false;
     }
}

//¼ýÀÚ¸¸ ÀÔ·Â onKeyUp
function num_only1(obj){
  if((event.keyCode<48) || (event.keyCode>57)){
	if (obj.value.length==1)
	{
		obj.value='';
	}else{
		obj.value=obj.value.substring(0,obj.value.length-1);
   }
    alert('¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.');
  }
}

//¼ýÀÚ¸¸ ÀÔ·Â onKeyPress
function num_only(){
  if((event.keyCode<48) || (event.keyCode>57)){
    event.returnValue=false;
  }
}

//¼ýÀÚ¸¸ ÀÔ·Â onChange
function checkNumber(){ 
	var objEv = event.srcElement; 
	var numPattern = /([^0-9])/; 
	numPattern = objEv.value.match(numPattern); 
	if(numPattern != null){ 
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!"); 
		objEv.value=""; 
		objEv.focus(); 
		return false; 
	} 
} 

/* ¼ýÀÚ¸¸ ÀÔ·Â*/
function CheckNumberKeys() { // ¹®ÀÚÀÔ·Â ±ÝÁö ÇÔ¼ö ¼³Á¤
	if( event.keyCode < 48 || event.keyCode > 57 ) {
		if (event.keyCode != 13) {
			event.keyCode=0;
			alert("¼ýÀÚ¸¸ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
		}
	}
}

//ÅØ½ºÆ® ¹Ú½º¿¡¼­ ÅÇÅ° Àû¿ë
function useTab(el){
	if(9==event.keyCode){
		(el.selection=document.selection.createRange()).text="\t";
		event.returnValue=false;
	}
}

// ÀÚµ¿ Æ÷Ä¿½º ÀÌµ¿
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
	input.value = input.value.slice(0, len);
	input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
	var found = false, index = 0;
	while(!found && index < arr.length)
	if(arr[index] == ele)
		found = true;
	else
		index++;
	return found;
}
function getIndex(input) {
	var index = -1, i = 0, found = false;
	while (i < input.form.length && index == -1)
	if (input.form[i] == input)index = i;
	else i++;
		return index;
	}
return true;
}

// ÅëÈ­ Æ÷¸Ë
function formatCurrency(num){ 
  var sign=""; 
  
  if(num==0) {
     return num;
  }
     
  if(num<0){ 
    num=Math.abs(num)*(-1);
    sign="-";
  }
  
  num=new String(num) 
  
  var temp="";
  var pos=3;
  var num_len=num.length;
  while (num_len>0){ 
    num_len=num_len-pos;
    if(num_len<0) {
      pos=num_len+pos;
      num_len=0;
    } 
    temp=","+num.substr(num_len,pos)+temp;
  } 
  return sign+temp.substr(1); 
} 

// °ø¹éÃ¼Å©
function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

// ´ÙÀ½ ÀÔ·Â Æ÷Ä¿½º ÀÌµ¿
function Field_Next(form,field)
{
var next=0, found=false
var f=form
if(event.keyCode!=13) return;
for(var i=0;i<f.length;i++)
	{
	if(field.name==f.item(i).name) 
	{
		next=i+1;
		found=true
		break;
	}
	}
while(found)  //Infinite loop 
	{
	if( f.item(next).disabled==false &&  f.item(next).type!='hidden')
		{
		f.item(next).focus();
		break;
		}
	else
		{
		if(next<f.length-1)
			next=next+1;
		else
			break;
			
		}
	}
}

// º¸ÀÌ±â
function hSetObjVisible(objId) {

	var obj = hGetObjStyle(objId);

	obj.display = 'block';
}
    // ¼û±â±â
function hSetObjHidden(objId) {

	var obj = hGetObjStyle(objId);

	obj.display = 'none';
}
function hGetObjStyle(objId) {

        // IE5+, NE6+
        if (document.getElementById && document.getElementById(objId)) {

            return document.getElementById(objId).style;

        } else if (document.all && document.all(objId)) {
        // IE4

            return document.all(objId).style;
        } else if (document.layers && document.layers[objId]) {
        // NE4

            return document.layer[objId];
        } else {

            return false;
        }
}

// ÆË¾÷Ã¢ Âü°íÀÚ·á¿ëÀÓ.

function close_window() 
  { 
   window.close(); 
   } 
 
function open_window(url){ 
                var str 
                str = "toolbar=0,location=0,directories=0,status=0,scrollbars=yes,resizable=1,width=644 ,height=650,top=20,left=20"
                plans = window.open(url,"",str ); 
                plans.focus(); 
        } 

//** ÀÔ·Â Byte Ã¼Å©
//onKeyUp="FUN_Input_Calc_Byte(this, Á¦ÇÑbyte¿ë·®)"
function FUN_Input_Calc_Byte(Obj, MaxByte){

	var Obj_String; //** °Ë»ç ÇÒ ÀÔ·ÂÆûÀÇ ±ÛÀÚ
	var Obj_Count_Byte =0; //** °Ë»ç ÇÒ ±ÛÀÚÀÇ Byte ¼ö
	var Obj_String_Length =0; //** °Ë»ç ±ÛÀÚÀÇ ±æÀÌ
	var tmpString; //** ±ÛÀÚÀÇ ÀÓ½ÃÀúÀå
	var OverByte = 0; //** ¿À¹öµÇ´Â ±ÛÀÚ ¹ÙÀÌÆ®
	var i;

	Obj_String = new String(Obj.value);
	Obj_String_Length = Obj_String.length;

	for(i=0;i<Obj_String_Length;i++){
		tmpString = Obj_String.charAt(i);

		if(escape(tmpString).length > 4){
			Obj_Count_Byte +=2;
		}else if (tmpString != 'r'){
			Obj_Count_Byte ++;
		}
	}

	if(Obj_Count_Byte > MaxByte){
		OverByte = Obj_Count_Byte - MaxByte;
		alert(MaxByte +'Byte ÀÌ»ó ÀÔ·ÂÇÏ½Ç¼ö ¾ø½À´Ï´Ù.\n\nÀÔ·Â ³»¿ëÁß '+ OverByte +'Byte´Â ÀÚµ¿ »èÁ¦ µË´Ï´Ù.');

//** ±ÛÀÚ ÀÚ¸£±â
		FUN_Input_Cut_Text(Obj, MaxByte);

//** Byte ¼ö ´Ù½Ã ÃøÁ¤
		setTimeout(function(){ FUN_Input_Calc_Byte(Obj, MaxByte); }, 300);
	}

	var CheckText = document.all[Obj.name +'_Byte'];
	if(CheckText){
		CheckText.innerText = Obj_Count_Byte +'/'+ MaxByte +'Byte'
	}
	return;
}

//** ±ÛÀÚ ÀÚ¸£±â
function FUN_Input_Cut_Text(Obj, MaxByte){

	var Obj_String; //** °Ë»ç ÇÒ ÀÔ·ÂÆûÀÇ ±ÛÀÚ
	var Obj_Count_Byte =0; //** °Ë»ç ÇÒ ±ÛÀÚÀÇ Byte ¼ö
	var Obj_String_Length =0; //** °Ë»ç ±ÛÀÚÀÇ ±æÀÌ
	var tmpString; //** ±ÛÀÚÀÇ ÀÓ½ÃÀúÀå
	var i;
	var a=', b';

	Obj_String = new String(Obj.value);
	Obj_String_Length = Obj_String.length;

	for(i=0;i<Obj_String_Length;i++){
		if(Obj_Count_Byte < MaxByte){
			tmpString = Obj_String.charAt(i);

			if(escape(tmpString).length > 4){
				Obj_Count_Byte +=2;
			}else if(tmpString != 'r'){
				Obj_Count_Byte ++;
			}
		}else{
			break;
		}
	}

	if((Obj_Count_Byte - MaxByte) == 0){
		Obj_String = Obj_String.substring(0, i);
	}else{
		Obj_String = Obj_String.substring(0, i-1);
	}

	if((MaxByte % 2)==1){
		Obj_String_Length = (Obj_String.length - 1);

		if(escape(Obj_String.charAt(Obj_String_Length)).length > 4){
			Obj_String = Obj_String.substring(0, Obj_String_Length);
		}
	}

	Obj.value = Obj_String;
	return;
}

//** ÅÂ±×Á¦°Å
function RemoveHTML( strText )
{
    var regEx = /<[^>]*>/g;
    return strText.replace(regEx, "");
}

//setImageWidth();
function setImageWidth(){
		if(!(document.all['mainimg'] && document.all['mainimg']))
			return;
		var w = document.all['mainimg'].width;
		var h = document.all['mainimg'].height;
		var timg = new Image();
		timg.src = document.all['mainimg'].src;
		var cnt = 0;
		if(w == 0) {
			if(cnt < 3){
				cnt++;
				setTimeout('setImageWidth()', 300);
			}
		} 
		/* else if(timg.width < w || timg.height < h) {
			document.all['mainimg'].src = "";
		} */ 
}
// ÅØ½ºÆ® »óÀÚ¿¡¼­ TabÅ° »ç¿ë
function useTab(el){
	if(9==event.keyCode){
		(el.selection=document.selection.createRange()).text="\t";
		event.returnValue=false;
	}
}

/**
 * ¼±ÅÃµÈ ¶óµð¿À¹öÆ°ÀÌ ÀÖ´ÂÁö Ã¼Å©
 */
function CheckedRadio(msg,input) {
	var j=0;
    if (input.length > 1) {
        for (var inx = 0; inx < input.length; inx++) {
            if (input[inx].checked==true) { j++; }
        }
		if (j==0)
		{
			alert(msg+" ¼±ÅÃÇØ ÁÖ¼¼¿ä...");
            input[0].focus();
            return ;
		} 
    }	else {
        if (!input.checked) {
               alert(msg+" ¼±ÅÃÇØ ÁÖ¼¼¿ä...");
                input[0].focus();
                return ;
			}
     }
}
/**
 * ¼±ÅÃµÈ Ã¼Å©¹Ú½º°¡ ÀÖ´ÂÁö Ã¼Å©
 */
function CheckedBox(msg,input) {
    return CheckedRadio(msg,input);
}

//ÁÖ¹Î¹øÈ£Ã¼Å©
function checkjumin(obj1,obj2){
      var total,i,sum,multy,comp,last;
   
      total = obj1+obj2;
      i = 0;
      sum = 0;
      multy="234567892345";
      while(i < 12){
           sum = sum+parseInt(total.substring(i,i+1))*parseInt(multy.substring(i,i+1));
           i = i+1; 
      }
      comp = 11-sum%11;
      last = parseInt(total.substring(12,13));
      if(comp == 11){
          comp = 1;
      }
      else{
        if (comp == 10){ 
          comp = 0;
        }
      }
      if (last != comp){
             return true;
      }
}

// ¼­ºñ½º ÇÏÀ§ ¸ñ·Ï Á¢±â ±â´É
function divDisplay(objId, act) {
	if (document.getElementById(objId)) {
		document.getElementById(objId).style.display = act;
	}
}

function publicInfo(obj, num) {
	if (document.getElementById("divId_" + num).style.display == "block") {
		obj.src = "/images/icons/icon_div_open.gif";
		divDisplay("divId_" + num, "none");
	} else {
		obj.src = "/images/icons/icon_div_close.gif";
		divDisplay("divId_" + num, "block");
	}
}

function divDisplay1(objId, act) {
	if (document.getElementById(objId)) {
		document.getElementById(objId).style.display = act;
	}
}

function addItem(obj_img,obj_frm,num) {
	if (num<10)
	{
		if (document.getElementById(obj_frm + (num+1)).style.display == "none") {
			divDisplay1(obj_frm + (num+1), "block");
			for (i=4;i<=num ;i++ )
			{
				divDisplay(obj_img+i, "none");
			}
		}
	}else{
        alert("ÃÖ´ë "+num+"°³±îÁö¸¸ È®ÀåÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
	}
}

function minusItem(obj_img,obj_frm,num) {
	if (document.getElementById(obj_frm +  num).style.display == "block") {
		divDisplay(obj_frm +  num, "none");
		divDisplay(obj_img+(num-1), "block");
	}
}

// Á¤º¸ º¸ÀÌ±â
function showdisplay(display,hidden,obj_frm,chk){ 
	menu=eval("document.all.block"+display+".style"); 
	menu1=eval("document.all.block"+hidden+".style"); 
	if (menu.display=="none"){
		menu.display="block"; 
		menu1.display="none"; 
	}
	var ch=eval("document.all."+obj_frm+"yy");
	if (ch.length)
	{
		ch[0].disabled=false;
		ch[1].disabled=true;
    	}
	var ch1=eval("document.all."+obj_frm+"mm");
	if (ch1.length)
	{
		ch1[0].disabled=false;
		ch1[1].disabled=true;
    	}
} 
// Á¤º¸ ¼û±â±â
function showhidden(display,hidden,obj_frm,chk){ 
	menu=eval("document.all.block"+display+".style"); 
	menu1=eval("document.all.block"+hidden+".style"); 
	if (menu.display=="block"){
		menu.display="none"; 
		menu1.display="block"; 
	}
	var ch=eval("document.all."+obj_frm+"yy");
	if (ch.length)
	{
		ch[0].disabled=true;
		ch[1].disabled=false;
    	}
	var ch1=eval("document.all."+obj_frm+"mm");
	if (ch1.length)
	{
		ch1[0].disabled=true;
		ch1[1].disabled=false;
    	}
}

// ÀÔ·Â »óÀÚ °ø¹é Ã¼Å©
function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

// ÀÔ·ÂÆû Ã¼Å©
function chkForm(f)
{
	var i,currEl;
	for(i = 0; i < f.elements.length; i++)
	{
		currEl = f.elements[i];
		if (currEl.getAttribute("required") != null)
		{
			if(currEl.type.toUpperCase() == "TEXT" || currEl.tagName.toUpperCase() == "SELECT" || currEl.tagName.toUpperCase() == "TEXTAREA" ||currEl.type.toUpperCase() == "PASSWORD" ||currEl.type.toUpperCase() == "FILE" ||currEl.type.toUpperCase() == "HIDDEN")
			{
				if(!chkText(currEl,currEl.hname)) return false;
			}
			else if(currEl.type.toUpperCase() == "CHECKBOX")
			{
				if(!chkCheckbox(f, currEl,currEl.hname)) return false;
			}
			else if(currEl.type.toUpperCase() == "RADIO")
			{
				if(!chkRadio(f, currEl,currEl.hname)) return false;
			}
		}
		if(currEl.getAttribute("option") != null && currEl.value.length > 0)
		{
			if(!chkPatten(currEl,currEl.option,currEl.hname)) return false;
		}
		if(currEl.getAttribute("lengthchk") != null && currEl.value.length > 0)
		{
			if(!chkLength(currEl,currEl.lengthchk,currEl.hname)) return false;
		}
	}
	f.submit();
	return true;
}

function getLength(str)
{
	return (str.length + (escape(str) + "/%u").match(/%u/g).length-1);
}

function chkLength(field,length,name)
{
	if(getLength(field.value) > length)
	{
		alert(name + "\n\n¿µ¹®,¼ýÀÚ "+length+"ÀÚ , ÇÑ±Û "+(length/2)+"ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÀ» Á¦ÇÑÇÕ´Ï´Ù!"); 
		field.focus();
		return false;
	}
	return true;
}

function chkText(field, name)
{
	if(field.value.length < 1 || trim(field.value)=="")
	{
		alert(name);
		field.focus();
		return false;
	}
	return true;
}

function chkCheckbox(form, field, name)
{
	fieldname = eval(form.name+'.'+field.name);
	if (!fieldname.checked)
	{
		alert(name);
		field.focus();
		return false;
	}
	return true;
}

function chkRadio(form, field, name)
{
	fieldname = eval(form.name+'.'+field.name);
	for (i=0;i<fieldname.length;i++)
	{
		if (fieldname[i].checked) return true; 
	}
	alert(name);
	field.focus();
	return false;
}

// Æ¯¼ö¹®ÀÚ ¸·±â onKeyDown="checkNumber();"
function checkSpecial()
{
	var objEv = event.srcElement;
	var num ="{}[]()<>?_|~`!@#$%^&*-+\"'\\/ ";
	event.returnValue = true;
  
	for (var i=0;i<objEv.value.length;i++)
	{
		if(-1 != num.indexOf(objEv.value.charAt(i)))
			event.returnValue = false;
	}
  
	if (!event.returnValue)
	{
		alert("Æ¯¼ö¹®ÀÚ´Â ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		objEv.value="";
	}
}


/**
* ·¹ÀÌ¾î ÀÌµ¿ ½ºÅ©¸³Æ®
* Á¦ÀÛÀÚ : iezn(iezn@iezn.com, MSN: iezn@iezn.com)
* È¨ÆäÀÌÁö : http://iezn.com
*
* »ç¿ë¹æ¹ý : È¨ÆäÀÌÁö ÇÏ´Ü¿¡ new IEZN_quick_menu_simple(object ÀÌµ¿ÇÒ·¹ÀÌ¾î,integer ÀÌµ¿½Ã ºê¶ó¿ìÁ®»ó´Ü°üÀÇ offset °ª);
*
* ÁÖÀÇ»çÇ× 
* - ¹Ýµå½Ã ·¹ÀÌ¾îÀÇ position °ªÀº absolute °ªÀÌ¾î¾ß ÇÕ´Ï´Ù
* - ·¹ÀÌ¾îÀÇ ÃÊ±âÀ§Ä¡´Â left,top ½ºÅ¸ÀÏ·Î Á¤ÀÇµÇ¾î ÀÖ¾î¾ß ÇÕ´Ï´Ù. (º¸ÀÌ´Â À§Ä¡¿¡¼­ ½½¶óÀÌµù µË´Ï´Ù)
* - DOM BASE ·Î Á¦ÀÛµÇ¾ú±â ¶§¹®¿¡ ¿Ã¹Ù¸£Áö ¾ÊÀº html ÆäÀÌÁö¿¡¼­ ¿¡·¯°¡ ³¯ ¼ö ÀÖ½À´Ï´Ù (¿¹: ÀÌ·±°æ¿ì´Â µå¹°Áö¸¸ body ÅÂ±×°¡ Á¸ÀçÇÏÁö ¾Ê°Å³ª ÇÑ°³ÀÌ»ó Á¸ÀçÇÒ°æ¿ì µî..)
* - ½½¶óÀÌµù ·¹ÀÌ¾î¿¡ background:url ·Î ¹è°æÀ» ÀÌ¹ÌÁö·Î »ç¿ëÇÏÁö ¸¶½Ã±â ¹Ù¶ø´Ï´Ù. ½½¶óÀÌµù½Ã IE ºê¶ó¿ìÁ®¿¡¼­ Áö¼ÓÀûÀ¸·Î ÆÄÀÏÀ» ¿¢¼¼½º ÇÕ´Ï´Ù 
*/

function IEZN_quick_menu_simple(input_obj,move_top){
	this.timeId	 = new Array();
	this.div_obj = new Array();
	try{
		this.input_obj = input_obj;
		this.input_obj.style.display = 'none';
	}catch(e){}
	var IEZN_quick_menu_counter;
	IEZN_quick_menu_counter = (typeof(IEZN_quick_menu_counter)=='undefined')? 0:IEZN_quick_menu_counter++;
	this.counter = IEZN_quick_menu_counter;
	this.div_obj_top = parseInt(this.input_obj.style.top);
	this.div_obj_left = parseInt(this.input_obj.style.left);	
	this.div_obj_max_move_top = (move_top)? move_top:this.div_obj_top;//browser top offset 
	this.move();
}

IEZN_quick_menu_simple.prototype = {	
	move : function(){
		this.div_obj = document.createElement("div");
		this.div_obj.id='izqm1'+this.counter;
		this.div_obj.style.position = 'absolute';
		this.div_obj.style.top=this.div_obj_top+'px';
		this.div_obj.style.padding='0px';
		this.div_obj.style.left=this.div_obj_left+'px';
		this.div_obj.style.backgroundColor=(this.input_obj.style.backgroundColor)? this.input_obj.style.backgroundColor:'transparent';
		this.div_obj.style.overflow='hidden';
		this.div_obj.style.textOverflow='ellipsis';
		this.div_obj.style.width=this.input_obj.style.width;
		this.div_obj.style.border=this.input_obj.style.border;
		this.div_obj.style.padding=this.input_obj.style.padding;
		try{
			document.body.appendChild(this.div_obj);			
			this.div_obj.innerHTML = this.input_obj.innerHTML;
			this.move_menu();
		}catch(e){alert(e)}
	},
	move_menu : function (){
		var obj = this;
		this.div_obj_start = parseInt(this.div_obj.style.top,10);
		this.div_obj_end = parseInt(this.scrollTop()) + parseInt(this.div_obj_max_move_top,10);
		if (this.div_obj_end < parseInt(this.div_obj_top,10)) this.div_obj_end = parseInt(this.div_obj_top,10);
		if (this.div_obj_start != this.div_obj_end ) {
			this.div_obj_offset = Math.ceil(Math.abs( this.div_obj_end - this.div_obj_start ) / 15 );
			t = parseInt(this.div_obj.style.top, 10) + ((this.div_obj_end<this.div_obj_start)? this.div_obj_offset*-1:this.div_obj_offset);
			this.div_obj.style.top = t+'px';
			this.slide_time = 10;
		}
		this.timeId[this.div_obj.id] = window.setTimeout(function(){obj.move_menu()},this.slide_time);
	},
	scrollTop : function (){//xhtml doctype patch
		if (window.pageYOffset){
			scroll_top = window.pageYOffset
		}else if (document.documentElement && document.documentElement.scrollTop){
			scroll_top = document.documentElement.scrollTop
		}else if (document.body){
			scroll_top = document.body.scrollTop
		}
		return scroll_top;
	}
}

function getObj(name) {   
	if(document.getElementById) {     
		this.obj = document.getElementById(name);     
		this.style = document.getElementById(name).style;   
	} else if(document.all) {     
		this.obj = document.all[name];     
		this.style = document.all[name].style;   
	} else if(document.layers) {     
		this.obj = document.layers[name];     
		this.style = document.layers[name];   
	} 
}

function swf(src, w, h)
{
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="wmode" value="Transparent">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#ffffff">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}

function ImageUp(url,LayerTarger)
{
var MaxImg = document.all.MaxImg;
MaxImg.filters.blendTrans.Apply();
MaxImg.src=url;
MaxImg.filters.blendTrans.Play();
}

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_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_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];}
}

// ÄÞº¸¹Ú½º ¸Þ´º ÀÌµ¿
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

