function submitSelect(){
    document.forms[0].Query.value = Replace( document.forms[0].Query.value ,String.fromCharCode(13), '');
    document.forms[0].Query.value = Replace( document.forms[0].Query.value ,String.fromCharCode(10), '');
    document.forms[0].Query.value = Replace( document.forms[0].Query.value ,'\n', '');
    
   if(document.forms[0].Query.value.length <= 0)
   {
      alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
      return;
   }
        
document.forms[0].Type.value = "N";
document.forms[0].submit();
}
function submitSelect2(){
    document.forms[0].Query.value = Replace( document.forms[0].Query.value ,String.fromCharCode(13), '');
    document.forms[0].Query.value = Replace( document.forms[0].Query.value ,String.fromCharCode(10), '');
    document.forms[0].Query.value = Replace( document.forms[0].Query.value ,'\n', '');
    
    if(document.forms[0].Query.value.length <= 0)
    {
      alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
      return;
    }
document.forms[0].Type.value = "S";
document.forms[0].submit();
}
function Replace( replaceval, src, dst)
{

    var str = replaceval, words = "";

    if(replaceval.indexOf(src) != -1)
    {
        words = str.split(src);
        str = words[0];

        for(i=1; i<words.length; i++)
        {
            str += dst + words[i];
        }
    }
    return str;

}

var win1  = null;
function ShowDetail(gubun, applnods, page)
{
    if( win1 == null || win1.closed )
    {
            //win1 = window.open("http://patent1.kipris.or.kr/cgi-bin/KT30OL1000_1.cgi?appl_num=" +applnods, "see", "width=1004, height=640, left=10, top=10,menubar=no,  scrollbars=yes,directories=no, toolbar=no, resizable=yes, status=yes");
            win1 = window.open("../main/DetailInfo.jsp?reg_key=5BpjNrtjRsaQhyqmZ30AmQ%3D%3D&APPLNO="+applnods , "view", "width=850, height=640, left=10, top=10,menubar=no,  scrollbars=yes,directories=no, toolbar=no, resizable=yes, status=yes");
       
    }    
  	else
	  {
	    win1.focus();
    }    
}
var xml_win = null;
function viewXML(applnods, pubreg)
{

    if( xml_win == null || xml_win.closed )
    {
        if (pubreg == 'T')  //Ã¥ÀÚ°øº¸ º¸±â
        {
            xml_win  = window.open("http://patent2.kipris.or.kr/patent/kpdi1060a.do?applno=" + applnods , "XML", "status=yes, resizable=yes width=650, height=700 ,resizable=yes, scrollbars=yes, status=no, top=10, left=20");
        }
        else  //xml º¸±â
        {
            xml_win = window.open("../main/FullDoc.jsp?APPLNO=" +applnods+"&PUBREG="+pubreg , "XML", "status=yes, resizable=yes width=800, height=650  ,scrollbars=yes, top=10, left=20");
        }
    }    
	else
	{
	    xml_win.close();
        
        if (pubreg == 'T')
        {
            xml_win  = window.open("http://patent2.kipris.or.kr/patent/kpdi1060a.do?applno=" + applnods , "XML", "status=yes, resizable=yes width=650, height=700 ,resizable=yes, scrollbars=yes, status=no, top=10, left=20");
        }
        else  
        {
    	      xml_win = window.open("http://link.kipris.or.kr/link/main/FullDoc.jsp?APPLNO=" +applnods+"&PUBREG="+pubreg , "XML", "status=yes, resizable=yes width=800, height=650  ,scrollbars=yes, top=10, left=20");
        }
	}
}

function REFFCHECK(src)
{
//alert(document.referrer);
}
