
// ÀüÃ¼ ÆäÀÌÁö Àû¿ë : ¸µÅ©½Ã Á¡¼± ¾ø¾Ö±â
function bluring(){ 
 if(!event.srcElement) return;
 if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
 document.body.focus(); 
} 
document.onfocusin=bluring; 

function autoBlur(){ 

 try{
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
 }catch(e) {}
}
document.onfocusin=autoBlur;


// ActiveX ÆÐÄ¡ °ü·Ã 
function ieActiveX(id)
{
	document.write(id.innerHTML.replace("<!--","<").replace("-->",">")); id.id="";
}

// popup 
function popsn(url,trgt,w,h) { 
            window.open(url,trgt,'width='+w+',height='+h+',scrollbars=no,resizable=no,copyhistory=no,toolbar=no,top=10,left=10');
        }
function popsy(url,trgt,w,h) { 
            window.open(url,trgt,'width='+w+',height='+h+',scrollbars=yes,resizable=no,copyhistory=no,toolbar=no,top=10,left=10'); 
        }
function popsn_name(url,trgt,w,h) { 
            commonWin1 = window.open(url,trgt,'width='+w+',height='+h+',scrollbars=no,resizable=no,copyhistory=no,toolbar=no,top=10,left=10'); 
        }
		
// ÀÎÇ²ÅØ½ºÆ® 
function clearText(thefield)
	{
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
}

// ÀÌ¹ÌÁö ¿À¹ö-¾Æ¿ô
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.0
  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 && document.getElementById) x=document.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_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; }
}

//¹Ì´ÏÈ¨ÇÇ ÀÚ±â¼Ò°³ ½ºÅ©·Ñ and ÆË¾÷
var sRepeat=null; 

function doScrollerIE(dir, src, amount) { 
	if (amount==null) amount=10; 
	if (dir=="up") 
	document.all[src].scrollTop-=amount; 
	else 
	document.all[src].scrollTop+=amount; 
	if (sRepeat==null) 
	sRepeat = setInterval("doScrollerIE('" + dir + "','" + src + "'," + amount + ")",100); 
	return false 
} 

window.document.onmouseout = new Function("clearInterval(sRepeat);sRepeat=null"); 
window.document.ondragstart = new Function("return false"); 

function pop_edit(hid) {
	window.open ('/community/minihome/minihome_pop_intro.asp?hid='+hid,'edit','width=299px,height=324px,resizable=no');
}


// Äü¸Þ´º °ü·Ã 
function QuickClose(name) {
	document.getElementById(name).style.display = 'none';
}
function QuickOpen(name) {
	if(name != undefined) {
		document.getElementById(name).style.display = 'block';
	}
}


 // Footer °ü·Ã (¼¿·ºÆ®¹Ú½º)
 function showcombo(what){
	if (what.style.display=='none')
		what.style.display='';

}
function hidecombo(what){
	if (what.style.display=='')
		what.style.display='none';

}


// ·Ñ¸µ°øÁö 
function NvScroll() {
	this.version = "0.2";
	this.name = "NvScroll";
	this.divId = "list";
	this.item = new Array();
	this.itemcount = 0;
	this.currentspeed = 0;
	this.scrollspeed = 50;
	this.pausedelay = 1000;
	this.pausemouseover = false;
	this.stop = false;
	this.height = 100;
	this.width = 100;
	this.stopHeight=0;
	this.i=0;
	this.reloadData = 0;

	this.add = function () {
		var text = arguments[0];
		this.item[this.itemcount] = text;
		this.itemcount = this.itemcount + 1;
	};

	this.start = function () {
		if ( this.itemcount == 1 ) {
			this.add(this.item[0]);
		}
		this.display();
		this.currentspeed = this.scrollspeed;
		this.stop = true;
		setTimeout(this.name+'.scroll()',this.currentspeed);
		window.setTimeout(this.name+".stop = false", this.pausedelay);
	};
	
	this.display = function () {
        var htmlCode;
		htmlCode = '<div id="'+this.name+'" style="height:'+this.height+'; width:'+this.width+'; position:relative; overflow:hidden; ">';
		for(var i = 0; i < this.itemcount; i++) {
			htmlCode += '<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+(this.height*i)+'px; ">';
			htmlCode += this.item[i];
			htmlCode += '</div>';
		}
		htmlCode += '</div>';

        document.getElementById(this.divId).innerHTML=htmlCode;  
	};
	
	this.scroll = function () {
		if ( this.pause == true ) {
			window.setTimeout(this.name+".scroll()",this.pausedelay);
			this.pause = false;
		} else {
			this.currentspeed = this.scrollspeed;
			if ( !this.stop ) {
				for (var i = 0; i < this.itemcount; i++) {
					obj = document.getElementById(this.name+'item'+i).style;
					obj.top = parseInt(obj.top) - 1;
					if ( parseInt(obj.top) <= this.height * (-1) ) obj.top = this.height * (this.itemcount-1);
					if ( parseInt(obj.top) == 0 ) {
						this.currentspeed = this.pausedelay;
						this.i = i;
					}
				}
			}
            if( !this.stop && i == this.itemcount && parseInt(obj.top) == 0 && this.reloadData == 1 ) {
				this.reloadData = 0;
            }
            else {
				window.setTimeout(this.name+".scroll()",this.currentspeed);
            }
		}
	};
	
	this.rolling = function () {
		if ( this.stop == false  ) {
			this.next();
		}
		window.setTimeout(this.name+".rolling()",this.scrollspeed);
		}
	}