//document.domain = "shootgoal.com:8000";


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_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_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];}}
}

//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,115,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='' />";
	doc+="<param name='FlashVars' value='loc=ko_KR&required_version=9,0,115,0' />";
	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 chkBlank(str) {
	tmp=false;
	if(str.indexOf(" ") >= 0) tmp=true;
	
	return tmp;
}

//Æ¯¼ö¹®ÀÚ °ø¹éÀÌ ÀÖ´ÂÁö Ã¼Å©ÇÏ´Â ÇÔ¼ö
function chkBlankSpecial(str) {
	tmp=false;
	if(str.indexOf("¡¡") >= 0) tmp=true;
	if(str.indexOf("¡©") >= 0) tmp=true;
	
	return tmp;
}

//¸Þ½ÃÁö¸¦ »Ñ¸®°í ÇØ´ç ¿ÀºêÁ§Æ®¿¡ Æ÷Ä¿½º ¸ÂÃß´Â ÇÔ¼ö
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 ContentsViewOpen(u) {
	
	thisWindow=eval('window.open(u)');
}

//ÆË¾÷Ã¢
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 OpenWindowCenter(url ,mwidth, mheight) {
	l=(screen.width)?(screen.width-mwidth)/2:0;
	t=(screen.height)?(screen.height-mheight)/2:0;
	var scroll	= screen.height < parseInt ( mheight , 10 ) ? 'yes' : 'no' ;
	thisWindow=eval('window.open(url, "", "top='+t+'px, left='+l+'px, width='+mwidth+'px, height='+mheight+'px, resizable=0, scrollbars=' + scroll + ', status=0")');
}

function OpenWindowCenterName(url, na, mwidth, mheight) { 
	l=(screen.width)?(screen.width-mwidth)/2:0;
	t=(screen.height)?(screen.height-mheight)/2:0;
	thisWindow=eval('window.open("'+url+'", "'+na+'", "top='+t+'px, left='+l+'px, width='+mwidth+'px, height='+mheight+'px, resizable=0, scroll=no, status=0")');
}

function OpenWindowScroll(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,scrollbars=yes,status=0")');	
}

function OpenWindowCenterNameScroll(url, name, mwidth, mheight, scr) { 
	l=(screen.width)?(screen.width-mwidth)/2:0;
	t=(screen.height)?(screen.height-mheight)/2:0;
	thisWindow=eval('window.open(url, "'+name+'", "top='+t+'px, left='+l+'px, width='+mwidth+'px, height='+mheight+'px, resizable=0, scrollbars='+scr+', 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 InputOnlyNumber() {
	if((event.keyCode<48 || event.keyCode>57) && event.keyCode!=13) event.returnValue=false;
}

//½Ã°è
function MakeTimeString(obj) {
	var thistime=new Date();	
	thistime=thistime.toLocaleString();
	obj.innerText=thistime;
}

function ShowTimeString(str) {
	obj=document.getElementById(str);
	MakeTimeString(obj);
	window.setInterval("MakeTimeString(obj)", 1000);
}

function ResizeIFrame(obj, min_w, min_h) {
	var this_body=document.frames(obj).document.body;
	var this_name=document.all(obj);
	
	this_name.style.width=this_body.scrollWidth+(this_body.offsetWidth-this_body.clientWidth);
	this_name.style.height=this_body.scrollHeight+(this_body.offsetHeight-this_body.clientHeight);
	
	if(this_name.style.height=="0px" || this_name.style.width=="0px") {
		this_name.style.width=min_w;
		this_name.style.height=min_h;
	}
}

function ResizeIFrame2(obj, min_w, min_h) {
	var this_body=document.getElementById(obj).contentWindow.document.body;
	var this_name=document.getElementById(obj);
	
	this_name.style.width=this_body.scrollWidth+(this_body.offsetWidth-this_body.clientWidth);
	this_name.style.height=this_body.scrollHeight+(this_body.offsetHeight-this_body.clientHeight);
	
	if(this_name.style.height=="0px" || this_name.style.width=="0px") {
		this_name.style.width=min_w;
		this_name.style.height=min_h;
	}
}

function ResizeIFrameTop(obj, min_w, min_h) {
	var this_body=top.document.frames(obj).document.body;
	var this_name=top.document.all(obj);
	
	this_name.style.width=this_body.scrollWidth+(this_body.offsetWidth-this_body.clientWidth);
	this_name.style.height=this_body.scrollHeight+(this_body.offsetHeight-this_body.clientHeight);
	
	if(this_name.style.height=="0px" || this_name.style.width=="0px") {
		this_name.style.width=min_w;
		this_name.style.height=min_h;
	}
}

function ResizeSelf(min_w, min_h) {
	var this_body=document.body;
	var this_name=this_body;
	
	this_name.style.width=this_body.scrollWidth+(this_body.offsetWidth-this_body.clientWidth);
	this_name.style.height=this_body.scrollHeight+(this_body.offsetHeight-this_body.clientHeight);
	
	if(this_name.style.height=="0px" || this_name.style.width=="0px") {
		this_name.style.width=min_w;
		this_name.style.height=min_h;
	}
}

function loginCheck(doc) {
	if(trim(doc.userid.value)=="") return AlertMsgFocus("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.", doc.userid);
	if(trim(doc.passwd.value)=="") return AlertMsgFocus("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.", doc.passwd);
}

function AllSearchCheck(doc) {
	if(trim(doc.str.value)=="") return AlertMsgFocus("°Ë»öÇÒ ³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.", doc.str);
}

function WriteBannerImage(str) {
	document.write(str);
}

function CopyToClipboard(str) {
	window.clipboardData.setData("Text", str);
	alert("ÀÌ±ÛÀÇ ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\r\n\r\n[ºÙ¿©³Ö±â]ÇÏ½Ã¸é ÀÌ ±ÛÀÇ ÁÖ¼Ò¸¦ ¸µÅ© °Å½Ç ¼ö ÀÖ½À´Ï´Ù.");
}

function CopyToClipboardBanner(str) {
	window.clipboardData.setData("Text", str);
	alert("ÀÌ±ÛÀÇ ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù..\r\n\r\n´Ù¸¥ »çÀÌÆ®¿¡ ¹è³Ê¿Í ÇÔ²² ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function resizePopup() {
		var w=document.body.scrollWidth;
		var h=document.body.scrollHeight;
		if(h > 500) window.resizeBy(w-document.body.clientWidth, h-document.body.clientHeight);
}

function startText() {
  for (i=0; i<ctnt.length; i++) insertText(i);
  window.setTimeout("scroll()",wait);
}

function scroll() {
  if (mouse && flag) {
    for (i=0;i<ctnt.length;i++) {
      if (temp == 0 && imgflag) {
	for (j=0;j<ctnt_i.length;j++) {
	  tmp = document.getElementById('img_area'+j).style;
	  if (count % ctnt_i.length == j) {
	    tmp.display = '';
	  } else {
	    tmp.display = 'none';
	  }
	}
	imgflag=false;
	count++;
      }
      temp++;
      tmp = document.getElementById('scroll_area'+i).style;
      tmp.top = parseInt(tmp.top)-speed;
      if (parseInt(tmp.top) <= height*(-1)) {
        tmp.top = height*(ctnt.length-1);
      }
      if (temp>(amount-1)*ctnt.length) {
        flag=false;
        temp=0;
        window.setTimeout("flag=true;temp=0;imgflag=true;",wait);
      }
    }
  }
  window.setTimeout("scroll()", 5);
}
function insertText(i) {
  htmlstr='<div style="left: 0px; width: 390px; position: absolute; top: '+(height*i+1)+'px" id="scroll_area'+i+'">\n';
  htmlstr+=ctnt[i]+'\n'+'</div>\n';
  document.write(htmlstr);
}

function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}

// onload¸¦ Áö¿øÇÏÁö ¾Ê´Â ±¸±ÛÅ©·Ò°ú ÆÄÀÌ¾îÆø½º¸¦ À§ÇÑ ÀÚ¹Ù½ºÅ©¸³Æ®ÀÔ´Ï´Ù.
window.onload = function() {
	try {
		if(parent.document.width != document.width || parent.document.height != document.height) {
			parent.document.getElementById('IFRAME_main').width = document.width;
			parent.document.getElementById('IFRAME_main').height = document.height;
		}
	}
	catch(e) {}
}

function printSWF(id, flashUri, vWidth, vHeight, winMode, bgColor, param)
{
	var _obj_ = "";
	_obj_ = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="' + vWidth + '" height="' + vHeight + '" id="' + id + '" align="middle">';
	_obj_ += '<param name="allowScriptAccess" value="always" />';
	_obj_ += '<param name="allowFullScreen" value="true" />';
	_obj_ += '<param name="movie" value="' + flashUri + '" />';
	_obj_ += '<param name="quality" value="high" />';
	_obj_ += '<param name="wmode" value="' + winMode + '" />';
	_obj_ += '<param name="bgcolor" value="' + bgColor + '" />';
	_obj_ += '<param name="flashvars" value="' + param + '"/>';
	_obj_ += '<embed src="' + flashUri + '" quality="high" wmode="' + winMode + '" bgcolor="' + bgColor + '" width="' + vWidth +'" height="' + vHeight + '" id="' + id + '" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>';
	_obj_ += '</object>';
	document.writeln( _obj_ );

	eval("window." + id + " = document.getElementById('" + id + "');");
}

