//////////////////////////////////////// °øÁö»çÇ× ¸ÖÆ¼ÅÇ Ã³¸® ½ÃÀÛ ///////////////

String.prototype.trim = function() {
	return this.replace(/(\s*)|(\s*$)/g, "");
}

// image roll
function menuOver() {
	this.src = this.src.replace(".gif", "_on.gif");
}
function menuOut() {
	this.src = this.src.replace("_on.gif", ".gif");
}

function imageOver(imgEl) {
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}
function imageOut(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}

// tabbed menu
function initTabMenu(menuElId) {
	var tabMenu = document.getElementById(menuElId).getElementsByTagName("a");
	for(i=0; i<tabMenu.length; i++) {
		thismenu = tabMenu.item(i);
		thismenu.menuContainer = document.getElementById(menuElId);
		thismenu.targetEl = document.getElementById(tabMenu.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.getElementsByTagName("img").item(0).onmouseover = menuOver;
		thismenu.getElementsByTagName("img").item(0).onmouseout = menuOut;
		thismenu.onclick = tabMenuClick;
		thismenu.onmouseover = tabMenuClick;
		thismenu.onfocus = tabMenuClick;
	}

	initmenu = tabMenu.item(0);
	initmenu.targetEl.style.display = "block";
	initmenu.getElementsByTagName("img").item(0).onmouseover();
	initmenu.getElementsByTagName("img").item(0).onmouseover = null;
	initmenu.getElementsByTagName("img").item(0).onmouseout = null;
	initmenu.menuContainer.current = initmenu;
}
function tabMenuClick() {
	currentmenu = this.menuContainer.current;
	if (currentmenu != this) {
		currentmenu.targetEl.style.display = "none";
		currentmenu.getElementsByTagName("img").item(0).onmouseover = menuOver;
		currentmenu.getElementsByTagName("img").item(0).onmouseout = menuOut;
		currentmenu.getElementsByTagName("img").item(0).onmouseout();

		this.targetEl.style.display = "block";
		this.getElementsByTagName("img").item(0).onmouseover = null;
		this.getElementsByTagName("img").item(0).onmouseout = null;
		this.menuContainer.current = this;
	}
	return false;
}
//////////////////////////////////////// °øÁö»çÇ× ¸ÖÆ¼ÅÇ Ã³¸® ³¡ ///////////////

//////////////////////////////////////// ¹öÆ° ·Î±×ÀÎ,·Î±×¾Æ¿ô Ã³¸® ½ÃÀÛ ///////////////
function loginCheck(loc) {
	var tabMenu = document.getElementById('loginpop').getElementsByTagName("a");
	var thismenu = tabMenu.item(0);
	// if (login_check.length > 1) {
  if (login_check == 'ok') {
		thismenu.getElementsByTagName("img").item(0).src = thismenu.getElementsByTagName("img").item(0).src.replace(".gif", "_on.gif");
		thismenu.getElementsByTagName("img").item(0).alt = '·Î±×¾Æ¿ô';
		// tabMenu.item(0).href='/index.php?control=member2&task=login_action&action=logout&redirect='+(loc);
		tabMenu.item(0).href='/index.php?control=member2&task=login_action&action=logout';
	}
	var tabMenu2 = document.getElementById('promise').getElementsByTagName("a");
	var thismenu2 = tabMenu2.item(0);
	//if (login_check.length > 1) {
	if (login_check == 'ok') {
		thismenu2.getElementsByTagName("img").item(0).src = thismenu2.getElementsByTagName("img").item(0).src.replace(".gif", "_on.gif");
		thismenu2.getElementsByTagName("img").item(0).alt = 'Á¤º¸¼öÁ¤';
		tabMenu2.item(0).href='/index.php?control=member2&task=modify';
	}
}

function loginCheck3(loc) {
	var tabMenu = document.getElementById('loginpop').getElementsByTagName("a");
	var thismenu = tabMenu.item(0);
	if (login_check == 'ok') {
		tabMenu.item(0).href='/bbs/bbs/login.php?action=logout&redirect='+(loc);
		tabMenu.item(0).innerText = '·Î±×¾Æ¿ô';
	}
	var tabMenu2 = document.getElementById('promise').getElementsByTagName("a");
	var thismenu2 = tabMenu2.item(0);
	if (login_check == 'ok') {
		tabMenu2.item(0).href='/home/cbtp/member_modify.html';
		tabMenu2.item(0).innerText = 'Á¤º¸¼öÁ¤';
	}
}
//////////////////////////////////////// ¹öÆ° ·Î±×ÀÎ,·Î±×¾Æ¿ô Ã³¸® ¸¶Áö¸· ///////////////

//////////////////////////////////////// Æû ·Î±×ÀÎ,·Î±¸¾Æ¿ô Ã³¸® ½ÃÀÛ /////////////////
function loginCheckForm(loc,loc2)
{
	if (login_check=='ok') {
		document.getElementById(loc).style.display='none';
		document.getElementById(loc2).style.display='';
	} else {
		document.getElementById(loc).style.display='';
		document.getElementById(loc2).style.display='none';
	}
}

//////////////////////////////////////// Æû ·Î±×ÀÎ,·Î±¸¾Æ¿ô Ã³¸® ¸¶Áö¸· ///////////////

// ¸ÞÀÎÈ­¸é ·Î±×ÀÎ Ã³¸®.
function checkid(form)
{
	if (!form.id.value) {
		alert('\nID¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.\n');
		form.id.focus();
		return false;
	}
	if (!form.pw.value) {
		alert('\nPASS¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.\n');
		form.pw.focus();
		return false;
	}
	return true;
}

var curr_showid = null;
function show_layer(lname)
{
   var ms_id = 'mtri';
   if (typeof(document.all[lname]) == 'undefined') return;
   if (curr_showid == null) curr_showid = lname;
   else {
     na_hide_layer(curr_showid);
     curr_showid = lname;
   }

   try {
      document.all[lname].style.visibility = 'visible';
      //document.all[ms_id].style.visibility = 'visible';
   } catch (e) {}
}

function hide_slayer()
{
   var ms_id = 'mtri';
   if (curr_showid)
   {
      na_hide_layer(curr_showid);
      na_hide_layer(ms_id);
      curr_showid = null;
   }
}

function na_hide_layer(lname)
{
   try {
      document.getElementById(lname).style.visibility = 'hidden';
   } catch (e) {}
}

function layer_pos(id)
{
	var menuPos = [[278,380],[381,465],[466,562],[563,646],[647,723],[724,788],[789,870]];
	var resultPos = [329,423,514,604,685,756,829];
	var pos = event.x;//checkwhere(window.event);
	var total = 890;
	var width1 = 0;
	var ms_id = 'mtri';
	width1 = parseInt(width1);
	var leftpos = null;
	var mtriPos = null;
	var newid = id.substr(id.length - 1);

	try {
		width1 = document.getElementById(id).offsetWidth; //.substr(0,-2);
	} catch (e) {}

	newid = parseInt(newid);
	width1 = parseInt(width1);

	if (!pos) {
		layer_pos(id);
		return;
	}

	for (i = 0; i < menuPos.length; i++)
	{
		var mArr = menuPos[i];
		if (newid == i+1) {
			leftpos = mtriPos = resultPos[i];
			leftpos -= 40;
			break;
		}
	}

	if ((width1+leftpos) > total) {
		var curr = (width1+leftpos) - total;
		leftpos= (leftpos-curr) - 10;
	}

	if (leftpos < 200) {
	   leftpos = 230;
	}

	try {
	  document.getElementById(id).style.left = leftpos;
	  document.getElementById(ms_id).style.left = mtriPos;
	} catch (e) {}
}

function layer_pos2(id)
{
	var menuPos = [[222,328],[329,427],[428,535],[536,632],[633,719],[720,792],[792,892]];
	var resultPos = [275,378,481,584,676,756,842];
	var pos = event.x;//checkwhere(window.event);
	var total = 890;
	var width1 = 0;
	var ms_id = 'mtri';
	width1 = parseInt(width1);
	var leftpos = null;
	var mtriPos = null;
	var newid = id.substr(id.length - 1);

	try {
		width1 = document.getElementById(id).offsetWidth; //.substr(0,-2);
	} catch (e) {}

	newid = parseInt(newid);
	width1 = parseInt(width1);

	if (!pos) {
		layer_pos(id);
		return;
	}

	for (i = 0; i < menuPos.length; i++)
	{
		var mArr = menuPos[i];
		if (newid == i+1) {
			leftpos = mtriPos = resultPos[i];
			leftpos -= 40;
			break;
		}
	}

	if ((width1+leftpos) > total) {
		var curr = (width1+leftpos) - total;
		leftpos= (leftpos-curr) - 10;
	}

	if (leftpos < 200) {
	   leftpos = 230;
	}

	try {
	  document.getElementById(id).style.left = leftpos;
	  document.getElementById(ms_id).style.left = mtriPos;
	} catch (e) {}
}

function checkwhere(e)
{ // È­¸éÁÂÇ¥ ±¸ÇÏ±â
	var xCoord, yCoord;
	if (document.layers){
		xCoord = e.x;
		yCoord = e.y;
	}
	else if (document.all){
		xCoord = event.clientX;
		yCoord = event.clientY;
	}
	else if (document.getElementById){
		xCoord = e.clientX;
		yCoord = e.clientY;
	}
	var scy = document.body.scrollTop + yCoord;
	scy2 = e.screenX;
	scy = e.clientX;
	scy1 = e.pageX;
	return scy;
}

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

function 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;
}

/* page print */
function pagePrint(curl)
{
	var pwin = window.open(curl+'&nohead=1','print_window','width=700,height=700,left=50,top=0,scrollbars');
	pwin.print();
}

/* write flash tag to body */
function flash_print_all()
{
	head_flash();
	main_flash();
}

function notice_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 "";
}

function fncom_chk_strlength_cut(vn_maxlength, vn_str)
{
 var vn_sumlength=0;
 var vn_restr='';
 for(var i= 0;i < vn_str.length; i++)
 {
  if( escape(vn_str.charAt(i)).length > 3 ) { vn_length = 2; }
  else if (vn_str.charAt(i) == '<' || vn_str.charAt(i) == '>') { vn_length = 4; }
  else { vn_length = 1 ; }
  if ( vn_maxlength < (vn_sumlength + vn_length) ) { break; }
  vn_sumlength += vn_length;
  vn_restr += vn_str.charAt(i);
 }
 return (vn_restr);
}

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) { //v3.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); return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function login_pop()
{
	//window.open('/open_content/web/member/login.php','_login','width=550,height=247');
	location.href='/open_content/web/login.php';
}

function logout_ok(redirect)
{
	// location.href='/bbs/bbs/login.php?action=logout&redirect='+(redirect);
	location.href='/open_content/web/login.php?action=logout&redirect='+(redirect);
}

function topen(url)
{
	if (url) {
		window.open(url);
	}
}

/**
 * µðÀÚÀÎ º¸Á¤¿ë ½ºÅ©¸³Æ® (CSS µðÀÚÀÎ Àç±¸¼º¿ë ½ºÅ©¸³Æ®)
 */
// layout adjust
function adjustLayout() {

	if (document.getElementById("Left") && document.getElementById("Inbody")) {
		if (document.getElementById("Left").offsetHeight > document.getElementById("Inbody").offsetHeight) {
			document.getElementById("Inbody").style.height = ((document.getElementById("Left").offsetHeight) - 50) + "px";
		}
	}
	/*
	if (document.getElementById("sub_navigation") && document.getElementById("contentsTable")) {
		if (document.getElementById("sub_navigation").offsetHeight > document.getElementById("contentsTable").offsetHeight) {
			document.getElementById("contentsTable").style.height = (document.getElementById("sub_navigation").offsetHeight + 10) + "px";
		}
	}
	//set page print button
	if (document.getElementById("page-print")) {
		document.getElementById("page-print").onclick = function () {
			window.print();
			return false;
		}
	}
	*/
}


/*
@default.js
function showit(content) {
	textFrame.innerHTML = content;
}
*/
function subGohome() {
	if (subhome_url)
	{
		window.open(subhome_url);
	} else {
		alert("È¨ÆäÀÌÁö ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù.");
	}
}

// ÆäÀÌÁö ½ºÅ©·¦ ÇÏ±â
function pageScrap()
{
	var str = document.getElementById('stitle').value;
	document.getElementById('div_scrap').innerHTML = '<iframe src="" name="scrap_frame" id="scrap_frame" width="0" height="0" frameborder="0"></iframe>';
	document.scrap_frm_new.NAME.value=str;
	document.scrap_frm_new.target="scrap_frame";
	document.scrap_frm_new.submit();
}

// ÆäÀÌÁö °Ë»ö
function check_search(f)
{
	/*
	f.Search_text.value = f.qt.value.trim();
	if (f.Search_field.selectedIndex < 1) {
		alert('°Ë»öÄ«Å×°í¸®¸¦ ¼±ÅÃÇÏ¼¼¿ä.');
		f.Search_field.focus();
		return false;
	}
	*/
	if (f.qt.value == "") {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		f.qt.focus();
		return false;
	}
	if (f.qt.value.length < 2) {
		alert('°Ë»ö¾î´Â µÎÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
		f.qt.value = "";
		f.qt.focus();
		return false;
	}
	return true;
}

function check_search2(f)
{
	f.qt.value = f.qt.value.trim();
	if (f.menu.selectedIndex < 1) {
		alert('°Ë»öÄ«Å×°í¸®¸¦ ¼±ÅÃÇÏ¼¼¿ä.');
		f.menu.focus();
		return false;
	}
	if (f.qt.value == "") {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		f.qt.focus();
		return false;
	}
	if (f.qt.value.length < 2) {
		alert('°Ë»ö¾î´Â µÎÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
		f.qt.value = "";
		f.qt.focus();
		return false;
	}
	return true;
}

function check_search3(f)
{
	/*
	f.Search_text.value = f.qt.value.trim();
	if (f.Search_field.selectedIndex < 1) {
		alert('°Ë»öÄ«Å×°í¸®¸¦ ¼±ÅÃÇÏ¼¼¿ä.');
		f.Search_field.focus();
		return false;
	}
	*/
	if (f.Search_text.value == "") {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		f.Search_text.focus();
		return false;
	}
	if (f.Search_text.value.length < 2) {
		alert('°Ë»ö¾î´Â µÎÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
		f.Search_text.value = "";
		f.Search_text.focus();
		return false;
	}
	return true;
}


var ttsctlimgc = 0;
function ttsctlclick()
{
	var item = document.getElementById('ttsctlimg');
	if (!ttsctlimgc) {
		imageOver(item);
		ttsctlimgc++;
	} else {
		imageOut(item);
		ttsctlimgc=0;
	}
	//ttsCtlBtn
}

function AntiSpamTree(UniqId) {
	window.open('/lib/NeverSpam/antispaminTree.php?UniqId='+UniqId,'NeverSpam','width=180,height=263,left=1,top=1');
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_jumpMenu2(targ,selObj,restore){ //v3.0
  eval("window.open('"+selObj.options[selObj.selectedIndex].value+"')");
  if (restore) selObj.selectedIndex=0;
}
function MM_jumpMenu3(targ,selObj,restore){ //v3.0
  // eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  // if (restore) selObj.selectedIndex=0;
  var url = selObj.options[selObj.selectedIndex].value;
  if (url=='')
  {
	  return false;
  }

  if(url!="http://"){
    window.open(url,'','top=10,left=10,width=800,height=600,menubar=1,status=1,toolbar=1,location=1,scrollbars=1,resizable=1');
  }else{

  }
}
function open_notice()
{
	window.open('/bbs/bbs/board.html?board_id=news_notice&board_id=news_notice','notice','width=620,height=450,scrollbars,resizable');
}

function webzin_memwrite()
{
	window.open('/webzin/Webzin_Member_Write.php','Webzin_Member_Write','width=712,height=500,left=50,top=50');
}

// ³»¿ëº¸±â
function openViewPage(url)
{
	var urlArr = url.split('?');
	var resulturl = '/bbs/bbs/board.html?'+urlArr[1];
   var LeftPosition = (screen.width) ? (screen.width-400)/2 : 0;
   var TopPosition = (screen.height) ? (screen.height-350)/2 : 0;
   window.open(resulturl+'&nohead=1','qs',
      'width=546,height=360,scrollbars,left='+LeftPosition+',top='+TopPosition);
}


function resizeCaller() {
	var dyniframe = new Array();
	for (i=0; i<iframeids.length; i++) {
		if (document.getElementById)
			resizeIframe(iframeids[i]);
		if ((document.all || document.getElementById) && iframehide=="no") {
			var tempobj = document.all ? document.all[iframeids[i]] : document.getElementById(iframeids[i]);
			tempobj.style.display="block";
		}
	}
}

function resizeIframe(frameid) {
	try {
		var currentfr = document.getElementById(frameid);
		if (currentfr && !window.opera) {
			currentfr.style.display="block";
			if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
				currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
			else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
				currentfr.height = currentfr.Document.body.scrollHeight;
			if (currentfr.addEventListener)
				currentfr.addEventListener("load", readjustIframe, false);
			else if (currentfr.attachEvent) {
				currentfr.detachEvent("onload", readjustIframe); // Bug fix line
				currentfr.attachEvent("onload", readjustIframe);
			}
		}
	} catch(e) {}
}


/*
¨ç.width : Ã¢ °¡·Î±æÀÌ ÁöÁ¤ [no,yes(»ý±è)]
¨è.height : Ã¢ ¼¼·Î±æÀÌ ÁöÁ¤ [no,yes(»ý±è)]
¨é.toolbar : ´ÜÃàµµ±¸Ã¢ À¯¹«ÁöÁ¤ [no,yes(»ý±è)]
¨ê.menubar : ¸Þ´ºÃ¢ À¯¹«ÁöÁ¤ [no,yes(»ý±è)]
¨ë.location : ÁÖ¼ÒÃ¢ À¯¹«ÁöÁ¤ [no,yes(»ý±è)]
¨í.scollbars : ½ºÅ©·Ñ¹Ù ÁöÁ¤ [no,yes(»ý±è)]
¨î.status : ¾Æ·¡ »óÅÂ¹ÙÃ¢ À¯¹«ÁöÁ¤ [no,yes(»ý±è)]
¨ï.resizable : Ã¢º¯Çü À¯¹«ÁöÁ¤ [no,yes(»ý±è)]
¨ð.fullscreen : ÀüÃ¼È­¸é À¯¹«ÁöÁ¤ [no,yes(»ý±è]
¨ñ.channelmode=yes : ¾Õ&µÚ·Î,Ã¢ÃÖ¼ÒÈ­.´Ý±âµîÀ» ¼³Á¤(F11¹ø Å°¶û °°À½)
¨ò.left=0,top=0 : Ã¢À» °íÁ¤½ÃÅ²´Ù.¿ÞÂÊ ±¸¼®¿¡ °íÁ¤
*/

function MM_openWindow(u, w, h, r, s)
{
	opening_window = window.open(u, '', 'width='+w+',height='+h+', resizable='+r+', scrollbars='+s);
	opening_window.focus();
}

function kk_openWin(url, winname, width, height, tbar, mbar, sbar, loc, status, resizable, fscreen, left, top, cflag)
{
	if(cflag == 'yes' || cflag == 'y' || cflag == '1')
	{
		left = (window.screen.width - width ) / 2;
		top  = (window.screen.height- height) / 2;
	}

	opening_window = window.open(url, winname, 'width=' + width + ', height=' + height + ', toolbar=' + tbar + ', menubar=' + mbar + ', scrollbars=' + sbar + ', location=' + loc + ', status=' + status + ', resizable=' + resizable + ', fullscreen=' + fscreen + ', left=' + left + ', top=' + top);
	opening_window.focus();
}

/*
openEvent:À¥Áø¸µÅ©
openEvent1:3d¿µ»ó°ü¸µÅ©
openEvent2:»çÁø¿µ»ó°ü¸µÅ©
*/

function openEvent(){
 window.open('/webzin/main.php','event','width=790,height=740,scrollbars=yes,resizable=no');
}
function openEvent2(){
 if(login_check=='ok'){
   window.open('/ebook/ebook/contents/1-1.php','event2','width=1004,height=720,scrollbars=no,resizable=no');
 }else{
   window.open('/ebook/ebook/sample.html','event2','width=1004,height=620,scrollbars=no,resizable=no');
 }
}
function openEvent1(){
 window.open('/open_content/web/content/3d_cyber.html','event1','width=1004,height=700,scrollbars=no,resizable=no');
}

///////±«»ê¼îÇÎ¸ô »õÃ¢À¸·Î ¿­±â//////
function shoppingview(){
url = "http://www.gsjangter.com/" ;
window.open(url,'','');
}

///////À¥Áø »õÃ¢ ¿­±â ÇÃ·¡½Ã ¸µÅ©//////
function webzinview(){
url = "/webzin/main.php" ;
window.open(url,'','toolbar=no,menubar=no,location=no,directions=no, scrollbars=yes,status=yes,width=790,height=740');
}

// ·Î±×ÀÎ È­¸éÀ¸·Î ÀÌµ¿..
function move_loginpage2(url)
{
	if (confirm("·Î±×ÀÎ ÇØ¾ß º¼ ¼ö ÀÖ½À´Ï´Ù")) {
		top.location.href='/open_content/web/login.php?redirect='+url;
	}
}

// 2´Ü 5¼¾ÅÍ ¸Þ´º Ã³¸®.
function centerquick(idx)
{
	var menu_idx = eval('menu_quick_'+(idx));
	if (menu_idx) {
		if (menu_idx.length > 0) {
			var z = menu_idx.length;
			var html = '';
			for (i = 0; i < z; i++) {
				var tmp = menu_idx[i];
				if (tmp[2].length > 0) {
					html += '<option value="'+tmp[2]+'&lm_uid='+tmp[0]+'">'+tmp[1]+'</option>';
				}
			}
			document.write(html);
		}
	}
}

function define_calendar(obj) {
	if (obj.value != '') {

	new Ajax.Request('./index.php', {
			 method: 'get',
			 parameters: { control : 'webroot', md : 'calendar', get_idx : obj.value },
			 onComplete: function (req) { showResponse(req); }
	});
		
	} else {
		
	new Ajax.Request('./index.php', {
			 method: 'get',
			 parameters: { control : 'webroot', md : 'calendar' },
			 onComplete: function (req) { showResponse(req); }
	});

	}
}

function define_calendar_move(cal_year,cal_month,get_idx) {
	new Ajax.Request('./index.php', {
			 method: 'get',
			 parameters: { control : 'webroot', md : 'calendar',  'get_idx' : get_idx, 'cal_year' : cal_year , 'cal_month' : cal_month },
			 onComplete: function (req) { showResponse(req); }
	});
}
function showResponse(req) {
//	alert(req.responseText);
	document.getElementById('CalendarCol').innerHTML = decodeURIComponent(req.responseText);
}
// ÇÃ·¡½Ã ¸Þ´º¿¡¼­ È£ÃâµÊ..
function menu_go(lm_order) 
{
	new Ajax.Request('./index.php', {
			 method: 'get',
			 parameters: { control : 'webroot', md : 'make_murl', 'lm_order' : lm_order },
			 onComplete: function (req) { menu_go_response(req); }
	});
}



function menu_go_response(req) {
  
   
	if (req == undefined) {
		return;
	}  


	var outstr = decodeURIComponent(req.responseText);
	
		
	if (outstr == 'error') {
		alert('¿¬°áµÈ ¸µÅ©°¡ ¾ø½À´Ï´Ù.');
		return;
	}
	var row = outstr.split(',');

	
	if (!row) {
		alert('¿¬°áµÈ ¸µÅ©°¡ ¾ø½À´Ï´Ù.');
		return;
	}
	
	if(row[6]=='2'){  /* ¿ÜºÎ¸µÅ© */
	   eval("window.open('"+row[3]+"','','top=50,left=50,width=800,height=600,scrollbars=1,status=1,menubar=1,location=1,toolbar=1,resizable=1')");
	   return;
	}
	
	
	eval("document.location.href = '"+row[3]+'&lm_uid='+row[0]+"'");
}



function adm_menu_go(lm_order){
  
	new Ajax.Request('./index.php?', {
			 method: 'get',
			 parameters: { adm_root : 'webroot', control : 'webroot', md : 'make_adm_murl', 'lm_order' : lm_order },
			 onComplete: function (req) { adm_menu_go_response(req); }
	});
}


function adm_menu_go_response(req){

	if (req == undefined) {
		return;
	}
		
	var outstr = decodeURIComponent(req.responseText);
		
	if (outstr == 'error') {
		alert('¿¬°áµÈ ¸µÅ©°¡ ¾ø½À´Ï´Ù.');
		return;
	}
	var row = outstr.split(',');
	
	if (!row) {
		alert('¿¬°áµÈ ¸µÅ©°¡ ¾ø½À´Ï´Ù.');
		return;
	}
	
	if(row[6]=='2'){  /* ¿ÜºÎ¸µÅ© */
	   eval("window.open('"+row[3]+"','','top=50,left=50,width=800,height=600,scrollbars=1,status=1,menubar=1,location=1,toolbar=1,resizable=1')");
	   return;
	}	
	
	eval("document.location.href = '"+row[3]+'&lm_uid='+row[0]+"'");

}


// °Ë»ö¾î 
function check_totalsearch(fm){
	var temp;
	temp = fm.Search_text.value.trim();
	if (!temp) {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		fm.Search_text.value = '';
		fm.Search_text.focus;
		return false;
	}
	return true;
}


// ÆäÀÌÁö ÀÌµ¿
function goto_page(lm_uid) 
{
	new Ajax.Request('./index.php', {
			 method: 'get',
			 parameters: { control : 'webroot', md : 'make_murl', 'lm_uid' : lm_uid },
			 onComplete: function (req) { page_go_response(req); }
	});}

// ÆäÀÌÁö ÀÌµ¿
function page_go(lm_uid) 
{
	new Ajax.Request('./index.php', {
			 method: 'get',
			 parameters: { control : 'webroot', md : 'make_murl', 'lm_uid' : lm_uid },
			 onComplete: function (req) { page_go_response(req); }
	});
//	eval("location.href = 'index.php?control=html&lm_uid="+(lm_uid)+"';");
}

function page_go_response(req) {
	if (req == undefined) {
		return;
	}
	var outstr = decodeURIComponent(req.responseText);
	if (outstr == 'error') {
		alert('¿¬°áµÈ ¸µÅ©°¡ ¾ø½À´Ï´Ù.');
		return;
	}
	var row = outstr.split(',');
	if (!row) {
		alert('¿¬°áµÈ ¸µÅ©°¡ ¾ø½À´Ï´Ù.');
		return;
	}
	eval("location.href = '"+row[3]+'&lm_uid='+row[0]+"'");
}


function goto_page61() 
{
	location.href='index.php?control=rd&md=trend&lm_uid=61';
}

// º¸À¯Àåºñ°Ë»ö
function machine_search(fm) 
{
	var temp;
	temp = fm.model_name.value.trim();
	if (!temp) {
		alert('°Ë»ö ÇÏ½Ç º¸À¯Àåºñ¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		fm.model_name.value='';
		fm.model_name.focus();
		return false;
	}
}

// ÀÌ¸ÞÀÏ½ºÆÔ¹æÁöÃ³¸®
function email_antispam(uid){
    
  url = '/?control=member2&task=email_antispam&ei_uid='+uid;
  window.open(url,'','top=200,left=200,width=300,height=300,scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=0');
  
}


// ÀÌ¸ÞÀÏ½ºÆÔ¹æÁöÃ³¸®(°Ô½ÃÆÇ¿ë)
function email_board_antispam(board_id,no){
    
  url = '/?control=member2&task=email_board_antispam&board_id='+board_id+'&no='+no;
  window.open(url,'','top=200,left=200,width=300,height=300,scrollbars=0,toolbar=0,menubar=0,location=0,status=0,resizable=0');
  
}


// ÇØ´ç ÁÖ¼Ò·Î ÀÌµ¿½ÃÄÑÁÖ´Â ÇÔ¼ö
function goto_url(url){
       
   if(url!=''){
       document.location.href=url;
   } 
    
}


// Á¦Ç°¹®ÀÇ
function product_inquiry(){
   var url = '/index.php?control=inquiry&i_gubun=1';
   window.open(url,'','top=50,left=50,width=700,height=700,scrollbars=1,menubar=0,toolbar=0,location=0,directories=0,status=0,resizable=0');
}


// Á¦Ç°¹®ÀÇ(¿µ¹®)
function product_inquiry_eng(){
   var url = '/index.php?control=inquiry_eng&i_gubun=1';
   window.open(url,'','top=50,left=50,width=700,height=700,scrollbars=1,menubar=0,toolbar=0,location=0,directories=0,status=0,resizable=0');
}


// ÀÌ¹ÌÁö È®´ëº¸±â
function img_view(fname){
  window.open('/img_view.html?sfile='+fname,'','top=50,left=50,width=50,height=50,scrollbars=1,status=0,menubar=0,toolbar=0,location=0,directories=0,resizable=0');
}

// ÀÌ¹ÌÁö ÀÎ¼âÇÏ±â
function img_print(fname){
  window.open('/img_print.html?sfile='+fname,'','top=50,left=50,width=50,height=50,scrollbars=1,status=0,menubar=0,toolbar=0,location=0,directories=0,resizable=0');
}


// ÀÌ¹ÌÁö ·Ñ¿À¹öÈ¿°ú
function img_over(obj){
   obj.src = obj.src.replace('_on.gif','.gif').replace('.gif','_on.gif');
}

// ÀÌ¹ÌÁö ·Ñ¿À¹öÈ¿°ú
function img_out(obj,onoff){
  if(onoff!='_on'){ obj.src = obj.src.replace('_on.gif','.gif').replace('_on.gif','.gif'); }
}

