
/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ °¢ ÆäÀÌÁö °øÅë »ç¿ë                                            ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function showlayer()
{
          var i, p, v, obj, args = showlayer.arguments;

          for (i=0; i<(args.length-2); i+=3)

          if ((obj = objectfind(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 swapimage()
{ 
          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 objectfind(n, d)
{ 
          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=objectfind(n,d.layers[i].document);
          if(!x && document.getElementById) 
          x=document.getElementById(n); 
          return x;
}

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_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 myFavorite() { 
window.external.AddFavorite('http://fish.darakwon.co.kr/', '³¬½Ã±¤Àå ³¬½ÃÃáÃß') 
} 

function getStyle(el, style) {
	var value = el.style[style];
	if(!value)	{
		if(document.defaultView && document.defaultView.getComputedStyle) {
			var css = document.defaultView.getComputedStyle(el, null);
			value = css ? css[style] : null;
		} 
		else if (el.currentStyle) value = el.currentStyle[style];
	}
	return value == 'auto' ? null : value;
}

function familyToggle() {	
	var familyButton = document.getElementById('familyToggle');
	var familyListCon = document.getElementById('familyList');
	familyListCon.style.visibility = "hidden";
	document.documentElement.onclick = function() {	   
		familyListCon.style.visibility = 'hidden'
	}
	familyButton.onclick = function(e) {
		var event = window.event || e;
		if(event.preventDefault){event.preventDefault(); event.stopPropagation();}
		else {event.returnValue = false; event.cancelBubble = true;}
		familyListCon.style.visibility=(getStyle(familyListCon,'visibility')=='hidden') ? 'visible':'hidden';	
	}
	return false;
}



/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ÇÁ·¹ÀÓ »ç¿ë½Ã »õ·Î°íÄ§ÇÒ °æ¿ì ¸ÞÀÎÀ¸·Î °¡´Â °É ¸·±â À§ÇØ »ç¿ë  ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
document.onkeydown = function() { 
	if (event.keyCode == 116) { 
		event.keyCode = 505; 
	} 
	if (event.keyCode == 505) { 
		location.reload(); 
		return false; 
	} 
} 



/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ½ºÅ©·Ñ¸µ »ç¿ë                                                  ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function Rolling(canvas,width,height,direction,pixelgap,timegap,idlegap)
{
	this.canvas = canvas;
	this.width = width;
	this.height = height;
	this.direction = direction;	//0: left, 1: right, 2: up, 3: down
	this.pixelgap = pixelgap;
	this.timegap = timegap;
	this.idlegap = idlegap;
	this.box = document.createElement("DIV");
	this.box.style.width = this.width + "px";
	this.box.style.height = this.height + "px";
	this.box.style.overflow = "hidden";
	this.setTimeOut = null;
	this.current = null;
	this.next = null;
}

Rolling.prototype =
{
	Init: function () {
		var This = this;
		this.box.onmouseover = function () { window.clearTimeout(This.setTimeOut); }
		this.box.onmouseout = function () { This.setTimeOut = window.setTimeout(function () { This.Run(); },This.timegap); }
		this.canvas.appendChild(this.box);
		this.box.style.position = "absolute";
		for (var i = 0; i < this.box.childNodes.length; i++) {
			this.box.childNodes[i].style.position = "absolute";
			if (i > 0) {
				if (this.direction == 0 || this.direction == 1) {
					this.box.childNodes[i].style.left = (this.box.childNodes[i - 1].offsetLeft + this.box.childNodes[i - 1].offsetWidth) + "px";
				} else if (this.direction == 2 || this.direction == 3) {
					this.box.childNodes[i].style.top = (this.box.childNodes[i - 1].offsetTop + this.box.childNodes[i - 1].offsetHeight) + "px";
				}
			}
			if (i == this.box.childNodes.length - 1) {
				if (this.direction == 1) {
					this.box.childNodes[i].style.left = -this.box.childNodes[i].offsetWidth + "px";
				} else if (this.direction == 3) {
					this.box.childNodes[i].style.top = -this.box.childNodes[i].offsetHeight + "px";
				}
			}
		}
	},
	Run: function () {
		if (this.box.hasChildNodes() == false) { return; }
		if (this.direction == 0) { this.moveLeft(); }
		if (this.direction == 1) { this.moveRight(); }
		if (this.direction == 2) { this.moveUp(); }
		if (this.direction == 3) { this.moveDown(); }
	},
	moveLeft: function () {
		var This = this;
		if (this.current == null) { this.current = 0; }
		window.clearTimeout(this.setTimeOut);
		for (var i = 0; i < this.box.childNodes.length; i++) {
			this.box.childNodes[i].style.left = (this.box.childNodes[i].offsetLeft - this.pixelgap) + "px";
		}
		this.next = (this.current + 1 >= this.box.childNodes.length) ? 0 : this.current + 1;
		if (this.box.childNodes[this.next].offsetLeft <= 0) {
			var nextPosition = 0;
			for (var i = 1; i < this.box.childNodes.length; i++) { nextPosition += this.box.childNodes[i].offsetWidth; }
			this.box.childNodes[this.current].style.left = nextPosition + "px";
			this.current = (this.current + 1 >= this.box.childNodes.length) ? 0 : this.current + 1;
			this.setTimeOut = window.setTimeout(function () { This.Run(); },this.idlegap);
		} else {
			this.setTimeOut = window.setTimeout(function () { This.Run(); },this.timegap);
		}
	},
	moveRight: function () {
		var This = this;
		if (this.current == null) { this.current = this.box.childNodes.length - 1; }
		window.clearTimeout(this.setTimeOut);
		for (var i = 0; i < this.box.childNodes.length; i++) {
			this.box.childNodes[i].style.left = (this.box.childNodes[i].offsetLeft + this.pixelgap) + "px";
		}
		this.next = (this.current - 1 < 0) ? this.box.childNodes.length - 1 : this.current - 1;
		if (this.box.childNodes[this.current].offsetLeft >= 0) {
			this.box.childNodes[this.next].style.left = -this.box.childNodes[this.next].offsetWidth + "px";
			this.current = (this.current - 1 < 0) ? this.box.childNodes.length - 1 : this.current - 1;
			this.setTimeOut = window.setTimeout(function () { This.Run(); },this.idlegap);
		} else {
			this.setTimeOut = window.setTimeout(function () { This.Run(); },this.timegap);
		}
	},
	moveUp: function () {
		var This = this;
		if (this.current == null) { this.current = 0; }
		window.clearTimeout(this.setTimeOut);
		for (var i = 0; i < this.box.childNodes.length; i++) {
			this.box.childNodes[i].style.top = (this.box.childNodes[i].offsetTop - this.pixelgap) + "px";
		}
		this.next = (this.current + 1 >= this.box.childNodes.length) ? 0 : this.current + 1;
		if (this.box.childNodes[this.next].offsetTop <= 0) {
			var nextPosition = 0;
			for (var i = 1; i < this.box.childNodes.length; i++) { nextPosition += this.box.childNodes[i].offsetHeight; }
			this.box.childNodes[this.current].style.top = nextPosition + "px";
			this.current = (this.current + 1 >= this.box.childNodes.length) ? 0 : this.current + 1;
			this.setTimeOut = window.setTimeout(function () { This.Run(); },this.idlegap);
		} else {
			this.setTimeOut = window.setTimeout(function () { This.Run(); },this.timegap);
		}
	},
	moveDown: function () {
		var This = this;
		if (this.current == null) { this.current = this.box.childNodes.length - 1; }
		window.clearTimeout(this.setTimeOut);
		for (var i = 0; i < this.box.childNodes.length; i++) {
			this.box.childNodes[i].style.top = (this.box.childNodes[i].offsetTop + this.pixelgap) + "px";
		}
		this.next = (this.current - 1 < 0) ? this.box.childNodes.length - 1 : this.current - 1;
		if (this.box.childNodes[this.current].offsetTop >= 0) {
			this.box.childNodes[this.next].style.top = -this.box.childNodes[this.next].offsetHeight + "px";
			this.current = (this.current - 1 < 0) ? this.box.childNodes.length - 1 : this.current - 1;
			this.setTimeOut = window.setTimeout(function () { This.Run(); },this.idlegap);
		} else {
			this.setTimeOut = window.setTimeout(function () { This.Run(); },this.timegap);
		}
	}
}


/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ PNG ÀÌ¹ÌÁö À¥¿¡¼­ º¸ÀÌµµ·Ï Àû¿ë  ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function setPng24(obj) { 
var request_os = window.navigator.userAgent; 
var os_array = request_os.split(";"); 

if(os_array[1] != " MSIE 7.0") { 
obj.width=obj.height=1; 
obj.className=obj.className.replace(/png24/i,''); 
obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"; 
obj.src=''; 
} 

return ''; 
} 



/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ¸¶¿ì½º¿À¹ö/¾Æ¿ô½Ã ¹è°æÀÌ¹ÌÁö º¯°æ  ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function change_background(that,img_src,tno){
	var oTD = eval("document.all." + tno);
  	that.style.backgroundImage = "url("+img_src+")";
  	oTD.style.color = "#ffffff";
}

function change2_background(that,img_src,tno){
	var oTD = eval("document.all." + tno);
	that.style.backgroundImage = "url("+img_src+")";
  	oTD.style.color = "#555555";
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ¸¶¿ì½º¿À¹ö/¾Æ¿ô½Ã ÀÌ¹ÌÁö º¯°æ  ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function change_image(imgName,img_src,tableName,idNum,totalNum,table_over,table_out,td_over,td_out,table_change,td_change){
	idNum = parseInt(idNum);
	totalNum = parseInt(totalNum);
		
	document.getElementById(imgName).src = img_src;
	
	if(table_change=="Y"){
		for (i=1; i<=totalNum; i++){
			var oTABLE = eval("document.all." + tableName+i);
			var oTD = eval("document.all." + tableName+i+"_td");
			
			if(i==idNum){
				oTABLE.style.backgroundColor=table_over;
				if(td_change=="Y"){
					oTD.style.backgroundColor=td_over;
				}
			}else{
				oTABLE.style.backgroundColor=table_out;
				if(td_change=="Y"){
					oTD.style.backgroundColor=td_out;
				}
			}
		}		
	}
	
}

function change2_image(imgName,img_src,tableName,idNum,totalNum,table_over,table_out,td_over,td_out,table_change,td_change){
	idNum = parseInt(idNum);
	totalNum = parseInt(totalNum);
	
	document.getElementById(imgName).src = img_src;
	
	if(table_change=="Y"){
		for (i=1; i<=totalNum; i++){
			var oTABLE = eval("document.all." + tableName+i);
			var oTD = eval("document.all." + tableName+i+"_td");
			
			if(i==idNum){
				oTABLE.style.backgroundColor=table_over;
				if(td_change=="Y"){
					oTD.style.backgroundColor=td_over;
				}
			}else{
				oTABLE.style.backgroundColor=table_out;
				if(td_change=="Y"){
					oTD.style.backgroundColor=td_out;
				}
			}
		}		
	}
}


/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ DIV ±¸ºÐ  ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function DivTab(divName,idNum,totalNum,img_over,img_out,img_change,no_change){
	idNum = parseInt(idNum);
	totalNum = parseInt(totalNum);
	for (i=1; i<=totalNum; i++){
	  if(i!=2){
		if(i==idNum){
			if(img_change=="Y"){
				document.getElementById(divName+"IMG"+i).src = img_over+i+".gif";	
			}
			document.getElementById(divName+idNum).style.display='block';
		}else{
			if(img_change=="Y"){
				document.getElementById(divName+"IMG"+i).src = img_out+i+".gif";	
			}
			document.getElementById(divName+i).style.display='none';
		}
	  }
	}
	if(no_change=="Y"){
		if(idNum<totalNum){
			NextNum = idNum+1;
		}else{
			NextNum = 1;
		}
		clearTimeout(this.DivRotate);
		DivRotate = window.setTimeout(function () { DivAuto(divName,NextNum,totalNum,img_change); },5000);
	}
}

function DivAuto(divName,idNum,totalNum,img_change) {
	idNum = parseInt(idNum);
	totalNum = parseInt(totalNum);
	for (i=1; i<=totalNum; i++){
		if(i==idNum){
			if(img_change=="Y"){
				document.getElementById(divName+"IMG"+i).src = "img/btn_on_"+i+".gif";	
			}
			document.getElementById(divName+idNum).style.display='block';
		}else{
			if(img_change=="Y"){
				document.getElementById(divName+"IMG"+i).src = "img/btn_off_"+i+".gif";	
			}
			document.getElementById(divName+i).style.display='none';
		}
  	}	
	if(idNum<totalNum){
		NextNum = idNum+1;
	}else{
		NextNum = 1;
	}
  	clearTimeout(this.DivRotate);
	DivRotate = window.setTimeout(function () { DivAuto(divName,NextNum,totalNum,img_change); },5000);
}


/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ¼ýÀÚÅ°¸¸ ÀÔ·Â°¡´É Ã¼Å© ¦¢
  ¦§¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ª¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ style="ime-mode:disabled" onKeyPress="NumObj(this,'-');" Ãß°¡  ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function NumObj(objname, addStr)
{
	if (event.keyCode >= 48 && event.keyCode <= 57)
	{
		return true;
	}
	else if (event.keyCode == 45 && addStr == "-")
	{
		return true;
	}
	else if (event.keyCode == 46 && addStr == ".")
	{
		return true;
	}
	else
	{
		event.returnValue = false;
	}
}

/*----------------------------------------------------------------
±âÅ¸ »ç¿ë ÇÔ¼ö ¸ðÀ½
/*----------------------------------------------------------------

/**************************************************
*ÀÍ½ºÇÃ·Î·¯ È®ÀÎ ÀÍ½ºÇÃ·Î·¯ ¶ó¸é IE´Â true ¾Æ´Ï¶ó¸é False
****************************************/
var IE = navigator.userAgent.indexOf("MSIE") != -1;
//ÀÍ½ºÇÃ·Î·¯ ¹öÁ¯ ÇöÀç ¹öÁ¯ÀÌ 6 ÀÌ¸é 6°ªÀÌ ³ª¿È
var IEVersion = parseFloat(navigator.appVersion.split("MSIE")[1]);

/***********************************
¼³¸í : ÇÑ±Û ÇÑ±ÛÀÚ¸¦ 2byte·Î ÀÎ½ÄÇÏ¿©, IEµç Netscapeµç Á¦´ë·Î byte±æÀÌ¸¦ ±¸ÇØ ÁÝ´Ï´Ù.
¿¹) getByteLength("abc°¡³ª´Ù") getByteLength(Æû.ÀÌ¸§.¹ë·ù) 
°á°ú) 9
¸®ÅÏ : ±æÀÌ
 ****************************************/
function getByteLength(s){
   var len = 0;
   if ( s == null ) return 0;
   for(var i=0;i<s.length;i++){
      var c = escape(s.charAt(i));
      if ( c.length == 1 ) len ++;
      else if ( c.indexOf("%u") != -1 ) len += 2;
      else if ( c.indexOf("%") != -1 ) len += c.length/3;
   }
   return len;
}
 
/***********************************
¼³¸í : Æû¿¡¼­ °ø¹é Ã¼Å©ÇØ¼­ °ø¹éÀÌ¸é ¸Þ¼¼Áö º¸¿©Áö°í ÇØ´ç Æû°ª¿¡ Æ÷Ä¿½º
¿¹) checkSpace(frm,strMsg) checkSpace(Æû.ÀÌ¸§, ¸Þ¼¼Áö)
¸®ÅÏ) °ø¹éÀÌ¸é false °ø¹éÀÌ ¾Æ´Ï¸é true
 ****************************************/
function checkSpace(frm,strMsg){
	var str = frm.value
	if (str.search(/\S/)<0){			//\S °ø¹éÀÌ ¾Æ´Ñ ¹®ÀÚ¸¦ Ã£´Â´Ù.
		alert (strMsg);
		frm.value = "";
		frm.focus();
		return false;
	}
	var temp=str.replace(' ','');
	if (temp.length == 0){
		alert (strMsg);
		frm.value = "";
		frm.focus();
		return false;
	}
	return true;
}

/***********************************
¼³¸í : Æû¿¡¼­ °ø¹é Ã¼Å©
¿¹) ckSpace(str) checkSpace(Æû.ÀÌ¸§.¹ë·ù)
¸®ÅÏ) °ø¹éÀÌ¸é false °ø¹éÀÌ ¾Æ´Ï¸é true
 ****************************************/
function ckSpace(str){
	if (str.search(/\S/)<0){
		return false;
	}
	var temp=str.replace(' ','');
	if (temp.length == 0){
		return false;
	}
	return true;
}


/************************************************************
¼³¸í : ÀÔ·ÂÇÑ emailÀÌ ¿µ¹®ÀÚ¿Í @°ªÀÌ Á¤È®ÀÌ µé¾î°¡ ÀÖ´ÂÁö 
¿¹) checkEmail("test@test.co.kr")
°á°ú) true
¸®ÅÏ : ÀÌ¸ÞÀÏÀÌ ¸Â´Ù¸é  True , Æ²¸®´Ù¸é false
************************************************************/
function checkEmail(email){
	var str='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
	var flag=0;
	var comma=0;
	for(i=0; i<email.length; i++) {
		for(j=0; j<str.length; j++) {
			if(email.charAt(i)==str.charAt(j)){
				break;
			}
		}
		if(j==str.length) {
			if(email.charAt(i)=='@'){
				flag++;
			}else if(email.charAt(i)=='.'){
				comma++;
			}else{
				return false;
			}
		}
	}
	if(flag!=1){
		return false;
	}else if((comma<1)||(comma>3)){
		return false;
	}else{
		return true;
	}
}


function email_chk(email){
	var t = email.value;
	var ValidFlag = false;
	var atCount = 0;
	var SpecialFlag;
	var atLoop;
	var atChr;
	var BadFlag;
	var tAry1;
	var UserName;
	var DomainName;

	if ( t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0 ) {
		atCount = 0;
		SpecialFlag = false;

		for( atLoop=1; atLoop<=t.length; atLoop++ ) {
			atChr = t.substring( atLoop, atLoop+1 );
			if ( atChr == "@" ) atCount = atCount + 1;

			if ( (atChr >= 32) && (atChr <= 44) ) SpecialFlag = true;
			if ( (atChr == 47) || (atChr == 96) || (atChr >= 123) ) SpecialFlag = true;
			if ( (atChr >= 58) && (atChr <= 63) ) SpecialFlag = true;
			if ( (atChr >= 91) && (atChr <= 94) ) SpecialFlag = true;
		}

		if ( ( atCount == 1 ) && (SpecialFlag == false ) ) {
			BadFlag = false;
			tAry1 = t.split("@");
			UserName = tAry1[0];
			DomainName = tAry1[1];
			if ( (UserName.length <= 0 ) || (DomainName.length <= 0 ) ) BadFlag = true;
			if ( DomainName.substring( 1, 2 ) == "." ) BadFlag = true;
			if ( DomainName.substring( DomainName.length-1, DomainName.length) == "." ) BadFlag = true;
			//if (DomainName == "hanmail.net") BadFlag = true;
			//if (DomainName == "daum.net") BadFlag = true;
			ValidFlag = true;
		}
	}
	if ( BadFlag == true ) ValidFlag = false;
	return ValidFlag;
}

/************************************************************
¼³¸í : ÀÔ·ÂÇÑ ¹ë·ù°ªÀÌ ¿øÇÏ´Â Ã¼Å©°ªÀÇ ´Ü¾î¶û ¸Â´ÂÄ¡ Ã¼Å©
¿¹)checkVal(Æû.ÀÌ¸§.¹ë·ù,"0123456789")  => ¹ë·ù °ªÀÌ 0~9 ±îÁö ÀÌ¸é true
°á°ú) ¹ë·ù °ªÀÌ Ã¼Å©°ª¿¡ ¼ÓÇÏ´Â ´Ü¾îÀÌ¸é true ¼ÓÇÏÁö ¾Ê´Â ´Ü¾î°¡ ÀÖÀ¸¸é false
¸®ÅÏ : ¸Â´Ù¸é  True , Æ²¸®´Ù¸é false
************************************************************/
function checkVal(val,chkStr){
	for (var i=0; i <chkStr.length; i++){
		if(chkStr.indexOf(val.substring(i,i+1))<0) {
			return false;
		}
	}
	return true;
}

/************************************************************
¼³¸í : Ã¼Å© ¹Ú½º, ¶óµð¿À ¹öÆ° ¼±ÅÃ Ã¼Å©
¿¹)checkRadio(Æû.ÀÌ¸§)
°á°ú) Ã¼Å© ÇÑ°Ô ÀÖ´Ù¸é true Ã¼Å©ÇÑ°Ô ¾ø´Ù¸é false
************************************************************/
function checkRadio(InputName){
	if(InputName){
		if(!InputName.length) {
			if(InputName.checked) {
				return true;
			}
		} else {
			for(i=0;i<InputName.length;i++) {
				if(InputName[i].checked) {
					return true;
				}
			}
		}
	}
	return false;
}


/************************************************************
¼³¸í : »õÃ¢ ¶ç¿ö¼­ Æ÷Ä¿½º ÁÖ±â
¿¹)windowOpen(url,winName,width,height,scrollbars,resizable,left,top)
windowOpen('ÁÖ¼Ò','À©µµ¿ìÀÌ¸§',500,400,'yes','no',100,100)
************************************************************/
function windowOpen(url,winName,width,height,scrollbars,resizable,left,top){
	var newWin=window.open(url,winName,"width="+width+",height="+height+",scrollbars="+scrollbars+",resizable="+resizable+",left=" + left + ",top=" + top+",directories=no,status=no,menubar=no");
	newWin.focus(); 
}


/************************************************************
¼³¸í : Æû Ã¼Å© ÇÔ¼ö
¿¹)checkFrm(Æû.ÀÌ¸§, "ÀÔ·Â¶õ", "", ÀÛÀº°ª, Å«°ª)
°ªÀÌ Àß¸øµÈ°Ô ÀÖ´Ù¸é false
°ªÀÌ ¿Ã¹Ù¸£´Ù¸é true
ex ) if(!checkFrm(frm.mem_name, "ÀÌ¸§", "", 1, 5)) return;
************************************************************/
function checkFrm(target, cmt, astr, lmin, lmax){
	var i;
	var t = target.value;
	if(t.search(/\S/)<0){
		alert(cmt + ' ÀÔ·Â¶õ¿¡ °ø¹éÀÌ ÀÖ½À´Ï´Ù. °ªÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		target.focus();
		return false;
	}

	var temp = t.replace(' ','');
	if (temp.length == 0){
		alert(cmt + ' ÀÔ·Â¶õ¿¡ °ø¹éÀÌ ÀÖ½À´Ï´Ù. °ªÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
		target.focus();
		return false;
	}
		
	if(t.length < lmin || t.length > lmax){
		if (lmin == lmax) alert(cmt + ' ÀÔ·Â¶õÀº ' + lmin + ' ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù');
		else alert(cmt + ' ÀÔ·Â¶õÀº ' + lmin + ' ~ ' + lmax + ' ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù');
		target.focus();
		return false;
	}

	if (astr.length > 1) {
		for (i=0; i < t.length; i++){
			if(astr.indexOf(t.substring(i,i+1))<0){
				alert(cmt + ' ÀÔ·Â¶õ¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù');
				target.focus();
				return false;
			}
		}
	}
	return true;
}

/************************************************************
¼³¸í : ÁÖ¹Î¹øÈ£ Ã¼Å© ÇÔ¼ö
¿¹)checkJumin(ÁÖ¹Î¹øÈ£)
°ªÀÌ Àß¸øµÈ°Ô ÀÖ´Ù¸é false
°ªÀÌ ¿Ã¹Ù¸£´Ù¸é true
************************************************************/
function checkJumin(it){
	IDtot = 0;
	IDAdd = "234567892345";

	for(i=0; i<12; i++) IDtot = IDtot + parseInt(it.substring(i, i+1)) * parseInt(IDAdd.substring(i, i+1));
	IDtot = 11 - (IDtot%11);
	if (IDtot == 10) IDtot = 0;
	else if (IDtot == 11) IDtot = 1;

	if(parseInt(it.substring(12, 13)) != IDtot) return false;
	else return true;
}



// ÁÖ¹Î¹øÈ£ Ã¼Å©
function bxResNoChk(objText, iNum) {
    sCode = objText.value + iNum;

    if (sCode.length == 13) {
        lTot = 0;
        lAdd = "234567892345";

        for (i = 0; i < 12; i++) {
            lTot = lTot + sCode.substring(i, i + 1) * lAdd.substring(i, i + 1)
        }
        lTot = 11 - (lTot % 11);

        if (parseInt(sCode.substring(6, 7), 10) >= 5) {
            if (lTot >= 10) { lTot -= 10; }

            lTot += 2;

            if (lTot >= 10) { lTot -= 10; }
        }
        else {
            if (lTot == 10) lTot = 0;
            else if (lTot == 11) lTot = 1;
        }

        if (sCode.substring(12, 13) == lTot) {
            //objText.value = sCode.substring(0,6) + "-" + sCode.substring(6,13);
            return true;
        }
        else {
            alert("ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ·Â ¿À·ùÀÔ´Ï´Ù.");
            objText.focus();
            objText.select();
            return false;
        }
    }
    else {
        alert("ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ·Â ¿À·ùÀÔ´Ï´Ù.");
        objText.focus();
        objText.select();
        return false;
    }
}

//ÁÖ¹®ÃÑ¾× Ãµ´ÜÀ§ ÄÞ¸¶Âï±â
function commaNum(num) {  
	if (num < 0) { num *= -1; var minus = true} 
	else var minus = false 

	var dotPos = (num+"").split(".") 
	var dotU = dotPos[0] 
	var dotD = dotPos[1] 
	var commaFlag = dotU.length%3 

	if(commaFlag) { 
	        var out = dotU.substring(0, commaFlag)  
	        if (dotU.length > 3) out += "," 
	} 
	else var out = "" 

	for (var i=commaFlag; i < dotU.length; i+=3) { 
	        out += dotU.substring(i, i+3)  
	        if( i < dotU.length-3) out += "," 
	} 

	if(minus) out = "-" + out 
	if(dotD) return out + "." + dotD 
	else return out  
} 

/************************************************************
¼³¸í : ÀÚµ¿ ÅÇ ÀÌµ¿
¿¹)<input name="jumin1" type="text" class="box1" size="10" onKeyUp="return autotab(this, 6, event);">
************************************************************/
function autotab(input,len, e) {
	var isNN = (navigator.appName.indexOf("Netscape")!=-1);
    var keycd = (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 && !iscontain(filter, keycd))
    {
      input.value = input.value.slice(0, len);
      input.form[(getindex(input)+1) % input.form.length].focus();
    }
  }
function iscontain(filter, keycd) {
    var found = false;
    var index = 0;

    while(!found && index < filter.length)

    if(filter[index] == keycd) found = true;
    else index++;

    return found;
}
function getindex(input) {
    var index = -1;
    var i = 0;
    var found = false;

    while (i < input.form.length && index == -1)

    if (input.form[i] == input)index = i;
    else i++;

    return index;
    return true;
}

function InitXMLHttp() {
	xmlHttp = false;
	if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
		if (xmlHttp.overrideMimeType){
			xmlHttp.overrideMimeType('text/xml');
		}
	}else if (window.ActiveXObject) {
		try{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
		}catch(e){
			try{
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(E){
				xmlHttp = false;
			}
		}
	}
	return xmlHttp;
}

// ÄíÅ° ÀÐ±â
function GetCookie(name){
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;

    while(i < clen){
        var j = i + alen;
        if(document.cookie.substring(i, j) == arg)
        return getCookieVal(j);
        i = document.cookie.indexOf(" ", i) + 1;
        if(i == 0) break;
    }
    return null;
}

// ÄíÅ° ÀÐ±â
function getCookieVal(offset){
    var endstr = document.cookie.indexOf(";", offset);
    if(endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}

// ÄíÅ° ÀÐ±â2 - 2Áß ÄíÅ°¿¡¼­ »ç¿ë
function GetCookie2(key1, key2) {
  var tmp = GetCookie(key1);
  if(tmp == null)
    return null;

  tmp = tmp.split("&");
  for(var i = 0; i<tmp.length; i++) {
    var tmp2 = tmp[i].split("=");
    if(tmp2.length == 2 && tmp2[0] == key2) {
      return tmp2[1];
    }
  }
  return null;
}

/************************************************************
¼³¸í : ³¬½Ã±¤Àå ÄÁÅÙÃ÷ ¸®½ºÆ® °Ë»ö Ã¼Å© ÇÔ¼ö
************************************************************/
function searchcontent(){
	var frm = document.search;
	var Alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
	var Digit = '1234567890';
	var TelDigit = '-1234567890';	

	if (!checkFrm(frm.s_txt, "°Ë»ö³»¿ë", "", 2, 10)) return false;
}

function detailsearch(){
	var frm = document.search;
	var Alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
	var Digit = '1234567890';
	var TelDigit = '-1234567890';	

	if (!checkFrm(frm.s_txt_re, "°Ë»ö³»¿ë", "", 2, 10)) return false;
}

/************************************************************
¼³¸í : ³¬½Ã±¤Àå »ó´Ü ÀüÃ¼°Ë»ö Ã¼Å©ÇÔ¼ö
************************************************************/
function allsearch(){
	var frm = document.totalsearch;
	var Alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
	var Digit = '1234567890';
	var TelDigit = '-1234567890';	
	
	if (!checkFrm(frm.t_search,"°Ë»ö¾î","",2,20)) return false;
}

/*ÇÃ·¡½¬¹è³Ê¿ë*/
function flash_view(flash_src,width,height){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'"><PARAM NAME="movie" VALUE="'+flash_src+'" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+flash_src+'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent" width="'+width+'" height="'+height+'" /></object>');
}

/************************************************************
¼³¸í : ³¬½Ã±¤Àå ´ñ±Û¾²±â Ã¼Å©ÇÔ¼ö
************************************************************/
function commentcheck(){
	var frm = document.comment;
	var Alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
	var Digit = '1234567890';
	var TelDigit = '-1234567890';	

	if (GetCookie2("FISHUSER","USERID") == "" || GetCookie2("FISHUSER","USERID") == null){
		if (confirm("·Î±×ÀÎÀ» ÇÏ¼Å¾ß ´ñ±ÛÀ» ¾²½Ç ¼ö ÀÖ½À´Ï´Ù.\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
			location.href="../member/login.asp";
			return false;
		}else{
			return false;
		}
	}else{
		if (!checkFrm(frm.tx_comment,"´ñ±Û","",5,100)) return false;		
	}
}

function logincheck(){
	if (GetCookie2("FISHUSER","USERID") == "" || GetCookie2("FISHUSER","USERID") == null){
		if (confirm("·Î±×ÀÎÀ» ÇÏ¼Å¾ß ´ñ±ÛÀ» ¾²½Ç ¼ö ÀÖ½À´Ï´Ù.\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
			location.href="../member/login.asp";
			return false;
		}else{
			window.location.reload();
			return false;
		}
	}
}
