function appendNavi(id, appendCtg) {
	var nd = document.getElementById(id);
	if(!nd) return;
	var li = document.createElement("li");
	li.innerHTML = " &gt; ";
	nd.appendChild(li);
	li = document.createElement("li");
	li.innerHTML = appendCtg;
	nd.appendChild(li);
	
}
// ÁÂ¿ì·Ñ¸µ½Ã mediapd.uprev(), mediapd.unext(), mediapd.type = 3, mediapd.num = 4(³ëÃâ°¹¼ö);
// À§¾Æ·¡·Ñ¸µ½Ã mediapd.uprev2(), mediapd.unext2(), mediapd.type = 1, mediapd.num = 4(³ëÃâ°¹¼ö);
function NvScroll() {
	this.version = "0.2";
	this.name = "NvScroll";
	this.item = new Array();
	this.itemcount = 0;
	this.currentspeed = 0;
	this.scrollspeed = 50;
	this.pausedelay = 1000;
	this.pausemouseover = false;
	this.stop = false;
	this.type = 1;
	this.height = 100;
	this.width = 100;
	this.stopHeight=0;
	this.i=0;

	this.add = function () {
		var text = arguments[0];

		this.item[this.itemcount] = text;
	//	alert(this.item[this.itemcount]);
		this.itemcount ++;
	};

	this.start = function (layer_name) {

		if ( this.itemcount == 1 ) {
			this.add(this.item[0]);
		}
		if (layer_name != null)
		{
			document.getElementById(layer_name).innerHTML = this.str_ret();
		}
		else 
		{
			this.display();
		}
		this.currentspeed = this.scrollspeed;
		if ( this.type == 1 || this.type == 2 ) {
			this.stop = true;
			setTimeout(this.name+'.rolling2()',this.currentspeed);
			window.setTimeout(this.name+".stop = false", this.pausedelay);
		} else if ( this.type == 3 ) {
			this.stop = true;
			setTimeout(this.name+'.rolling()',this.currentspeed);
			window.setTimeout(this.name+".stop = false", this.pausedelay);
		}

	};

	this.display = function () {
		if (this.type == 1)	{
			document.write('<div id="'+this.name+'" style="height:'+(this.height*this.num-this.widtht)+'; width:'+this.width+'; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">');
		} else if ( this.type == 3)
		{
			document.write('<div id="'+this.name+'" style="height:'+this.height+'; width:'+(this.width*this.num-this.widtht)+'; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">');
		}
		for(var i = 0; i < this.itemcount; i++) {
			if ( this.type == 1 ) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+(this.height*i)+'px; ">');
				document.write(this.item[i]);
				document.write('</div>');
			} else if ( this.type == 2 || this.type == 3 ) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i)+'px; width:'+this.width+'; position:absolute; top:0px; ">');
				document.write(this.item[i]);
				document.write('</div>');
			}
		}
		document.write('</div>');
	};
	// ¹Ù·Î µð½ºÇÃ·¹ÀÌ ¾Ê°í ½ºÆ®¸µ ¸®ÅÏÇÏµµ·Ï Ãß°¡ 2006-03-30
	this.str_ret = function () {
		var str = '<div id="'+this.name+'" style="height:'+this.height+'; width:'+this.width+'; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">';
		for(var i = 0; i < this.itemcount; i++) {
			if ( this.type == 1 ) {
				str += '<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+(this.height*i)+'px; ">';
				str += this.item[i];
				str += '</div>';
			} else if ( this.type == 2 || this.type == 3 ) {
				str += '<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i)+'px; width:'+this.width+'; position:absolute; top:0px; ">';
				str += this.item[i];
				str += '</div>';
			}
		}
				str += '</div>';
				return str;
	};

	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 (i = 0; i < this.itemcount; i++) {
					obj = document.getElementById(this.name+'item'+i).style;
					if ( this.type == 1 ) {
						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;
					} else if ( this.type == 2 ) {
						obj.left = parseInt(obj.left) - 1;
						if ( parseInt(obj.left) <= this.width * (-1) ) obj.left = this.width * (this.itemcount-1);
						if ( parseInt(obj.left) == 0 ) this.currentspeed = this.pausedelay;
					}
				}
			}
			window.setTimeout(this.name+".scroll()",this.currentspeed);
		}
	};

	this.rolling = function () {
		if ( this.stop == false  ) {
			this.next();
		}
		self.setTimeout(this.name+".rolling()",this.scrollspeed);
	}

	this.rolling2 = function () {
		if ( this.stop == false  ) {
			this.next2();
		}
		window.setTimeout(this.name+".rolling2()",this.scrollspeed);

	}

	this.onmouseover = function () {
		if ( this.pausemouseover ) {
			this.stop = true;
		}
	};

	this.onmouseout = function () {
		if ( this.pausemouseover ) {
			this.stop = false;
		}
	};

	this.next = function() {
		try{
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					width = this.width + parseInt(obj.left);
					break;
				}
			}
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					obj.left = this.width * (this.itemcount-1);
				} else {
					obj.left = parseInt(obj.left) - width;
				}
			}
		}catch(e){
			alert(e);
		}
	}

	this.next2 = function() {
		try{
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.top) < 1 ) { 
					height = this.height + parseInt(obj.top);
					break;
				}
			}
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.top) < 1 ) { 
					obj.top = this.height * (this.itemcount-1);
				} else {
					obj.top = parseInt(obj.top) - height;
				}
			}
		}catch(e){
			alert(e);
		}
	}

	this.prev = function() {

		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( parseInt(obj.left) < 1 ) { 
				width = parseInt(obj.left) * (-1);
				break;
			}
		}
		if ( width == 0 ) {
			total_width = this.width * (this.itemcount-1);
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) + 1 > total_width ) { 
					obj.left = 0;
				} else {
					obj.left = parseInt(obj.left) + this.width;
				}
			}
		} else {
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					obj.left = 0;
				} else {
					obj.left = parseInt(obj.left) + width;
				}
			}
		}
	}

	this.prev2 = function() {

		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( parseInt(obj.top) < 1 ) { 
				height = parseInt(obj.top) * (-1);
				break;
			}
		}
		if ( height == 0 ) {
			total_width = this.height * (this.itemcount-1);
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.top) + 1 > total_width ) { 
					obj.top = 0;
				} else {
					obj.top = parseInt(obj.top) + this.height;
				}
			}
		} else {
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.top) < 1 ) { 
					obj.top = 0;
				} else {
					obj.top = parseInt(obj.top) + height;
				}
			}
		}
	}

	this.unext = function () {
		this.onmouseover();
		this.next();
		window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}

	this.unext2 = function () {
		this.onmouseover();
		this.next2();
		window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}

	this.uprev = function () {
		this.onmouseover();
		this.prev();
		window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}

	this.uprev2 = function () {
		this.onmouseover();
		this.prev2();
		window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}
}

/*
		±Û·Î¹ú ·Ñ¿À¹ö
*/
	function SGslideshow(){
		var ImgNum = 0;
		this.imgobj = new Array();
		this.textobj = new Array();
		
		this.slideimgdata = new Array();
		this.slidetextdata = new Array();
		
		this.name = "SGslide"
		this.ImgLength;
		this.delay = 1000; //ÀÚµ¿ÀüÈ¯½Ã ½Ã°£¼³Á¤(1000=1ÃÊ)
		this.lock = false;	
		this.run = null;
		this.imgobjcount=0;
		this.textobjcount=0;
		this.direction = 1;
		
		this.chgImg=function(dir){
			if (document.images) {
				
				ImgNum = ImgNum + dir;
				if (ImgNum > this.ImgLength) {
					ImgNum = 0;
				}
				if (ImgNum < 0) {
					ImgNum = this.slideimgdata.length + ImgNum;
				}
				if(ImgNum < 0 ) ImgNum = 0;
				if (this.imgobj.length > 0 ) {
					document.getElementById((this.name)+"1"+"").src = this.slideimgdata[ImgNum];
					if(this.imgobj.length>1){
						for(i=1;i<dir;i++){
							document.getElementById((this.name)+(i+1)+"").src = this.slideimgdata[ImgNum+i];
						}
					}	
				}
				if ( this.textobj.length > 0 ) {
					document.getElementById((this.name)+"TEXT1").innerHTML = this.slidetextdata[ImgNum];
					if(this.textobj.length>1){
						for(i=1;i<dir;i++){
							document.getElementById((this.name)+"TEXT" + (i+1) +"").innerHTML = this.slidetextdata[ImgNum+i];
						}
					}		
				}
		   }
		};

		this.imgobjadd = function () {
			var text  = arguments[0];
			this.imgobj[this.imgobjcount] = text;
			this.imgobjcount ++;
		};
		this.textobjadd = function () {
			var text  = arguments[0];
			this.textobj[this.textobjcount] = text;
			this.textobjcount ++;
		};
		
		this.display = function(){
			for (i=0;i<this.imgobj.length ;i++ )
			{
				document.write(this.imgobj[i]);
			}
			for (i=0;i<this.textobj.length ;i++ )
			{
				document.write(this.textobj[i]);
			}
		};

		this.start=function() {
		
			if (this.lock == true) {
				this.lock = false;
				window.clearInterval(this.run);
			}
			else if (this.lock == false) {

				this.ImgLength = this.slideimgdata.length-(this.imgobj.length);
				this.display();	
				this.lock = true;
				this.run = setInterval(this.name+".chgImg("+this.direction+");",this.delay);
		   }
		};
		this.nextSlide=function(){
			window.clearInterval(this.run);
			this.chgImg(this.direction);
		}
		this.prevSlide=function(){
			window.clearInterval(this.run);
			this.chgImg(parseInt(this.direction) * (-1));
		}
	}
	
	function SGslideshowForMain(){
		var ImgNum = 0;
		this.imgobj = new Array();
		this.textobj = new Array();
		
		this.slideimgdata = new Array();
		this.slidetextdata = new Array();
		
		this.name = "SGslide"
		this.ImgLength;
		this.delay = 2000; //ÀÚµ¿ÀüÈ¯½Ã ½Ã°£¼³Á¤(1000=1ÃÊ)
		this.lock = false;	
		this.run = null;
		this.imgobjcount=0;
		this.textobjcount=0;
		this.direction = 1;
		
		this.chgImg=function(dir){
			if (document.images) {
				
				ImgNum = ImgNum + dir;
				if (ImgNum > this.ImgLength) {
					ImgNum = ImgNum - this.slideimgdata.length ;
				}
				if (ImgNum < 0) {
					ImgNum = this.slideimgdata.length + ImgNum;
				}
				if (this.imgobj.length > 0 ) {
					document.getElementById((this.name)+"1"+"").innerHTML = this.slideimgdata[ImgNum];
					if(this.imgobj.length>1){
						for(i=1;i<dir;i++){
							document.getElementById((this.name)+(i+1)+"").innerHTML = this.slideimgdata[ImgNum+i];
						}
					}	
				}
				if ( this.textobj.length > 0 ) {
					document.getElementById((this.name)+"TEXT1").innerHTML = this.slidetextdata[ImgNum];
					if(this.textobj.length>1){
						for(i=1;i<dir;i++){
							document.getElementById((this.name)+"TEXT" + (i+1) +"").innerHTML = this.slidetextdata[ImgNum+i];
						}
					}		
				}
		   }
		};

		this.imgobjadd = function () {
			var text  = arguments[0];
			this.imgobj[this.imgobjcount] = text;
			this.imgobjcount ++;
		};
		this.textobjadd = function () {
			var text  = arguments[0];
			this.textobj[this.textobjcount] = text;
			this.textobjcount ++;
		};
		
		this.display = function(){
			for (i=0;i<this.imgobj.length ;i++ )
			{
				document.write(this.imgobj[i]);
			}
			for (i=0;i<this.textobj.length ;i++ )
			{
				document.write(this.textobj[i]);
			}
		};

		this.start=function() {
		
			if (this.lock == true) {
				this.lock = false;
				window.clearInterval(this.run);
			}
			else if (this.lock == false) {

				this.ImgLength = this.slideimgdata.length-(this.imgobj.length);
				this.display();	
				this.lock = true;
				this.run = setInterval(this.name+".chgImg("+this.direction+");",this.delay);
		   }
		};
		this.nextSlide=function(){
			window.clearInterval(this.run);
			this.chgImg(this.direction);
			this.run = setInterval(this.name+".chgImg("+this.direction+");",this.delay);
		}
		this.prevSlide=function(){
			window.clearInterval(this.run);
			this.chgImg(parseInt(this.direction) * (-1));
			this.run = setInterval(this.name+".chgImg("+this.direction+");",this.delay);
		}
	}
	function tabover(id,cnt,div){

		var tname = id.substr(0,(id.length)-(cnt.length));
		if(div!=undefined){
			var tdiv = div.substr(0,(div.length)-(cnt.length));
		}
		for (i=1;i<=cnt; i++){

			if (id==tname+i){
				document.getElementById(id).src =  document.getElementById(tname+i).src.substring(0,document.getElementById(tname+i).src.lastIndexOf("_"))+"_on.gif";
				if(div!=undefined){
					document.getElementById(tdiv+i).style.display = "";
				}
				
			}
			else{
				document.getElementById(tname+i).src =  document.getElementById(tname+i).src.substring(0,document.getElementById(tname+i).src.lastIndexOf("_"))+"_off.gif";
				if(div!=undefined){
					document.getElementById(tdiv+i).style.display = "none";
				}
			}
			
		}	
	}

	function tamsaover(id,cnt,div){

		var tname = id.substr(0,(id.length)-(cnt.length));
		if(div!=undefined){
			var tdiv = div.substr(0,(div.length)-(cnt.length));
		}

		for (i=1;i<=cnt; i++){

			if (id==tname+i){
				document.getElementById(id).className =  "on";
				if(div!=undefined){
					document.getElementById(tdiv+i).style.display = "";
				}
				
			}
			else{
				document.getElementById(tname+i).className = "";
				if(div!=undefined){
					document.getElementById(tdiv+i).style.display = "none";
				}
			}
			
		}	
	}

	function tabover_re(id,cnt,div){

		var tname = id.substr(0,(id.length)-(cnt.length));
		if(div!=undefined){
			var tdiv = div.substr(0,(div.length)-(cnt.length));
		}
		for (i=1;i<=cnt; i++){

			if (id==tname+i){
				document.getElementById(id).src =  document.getElementById(tname+i).src.substring(0,document.getElementById(tname+i).src.lastIndexOf("_"))+"_on.gif";
				if(div!=undefined){
					document.getElementById(tdiv+i).style.display = "";
					document.getElementById(tdiv+i+"_re").style.display = "";
				}
				
			}
			else{
				document.getElementById(tname+i).src =  document.getElementById(tname+i).src.substring(0,document.getElementById(tname+i).src.lastIndexOf("_"))+"_off.gif";
				if(div!=undefined){
					document.getElementById(tdiv+i).style.display = "none";
					document.getElementById(tdiv+i+"_re").style.display = "none";
				}
			}
			
		}	
	}

	function rollover(img){
		var onImage = img.src.substring(0,img.src.lastIndexOf("_"))+"_on.gif";
		img.src = onImage;
	}
	function hide(img){
		var offImage = img.src.substring(0,img.src.lastIndexOf("_"))+"_off.gif";
		img.src = offImage;
	}

	function setObjColor(obj){
		obj.style.color = "red";
	}
	function setObjOrgColor(obj){
		obj.style.color = "black";
	}
	

/*
	ÄíÅ°
*/
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 "";  // º»¹®¿¡ ÆùÆ® »çÀÌÁî º¯°æ¿¡·¯ ÁÖ¼®Ã³¸® by moriah 2010.11.24
}
function setCookie( name, value, expiredays, dom)
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	if(arguments[2] == null)
		document.cookie = name + "=" + escape( value ) + "; path=/;" 
	else if(arguments[3] == null) {
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() +";" 
	}
	else {
		document.cookie = name + "=" + escape( value ) + "; path=/; domain=" + dom + "; expires=" + todayDate.toGMTString() +";" 
	}

}
function reSize(id){
	try{	
		if(id == null) id = "comment";

		var oBody	=	getElementById(id).document.body;
		var oFrame	=	document.getElementById(id);
			
		oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
		oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth);
		alert(oFrame.style.width);
	}
	//An error is raised if the IFrame domain != its container's domain
	catch(e)
	{
		window.status =	'Error: ' + e.number + '; ' + e.description;
	}
}
function showExpose(num) {
	for ( i = 0 ; i < 3 ; i++ ) {
		dd = document.getElementById("MAIN_RTEXPOSE" + (i+1));
		if ( (i+1) == num) {
			dd.style.display = "block";
		}
		else {
			dd.style.display = "none";
		}
	}
}

// °ø¹éÃ¼Å© ÇÔ¼ö Á¤ÀÇºÎºÐ
function isEmpty( data ){
   for ( var i = 0 ; i < data.length ; i++ ){
	  if ( data.substring( i, i+1 ) != " " ){
		 return false;
	  }
   }
   return true;
} 

/** À¯È¿¼º °Ë»ç ·çÆ¾ **/
function MC_eregNumeric(str){
	var reg = RegExp("^[0-9\.]+$");
	return reg.test(str);	
}
function MC_eregAlpha(str) {
	var reg = RegExp("^[a-zA-Z]+$");
	return reg.test(str);
}
function MC_eregEmail(str) {
	var reg = RegExp(/^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$/i);
	return reg.test(str);
}

function MC_eregAlphaNumeric(str){
	var reg = RegExp("^[0-9\.a-zA-Z]+$");
	return reg.test(str);
}
function MC_eregKorean(str) {
	var reg = RegExp("^[°¡-?0-9 ]+$");
	return reg.test(str);
}
function MC_eregID(str){
	var reg = RegExp("^[a-zA-Z0-9\_]{4,12}$");
	return reg.test(str);
}
function MC_eregPhone(str){
	var reg = RegExp("^[0-9]{2,3}-[0-9]{3,4}-[0-9]{4}$");
	return reg.test(str);
}
//ÁÖ¹Îµî·Ï Ã¼Å©

function check_juminno(juminno){
	var jumin1 = juminno.substr(0,6);
	var jumin2 = juminno.substr(6,7);

  
  // ¹®ÀÚ¿­À» Á¤¼ö·Î ¹Ù²ãÁÖ´Â ³»ÀåÇÔ¼ö : parseInt()
	a1 = parseInt(jumin1.charAt(0))*2;
	a2 = parseInt(jumin1.charAt(1))*3;
	a3 = parseInt(jumin1.charAt(2))*4;
	a4 = parseInt(jumin1.charAt(3))*5;
	a5 = parseInt(jumin1.charAt(4))*6;
	a6 = parseInt(jumin1.charAt(5))*7;
	a7 = parseInt(jumin2.charAt(0))*8;
	a8 = parseInt(jumin2.charAt(1))*9;
	a9 = parseInt(jumin2.charAt(2))*2;
	a10 = parseInt(jumin2.charAt(3))*3;
	a11 = parseInt(jumin2.charAt(4))*4;
	a12 = parseInt(jumin2.charAt(5))*5;

	tot=a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12;

	na=tot%11;
	ch=11-na;
	  
	if(ch==10)ch=0;
	if(ch==11)ch=1;

	if(ch!=parseInt(jumin2.charAt(6))){
		alert("ÀÔ·ÂÇÑ ÁÖ¹Îµî·Ï¹øÈ£¸¦ È®ÀÎÈÄ,´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
		return false;
	}
	return true
}

//14¼¼¹Ì¸¸ ÁÖ¹Îµî·ÏÃ¼Å©

function check_residence_14(jumin1,jumin2,o)
{
	var frm = o;
	var today_yy = new Date();
	var buf = "";
	buf = today_yy.getYear();
	//alert(buf);
	
	aform = document.member_info;
	yy = jumin1.substr(0,2);
	mm = jumin1.substr(2,2);
	dd = jumin1.substr(4,2);
	gender = jumin2.substr(0,1);
	chk = 0;

	birth_yy = 19 + yy;
	if (birth_yy <= buf - 14)
	{
		alert('¸¸14¼¼ ÀÌÇÏ°¡ ¾Æ´Õ´Ï´Ù.');
		frm.jumin1.value = ""
		frm.jumin2.value = ""
		frm.jumin1.focus();
		return false;
	}

	if ((jumin1.length!=6)||(mm <1||mm>12||dd<1)){
			frm.jumin11.value = "";
			alert ('ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®°¡ Àß¸øµÇ¾ú½À´Ï´Ù.');
			frm.jumin1.focus();
			return false;
	}
   
	if ((gender != 1 && gender !=2 && gender != 3 && gender !=4 )||(jumin2.length != 7 )){
			frm.jumin2.value = "";
			alert ('ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®°¡ Àß¸øµÇ¾ú½À´Ï´Ù.');
			frm.jumin2.focus();
			return false;
	}



  
	for (var i = 0; i <=5 ; i++){
		chk = chk + ((i%8+2) * parseInt(jumin1.substring(i,i+1)))
	}

	for (var i = 6; i <=11 ; i++){
			chk = chk + ((i%8+2) * parseInt(jumin2.substring(i-6,i-5)))
	}

	chk = 11 - (chk %11)
	chk = chk % 10

	if (chk != jumin2.substring(6,7))
	{
			frm.jumin1.value = ""
			frm.jumin2.value = ""
			alert ('¸ÂÁö ¾Ê´Â ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.');
			frm.jumin1.focus();
			return false;
	}
	return true;
}

//¿Ü±¹ÀÎ ¹øÈ£ Ã¼Å©
function check_fgnno(fgnno){
	var sun = 0;
	var odd = 0;
	buf = new Array(13);
	for(var i=0;i<13;i++){
		buf[i] = parseInt(fgnno.charAt(i));
	}
	odd = buf[7]*10+buf[8];
	if(odd%2!=0){
		return false;
	}
	if((buf[11]!=6)&&(buf[11]!=7)&&(buf[11]!=8)&&(buf[11]!=9)){
		return false;
	}
	multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
	for(var i=0,sum=0;i<12;i++){
		sum+=(buf[i]*=multipliers[i]);
	}
	sum=11-(sum%11);
	if(sum>=10){
		sum-=10;
	}
	sum+=2;
	if(sum>=10){
		sum-=10;
	}
	if(sum!=buf[12]){
		return false;
	}
	return false;
}

//ÆË¾÷Ã¢ ¶ç¿ì±â
function popstart(url,sName){

	var win = window.open(url, sName, "scrollbars=yes,status=no,toolbar=no,resizable=yes,location=no,menu=no,width=10,height=10"); 
	win.opener.self;
}
//Æ÷Åä ½½¶óÀÌµå ÆË¾÷ (Å©±â°íÁ¤, ½ºÅ©·Ñ¹Ù ¾øÀ½, »çÀÌÁî Á¶Àý ¾ÈµÊ)
function slidePopStart(url,sName){
	var win = window.open(url, sName, "scrollbars=no,status=no,toolbar=no,resizable=no,location=no,menu=no,width=840,height=700"); 
	win.opener.self;
}
//ÆË¾÷Ã¢ »çÀÌÁî ÀÚµ¿ Á¶Àý
function WindowReset(win){ // »õÃ¢ÀÇ Å©±â¿Í À§Ä¡ Àç¼³Á¤
  
  var winBody = win.document.body; 
  // »õÃ¢ÀÇ »çÀÌÁî¿¡ ´õÇØÁÙ marginWidth¿Í marginHeight 
  var marginHeight = parseInt(winBody.topMargin)+parseInt(winBody.bottomMargin); 
  var marginWidth = parseInt(winBody.leftMargin)+parseInt(winBody.rightMargin); 
  // »õÃ¢ÀÇ »çÀÌÁî ¼³Á¤ 
  var wid = winBody.scrollWidth + (winBody.offsetWidth - winBody.clientWidth) + marginWidth-5;
  var hei = winBody.scrollHeight + (winBody.offsetHeight - winBody.clientHeight) + marginHeight+17; 
  // »çÀÌÁî ÀçÁ¶Á¤ 
  win.resizeTo(wid, hei); 
} 

function goSubscription(userid,eid,f){
	if(userid==""){
		if(confirm("·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½ºÀÔ´Ï´Ù\n\nÁö±Ý ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")) {
		location.href = "/member/login.asp?f="+f;
		}
	}
	else{
		location.href="components/evnetSubscription.asp?eid="+eid;
	}
}
function adFlashWrite(flash) {
	document.write(flash);
}

// ÁÂ¿ì·Ñ¸µ½Ã mediapd.uprev(), mediapd.unext(), mediapd.type = 3, mediapd.num = 4(³ëÃâ°¹¼ö);
// À§¾Æ·¡·Ñ¸µ½Ã mediapd.uprev2(), mediapd.unext2(), mediapd.type = 1, mediapd.num = 4(³ëÃâ°¹¼ö);
function NvScroll_stop() {
	this.version = "0.2";
	this.name = "NvScroll_stop";
	this.item = new Array();
	this.itemcount = 0;
	this.currentspeed = 0;
	this.scrollspeed = 50;
	this.pausedelay = 1000;
	this.pausemouseover = false;
	this.stop = false;
	this.type = 1;
	this.height = 100;
	this.width = 100;
	this.stopHeight=0;
	this.i=0;

	this.add = function () {
		var text = arguments[0];

		this.item[this.itemcount] = text;
	//	alert(this.item[this.itemcount]);
		this.itemcount ++;
	};

	this.start = function (layer_name) {

		if ( this.itemcount == 1 ) {
			this.add(this.item[0]);
		}
		if (layer_name != null)
		{
			document.getElementById(layer_name).innerHTML = this.str_ret();
		}
		else 
		{
			this.display();
		}
		this.currentspeed = this.scrollspeed;
		if ( this.type == 1 || this.type == 2 ) {
			this.stop = true;
			setTimeout(this.name+'.rolling2()',this.currentspeed);
			//window.setTimeout(this.name+".stop = false", this.pausedelay);
		} else if ( this.type == 3 ) {
			this.stop = true;
			setTimeout(this.name+'.rolling()',this.currentspeed);
			//window.setTimeout(this.name+".stop = false", this.pausedelay);
		}

	};

	this.display = function () {
		if (this.type == 1)	{
			document.write('<div id="'+this.name+'" style="height:'+(this.height*this.num-this.widtht)+'; width:'+this.width+'; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">');
		} else if ( this.type == 3)
		{
			document.write('<div id="'+this.name+'" style="height:'+this.height+'; width:'+(this.width*this.num-this.widtht)+'; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">');
		}
		for(var i = 0; i < this.itemcount; i++) {
			if ( this.type == 1 ) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+(this.height*i)+'px; ">');
				document.write(this.item[i]);
				document.write('</div>');
			} else if ( this.type == 2 || this.type == 3 ) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i)+'px; width:'+this.width+'; position:absolute; top:0px; ">');
				document.write(this.item[i]);
				document.write('</div>');
			}
		}
		document.write('</div>');
	};
	// ¹Ù·Î µð½ºÇÃ·¹ÀÌ ¾Ê°í ½ºÆ®¸µ ¸®ÅÏÇÏµµ·Ï Ãß°¡ 2006-03-30
	this.str_ret = function () {
		var str = '<div id="'+this.name+'" style="height:'+this.height+'; width:'+this.width+'; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">';
		for(var i = 0; i < this.itemcount; i++) {
			if ( this.type == 1 ) {
				str += '<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+(this.height*i)+'px; ">';
				str += this.item[i];
				str += '</div>';
			} else if ( this.type == 2 || this.type == 3 ) {
				str += '<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i)+'px; width:'+this.width+'; position:absolute; top:0px; ">';
				str += this.item[i];
				str += '</div>';
			}
		}
				str += '</div>';
				return str;
	};

	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 (i = 0; i < this.itemcount; i++) {
					obj = document.getElementById(this.name+'item'+i).style;
					if ( this.type == 1 ) {
						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;
					} else if ( this.type == 2 ) {
						obj.left = parseInt(obj.left) - 1;
						if ( parseInt(obj.left) <= this.width * (-1) ) obj.left = this.width * (this.itemcount-1);
						if ( parseInt(obj.left) == 0 ) this.currentspeed = this.pausedelay;
					}
				}
			}
			//window.setTimeout(this.name+".scroll()",this.currentspeed);
		}
	};

	this.rolling = function () {
		if ( this.stop == false  ) {
			this.next();
		}
		//self.setTimeout(this.name+".rolling()",this.scrollspeed);
	}

	this.rolling2 = function () {
		if ( this.stop == false  ) {
			this.next2();
		}
		//window.setTimeout(this.name+".rolling2()",this.scrollspeed);

	}

	this.onmouseover = function () {
		if ( this.pausemouseover ) {
			this.stop = true;
		}
	};

	this.onmouseout = function () {
		if ( this.pausemouseover ) {
			this.stop = false;
		}
	};

	this.next = function() {
		try{
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					width = this.width + parseInt(obj.left);
					break;
				}
			}
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					obj.left = this.width * (this.itemcount-1);
				} else {
					obj.left = parseInt(obj.left) - width;
				}
			}
		}catch(e){
			alert(e);
		}
	}

	this.next2 = function() {
		try{
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.top) < 1 ) { 
					height = this.height + parseInt(obj.top);
					break;
				}
			}
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.top) < 1 ) { 
					obj.top = this.height * (this.itemcount-1);
				} else {
					obj.top = parseInt(obj.top) - height;
				}
			}
		}catch(e){
			alert(e);
		}
	}

	this.prev = function() {

		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( parseInt(obj.left) < 1 ) { 
				width = parseInt(obj.left) * (-1);
				break;
			}
		}
		if ( width == 0 ) {
			total_width = this.width * (this.itemcount-1);
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) + 1 > total_width ) { 
					obj.left = 0;
				} else {
					obj.left = parseInt(obj.left) + this.width;
				}
			}
		} else {
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					obj.left = 0;
				} else {
					obj.left = parseInt(obj.left) + width;
				}
			}
		}
	}

	this.prev2 = function() {

		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( parseInt(obj.top) < 1 ) { 
				height = parseInt(obj.top) * (-1);
				break;
			}
		}
		if ( height == 0 ) {
			total_width = this.height * (this.itemcount-1);
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.top) + 1 > total_width ) { 
					obj.top = 0;
				} else {
					obj.top = parseInt(obj.top) + this.height;
				}
			}
		} else {
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.top) < 1 ) { 
					obj.top = 0;
				} else {
					obj.top = parseInt(obj.top) + height;
				}
			}
		}
	}

	this.unext = function () {
		this.onmouseover();
		this.next();
		//window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}

	this.unext2 = function () {
		this.onmouseover();
		this.next2();
		//window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}

	this.uprev = function () {
		this.onmouseover();
		this.prev();
		//window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}

	this.uprev2 = function () {
		this.onmouseover();
		this.prev2();
		//window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}
}

//ÀÌ¹ÌÁö ¸®»çÀÌÁî ÇÔ¼ö 2009.01.29 Áø»óÃ¶ 
//»ç¿ë ¿¹ : <img src="#" onload="PhotoResize(this,60,40)"/>
function PhotoResize(img,maxWidth,maxHeight){
	if (img.width/img.height>maxWidth/maxHeight){
		img.width=maxWidth;
		img.height=img.height*maxWidth/img.width;
	}else{
		img.height=maxHeight;
		img.width=img.width*maxHeight/img.height;
	}
}

function NoImage(img){
	img.src="/Articles/Images/photo/noimage.gif";
}

//ÆùÆ® ±½±â º¯°æ
function changeFont(thick){
	thick.style.fontWeight = "bold";
}
function turnBack(thick){
	thick.style.fontWeight = "normal";
}

//¹è°æ»ö º¯°æ
function changeBackground(bgc){
	bgc.style.background = '#ffffff'
}
function returnBackground(bgc){
	bgc.style.background = '#FFEAEF'
}

//¸ÞÀÎ ¸®ÇÁ·¹½¬
function reloadSegyeMain(){
	location.href = "/Articles/Main.asp";
}

//¸ÞÀÎ ¸®ÇÁ·¹½¬
function reloadSegyeMain_html(){
	location.href = "/Articles/Main.html";
}


//ºÏ¸¶Å©
function sgbookmark(){
	window.external.AddFavorite('http://www.segye.com', '¼¼»óÀ» º¸´Â ´«, ±Û·Î¹ú ¹Ìµð¾î - ¼¼°èÀÏº¸ -');
}


function generateMenuNavi(code,subcode){
	var leftMenuSelected=document.getElementById("LEFTMENU"+code);
	if (leftMenuSelected){
		var leftMenuStr=""
		if (leftMenuSelected.getElementsByTagName("p")[0].innerHTML>""){
			leftMenuStr=leftMenuSelected.getElementsByTagName("p")[0].innerHTML;
			leftMenuSelected.getElementsByTagName("p")[0].innerHTML="<strong>"+leftMenuStr+"</strong>"
		}else{
			leftMenuStr=leftMenuSelected.getElementsByTagName("a")[0].innerHTML;
			leftMenuSelected.getElementsByTagName("a")[0].innerHTML="<strong>"+leftMenuStr+"</strong>"
		}
		
		var leftMenuSubSelected=document.getElementById("LEFTMENU"+code+subcode);
		var leftMenuSubStr="";
		if (leftMenuSubSelected){
			leftMenuSubStr=leftMenuSubSelected.innerHTML;
		}

		var nav=document.getElementById("UNAVI");
		if(nav){
			if (leftMenuSubStr){
				if (leftMenuSelected.getElementsByTagName("p")[0].innerHTML){
					nav.innerHTML =  nav.innerHTML + "<li>&gt</li><li>" + leftMenuStr + "</li>" + "<li>&gt</li><li><b>" + leftMenuSubStr + "</b></li>";
				}else{
					nav.innerHTML =  nav.innerHTML + "<li>&gt</li><li><b>" + leftMenuSubStr + "</b></li>";
				}
			}else{
				nav.innerHTML =  nav.innerHTML + "<li>&gt</li><li><B>" + leftMenuStr + "</b></li>";
			}
		}
	}
}

function generateMenuNaviMajor(code,subcode){
	var leftMenuSelected=document.getElementById("LEFTMENU"+code);
	if (leftMenuSelected){
		var leftMenuStr=""
		if (leftMenuSelected.getElementsByTagName("p").innerHTML){
			leftMenuStr=leftMenuSelected.getElementsByTagName("p")[0].innerHTML;
			leftMenuSelected.getElementsByTagName("p")[0].innerHTML="<strong>"+leftMenuStr+"</strong>"
		}else{
			leftMenuStr=leftMenuSelected.getElementsByTagName("a")[0].innerHTML;
			leftMenuSelected.getElementsByTagName("a")[0].innerHTML="<strong>"+leftMenuStr+"</strong>"
		}
		
		var leftMenuSubSelected=document.getElementById("LEFTMENU"+code+subcode);
		var leftMenuSubStr="";
		if (leftMenuSubSelected){
			leftMenuSubStr=leftMenuSubSelected.innerHTML;
		}

		var nav=document.getElementById("UNAVI");
		if(nav){
			if (leftMenuSubStr){
				nav.innerHTML =  nav.innerHTML + "<li>&gt</li><li><b>" + leftMenuSubStr + "</b></li>";
			}
		}
	}
}

//ÁÂÃø ¸Þ´º ÇÔ¼öµé
var leftMenuSubCloseTimer;
function leftMenuMouseover(obj){
	for(var i=1;i<10;i++){
		if(document.getElementById("LEFTMENU0"+i+"SUB")){
			document.getElementById("LEFTMENU0"+i+"SUB").style.display="none";
		}
	}
	for(var i=1;i<10;i++){
		if(document.getElementById("LEFTMENU0"+i)){
			document.getElementById("LEFTMENU0"+i).style.fontWeight="";
		}
	}
	if(document.getElementById(obj.id+"SUB")){
		document.getElementById(obj.id+"SUB").style.display="";
	}
	obj.style.fontWeight="bold";
}
function leftMenuMouseout(obj){
	clearTimeout(leftMenuSubCloseTimer);
	leftMenuSubCloseTimer=setTimeout(function(){leftMenuhide(obj);},1000);
}
function leftMenuSubMouseover(obj){
	clearTimeout(leftMenuSubCloseTimer);
}
function leftMenuSubMouseout(obj){
	clearTimeout(leftMenuSubCloseTimer);
	leftMenuSubCloseTimer=setTimeout(function(){leftMenuSubhide(obj);},1000);
}
function leftMenuhide(obj){
	if(document.getElementById(obj.id+"SUB")){
		document.getElementById(obj.id+"SUB").style.display="none";
	}
	obj.style.fontWeight="";
}
function leftMenuSubhide(obj){
	document.getElementById(obj.id).style.display="none";
	document.getElementById(obj.id.substring(0,10)).style.fontWeight="";
}

//BottomÀÇ ÄÞº¸¹Ú½º ÇÔ¼ö
var pastServiceMenuOpened2=0;
var pastServiceMenuTimer2;
function pastServiceMenuToggle2(){
	if(pastServiceMenuOpened2==0) {
		pastServiceMenuOpened2=1;
		document.getElementById("selectoverMenuS1").style.display="";
		document.getElementById("RightServiceMenuButton").getElementsByTagName("li")[0].style.backgroundPosition="0px -60px";
	}else{
		pastServiceMenuOpened2=0;
		document.getElementById("selectoverMenuS1").style.display="none";
		document.getElementById("RightServiceMenuButton").getElementsByTagName("li")[0].style.backgroundPosition="0px -40px";
	}
}
function pastServiceMenuMouseOut2(){
	clearTimeout(pastServiceMenuTimer2);
	pastServiceMenuTimer2=setTimeout(function(){pastServiceMenuOpened2=0;document.getElementById("selectoverMenuS1").style.display="none";document.getElementById("RightServiceMenuButton").getElementsByTagName("li")[0].style.backgroundPosition="0px 0px";},1000);
}
function pastServiceMenuButtonOver2(){
	if(pastServiceMenuOpened2==0){
		document.getElementById("RightServiceMenuButton").getElementsByTagName("li")[0].style.backgroundPosition="0px -40px";
	}else{
		document.getElementById("RightServiceMenuButton").getElementsByTagName("li")[0].style.backgroundPosition="0px -60px";
	}
	
}
function pastServiceMenuButtonOut2(){
	if(pastServiceMenuOpened2==0){
		document.getElementById("RightServiceMenuButton").getElementsByTagName("li")[0].style.backgroundPosition="0px 0px";
	}else{
		document.getElementById("RightServiceMenuButton").getElementsByTagName("li")[0].style.backgroundPosition="0px -20px";
	}
}

//³×ºñ°ÔÀÌ¼Ç
function navigation(){
	if(typeof(gTopCategory) == "object") {
		document.writeln("<li>></li>");
		document.writeln("<li>" + gTopCategory._categorytext + "</li>");
		var t = gTopCategory.getSelectedSubmenu();
		if(t) {
			document.writeln("<li>></li>");
			document.writeln("<li>" + t._subText + "</li>");
		}
		if(typeof(gLeafCtg) == "string" && gLeafCtg != null && gLeafCtg != "") {
			try {
				var nCtg = parseInt(gLeafCtg)-1;
				if(nCtg >= 0 && t._leaf.length > nCtg) {
					document.writeln("<li>></li>");
					document.writeln("<li>" + t._leaf[nCtg] + "</li>");
				}
			}catch(e) {	}
		}
	}
}
function navigation_re(){
	var Request = function()
	{
		this.getParameter = function( name )
		{
			var rtnval = '';
			var nowAddress = unescape(location.href);
			var parameters = (nowAddress.slice(nowAddress.indexOf('?')+1,nowAddress.length)).split('&');

			for(var i = 0 ; i < parameters.length ; i++)
			{
				var varName = parameters[i].split('=')[0];
				if(varName.toUpperCase() == name.toUpperCase())
				{
					rtnval = parameters[i].split('=')[1];
					break;
				}
			}
			return rtnval;
		}
	}
	if(typeof(gTopCategory) == "object") {
		var request=new Request();
		var gLeafCtg=request.getParameter('subctg1');
		var gCID=request.getParameter('cid');	
		var t = gTopCategory.getSelectedSubmenu();
		//if(t) {
			//document.writeln("<li class='st'><a href='"+ t._link +"'><img src='http://img.segye.com/Articles/images/menu/"+ //gTopCategory._category + t._subCategory + ".gif' border='0' alt='"+ t._subText +"'></a></li>");
		//}

		if (gTopCategory._category=="FAMILYGLOBAL"){
			if (t==null){
				document.writeln("<li class='st'><a href='default.asp'><img src='http://img.segye.com/Articles/images/menu/"+ gTopCategory._category +gTopCategory._submenu[parseInt(gCID.substr(4,2),10)-1]._subCategory + ".gif' border='0' alt='" + gTopCategory._submenu[parseInt(gCID.substr(4,2),10)-1]._subText+"'></a></li>");
			}else{
				document.writeln("<li class='st'><a href='"+ t._link +"'><img src='http://img.segye.com/Articles/images/menu/"+ gTopCategory._category + t._subCategory + ".gif' border='0' alt='"+ t._subText +"'></a></li>");
			}
		}
		else if (gTopCategory._category=="MOVIE" || gTopCategory._category=="PUNCH" || t==null)
		{
			document.writeln("<li class='st'><a href='default.asp'><img src='http://img.segye.com/Articles/images/menu/"+ gTopCategory._category + ".gif' border='0' alt='"+ gTopCategory._categorytext +"'></a></li>");
		}else{
			document.writeln("<li class='st'><a href='"+ t._link +"'><img src='http://img.segye.com/Articles/images/menu/"+ gTopCategory._category + t._subCategory + ".gif' border='0' alt='"+ t._subText +"'></a></li>");
		}

		if(typeof(gLeafCtg) == "string" && gLeafCtg != null && gLeafCtg != "") {
			try {
				var nCtg = parseInt(gLeafCtg,10)-1;
				if(nCtg >= 0 && t._leaf.length > nCtg) {
					document.writeln("<li class='sts'><a href='"+ t._link +"?subctg1="+gLeafCtg+"'>"+ t._leaf[nCtg] + "</a></li>");
				}
			}catch(e) {	}
		}else if(gCID.substr(6,2)!="00"){
			try {
				if(t==null){
					var nCtg = parseInt(gCID.substr(6,2),10)-1;
					if(nCtg >= 0 && gTopCategory._submenu[parseInt(gCID.substr(4,2),10)-1]._leaf.length > nCtg) {
						document.writeln("<li class='sts'><a href='default.asp?subctg1="+gCID.substr(6,2)+"'>"+ gTopCategory._submenu[parseInt(gCID.substr(4,2),10)-1]._leaf[nCtg] + "</a></li>");
					}
				}else{
					var nCtg = parseInt(gCID.substr(6,2),10)-1;
					if(nCtg >= 0 && t._leaf.length > nCtg) {
						document.writeln("<li class='sts'><a href='"+ t._link +"?subctg1="+gCID.substr(6,2)+"'>"+ t._leaf[nCtg] + "</a></li>");
					}
				}
			}catch(e) {	}
		}else if(gCID.substr(4,2)!="00" && (gTopCategory._category=="FAMILYGLOBAL" || gTopCategory._category=="MOVIE" || gTopCategory._category=="PUNCH")){

			try {
				var nCtg = parseInt(gCID.substr(4,2),10)-1;
				if(nCtg >= 0 && gTopCategory._submenu.length > nCtg) {
					document.writeln("<li class='sts'><a href='"+gTopCategory._submenu[nCtg]._link+"'>"+ gTopCategory._submenu[nCtg]._subText + "</a></li>");
				}
			}catch(e) {	}
		}
	}
}
/*
	±â»çÅ©°Ô  ±â»çÀÛ°Ô  ÇÁ¸°Æ®  ¸ÞÀÏ  ºí·Î±×¿¡ ´ã±â  ½ºÅ©·¦  ¸ð¹ÙÀÏ Àü¼ÛÇÏ±â 
*/
var AR_CurrentFontSize = 11;
//window.onload=function() {
//	AR_FontInit();
//}

window.attachEvent('onload',AR_FontInit);

function AR_FontValueInit() {
	if( getCookie("SGGFontSize") != "")  {
		//AR_CurrentFontSize = getCookie("SGGFontSize");
	}
}
function AR_FontInit() {
	var content = document.getElementById("SG_ArticleContent");
	if(content) {
		AR_FontValueInit();
		var list = content.getElementsByTagName("li");
		if(list) {
			for( i = 0 ; i < list.length ; i++ ) {
				list[i].style.fontSize = AR_CurrentFontSize + "pt";
				if(AR_CurrentFontSize > 13) 
					list[i].style.lineHeight = "1.5";
			}
		}
	}
}
function AR_FontSize(delta) {
	var content = document.getElementById("SG_ArticleContent");
	if(content) {
		AR_FontValueInit();
		AR_CurrentFontSize = parseInt(AR_CurrentFontSize) + delta;
		
		if(AR_CurrentFontSize < 11 || AR_CurrentFontSize >= 21) return;
		var list = content.getElementsByTagName("li");
		if(list) {
			for( i = 0 ; i < list.length ; i++ ) {
				list[i].style.fontSize = AR_CurrentFontSize + "pt";
				if(AR_CurrentFontSize > 13) 
					list[i].style.lineHeight = "1.5";
			}
		}
		setCookie("SGGFontSize",AR_CurrentFontSize,1);
	}
}
function AR_Print(id) {
	
}
function AR_ToBlog(id) {
	
}
function AR_Scrap(id) {
	
}
function AR_ToMobile(id) {
	
}

//ÆË¾÷Ã¢ »çÀÌÁî ÀÚµ¿ Á¶Àý
function WindowReset(win){ // »õÃ¢ÀÇ Å©±â¿Í À§Ä¡ Àç¼³Á¤
  
  var winBody = win.document.body; 
  // »õÃ¢ÀÇ »çÀÌÁî¿¡ ´õÇØÁÙ marginWidth¿Í marginHeight 
  var marginHeight = parseInt(winBody.topMargin)+parseInt(winBody.bottomMargin); 
  var marginWidth = parseInt(winBody.leftMargin)+parseInt(winBody.rightMargin); 
  // »õÃ¢ÀÇ »çÀÌÁî ¼³Á¤ 
  var wid = winBody.scrollWidth + (winBody.offsetWidth - winBody.clientWidth);
  var hei = winBody.scrollHeight + (winBody.offsetHeight - winBody.clientHeight) + marginHeight+17; 
  // »çÀÌÁî ÀçÁ¶Á¤ 
  win.resizeTo(wid+8, hei); 
}

function winResize() {
	var Dwidth = parseInt(document.body.scrollWidth);
	var Dheight = parseInt(document.body.scrollHeight);
	var divEl = document.createElement("div");

	divEl.style.position = "absolute";
	divEl.style.left = "0px";
	divEl.style.top = "0px";
	divEl.style.width = "100%";
	divEl.style.height = "100%";

	document.body.appendChild(divEl);

	//document.body.insertBefore(divEl, document.body.firstChild);
	//alert("Dwidth : " + Dwidth + ", divEl.offsetWidth : " + divEl.offsetWidth + ", 
	//Dheight : " + Dheight + ", divEl.offsetHeight : " + divEl.offsetHeight);

	if(navigator.userAgent.indexOf("MSIE") !=-1)
		window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight);
	else
		window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight);

	document.body.removeChild(divEl);
}

/***************************************	   msn °ü·Ã ÇÔ¼ö	  ********************************************/
 function setCookie_domain(name ,value, expires, path, domain, secure)
 {
  document.cookie = name + "=" + escape (value) +
  ((expires) ? "; expires=" + expires.toGMTString() : "") +
  ((path) ? "; path=" + path : "") +
  ((domain) ? "; domain=" + domain : "") +
  ((secure) ? "; secure" : "");
 }
 function fn_CookieAdd(value)
 {
  var expiry = new Date();
  var name = "segye_article_msn";
  var path = "/";
  var domain = "segye.com";
  var secure = "";
  var urlData = location.href;
  var start_point = "";
  var end_point = "";
 
  expiry.setTime(expiry.getTime() + 1 * (24 * 60 * 60 * 1000));
  setCookie_domain(name, value, expiry, path, domain, secure);
 }
 function fn_GetCookie() 
 {
  var name = "segye_article_msn";
  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 "";
 }
 function fn_CheckCookie()
 {
  if (!fn_GetCookie())
  {
   alert ("ÄíÅ°¼³Á¤°¡ Çã¿ëµÇÁö ¾ÊÀº °æ¿ì ´Ù¸¥±â»ç°¡ Àü¼ÛµÉ ¼ö ÀÖ½À´Ï´Ù. \n\nÀÎÅÍ³Ý¿É¼Ç¿¡¼­ ÄíÅ°Çã¿ëÀ» È®ÀÎÇØ ÁÖ¼¼¿ä.");
   return false;
  }
 }
 var obj;
 function fn_TryMSN(total_id) {  
  var AppID = "99995657";
  fn_CookieAdd(total_id);
  fn_CheckCookie();
  CheckMessenger();
  LaunchApp(AppID, "");
 }
 function CheckMessenger()
 {
  eval ('try {obj = new ActiveXObject("MSNMessenger.P4QuickLaunch");} catch (e) {obj = null;}');
  var strErrorPage = "http://www.segye.com";
 }
 function LaunchApp(AppID, emailID)
 {
  if (obj != null)
  {
   obj.LaunchApp(AppID, emailID);
  }
 }
function tryMSN(){
	var id='<%=request("aid")%>'+document.getElementById("SG_ArticleCategory").innerHTML;
	fn_TryMSN(id);
}
function scrapMe2day() {
	var content = '"' + document.title.replace(' - ¼¼»óÀ» º¸´Â ´«, ±Û·Î¹ú ¹Ìµð¾î - ¼¼°èÀÏº¸ -','') + '":' + 'http://www.segye.com/Articles/RedirectArticleView.asp?aid=<%=request("aid")%>&cid=<%=request("cid")%>'; 
	window.open('http://me2day.net/posts/new?new_post[body]='+encodeURIComponent(content),'','','');
	
}
function scrapTwitter() {
	var content = '"' + document.title.replace(' - ¼¼»óÀ» º¸´Â ´«, ±Û·Î¹ú ¹Ìµð¾î - ¼¼°èÀÏº¸ -','').substring(0,40) + '":' + 'http://www.segye.com/Articles/RedirectArticleView.asp?aid=<%=request("aid")%>&cid=<%=request("cid")%>'; 
	window.open('http://twitter.com/intent/tweet?text='+encodeURIComponent(content),'','','');
}
function scrapSkcomms() {
	var skurl = '';
	skurl = 'http://www.segye.com/Articles/RedirectArticleView.asp?aid=<%=request("aid")%>&cid=<%=request("cid")%>';
	var sktitle = '';
	sktitle = document.title.replace(' - ¼¼»óÀ» º¸´Â ´«, ±Û·Î¹ú ¹Ìµð¾î - ¼¼°èÀÏº¸ -','');
	var sksummary = '';
	sksummary = document.getElementById("SG_ArticleContent").innerHTML;
	sksummary = sksummary.replace(new RegExp("<(/)?([a-zA-Z]*)(\\s[a-zA-Z]*=[^>]*)?(\\s)*(/)?>" , "gi"), "");
	sksummary = sksummary.substring(0,20);
	var skmeche = '';
	skmeche = '¼¼°è´åÄÄ';
	var article_body=document.getElementById("SG_ArticleContent").getElementsByTagName("li");
	var tempStr=article_body[0].innerHTML;
	var image_count=0;
	if (article_body[0].getElementsByTagName("img")!=null){
		image_count=article_body[0].getElementsByTagName("img").length;
	}
	var skthumbnail='';
	if (image_count>0)
	{
		skthumbnail = article_body[0].getElementsByTagName("img")[0].src;
	}
	window.open('http://csp.cyworld.com/bi/bi_recommend_pop_euc.php?url='+encodeURI(skurl)+'&title='+encodeURIComponent(sktitle)+'&thumbnail='+encodeURI(skthumbnail)+'&summary='+encodeURIComponent(sksummary)+'&writer='+skmeche,'recom_icon_pop','width=400,height=364,scrollbars=no,resizable=no','');
}
// apsolute À§Ä¡¸¦ °¡Áø div ¹èÄ¡ÇÏ±â À§ÇØ mobile °ú msn_news¿ÍÀÇ ºê¶ó¿ìÀú»ó À§Ä¡Â÷¸¦ »« Àý´ëÀ§Ä¡°ª¿¡¼­ À§Ä¡¸¦ +½ÃÅ´
var msn_closetimer=null;
var Msn_TimeOut		 = 3000;
function msn_userGuide_view(e){
	var objx,objy;
	//alert(document.URL.indexOf('FamilyGlobal'));
	//alert(e.clientX+" "+e.clientY);
	if (document.URL.indexOf('FamilyGlobal')>0 || document.URL.indexOf('FAMILYGLOBAL')>0){
		objx=482;
		objy=27;
	}else{
		objx=482;
		objy=25;
	}
	//alert(document.URL);
	//var objx=document.getElementById('msn_news').getBoundingClientRect().left-document.getElementById('mobile').getBoundingClientRect().left+289;
	//var objy=document.getElementById('msn_news').getBoundingClientRect().top-document.getElementById('UNAVI').getBoundingClientRect().left+document.body.scrollTop-5;
	
	//alert(objx);
	//alert(objy);
	document.getElementById('msn_userGuide').style.visibility='visible'; 
	document.getElementById('msn_userGuide').style.left=objx;
	document.getElementById('msn_userGuide').style.top=objy; 
}
function msn_closetimer_start(){
	msn_closetimer=window.setTimeout(msn_userGuide_hide,Msn_TimeOut);
}
function msn_closetimer_cancle(){
	if(msn_closetimer)
	{
		window.clearTimeout(msn_closetimer);
	   msn_closetimer= null;
	}
}
function msn_userGuide_hide(){
	document.getElementById('msn_userGuide').style.visibility='hidden';
}

/* AjaxRequest & Net*/
/*
url-loading object and a request queue built on top of it
*/

/* namespacing object */
var net = new Object();

net.READY_STATE_UNINITIALIZED = 0;
net.READY_STATE_LOADING = 1;
net.READY_STATE_LOADED = 2;
net.READY_STATE_INTERACTIVE = 3;
net.READY_STATE_COMPLETE = 4;


/*--- content loader object for cross-browser requests ---*/
net.ContentLoader = function(url, onload, onerror, method, params, contentType) {
	this.req = null;
	net.currentLoader = this;
	this.onload = onload;
	this.onerror = (onerror) ? onerror : this.defaultError;
	this.loadXMLDoc(url, method, params, contentType);
}

net.ContentLoader.prototype.loadXMLDoc = function(url, method, params, contentType) {

	//ÆÄÀÌ¾îÆø½º 3.0ÀÌ»ó¿¡¼­ ¿À·ù¸¦ ¹ß»ýÇÏ¿© ÁÖ¼®Ã³¸®ÇÔ.
	//if (window.netscape && window.netscape.security.PrivilegeManager.enablePrivilege)
		//netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');

	if (!method) {
		method = "GET";
	}
	if (!contentType && method == "POST") {
		contentType = 'application/x-www-form-urlencoded';
	}
	if (window.XMLHttpRequest) {
		this.req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		this.req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (this.req) {
		try {
			var loader = this;
			this.req.onreadystatechange = function() {
				net.ContentLoader.onReadyState.call(loader);
			}
			this.req.open(method, url, true);
			if (contentType) {
				this.req.setRequestHeader('Content-Type', contentType);
			}
			this.req.send(params);
		} catch (err) {
			this.onerror.call(this);
		}
	}
}


net.ContentLoader.onReadyState = function() {
	//ÆÄÀÌ¾îÆø½º 3.0ÀÌ»ó¿¡¼­ ¿À·ù¸¦ ¹ß»ýÇÏ¿© ÁÖ¼®Ã³¸®ÇÔ.
	//if (window.netscape && window.netscape.security.PrivilegeManager.enablePrivilege)
		//netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
	var req = this.req;
	var ready = req.readyState;
	if (ready == net.READY_STATE_COMPLETE) {
		var httpStatus = req.status;
		//if (status==200 || httpStatus==0){
		if (httpStatus == 200 || httpStatus == 0) {
			this.onload.call(this);
		} else {
			this.onerror.call(this);
		}
	}
}

net.ContentLoader.prototype.defaultError = function() {
	alert("error fetching data!"
			+ "\n\nreadyState:" + this.req.readyState
			+ "\nstatus: " + this.req.status
			+ "\nheaders: " + this.req.getAllResponseHeaders());
}




/*--- queue system for efficient transfer of many small commands in a single request ---*/
net.cmdQueues = new Array();


net.CommandQueue = function(id, url, onUpdate, freq) {
	this.id = id;
	net.cmdQueues[id] = this;
	this.url = url;
	this.queued = new Array();
	this.sent = new Array();
	this.onUpdate = onUpdate;
	if (freq) {
		this.repeat(freq);
	}
	this.lastUpdateTime = 0;
}

net.CommandQueue.STATUS_QUEUED = -1;
net.CommandQueue.STATE_UNINITIALIZED = net.READY_STATE_UNINITIALIZED;
net.CommandQueue.STATE_LOADING = net.READY_STATE_LOADING;
net.CommandQueue.STATE_LOADED = net.READY_STATE_LOADED;
net.CommandQueue.STATE_INTERACTIVE = net.READY_STATE_INTERACTIVE;
net.CommandQueue.STATE_COMPLETE = net.READY_STATE_COMPLETE;
net.CommandQueue.STATE_PROCESSED = 5;

net.CommandQueue.PRIORITY_NORMAL = 0;
net.CommandQueue.PRIORITY_IMMEDIATE = 1;


net.CommandQueue.prototype.addCommand = function(command) {
	if (this.isCommand(command)) {
		this.queue.append(command, true);
		if (command.priority == net.CommandQueue.PRIORITY_IMMEDIATE) {
			this.fireRequest();
		}
	}
}

net.CommandQueue.prototype.fireRequest = function() {
	if (!this.onUpdate && this.queued.length == 0) {
		return;
	}
	var data = "lastUpdate=" + this.lastUpdateTime + "&data=";
	for (var i = 0; i < this.queued.length; i++) {
		var cmd = this.queued[i];
		if (this.isCommand(cmd)) {
			data += cmd.toRequestString();
			this.sent[cmd.id] = cmd;
		}
	}
	this.queued = new Array();
	this.loader = new net.ContentLoader(
			this.url,
			net.CommandQueue.onload,
			net.CommandQueue.onerror,
			"POST", data
			);
}

net.CommandQueue.prototype.isCommand = function(obj) {
	return (
			obj.implementsProp("id")
					&& obj.implementsProp("priority")
					&& obj.implementsFunc("toRequestString")
					&& obj.implementsFunc("parseResponse")
			);
}

net.CommandQueue.onload = function() {
	var xmlDoc = this.req.responseXML;
	var elDocRoot = xmlDoc.getElementsByTagName("responses")[0];
	var lastUpdate = elDocRoot.attributes.getNamedItem("updateTime");
	if (parseInt(lastUpdate) > this.lastUpdateTime) {
		this.lastUpdateTime = lastUpdate;
	}
	if (elDocRoot) {
		for (i = 0; i < elDocRoot.childNodes.length; i++) {
			elChild = elDocRoot.childNodes[i];
			if (elChild.nodeType == 1) {
				if (elChild.tagName == "command") {
					var attrs = elChild.attributes;
					var id = attrs.getNamedItem("id").value;
					var command = net.commandQueue.sent[id];
					if (command) {
						command.parseResponse(elChild);
					}
				} else if (elChild.tagName == "update") {
					if (this.implementsFunc("onUpdate")) {
						this.onUpdate.call(this, elChild);
					}
				}
			}
		}
	}
}

net.CommandQueue.onerror = function() {
	alert("problem sending the data to the server");
}

net.CommandQueue.prototype.repeat = function(freq) {
	this.unrepeat();
	if (freq > 0) {
		this.freq = freq;
		var cmd = "net.cmdQueues[" + this.id + "].fireRequest()";
		this.repeater = setInterval(cmd, freq * 1000);
	}
}
net.CommandQueue.prototype.unrepeat = function() {
	if (this.repeater) {
		clearInterval(this.repeater);
	}
	this.repeater = null;
}

//view Expose
function viewExpose(aid) {
	var cid = document.getElementById("SG_ArticleCategory");
	if(cid) cidtext = cid.innerHTML;
	var url = "/Articles/viewExpose.asp?aid="+aid+"&cid="+cidtext+"&temp="+Math.random();
	var ldr = new net.ContentLoader(url,viewExposeProc,viewExposeProcErr);
}
function viewExposeProc() { }
function viewExposeProcErr() { }

function readExpose(aid) {
	var url = "/Articles/readExpose.asp?aid="+aid+"&temp="+Math.random();
	var ldr = new net.ContentLoader(url,readExposeProc,readExposeProcErr);
}
function readExposeProc() { 
	var cnt = this.req.responseText;
	var v = document.getElementById("SGArticleViewCnt");
	if(v) {
		v.innerHTML = cnt;
	}
}
function readExposeProcErr() {}


//ºäÆäÀÌÁö ÇÏ´Ü ÁÖ¿ä±â»ç »ðÀÔ
function ViewInArticle(){
 if (document.getElementById("SG_ArticleContent") != null)
 {
	 var article_body2=document.getElementById("SG_ArticleContent").getElementsByTagName("li");
	 var tempStr="<ul><li>"+article_body2[0].innerHTML+"</li></ul>" + document.getElementById("gisa_juyo").innerHTML;
	 document.getElementById("SG_ArticleContent").innerHTML = tempStr;
 }
}
function ViewInArticle2(){	
	//¼öÁ¤ÀÚ Áø»óÃ¶ : 2009.8.21 ±â»ç³»¿¡ µ¿¿µ»óÀÌ µé¾î°¡¸é »õ·Î »Ñ·ÁÁö°Ô µÇ¸é¼­ ¿À·ù°¡ »ý°Ü ÀÌÃ³·³ appendChild¸¦ ½á¼­ ¼öÁ¤ÇÕ´Ï´Ù.
	var gisa_juyo=document.createElement("div");
	gisa_juyo.innerHTML=document.getElementById("gisa_juyo").innerHTML;
	document.getElementById("SG_ArticleContent").appendChild(gisa_juyo);
	if(document.getElementById("popularNews").getElementsByTagName("img")[0])
	{
		PhotoResize(document.getElementById("popularNews").getElementsByTagName("img")[0],175,120);
	}
	
}

// ±â»ç Á¦¸ñ ¹Ú½º »ðÀÔ

function title_icon() {
	//alert(document.getElementById("SG_LastUpdated").innerHTML);
	if(document.getElementById("SG_LastUpdated").innerHTML > "2011.02.27")
	{
			 var gisa_title=document.getElementById("SG_ArticleHeadLine").innerHTML;
			 if (document.getElementById("SG_MECHE")!= null)
			 {
				 var gisa_meche=document.getElementById("SG_MECHE").innerHTML;
			 }
			 if (document.getElementById("SG_TIME")!= null)
			 {
				 var gisa_time=document.getElementById("SG_TIME").innerHTML;
			 }
			 if (document.getElementById("SG_ISSUE")==null || document.getElementById("SG_POLL")==null)
			{
				var article_title="<div id='SG_ArticleHeadLine' class='articleView-Box-R-T'>"+gisa_title+"<font style='font-size:10pt;color:#5e6d84;font-weight:normal;line-height:19px;margin:5px 0 0 7px;'>"+gisa_meche+"</font></div><ul><li class='articleView-Box-R-Dr'>"+gisa_time+"</li></ul>"
				document.getElementById("articleView-Box-R").innerHTML=article_title;	
			}
			 if (document.getElementById("SG_ISSUE")!=null)
			 {
				 issue_body=document.getElementById("SG_ISSUE").innerHTML;
				 gisa_issue=document.getElementById("SG_ISSUE").getElementsByTagName("a")[0].innerHTML;
				 var start_issue=issue_body.indexOf("<A href");
				 var close_issue=issue_body.indexOf(">");
				 var issue_link="";
				 issue_link=issue_link+issue_body.substr(start_issue,close_issue-start_issue+1);
				 var article_title="<div id='SG_ArticleHeadLine' class='articleView-Box-R-T'>"+gisa_title+"<font style='font-size:10pt;color:#5e6d84;font-weight:normal;line-height:19px;margin:5px 0 0 7px;'>"+gisa_meche+"</font></div><ul><li class='articleView-Box-R-Dr'>"+gisa_time+"</li></ul><div class='articleView-Box-R-B'><div class='articleView-Box-R-B-L'>°ü·ÃÀÌ½´ :"+issue_link + gisa_issue+"</a></div></div>"
				document.getElementById("articleView-Box-R").innerHTML=article_title;
			 }
			 if (document.getElementById("SG_POLL")!=null)
			 {
				 poll_link=document.getElementById("SG_POLL").innerHTML;
				 var article_title="<div id='SG_ArticleHeadLine' class='articleView-Box-R-T'>"+gisa_title+"<font style='font-size:10pt;color:#5e6d84;font-weight:normal;line-height:19px;margin:5px 0 0 7px;'>"+gisa_meche+"</font></div><ul><li class='articleView-Box-R-Dr'>"+gisa_time+"</li></ul><div class='articleView-Box-R-B'><div class='articleView-Box-R-B-R'>"+poll_link+"<img src='/Articles/images/news/btn_connectpoll.gif' border='0' alt='°ü·ÃÆúº¸±â' align='absmiddle'></a></div></div>"
				document.getElementById("articleView-Box-R").innerHTML=article_title;
			 }
			document.getElementById("articleView-Box").style.display="";
		}
	}
