var mytop=320;  //Ã³À½¸Þ´ºÀÇ»ó´ÜÀ§Ä¡
function mymenuscroll() {  //½ºÅ©·Ñ½Ã¼öÇà

    //¸Þ´ºÀÇ»ó´ÜÀ§Ä¡¸¦½ºÅ©·ÑÀÇ»ó´ÜÀ§Ä¡¿Íºñ±³ÇÏ¿©Á¤ÇÔ
    var m_menu=document.all.sky;
    var s_top=document.body.scrollTop
    m_menu.style.top=s_top>mytop?s_top:mytop;
}
//Flash Writer
function WriteFlash(n, w, h, str) {
	
	var doc="";

	doc+="<object id='shell_object' name='";
	doc+=n;
	doc+="' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=9,0,16,0' width='";
	doc+=w;
	doc+="' height='";
	doc+=h;
	doc+="'>";
	doc+="<param name='movie' value='";
	doc+=str;
	doc+="' />";
	doc+="<param name='quality' value='high' />";
	doc+="<param name='wmode' value='opaque' />";
	doc+="<param name='menu' value='0' /> ";
	doc+="<param name='bgcolor' value='#ffffff' />";
	doc+="<param name='FlashVars' value='loc=ko_KR' />";
	doc+="<embed id='shell_object' name='";
	doc+=n;
	doc+="' type='application/x-shockwave-flash' src='";
	doc+=str;
	doc+="' flashvars='loc=ko_KR' quality='high' bgcolor='#FFFFFF' menu='0' width='";
	doc+=w;
	doc+="' height='";
	doc+=h;
	doc+="' pluginspage='http://www.macromedia.com/go/getflashplayer_kr' wmode='opaque'></embed>";
	doc+="</object>";

	document.write(doc);

}

//Á¤±Ô½ÄÀ» ÀÌ¿ëÇÑ È­ÀÌÆ®½ºÆäÀÌ½º ¹þ°Ü³»´Â ÇÔ¼ö
function trim(str) {

	str = str.replace(/^\s*/,'').replace(/\s*$/, '');
	return str;
	
}

//¸Þ½ÃÁö¸¦ »Ñ¸®°í ÇØ´ç ¿ÀºêÁ§Æ®¿¡ Æ÷Ä¿½º ¸ÂÃß´Â ÇÔ¼ö
function AlertMsgFocus(msg, obj) {

	alert(msg);
	obj.focus();
	return false;

}

function IDFocus(obj) {
	obj.focus();
}

//¼ýÀÚ¸¸ ÀÔ·Â¹Þ¾Æ¼­ Àû´çÇÑ ±æÀÌ¸é ´ÙÀ½ ¿ÀºêÁ§Æ®·Î Æ÷Ä¿½º ¿Å±â±â
function InputNextItem(pobj, nobj, t) {
	
	if(isNaN(pobj.value)) AlertMsgFocus("¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.", pobj);
	else {
		if(pobj.value.length==t) nobj.focus();
	}
	
}

//Ã¼Å©¹Ú½º Ã¼Å©
function CheckBox(obj) {
	
	objlen=obj.length;
	tmp=false;
	for(i=0;i<objlen;i++) {
		if(obj[i].checked) tmp=true;
	}
	return tmp;
	
}

//ÆË¾÷Ã¢
function OpenWindow(url ,mwidth, mheight, mleft) { 

	if (document.all&&window.print) IDCheck_flag=eval('window.showModelessDialog(url,window,"help:0;dialogtop:110px;dialogleft:'+mleft+'px;scroll=no;resizable:0;status:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")');
	else IDCheck_flag=eval('window.open(url,"","top=23px,left='+mleft+'px,width='+mwidth+'px,height='+mheight+'px,resizable=0,scroll=no,status=0")');	
}

//¿µ¾î¿Í ¼ýÀÚ ¹× ±âÅ¸ Æ¯¼ö¹®ÀÚ¸¸ ¾ÆÀÌµð Çã¿ë
function InputID(str) {
	
	var i;
	var Alpha= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-';
	compstr = new String(str);

	for (i =0;i<compstr.length;i++) {
	    if (Alpha.indexOf(compstr.substring(i,i+1))<0) {
			return false;
		}
	}
   return true;
   
}

//ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©
function CheckMail(str)
{
	if(str.search(/^\s*[\w\~\-\.]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g) == -1) {
		return false;
	}
	return true;
}

//³¯Â¥ Çü½Ä Ã¼Å©
function CheckDate(y, m, d) {
	var err=true;
	var daa=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

	if(y%1000 != 0 && y%4 == 0) daa[1] = 29; // À±³â
	if(d > daa[m-1] || d < 1) err=false; // ³¯Â¥ Ã¼Å©
	if(m < 1 || m > 12) err=false; // ¿ù Ã¼Å©
	if(m%1 != 0 || y%1 != 0 || d%1 != 0) err=false; // Á¤¼ö Ã¼Å©
	return err;
}

//ÁÖ¹Î¹øÈ£ Çü½Ä Ã¼Å©
function JuminCheck(jumin1, jumin2) { 
	check = false;
	total = 0;
	temp = new Array(13);

	for(i=1; i<=6; i++) temp[i] = jumin1.charAt(i-1);
	for(i=7; i<=13; i++) temp[i] = jumin2.charAt(i-7);

	for(i=1; i<=12; i++) {
		k = i + 1;
		if(k >= 10)
		k = k % 10 + 2;
	total = total + temp[i] * k;
	}
	mm = temp[3] + temp[4]; 
	dd = temp[5] + temp[6]; 

	totalmod = total % 11; 
	chd = 11 - totalmod; 
	
	if(chd == temp[13] && mm < 13 && dd < 32 && (temp[7]==1 || temp[7]==2)) check=true; 
	
	return check;
} 

//»ç¾÷ÀÚ µî·Ï¹øÈ£ Ã¼Å©
function check_busino(vencod) {
	var sum = 0;
	var getlist =new Array(10);
	var chkvalue =new Array("1","3","7","1","3","7","1","3","5");
	for(var i=0; i<10; i++) getlist[i] = vencod.substring(i, i+1);
	for(var i=0; i<9; i++) sum += getlist[i]*chkvalue[i];
	sum = sum + parseInt((getlist[8]*5)/10);
	sidliy = sum % 10;
	sidchk = 0;
	if(sidliy != 0) sidchk = 10 - sidliy;
	else sidchk = 0;
	if(sidchk != getlist[9]) return false;
	return true;
}

//¼ýÀÚ¿¡ ¼¼ÀÚ¸®¸¶´Ù ½°Ç¥
function FormatCurrency(num) {
	num=num.toString();
	len=num.length;

	divideNum=Math.floor(len / 3);
	startStrLen=len % 3;

	resultStr=num.substr(0, startStrLen );  
	remainStr=num.substr(startStrLen, len - startStrLen );  

	tmpStr = "";

	if(remainStr != "") {
		for(i=0;i<divideNum;i++) tmpStr=tmpStr + "," + remainStr.substr(i*3, 3);
	}

	resultStr = resultStr + tmpStr;

	if ( startStrLen == 0 ) resultStr = resultStr.substr(1, resultStr.length - 1);
	return resultStr;
}

//function MakeDate(num) {

function MakeDate(strAmount) {//fnAddDay(strTargetDate , strAmount) {
	
	strAmount=Number(strAmount);
	date=new Date();
	thisYear=date.getFullYear();
	thisMonth=date.getMonth()+1;
	thisDay=date.getDate();
	
	thisYear=thisYear.toString();
	thisMonth=thisMonth.toString();
	if(thisMonth.length < 2) thisMonth="0"+thisMonth;
	thisDay=thisDay.toString();
	if(thisDay.length < 2) thisDay="0"+thisDay;
		
	strTargetDate=thisYear+thisMonth+thisDay;
	
	var strPhoneTime = new Date(strTargetDate.substring(0,4), strTargetDate.substring(4,6) - 1, strTargetDate.substring(6,8),0, 0, 0, 0);
	var strIDay = strPhoneTime.getTime() + 24*3600*1000*strAmount;
	var strDay = new Date();

	strDay.setTime(strIDay);

	var strYear = strDay.getYear();
	var strMonth = strDay.getMonth()+1;
	var strDay = strDay.getDate();

	if(strMonth < 10){
	strMonth = "0" + strMonth;
	}
	if(strDay < 10){
	strDay = "0" + strDay;
	}
	return strYear.toString()+strMonth.toString()+strDay.toString();

}

function tmpAlert() {
	alert("¢Æ¢Æ¢Æ ÁØ ºñ Áß ÀÔ ´Ï ´Ù. ¢Æ¢Æ¢Æ");
}

function window::onscroll() {
	mymenuscroll();
}
