// object ¸¦ ÀÍ½ºÇÃ·Î·¯ ÆÐÄ¡¿¡ ¿µÇâ ¾È¹Þ°Ô ÇÏ±âÀ§ÇØ.
function objectlaunch(obcode)
{
    document.write(obcode);
}

// »óÅÂ¹ÙÀÇ ¸µÅ©ÁÖ¼Ò ³ªÅ¸³ª´Â°Í ¼û±â±â //
function hidestatus()
{
	window.status=''
	return true
}
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus
// »óÅÂ¹ÙÀÇ ¸µÅ©ÁÖ¼Ò ³ªÅ¸³ª´Â°Í ¼û±â±â //

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;

  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

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];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

////////////////////// ÀÌ¹ÌÁöÆÄÀÏ¸¸ ¾÷·Îµå °¡´ÉÇÏ°Ô ////////////////////////////////
function imgAttach(file) 
{
	var flag;
	if (!file) return;

	while (file.indexOf("\\") != -1)
	{
		file = file.slice(file.indexOf("\\") + 1);
		ext = file.slice(file.lastIndexOf(".")).toLowerCase();
		if ((ext == ".jpg") || (ext == ".JPG") || (ext == ".gif") || (ext == ".GIF") || (ext == ".jpeg") || (ext == ".JPEG") || (ext == ".png") || (ext == ".PNG")) { flag = "Y"; break; }
		else { flag = "N"; break; }
	}
	return flag;
}
////////////////////// ÀÌ¹ÌÁöÆÄÀÏ¸¸ ¾÷·Îµå °¡´ÉÇÏ°Ô ////////////////////////////////

// ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸ ÀÖ´ÂÁö Ã¼Å© // 
function valiCheck(field) 
{
	var valid = "abcdefghijklmnopqrstuvwxyz0123456789"
	var ok = "yes";
	var temp;
	for (var i=0; i<field.length; i++) 
	{
		temp = "" + field.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}
	if (ok == "no") 
	{
		alert("¼Ò¹®ÀÚ ¿µ¹®°ú ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù");
		return false;
	}

	return true;
}
// ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸ ÀÖ´ÂÁö Ã¼Å© // 

// ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸ ÀÔ·Â¹Þ°Ô // 
function valiCheckField(field) 
{
	var valid = "abcdefghijklmnopqrstuvwxyz0123456789"
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}
	if (ok == "no") 
	{
		alert("¼Ò¹®ÀÚ ¿µ¹®°ú ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù");
		field.focus();
		field.select();
	}
}
// ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸ ÀÔ·Â¹Þ°Ô // 


// showBtn(¹öÆ°width, ½ÇÇàµÉÇÔ¼ö,¹öÆ°TEXT, ¹öÆ°icon)
function showBtn(width,func,txt,icon)
{
       var btn = "";
       if(icon) icon = "<img src='"+icon+"'> ";
       else icon = "";

       btn += "<button class=bbtn onfocus='this.blur()' ";
       btn += "style='width:"+width+"' onClick=\""+func+"\" title='"+txt+"'>";
       btn += "<table cellspacing=0 cellpadding=0><tr>";
       btn += "<td class=ltd></td>";
       btn += "<td class=ctd>"+icon+txt+"</td>";
       btn += "<td class=rtd></td></tr></table>";
	   btn += "</button>";
       document.write(btn);
}

//////////////// ¿ìÆí¹øÈ£ Ã£±â ////////////////
function ZipWin(ref,what)
{
 	var window_left = (screen.width-640)/2;
 	var window_top = (screen.height-480)/2;
	ref = ref + "?what=" + what;      
	window.open(ref,"zipWin",'width=450,height=300, scrollbars=yes,status=no,top=' + window_top + ',left=' + window_left + '');
}
//////////////// ¿ìÆí¹øÈ£ Ã£±â ////////////////


//////////////// ¼ýÀÚ¸¸ ÀÔ·Â ////////////////
function isDigit (f,name)
{
	var str = eval("document."+f+"."+name);	
	for (var i = 0; i < str.value.length; i++)
	{
		if (str.value.charAt (i) < '0' || str.value.charAt (i) > '9')
		{
			alert("¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			str.value = "";
			str.focus();
			return false;
		}
	}
	return true;
}
//////////////// ¼ýÀÚ¸¸ ÀÔ·Â ////////////////

//¼ýÀÚ¸¸ ÀÔ·Â¹Þ´Â´Ù.
function onlyNum()
{
	if ((event.keyCode < 48) || (event.keyCode > 57)) event.returnValue = false;
	return true;
}


//////////////////// ÇÑ±ÛÀÔ·Â¾ÈµÇ°Ô Ã¼Å© ////////////////////////
function hanCheck(f,fieldname)
{
	var str = eval("document."+f+"."+fieldname);

	for(i=0;i<str.value.length;i++)
	{
		var a=str.value.charCodeAt(i);
		if (a > 128) 
		{
			alert('ÇÑ±ÛÀº »ç¿ëÇÏ½Ç¼ö ¾ø½À´Ï´Ù. ¿µ¹® ¶Ç´Â ¼ýÀÚ Á¶ÇÕÀ¸·Î ÇØÁÖ¼¼¿ä.');
//			str.value="";
			str.focus();
			return true;
		}
	}

	if((str.value.length < 4) || (str.value.length > 20))
	{
		alert('¾ÆÀÌµð´Â 4ÀÚÀÌ»ó 20ÀÚ ÀÌÇÏ·Î ¸¸µé¾îÁÖ¼¼¿ä.');
		str.value="";
		str.focus();
		return true;
	}
	return false;
}
//////////////////// ÇÑ±ÛÀÔ·Â¾ÈµÇ°Ô Ã¼Å© ////////////////////////


///////////////////// ¸ð´Þ Æû ¶ç¿ì±â //////////////////////////
function modalOpen(url,mwidth,mheight,top,left,resizable,scrollbars,status)
{ 
	if (window.showModalDialog){ window.showModalDialog(url,window,"help:0;dialogTop:"+top+"px;dialogLeft:"+left+"px;dialogWidth:"+mwidth+"px;dialogHeight:"+mheight+"px;scrollbars:"+scrollbars+";resizable:"+resizable+";status:"+status)  }
	else { alert('This method is only supported by Internet Explorer 4 and above.')  }
} 
///////////////////// ¸ð´Þ Æû ¶ç¿ì±â //////////////////////////


///////////////////// »õÃ¢ ¶ç¿ì±â //////////////////////////
function newOpen(url,name,mwidth,mheight,top,left,resizable,scrollbars,status,position,msg)
{
	// Ã¢ È­¸é°¡¿îµ¥·Î ¶ç¿ì±â //
	if(position=="CENTER")
	{
		if (window.screen) 
		{
			var aw = screen.availWidth - 10;
			var ah = screen.availHeight - 30;
			var xc = (aw - mwidth) / 2;
			var yc = (ah - mheight) / 2;
		
			left = xc;
			var screenX=yc;			
			top = xc;
			var screenY=yc;
		}
	}
		
	if(msg.length > 0)
	{
		if(confirm(msg)) 
		{
			eval('window.open(url,name,"top='+top+'px,left='+left+'px,screenX='+screenX+'px,screenY='+screenY+',width='+mwidth+'px,height='+mheight+'px,resizable='+resizable+',scrollbars='+scrollbars+',status='+status+'")');
		}
		else { return false; }
	}
	else
	{
		eval('window.open(url,name,"top='+top+'px,left='+left+'px,screenX='+screenX+'px,screenY='+screenY+',width='+mwidth+'px,height='+mheight+'px,resizable='+resizable+',scrollbars='+scrollbars+',status='+status+'")');
	}
}
///////////////////// »õÃ¢ ¶ç¿ì±â //////////////////////////


///////////////////// ¾çÂÊ °ø¹é ¾ø¾Ö±â /////////////////////
function trim (strSource) 
{
	re = /^\s+|\s+$/g;
	return strSource.replace(re, '');
}
///////////////////// ¾çÂÊ °ø¹é ¾ø¾Ö±â /////////////////////


///////////////////// ·¹ÇÁÆ®°ø¹é ¾ø¾Ö±â /////////////////////
function ltrim (strSource) 
{
	re = /^\s+/g;
	return strSource.replace(re, '');
}
///////////////////// ·¹ÇÁÆ®°ø¹é ¾ø¾Ö±â /////////////////////

///////////////////// ¿À¸¥ÂÊ°ø¹é ¾ø¾Ö±â /////////////////////
function rtrim (strSource) 
{
	re = /\s+$/g;
	return strSource.replace(re, '');
}
///////////////////// ¿À¸¥ÂÊ°ø¹é ¾ø¾Ö±â /////////////////////

////////////////////// ¾÷·Îµå ºÒ°¡ ÆÄÀÏ ÇÊÅÍ¸µ ////////////////////////////////
function LimitAttach(file,extArray) 
{
	var flag = "Y";
	if (!file) return;

	while (file.indexOf("\\") != -1)
	{
		file = file.slice(file.indexOf("\\") + 1);
		ext = file.slice(file.indexOf(".")).toLowerCase();
		for (var i = 0; i < extArray.length; i++) 
		{
			if (extArray[i] == ext)
			{
				flag = "N";
				break;
			} 
			if(flag == "N") break;
		}
	}
	return flag;
}
////////////////////// ¾÷·Îµå ºÒ°¡ ÆÄÀÏ ÇÊÅÍ¸µ ////////////////////////////////


///////////////////// ·¹´ë¿À ¹öÆ° Ã¼Å© ///////////////////////////////
function checkRadio(formName,fieldName,fieldVal)
{
	var str = eval("document."+formName+"."+fieldName);	
	
	var flag = "N";

	for(i=0;i<str.length;i++)
	{
		if(str[i].checked) { flag = "Y"; }
	}
	
	if(flag == "N") { alert(fieldVal+"¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä."); return false; }
	else { return true; }
}
///////////////////// ·¹´ë¿À ¹öÆ° Ã¼Å© ///////////////////////////////


// ºó ¾ÆÀÌÅÛÀ» È®ÀÎÇÏ°í ¿À·ù¸Þ½ÃÁö POP UP 
function IsEmptyRtnMsg(obj,msg,len) {
	var toCheck = obj.value;
	var chkstr = toCheck + "";
	var is_Space = true;
	if ((chkstr =="")||(chkstr == null)) {
		alert(msg + " ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		obj.focus();
		//obj.select();
		return true;
	}
	for (j=0; is_Space && (j<chkstr.length); j++)	{
		if (chkstr.substring(j,j+1) != "")
			is_Space = false;
	}
	if (is_Space)	{
		alert(msg + " ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		obj.focus();
		//obj.select();
		return true;
	}
	if (len != null)	{
		if (StrLeng(obj.value) > len)	{
			alert(msg + " ÇÑ±Û " + len/2 + ",¿µ¹® "+len+"ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.");
			obj.focus();
			//obj.select();
			return true;
		} else {
			return false;
		}
	}else return false;
}

// ¼ýÀÚÀÎÁö, ºñ¾îÀÖ´Â Áö ÆÇº°ÇÏ°í ¿À·ù¸Þ½ÃÁö Pop Up
function IsEmptyOrNotIntegerRtnMsg( obj, msg, len )	{
	var st = obj.value;
	if (!IsEmpty(st)) {
		for (j=0; (j<st.length); j++) {
			if ((st.substring(j,j+1) < "0")||(st.substring(j,j+1) > "9")) {
				alert(msg+" ¼ýÀÚ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.");
				obj.focus();
				//obj.select();
				return true;
			}
		}
	}	else	{
			alert(msg+" ÀÔ·ÂÇÏ½Ê½Ã¿À");
			obj.focus();
			//obj.select();
			return true;
	}
	if (len != null) {
		if (StrLeng(st) != len)	{
			alert(msg+""+len+"ÀÚ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.");
			obj.focus();
			//obj.select();
			return true;
		}
	}
	return false;
}

// ºñ¾î ÀÖ´ÂÁö¸¦  È®ÀÎ
function IsEmpty(toCheck)
{
	var chkstr = toCheck + "";
	var is_Space = true;
	if ((chkstr =="")||(chkstr == null)) {
		return true;
	}
	for (j=0; is_Space && (j<chkstr.length); j++)	{
		if (chkstr.substring(j,j+1) != "")
			is_Space = false;
	}
    return ( is_Space );
}

//¼ýÀÚÀÎÁö È®ÀÎ
function IsInteger(st)
{
    if (!IsEmpty(st)){
       for (j=0; j<st.length; j++){
         if (((st.substring(j, j+1) < "0") || (st.substring(j, j+1) > "9")))
	     return false;
       }
    } else {
       return false ;
    }
    return true ;
}


////////////  enter Ä¡¸é ´ÙÀ½ ÇÊµå·Î ÀÚµ¿ÀÌµ¿ ////////////////////////
function handleEnter (field, event)
{
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if (keyCode == 13) 
	{
		var i;
        for (i = 0; i < field.form.elements.length; i++)
		{
			if (field == field.form.elements[i]) break;
		}
		i = (i + 1) % field.form.elements.length;
		field.form.elements[i].focus();
		return false;
	} 
    else return true;
}    
////////////  enter Ä¡¸é ´ÙÀ½ ÇÊµå·Î ÀÚµ¿ÀÌµ¿ ////////////////////////


/////////// ÁÖ¹Î¹øÈ£·Î »ý³â¿ùÀÏ ±¸ÇÏ±â //////////////////
function snFromBirth(sn1,sn2)
{
	if ((sn1 != "") && (sn2 != ""))
	{
		var year = "";
		var sex = "";
		var flag = sn2.substr(0,1);

		if((flag == "1") || (flag == "3")) sex = "M";
		else sex = "W";

		if ((flag == "1") || (flag == "2")) { year = "19"; }
		else { year = "20"; }

		year += sn1.substr(0,2);
		month = sn1.substr(2,2);
		day = sn1.substr(4,2);
		
		var birthday = year+"-"+month+"-"+day+"-"+sex;

		return birthday;
	}
}
/////////// ÁÖ¹Î¹øÈ£·Î »ý³â¿ùÀÏ ±¸ÇÏ±â //////////////////


//////////////////// ÁÖ¹Î¹øÈ£ Ã¼Å© ////////////////////
function validSerial(f,ssn1,ssn2)
{
	var PNO1 = eval("document."+f+"."+ssn1);
	var PNO2 = eval("document."+f+"."+ssn2);
	var PN1 = eval("document."+f+"."+ssn1+".value");
	var PN2 = eval("document."+f+"."+ssn2+".value");

//	var PN=document.form1.mem_ssn1.value;
//	var PN1=document.form1.mem_ssn2.value;

	PN = PN1+'-'+PN2;
			
	if (PN.length !=14)
	{
		alert("À¯È¿ÇÏÁö ¾ÊÀº ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.");
//		document.form1.mem_ssn1.select();
		PNO1.select();
		return false;
	}

	PN1=PN.substr(0,6);
	PN2=PN.substr(7,7);
	chk=0;
	for (i=0;i<=5;i++) chk=chk+((i%8+2)*parseInt(PN1.substring(i,i+1)));
			
	for (i=6;i<=11;i++) chk=chk+((i%8+2)*parseInt(PN2.substring(i-6,i-5)));
			
	chk=11-(chk%11);
	chk=chk%10;
			
	if (chk !=PN2.substring(6,7))
	{
		alert("À¯È¿ÇÏÁö ¾ÊÀº ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\\nÁÖ¹Îµî·Ï¹øÈ£¸¦ ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À");
//		document.form1.mem_ssn1.select();
		PNO1.select();
		return false;
	}
	return true;
}
//////////////////// ÁÖ¹Î¹øÈ£ Ã¼Å© ////////////////////

//////////////////// ÀÌ¸ÞÀÏ ÁÖ¼Ò Ã¼Å© ////////////////////
function checkEmail(strField)
{ 
	var invalidaddress=new Array();
//	invalidaddress[0]='daum';		// ±ÝÁöÇÒ µµ¸ÞÀÎÀ» ÀÔ·Â ÇÏ¼¼¿ä 
//	invalidaddress[1]='hanmail';
	invalidaddress[1]='';

	var testresults;
	var invalidcheck=0; 
//	var str=document.form1.mem_email.value;
	var str = strField.value;

//	var filter = /^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	var filter = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");

	if (filter.test(str))
	{ 
		var tempstring=str.split('@');													//tempstring¿¡¼­ @ ±âÁØÀ¸·Î ºÐ¸®
		tempstring=tempstring[1].split('.');										//@À» ±âÁØÀ¸·Î ºÐ¸®ÇÑ¹®ÀÚ¿­¿¡¼­ . À» ±âÁØÀ¸·Î ºÐ¸®										
		for (i=0;i<invalidaddress.length;i++)
		{ 
			if (tempstring[0]==invalidaddress[i]) 
			invalidcheck=1 
		} 
		if (invalidcheck!=1){ testresults=true;}
		else{ alert('´Ù¸¥ ¸ÞÀÏ °èÁ¤À» »ç¿ëÇØ ÁÖ½Ã±æ ¹Ù¶ø´Ï´Ù.'); testresults=false;} 
	} 
	else
	{ 
		alert('ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù');
		testresults=false;
	} 
	return (testresults);
} 

function checkMail(f,fieldname)
{ 
	var str = eval("document."+f+"."+fieldname);

	if (document.layers||document.getElementById||document.all) 
	{		
		if(!checkEmail(str))
		{
			str.focus();
			return false;
		}
		else { return true ;}
	}
	else { return true; }
} 
//////////////////// ÀÌ¸ÞÀÏ ÁÖ¼Ò Ã¼Å© ////////////////////


/////////////////// ½½¶óÀÌµù ¹è³Ê  ////////////////////
function SlidingLayer() {

	this.version = "0.1";
	this.name = "NvChange";
	this.goTopFirstTop = document.all.goTopSpace.style.pixelTop;
	this.goTopFirstSpace = 0;
	this.goTopFirstLimit = 0;
	this.goTopLastTop = this.goTopFirstTop;
	this.intevalID = "";

	this.display = function () 
	{
		this.goTopLastTop = this.goTopLastTop + (((document.body.scrollTop + this.goTopFirstSpace) - this.goTopLastTop) * this.goTopFirstLimit);
		if(Math.abs(this.goTopLastTop - document.body.scrollTop) < 1.5) this.goTopLastTop = document.body.scrollTop;
		document.all.goTopSpace.style.pixelTop = this.goTopLastTop - 310;		
//		if(this.goTopFirstSpace == this.goTopLastTop) clearInterval(this.intervalID);
	};
}

/////////////////// ½½¶óÀÌµù ¹è³Ê  ////////////////////

/////////////////// ¼îÇÎ Å¸ÀÌÆ² »óÇ° ÃÊ¸¶´Ù ¹Ù²î´Â »óÇ° ////////////////////
function NvChange() {

	this.version = "0.1";
	this.name = "NvChange";
	this.item = new Array();
	this.itemcount = 0;
	this.itemoffset = 0;
	this.item_i = new Array();
	this.item_icount = 0;
	this.item_ioffset = 0;
	this.currentspeed = 0;
	this.scrollspeed = 50;
	this.pausedelay = 1000;
	this.pausemouseover = false;
	this.stop = 0;
	this.height = 100;
	this.heightGap = 0;
	this.width = 100;
	this.height_i = 100;
	this.width_i = 100;

	this.top = 100;
	this.left = 100;

	this.stopHeight=0;
	this.count=0;
	this.flag=true;
//	this.position="absolute";
	this.position="absolute";
	this.item_position="absolute";
	

	this.add = function () {
		var text = arguments[0];
		this.item[this.itemcount] = text;
		this.itemcount = this.itemcount + 1;
	};

	this.addImage = function () {
		var text = arguments[0];
		this.item_i[this.item_icount] = text;
		this.item_icount = this.item_icount + 1;
	};

	this.start = function () 
	{
		this.display();
		this.currentspeed = this.scrollspeed;
		obj = document.getElementById(this.name+'item0').style;
		obj.display='block';
		this.count++;
		setTimeout(this.name+'.scroll()',this.currentspeed);
	};

	this.ready = function () {
		now = new Date(); ran = now % this.item_icount;
		temp = this.item_i[ran]; this.item_i[ran] = this.item_i[0]; this.item_i[0] = temp;
		this.displayImage();
		obj_i = document.getElementById(this.name+'item_i0').style;
		obj_i.display='block';
	};

	this.display = function ()
	{
		document.write('<div id="'+this.name+'" style="height:'+this.height+';width:'+this.width+';position:'+this.position+'; left:'+this.left+'; top:'+this.top+'; overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
		for(var i = 0; i < this.itemcount; i++) 
		{
				document.write('<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+';position:'+this.item_position+'; display:none; ">');
				document.write(this.item[i]);
				document.write('</div>');
		}
		document.write('</div>');
	};

	this.displayImage = function () {
		document.write('<div id="'+this.name+'_i" style="left:0; height:'+this.height_i+';width:'+this.width_i+';position:relative;overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
		for(var i = 0; i < this.item_icount; i++) {
			document.write('<div id="'+this.name+'item_i'+i+'"style="left:0px; width:'+this.width_i+'; display:none; ">');
			document.write(this.item_i[i]);
			document.write('</div>');
		}
		document.write('</div>');
	};

	this.scroll = function () {
		this.currentspeed = this.scrollspeed;
		if ( !this.stop ) {
			this.imageChange();
		}
		window.setTimeout(this.name+".scroll()",this.currentspeed);
	};


	this.imageChange = function ()
	{
		for (k = 0; k < this.item_icount; k++) {
			obj_i = document.getElementById(this.name+'item_i'+k).style;
			if (this.count % this.item_icount == k) {
				obj_i.display = 'block';
			} else {
				obj_i.display = 'none';
			}
		}
		for (k = 0; k < this.itemcount; k++) {
			obj = document.getElementById(this.name+'item'+k).style;
			if (this.count % this.itemcount == k) {
				obj.display = 'block';
			} else {
				obj.display = 'none';
			}
		}
		this.count++;
	}

	this.onmouseover = function ()
	{
		if ( this.pausemouseover ) {
			this.stop = 1;
		}
	};
		for (k = 0; k < this.item_icount; k++) {
			obj_i = document.getElementById(this.name+'item_i'+k).style;
			if (this.count % this.item_icount == k) {
				obj_i.display = 'block';
			} else {
				obj_i.display = 'none';
			}
		}

	this.onmouseout = function ()
	{
		if ( this.pausemouseover ) {
			this.stop = 0;
		}
	};

	this.up = function ()
	{
		var i;
		this.stop++;

		if ( this.itemcount <= this.itemoffset )
			this.itemoffset = this.itemoffset % this.itemcount;

		for (i = 0; i < this.item_icount; i++) {
			obj_i = document.getElementById(this.name+'item_i'+i).style;
			if ( obj_i.display == "block" ) {this.item_ioffset = i+1;obj_i.display="none";}
		}

		if (this.item_icount > 0) {
			if (this.item_ioffset < this.item_icount) {
				obj_i = document.getElementById(this.name+'item_i'+this.item_ioffset).style;
				obj_i.display = "block";
			} else {
				obj_i = document.getElementById(this.name+'item_i0').style;
				obj_i.display = "block";
			}
		}
		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( obj.display == "block" ) {this.itemoffset = i+1;obj.display="none";}
		}
		if (this.itemoffset < this.itemcount) {
			obj = document.getElementById(this.name+'item'+this.itemoffset).style;
			obj.display = "block";
		} else {
			obj = document.getElementById(this.name+'item0').style;
			obj.display = "block";
		}
		window.setTimeout(this.name + ".stop--;",this.pausedelay);
		//this.stop--;
	}

}
/////////////////// ¼îÇÎ Å¸ÀÌÆ² »óÇ° ÃÊ¸¶´Ù ¹Ù²î´Â »óÇ° ////////////////////


function setCookie(name,value,expiredays ) 
{ 
        var todayDate = new Date(); 
        todayDate.setDate( todayDate.getDate() + expiredays ); 
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
}

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; 
}