







	


/**
 * - common_logsave.js
 * - Global Function Declare Part
 * - NDSL및 KISTI에서 log 저장할 때 이용한다.
 *
 * Copyright	Copyright (c) 2007
 * Company		LINKSOFT
 *
 * @author		SICHIN
 * @version		1.0,
 * @see
 * @date		2008. 05. 11
 */

/*=======================================================================================
  ###  현재 정의되어 있는 함수 리스트  ###
  =======================================================================================
- cgf_NDSLLogSave(as_gubun,as_contents,as_cnt,as_gubun_option) - NDSL논문DB저장 (tr_search_new table)
- cgf_KISTILogSave(userid, sitecode, svccode, usecode, content, retcount, comment, infoclass,accesstype) : KISTI 로그시스템 저장
=========================================================================================*/


/*<!--*****************************************************************************
	함 수 명	: cgf_NDSLLogSave(as_gubun,as_contents,as_cnt,as_gubun_option)
	설    명	: 로그를 쌓기위해 사용하는 함수 (tr_search_new에저장)
	Argument: as_gubun - 구분(페이지등..)
			  as_contents - 제어번호 혹은 쿼리등..
			  as_cnt - 검색건수
			  as_gubun_option - 화면내에서 이루어지는 행위(소트,페이지이동 등등..)	
******************************************************************************-->*/
function cgf_NDSLLogSave(as_gubun,as_contents,as_cnt,as_gubun_option){

	http = jQuery.ajax( {
		url: "/ndsllogsaveAjax.co",  
		type: "POST",
		data: {
			gubun: as_gubun, 
			contents: as_contents, 
			searchcnt: as_cnt, 
			gubun_option : as_gubun_option
		}, 
		async:true
	});

	return;
}

/*********************************************************************************************
userid: 이용자ID
sitecode == 개발: SS9999, 운영:SS22 (NDSL 과학기술 정보통합서비스 코드.
svccode == 저널: 전체;JR, 저널;JOUR , 프로시딩;PROC 
              논문:  전체;DOC, 논문;JAFO, 페이퍼;CFFO
usecode ==
		V04검색 결과 간략보기(목록보기)
		V05검색 결과 상세보기(서지정보조회)
		V07원문보기, 첨부자료 다운로드
		V08원문 복사 신청
content == 상세/원문다운로드/DDS신청시 해당 제어번호
retcount == 기본 1로 기록.
comment == 검색간략에서 검색식 입력
infoclass ==  정보분류코드, (논문/저널: 650.* DDC코드 소수점 1, 특허: IPC분류,  분석동향: )
accesstype == 04: 웹에서 이용.
***********************************************************************************************/
function cgf_KISTILogSave(userid, sitecode, svccode, usecode, content, retcount, comment, infoclass, accesstype)
{

	// alert(userid+', '+sitecode+', '+svccode+', '+usecode+', '+content+', '+retcount+', '+comment+', '+accesstype);

	if (userid == '') {
		userid ='GUEST';
	}
	weblog_usage(userid, sitecode, svccode, usecode, content, retcount, comment, infoclass, accesstype);
				
}
function cgf_KISTILogSave2(userid, sitecode, svccode, usecode, content, retcount, comment, infoclass, accesstype)
{
	var ifrm = makeIframe();
	var ofrm = makeLogSaveForm();
	if(ofrm != null){
			ofrm.target = 'ddslogiframe';
	       	ofrm.action = "/jsp/common/include/logsave_include.jsp";
	       	ofrm.method = "post";
	   		if (userid == '') {
				userid ='GUEST';
			}
	       	ofrm.userid.value = userid;
	       	ofrm.sitecode.value = sitecode;
	       	ofrm.svccode.value = svccode;
	       	ofrm.usecode.value = usecode;
	       	ofrm.content.value = content;
	       	ofrm.retcount.value = retcount;
	       	ofrm.comment.value = comment;
	       	ofrm.infoclass.value = infoclass;
	       	ofrm.accesstype.value = accesstype;
	       	ofrm.submit();
		}
			
}	
function makeLogSaveForm(){
	var ofrm =  document.logsavefrm;
	var frmBody = "";
	if(ofrm == null){
	    frmBody += "<form name='logsavefrm' method='post'>";
		frmBody += "<input type='hidden' name='userid' value=''>";
		frmBody += "<input type='hidden' name='sitecode' value=''>";
		frmBody += "<input type='hidden' name='svccode' value=''>";	
		frmBody += "<input type='hidden' name='usecode' value=''>";
		frmBody += "<input type='hidden' name='content' value=''>";	
		frmBody += "<input type='hidden' name='retcount' value=''>";	
		frmBody += "<input type='hidden' name='comment' value=''>";	
		frmBody += "<input type='hidden' name='infoclass' value=''>";	
	    frmBody += "<input type='hidden' name='accesstype' value=''>";	
		frmBody += "</form>";
		document.body.insertAdjacentHTML("BeforeEnd", " " + frmBody + " ");
		ofrm =  document.logsavefrm;
	}
	
	return ofrm;
}
function makeIframe(){
	var ifrm =  document.ddslogiframe;
	var ifrmBody = "";
	if(ifrm == null){
	    ifrmBody = "<iframe id='ddslogiframe' name='ddslogiframe' src='' frameborder='0' style='height:0px;width:0px' title=''></iframe>";	
		document.body.insertAdjacentHTML("BeforeEnd", " " + ifrmBody + " ");
		ifrm =  document.ddslogiframe;
	}
	return ifrm;
}



function gf_SatisFaction(as_url, as_svcCd, as_query, as_cn, as_target){
	var oSatiFrame = document.getElementById(as_target);
	if(oSatiFrame == null) makeSatiFrame();
	var oSatiForm =  makeSatiForm();
	oSatiForm.urlfind.value = as_url;
	oSatiForm.svccode.value = as_svcCd;
	oSatiForm.usequery.value = as_query;
	oSatiForm.usecn.value = as_cn;
	// 20090928. 고객만족도를 온라인 품질 평가로 수정
	// oSatiForm.action = "/jsp/common/satisfaction.jsp";	
	oSatiForm.action = "/jsp/common/research/nd_researchBasic.jsp";	

	oSatiForm.target = as_target;
	oSatiForm.submit();
}

function makeSatiFrame(){
	var ifrmHTML = " <iframe name='SatisFaction' src=''  width='746' height='100' frameborder='0' scrolling='no'></iframe>";		
	document.body.insertAdjacentHTML("beforeEnd", " " + ifrmHTML + " ");
	return;
}

function makeSatiForm(){
	var ofrm =  document.satisFactionFrm;
	if(ofrm == null){
		var frmBody = "<form name='satisFactionFrm' method='post'>";
		frmBody += "<input type='hidden' name='urlfind' value=''>";
		frmBody += "<input type='hidden' name='svccode' value=''>";
		frmBody += "<input type='hidden' name='usequery' value=''>";
		frmBody += "<input type='hidden' name='usecn' value=''>";
		frmBody += "</form>";
		document.body.insertAdjacentHTML("BeforeEnd", " " + frmBody + " ");
		ofrm =  document.satisFactionFrm;
	}
	return ofrm;
}



