// MOUSE onff
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.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_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_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];}
}

// À©µµ¿ì ¿ÀÇÂ - report onÀÇ ´Ù¿î·Îµå
function reportWin(win)
  {
   window.open (win,"NewWindow","width=510,height=250,left=100,top=100");
  }
  
// À©µµ¿ì ¿ÀÇÂ - ½ºÅ©·¦
function scrapW(win)
  {
   window.open (win,"NewWindow","width=510,height=320,left=100,top=100");
  }

function checkW(win)
  {
   window.open (win,"NewWindow","width=510,height=305,left=100,top=100");
  }

function rzoneW(win)
  {
   window.open (win,"NewWindow","width=600,height=350,left=100,top=100");
  }

function helpW(win)
  {
   window.open (win,"NewWindow","width=700,height=360,left=10,top=10");
  }

function locOpen(){
	opener.location.href = "/service/main/research.asp";
	window.close(this);
}


// ·¹ÀÌ¾î¿¡ »ç¿ë
function Layers_findObj(n, d) { //v4.0
	var p,i,x;  if(!d) d=document; if((p=n.indexOf('?'))>0&&parent.frames.length) {
	  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=Layers_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function Layers_showHideLayers() { //v3.0
	var i,p,v,obj,args=Layers_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=Layers_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; }
}


// ÀÎÇ²¹Ú½º ÀÌ¹ÌÁö
var box_i = false;
	function cha_i()
	{
		if ( box_i ) return;
		document.login_top.login_id.style.backgroundImage="";
		box=true;
	}

var box_p = false;
	function cha_p()
	{
		if ( box_p ) return;
		document.login_top.ssn2.style.backgroundImage="";
		box=true;
	}
	
var box_s = false;
	function cha_s()
	{
		if ( box_s ) return;
		document.searchFormTop.sKeyword.style.backgroundImage="";
		box=true;
	}

function fnPopAllScrap(theForm,tblName){
	var itemSeq = "";

	for (i=0; i < theForm.length; i++) {
		if(theForm[i].checked == true){
		itemSeq = itemSeq + theForm[i].value + ",";
		}
	}

	if(itemSeq == ""){
		alert("½ºÅ©·¦ÇÒ ±ÛÀ» ¼±ÅÃÇÏ¼¼¿ä.");
		return;
	}
	
	var popupLeftPosition = (window.top.screen.width-510)/2;
	var popupTopPosition = (window.top.screen.height-295)/2;
	window.open("/popup/main/scrap.asp?tblName="+tblName+"&itemSeq="+itemSeq,'zip','left='+popupLeftPosition+',top='+popupTopPosition+'location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,status=no,width=510,height=130,scrollbars=no');

}


//½ºÅ©·¦ ÆË¾÷Ã¢ ¶ç¿ì±â
function fnPopScrap(itemSeq,tblName){
	//ÀÏ¹Ý ÆË¾÷ ¹æ½Ä

	var popupLeftPosition = (window.top.screen.width-510)/2;
	var popupTopPosition = (window.top.screen.height-295)/2;
	window.open("/popup/main/scrap.asp?tblName="+tblName+"&itemSeq="+itemSeq,'zip','left='+popupLeftPosition+',top='+popupTopPosition+'location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,status=no,width=510,height=130,scrollbars=no');

	//´ÙÀÌ¾ó·Î±×¹æ½Ä Ãë¼Ò
	/*
	var dialStyle = "center:yes; dialogwidth:510px; dialogheight:418px; dialogleft:0px; dialogtop:0px; scroll:no; resizable:no; status:no; ";
	var returnVar = window.showModalDialog("/popup/main/scrap.asp?tblName="+tblName+"&itemSeq="+itemSeq,"A",dialStyle);
	var intReturnVar = parseInt(returnVar);
	if(returnVar == "undefined") return;
	if(intReturnVar > 0){
		alert("-.");
	}else if(intReturnVar == 0){
		alert("Àß¸øµÈ Á¢±ÙÀÌ°Å³ª ·Î±×ÀÎ µÇÁö ¾Ê¾Ò½À´Ï´Ù.");
	}
	*/
}

function fnAlertMessage(item){
	alert(item);
}

function term_pop() { 
	window.open("/service/main/pop_terms.asp", "pop_terms", "width=600,height=530,left=10,top=10,scrollbars=no");		  
}

//Æ÷Ä¿½º ¿ù°£ Æ¯ÇéºÐ¼® ÆË¾÷
function view_pop(file) { 
	window.open("/File/Focus/monthly/"+file, "pop_terms", "width=800,height=600,left=10,top=10,scrollbars=no,resizable=yes");	
}

//Temporary Popup Window Open
function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
