	/************************************************
	 * 함수명  : _popConsultingInfo(strConsulting_userid)
	 * 기 능	 : 컨설팅사 정보창을 띄움.
	 * @param: 컨설팅사 아이디.
	 * 작 성 자 : Mong
	 ************************************************/
	function _popConsultingInfo(strConsulting_userid)
	{
		if (!(strConsulting_userid)||strConsulting_userid=='')
		{
			alert('컨설팅사 정보가 누락되었습니다.');
			return;
		}
		window.open(encodeURI('/jsp/common/MembershipConsultingInfoView.jsp?strConsulting_userid='+strConsulting_userid), '_popConsultingInfo', 'width=700, height=500, toolbars=no, scrollbars=yes');
	} 
	
	/************************************************
	 * 함수명  : _popConsultantInfo(strConsultant_userid)
	 * 기 능	 : 컨설턴트 정보창을 띄움.
	 * @param: 컨설턴트 아이디.
	 * 작 성 자 : babmerseo
	 ************************************************/
	function _popConsultantInfo(strConsultant_userid) 
	{ 
		if (!(strConsultant_userid)||strConsultant_userid=='')
		{
			alert('컨설턴트 정보가 누락되었습니다.');
			return;
		}
		window.open(encodeURI('/jsp/common/MembershipConsultantInfoView.jsp?strConsultant_userid='+strConsultant_userid), '_popConsultantInfo', 'width=700, height=500, toolbars=no, scrollbars=yes');
	}
		
	/************************************************
	 * 함수명  : _popForeignerInfo(strConsultant_userid)
	 * 기 능	 : 외국인 전문가 정보창을 띄움.
	 * @param: 컨설턴트 아이디.
	 * 작 성 자 : joungmin
	 ************************************************/
	function _popForeignerInfo(strConsultant_userid) 
	{ 
		if (!(strConsultant_userid)||strConsultant_userid=='')
		{
			alert('컨설턴트 정보가 누락되었습니다.');
			return;
		}
		window.open(encodeURI('/jsp/common/MembershipForeignerInfoView.jsp?strConsultant_userid='+strConsultant_userid), '_popForeignerInfo', 'width=700, height=500, toolbars=no, scrollbars=yes');
	} 

	/************************************************
	 * 함수명  : _popSMEInfo(strSME_userid)
	 * 기 능	 : 중소기업 정보창을 띄움.
	 * @param: 중소기업 아이디.
	 * 작 성 자 : Mong
	 ************************************************/
	function _popSMEInfo(strSME_userid)
	{
		if (!(strSME_userid)||strSME_userid=='')
		{
			alert('중소기업 정보가 누락되었습니다.');
			return;
		}
		window.open(encodeURI('/jsp/common/MembershipSMEInfoView.jsp?strSME_userid='+strSME_userid), '_popSMEInfo', 'width=700, height=500, toolbars=no, scrollbars=yes');
	}

	/************************************************
	 * 함수명  : _popSmeInfoView(strSME_userid)
	 * 기 능	 : 중소기업 정보창을 띄움.
	 * @param: 중소기업 아이디.
	 * 작 성 자 : Mong
	 ************************************************/
	function _popSmeInfoView(strSME_userid)
	{
		if (!(strSME_userid)||strSME_userid=='')
		{
			alert('중소기업 정보가 누락되었습니다.');
			return;
		}
		window.open(encodeURI('/jsp/common/MembershipSMEInfoView.jsp?strSME_userid='+strSME_userid), '_popSMEInfo', 'width=700, height=500, toolbars=no, scrollbars=yes');
	}

	/************************************************
	 * 함수명  : _popPjtAppInfo(strSME_userid, strPjt_code, strPjt_code_part, strQuart)
	 * 기 능	 : 중소기업의 사업신청서 정보 창 을 띄움.
	 * @param: 중소기업 아이디.
	 * @param: 주사업코드.
	 * @param: 세부사업코드.
	 * @param: 분기코드.
	 * 작 성 자 : Mong
	 ************************************************/
	function _popPjtAppInfo(strSME_userid, strPjtCode, strPjtCodePart, strQuart)
	{
		if	(
				(!(strSME_userid)||strSME_userid=='')	||
				(!(strPjtCode)||strPjtCode=='')			||
				(!(strPjtCodePart)||strPjtCodePart=='')	||
				(!(strQuart)||strQuart=='')
			)
		{
			alert('사업신청서 정보가 누락되었습니다.');
			return;
		}
		var strUrl = "";
		strUrl+='/jsp/common/ProjectApplicationView.jsp';
		strUrl+='?strSME_userid='+strSME_userid;
		strUrl+='&strPjtCode='+strPjtCode;
		strUrl+='&strPjtCodePart='+strPjtCodePart;
		strUrl+='&strQuart='+strQuart;
		strUrl = encodeURI(strUrl);
		window.open(strUrl, '_popPjtAppInfo', 'width=800, height=600, toolbars=no, scrollbars=yes');
	}
	
	/************************************************
	 * 함수명  : _openJoinedConsultingCompany
	 * 기 능	 : 입사지원을 위한 컨설팅사 조회검색창
	 ************************************************/
	function _openJoinedConsultingCompany(strGbn)
    {
    	/** strGbn **/
    	/** "JOINED" -- 컨설팅사 입사지원 **/
    	
    	var url = "/jsp/common/ConsultingSearchPopup.jsp?strGbn="+strGbn;
    	url = encodeURI(url);
    	window.open(url,"JoinedConsulting","width=700, height=500, toolbars=no, scrollbars=yes, status=yes");
    }


	/************************************************
	 * 함수명  : 팝업관련
	 ************************************************/
	function 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 setCookie(name,value,expiredays)        //쿠키를 사용자에게 전달할 함수만들기
    {
        var todayDate = new Date();
        todayDate.setDate(todayDate.getDate() + expiredays);
        document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
    }

	function closeWin(ele) {
       // 체크박스에 체크되 있다면
	    if (ele.checked) {
		setCookie(ele.name, ele.value, 1);   
		}
		self.close();        //창 닫기 
	} 

	function openPopup(){  
		/** 09년 2월 5일자 팝업. **/
		//if (getCookie("popup_090205") != "done" ) window.open('/popup/popup_090205.jsp','popup_090205','width=359,height=330,top=10,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		/** 09년 3월 16일자 팝업. **/
		//if (getCookie("popup_090316") != "done" ) window.open('/popup/popup_090316.jsp','popup_090316','width=480,height=160,top=10,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		/** 09년 3월 27일자 팝업. (계좌안내) **/
		//if (getCookie("popup_090327") != "done" ) window.open('/popup/popup_090327.jsp','popup_090327','width=600,height=330,top=10,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		/** 09년 4월 07일자 팝업. (계좌안내) **/
		//if (getCookie("popup_090407") != "done" ) window.open('/popup/popup_090407.jsp','popup_090407','width=560,height=230,top=410,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		/** 09년 4월 24일자 팝업. (컨설팅 대학원 및 R&D 개설 공고) **/
		//if (getCookie("popup_090424") != "done" ) window.open('/popup/popup_090424.jsp','popup_090424','width=520,height=200,top=10,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		/** 09년 4월 24일자 팝업. (이미지) **/ 
		//if (getCookie("popup_090424_1") != "done" ) window.open('/popup/popup_090424_1.jsp','popup_090424_1','width=380,height=320,top=250,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		/** 09년 5월 29일자 팝업. (이미지) **/
		//if (getCookie("popup_090529") != "done" )  
		//window.open('/popup/csr_forum/popup_090529.jsp','popup_090529','width=400,height=420,top=250,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		//if (getCookie("popup_090612") != "done" )  
		//window.open('/popup/090612/popup_090612.jsp','popup_090612','width=400,height=420,top=250,left=420');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		//if (getCookie("popup_090618") != "done" )  // 과제별 기업부담금 납부 계좌 안내
		//window.open('/popup/popup_090618.jsp','popup_090618','width=415,height=420,top=250,left=10'); 
		//if (getCookie("popup_090703") != "done" )  
		//window.open('/popup/090703/popup_090703.jsp','popup_090703','width=400,height=420,top=250,left=430');
		//if (getCookie("popup_090707") != "done" ) 
		//window.open('/popup/090707/popup_090707.jsp','popup_090707','width=400,height=420,top=250,left=840');
		//if (getCookie("popup_090717") != "done" ) 
		//window.open('/popup/090717/popup_090717.jsp','popup_090717','width=400,height=420,top=250,left=840');
		//if (getCookie("popup_090827") != "done" ) 
		//window.open('/popup/090827/popup_090827.jsp','popup_090827','width=400,height=420,top=250,left=430');
		//if (getCookie("popup_090831") != "done" ) 
		//window.open('/popup/090831/popup_090831.jsp','popup_090831','width=400,height=420,top=250,left=10');
		//if (getCookie("popup_090904") != "done" ) 
		//window.open('/popup/090904/popup_090904.jsp','popup_090904','width=400,height=420,top=250,left=10');
		//if (getCookie("popup_090909") != "done" ) 
		//window.open('/popup/090909/popup_090909.jsp','popup_090909','width=400,height=420,top=250,left=10');
		//if (getCookie("popup_090919") != "done" ) 
		//window.open('/popup/090919/popup_090919.jsp','popup_090919','width=400,height=420,top=250,left=10');
		//if (getCookie("popup_091028") != "done" )		// 상권정보 시스템 설문조사
		//window.open('/popup/091028/popup_091028.jsp','popup_091028','width=440,height=660,top=200,left=430');
		//if (getCookie("popup_091106") != "done" ) 
		//window.open('/popup/Dream_Bus/popup_091106.jsp','popup_091106','width=400,height=420,top=200,left=430');
		//if (getCookie("popup_091109") != "done" )   	// CSR 참여 신청
		//window.open('/popup/csr_forum/popup_091109.jsp','popup_091109','width=400,height=420,top=250,left=430');
		//if (getCookie("popup_091202") != "done" ) 
		//window.open('/popup/091202/popup_091202.jsp','popup_091202','width=400,height=420,top=250,left=430');
		//if (getCookie("popup_inno") != "done" )   	// 컨설팅혁신대전 사전등록 양식
		//window.open('/popup/inno/popup_inno.jsp','popup_inno','width=400,height=470,top=200,left=10');   
		//if (getCookie("popup_100209") != "done" )  
		//window.open('/popup/100209/popup_100209.jsp','popup_100209','width=400,height=420,top=200,left=430');
		//if (getCookie("popup_100209_1") != "done" )  
		//window.open('/popup/100209_1/popup_100209_1.jsp','popup_100209_1','width=400,height=425,top=200,left=10');
		//if (getCookie("popup_unevent") != "done" ) 
		//	window.open('/popup/unevent/popup_unevent.jsp','popup_unevent','width=380,height=470,top=200,left=850');
		//if (getCookie("popup_100312") != "done" )  
		//	window.open('/popup/100312/popup_100312.jsp','popup_100312','width=400,height=425,top=200,left=10');
		//if (getCookie("popup_100315") != "done" )  
		//	window.open('/popup/100315/popup_100315.jsp','popup_100315','width=400,height=425,top=200,left=10');
		//if (getCookie("popup_100310") != "done" )  
		//window.open('/popup/100310/popup_100310.jsp','popup_100310','width=400,height=425,top=200,left=430');
		//if (getCookie("popup_100311") != "done" )  
		//	window.open('/popup/100311/popup_100311.jsp','popup_100311','width=400,height=425,top=200,left=850');		
		//if (getCookie("popup_100318") != "done" ) 
		//window.open('/popup/100318/popup_100318.jsp','popup_100318','width=400,height=425,top=200,left=10');
		//if (getCookie("popup_100328") != "done" ) 
		//	window.open('/popup/100328/popup_100328.jsp','popup_100328','width=400,height=425,top=200,left=10');
		//if (getCookie("popup_100323") != "done" ) 
		//window.open('/popup/100323/popup_100323.jsp','popup_100323','width=400,height=425,top=200,left=10');
		//if (getCookie("popup_100329") != "done" ) 
		//	window.open('/popup/100329/popup_100329.jsp','popup_100329','width=400,height=425,top=200,left=10');
 	}                         
	     
	function openForm(result){		
		if(result == "true") {
			//window.open('/popup/Dream_Bus/popup_Form.jsp','popup_091106','width=400,height=400,top=250,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
			window.open('/popup/inno/popup_Form.jsp','popup_inno','width=400,height=400,top=250,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		}else{
			alert("신청이 마감되었습니다.");
			return;
		}
	} 
	
	function openForm_091109(result){
			/** 09년 11월 09일자 팝업. (이미지) **/
		if(result == "true") {
			window.open('/popup/csr_forum/popup_Form.jsp','popup_091109','width=400,height=400,top=250,left=10');        //파일 이름과 속성을 자신에 맞게 수정하면 됩니다.
		}else{
			alert("신청이 마감되었습니다.");
			return;
		}
		
	} 
	 
	
	/************************************************
	 * 함수명  : _printEstimateReport
	 * 기 능	 : 선정평가보고서 인쇄창
	 ************************************************/
	function _printEstimateReport(strPjtCode,strPjtCodePart,strQuart,strSmeUserid)
	{
		var url = "/jsp/common/EstimateReportPrint.jsp";
		var params = "strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart+"&strQuart="+strQuart+"&strSmeUserid="+strSmeUserid;
		
		url = url + "?" + params;
		window.open(url,"JoinedConsulting","width=750, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	
	/************************************************
	 * 함수명  : _printEstimateReport
	 * 기 능	 : 선정평가보고서 보기창
	 ************************************************/
	function _viewEstimateReport(strPjtCode,strPjtCodePart,strQuart,strSmeUserid)
	{
		var url = "/jsp/common/EstimateReportPrint.jsp";
		var params = "strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart+"&strQuart="+strQuart+"&strSmeUserid="+strSmeUserid;
		
		url = encodeURI(url + "?" + params);
		window.open(url,"JoinedConsulting","width=750, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	
	/************************************************
	 * 함수명  : _viewConsultantApplicationHistory
	 * 기 능	 : 컨설턴트 참여이력 보기 창
	 ************************************************/
	function _viewConsultantApplicationHistory(strPjtCode,strPjtCodePart,strUserid)
	{
		var url = "/jsp/smbacon/projectinfo/consultantparticipation/ConsultantApplicationHistory.jsp";
		var params = "strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart+"&strUserid="+strUserid;
		
		url = url + "?" + params;
		window.open(url,"consultantAppHistory","width=675, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	
	/************************************************
	 * 함수명  : _viewConsultingApplicationHistory
	 * 기 능	 : 컨설팅사 참여이력 보기창
	 ************************************************/
	function _viewConsultingApplicationHistory(strPjtCode,strPjtCodePart,strUserId)
	{
		var url = "/jsp/smbacon/projectinfo/consultingparticipation/ConsultingApplicationHistory.jsp";
		var params = "strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart+"&strUserId="+strUserId;
		
		url = url + "?" + params;
		window.open(url,"consultingAppHistory","width=675, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	/************************************************
	 * 함수명  : showApplicationProject
	 * 기 능	 : 컨설턴트 과제참여현황 
	 ************************************************/
	function showApplicationProject()
	{
		var url = "/jsp/smbacon/membership/joint/MemberConsultantApplicationProjectList.jsp";
		var cnt = checkedCnt('strConsultant_userid');
    	if(cnt < 1)
    	{
    		alert('컨설턴트를 선택해 주십시오.');
    		return false;
    	}
    	else if(cnt > 1)
    	{
    		alert('1명의 컨설턴트만 선택하여 주십시오.');
    		return false;
    	}
		else
		{
			var param = "strConsultantUserId="+checkedOnlyValue('strConsultant_userid');
			url = url + "?" + param;
			window.open(url,"showApplicationProject","width=675, height=500, toolbars=no, scrollbars=yes, status=yes");
		}	
	
	}
	
	
	
	/** ============================================================================================================================= **/
	/** ================================================ 여기부터 쿠폰관련 ============================================================== **/
	/** ============================================================================================================================= **/
					
	/************************************************
	 * 함수명  : viewCouponReturnedHistory()
	 * 기 능	 : 쿠폰반환신청 처리 이력보기 창
	 ************************************************/
	function viewCouponReturnedHistory(strPjtCode, strPjtCodePart, strQuart, strSmeUserId, strCouponSerial, strSeq)
	{
		var url = "/jsp/smbacon/business/coupon/CouponReturnedHistory.jsp";
		var params  = "strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart+"&strQuart="+strQuart;
			params += "&strSmeUserId="+strSmeUserId+"&strCouponSerial="+strCouponSerial+"&strSeq="+strSeq; 
		
		url = url + "?" + params;
		window.open(url,"couponReturnedHistory","width=675, height=500, toolbars=no, scrollbars=yes, status=yes");
	}					
	
	/************************************************
	 * 함수명  : viewCouponPublishedHistory()
	 * 기 능	 : 쿠폰발급 및 사용(반환)이력보기 창
	 ************************************************/
	function viewCouponPublishedHistory(strPjtCode, strPjtCodePart, strQuart, strSmeUserId, strCouponSerial)
	{
		var url = "/jsp/smbacon/business/coupon/CouponPublishedHistory.jsp";
		var params  = "strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart+"&strQuart="+strQuart;
			params += "&strSmeUserId="+strSmeUserId+"&strCouponSerial="+strCouponSerial; 
		
		url = url + "?" + params;
		window.open(url,"couponPublishedHistory","width=675, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	/************************************************
	 * 함수명  : viewCouponRequestHistory
	 * 기 능	 : 쿠폰신청의 처리이력을 조회한다.
	 ************************************************/
	function viewCouponRequestHistory(strSmeUserId, strPjtCode, strPjtCodePart, strQuart)
	{
		var url = "/jsp/smbacon/business/coupon/CouponRequestHistory.jsp";
		var param = "strSmeUserId="+strSmeUserId+"&strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart+"&strQuart="+strQuart;
		
		var cnt = checkedCnt('chk[]');
		if(cnt < 1)
		{
			alert('처리이력을 조회할 항목을 선택하세요 ');
			return false;
		}
		else if(cnt > 1)
		{
			alert('처리이력을 조회할 항목을 하나만 선택하세요');
			return false;
		}
		else
		{
			//체크박스의 값을 나누기 한다.
			//일련번호  :: 쿠폰상태
			var str = checkedOnlyValue('chk[]');
			var seq = str[0].split("::")[0];
			var status = str[0].split("::")[1];
			
			param += "&strSeq="+seq;
			url = url + "?" + param;
			window.open(url,"viewCouponRequestHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");	
		}
	}
	
	/************************************************
	 * 함수명  : viewCouponReqHist
	 * 기 능	 : 쿠폰신청의 처리이력을 조회한다.
	 ************************************************/
	function viewCouponReqHist(strPjtCode, strPjtCodePart, strQuart)
	{
		var url = "/jsp/smbacon/business/coupon/CouponRequestHistory.jsp";
		var param = "strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart+"&strQuart="+strQuart;
		
		var cnt = checkedCnt('chk[]');
		if(cnt < 1)
		{
			alert('신청이력을 조회할 쿠폰을 선택하세요');
			return false;
		}
		else
		{
			var str = checkedOnlyValue('chk[]');
			// 중소기업아이디 :: 일련번호:: 상태코드
			
			var strSmeUserId = str[0].split("::")[0];
			var strSeq = str[0].split("::")[1];
			param += "&strSmeUserId="+strSmeUserId+"&strSeq="+strSeq;
			url = url + "?" + param;
			window.open(url,"viewCouponRequestHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
		}
	}
	
	
	/** ============================================================================================================================= **/
	/** ================================================ 여기까지 쿠폰관련 ============================================================== **/
	/** ============================================================================================================================= **/
	
	
	/************************************************
	 * 함수명  : openProposalRequest(str)
	 * 기 능	 : 컨설팅사 검색창
	 ************************************************/
	function openProposalRequest(str,strPjtCodePart)
	{
		var url = "/jsp/smbacon/business/contract/request/ConsultingSearchForBusiness.jsp";
		if(str == 'CONSULTANT')url = "/jsp/smbacon/business/contract/request/ConsultantSearchForBusiness.jsp?";
		else if(str == 'CONSULTING') url = "/jsp/smbacon/business/contract/request/ConsultingSearchForBusiness.jsp";
		window.open(url,"consultSearchForBusiness","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	
	/** ============================================================================================================================= **/
	/** ================================================ 여기부터 제안요청 ============================================================== **/
	/** ============================================================================================================================= **/
	
	/************************************************
	 * 함수명  : viewProposalRequestHistory(str)
	 * 기 능	 : 제안요청 처리이력 팝업
	 ************************************************/
	function viewProposalRequestHistory()
	{
		var cnt = checkedCnt('chk[]');
		if(cnt<1)
		{
			alert('제안요청서를 선택하세요');
		}
		else if(cnt>1)
		{
			alert('제안요청서를 하나만 선택해 주세요');
		}
		else
		{
			var val = checkedOnlyValue('chk[]');
			var arr = val[0].split('|');
			var param  = "";
			if(arr.length == 7)
			{
				//요청상태|중소기업아이디|컨설팅사 아이디|년도별사업코드|세부사업코드|분기코드|일련번호
				param  = "strStatus="+arr[0]+"&strSmeUserId="+arr[1]+"&strConsultingUserId="+arr[2];
			    param += "&strPjtCode="+arr[3]+"&strPjtCodePart="+arr[4]+"&strQuart="+arr[5]+"&strSeq="+arr[6];
			}
			else if(arr.length == 8)
			{
				//요청상태|제안상태|중소기업아이디|컨설팅사 아이디|년도별사업코드|세부사업코드|분기코드|일련번호
				param  = "strStatus="+arr[0]+"&strSmeUserId="+arr[2]+"&strConsultingUserId="+arr[3];
			    param += "&strPjtCode="+arr[4]+"&strPjtCodePart="+arr[5]+"&strQuart="+arr[6]+"&strSeq="+arr[7];
			}
			    
			var url = "/jsp/smbacon/business/contract/request/ViewProposalRequestHistory.jsp?"+param;
			window.open(url,"viewProposalRequestHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
		}
	}
	
	/************************************************
	 * 함수명  : viewProposalReportHistory(str)
	 * 기 능	 : 제안서처리 이력 팝업
	 ************************************************/
	function viewProposalReportHistory(userGbn)
	{
		
		var cnt = checkedCnt('chk[]');
		if(cnt<1)
		{
			alert('제안요청서를 선택하세요');
		}
		else if(cnt>1)
		{
			alert('제안요청서를 하나만 선택해 주세요');
		}
		else
		{
			var val = checkedOnlyValue('chk[]');
			var arr = val[0].split('|');
			var param  = "";
			
			if(arr[1] == '')
			{
				alert('작성되지 않은 제안서의 이력을 열람 하실 수 없습니다.');
				return false;
			}
			
			if(userGbn == 'R_SME' && (arr[1] == 'D11' || arr[1]=='D15'))
			{
				alert('제출되지 않은 제안서의 이력은 열람하실 수 없습니다.');
				return false;
			}
			//요청상태|제안상태|중소기업아이디|컨설팅사 아이디|년도별사업코드|세부사업코드|분기코드|일련번호
			param  = "strStatus="+arr[0]+"&strSmeUserId="+arr[2]+"&strConsultingUserId="+arr[3];
			param += "&strPjtCode="+arr[4]+"&strPjtCodePart="+arr[5]+"&strQuart="+arr[6]+"&strSeq="+arr[7];
			
			var url = "/jsp/smbacon/business/contract/proposal/ViewProposalReportHistory.jsp?"+param;
			window.open(url,"viewProposalReportHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
		}
	}
	
	
	/************************************************
	 * 함수명  : viewProposalRequestReport(str)
	 * 기 능	 : 제안요청서 내용보기 팝업
	 ************************************************/
	function viewProposalRequestReport()
	{
		var cnt = checkedCnt('chk[]');
		if(cnt<1)
		{
			alert('열람하실 제안요청서를 선택하세요');
		}
		else if(cnt>1)
		{
			alert('열람하실 제안요청서를 하나만 선택해 주세요');
		}
		else
		{
			var val = checkedOnlyValue('chk[]');
			
			//alert(val);
			var arr = val[0].split('|');
			var param  = "";
			if(arr.length == 7)
			{
				//상태|중소기업아이디|컨설팅사 아이디|년도별사업코드|세부사업코드|분기코드|일련번호
				param  = "strStatus="+arr[0]+"&strSmeUserId="+arr[1]+"&strConsultingUserId="+arr[2];
			    param += "&strPjtCode="+arr[3]+"&strPjtCodePart="+arr[4]+"&strQuart="+arr[5]+"&strSeq="+arr[6];
			    
			    //팝업창을 호출한다.
			    popProposalRequestReport(arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[0]);
			} 
			else if(arr.length == 8)
			{
				//요청상태|제안상태|중소기업아이디|컨설팅사 아이디|년도별사업코드|세부사업코드|분기코드|일련번호
				param  = "strStatus="+arr[0]+"&strSmeUserId="+arr[2]+"&strConsultingUserId="+arr[3];
			    param += "&strPjtCode="+arr[4]+"&strPjtCodePart="+arr[5]+"&strQuart="+arr[6]+"&strSeq="+arr[7];
			    
			    //팝업창을 호출한다.
			    popProposalRequestReport(arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[0]);
			}   
			//var url = "/jsp/common/ViewProposalRequestReport.jsp?"+param;
			//window.open(url,"viewProposalRequestReport","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
		}
	}


	/************************************************
	 * 함수명  : _popProposalReportHistory(str)
	 * 기 능	 : 제안서 이력 팝업
	 ************************************************/
	function _popProposalReportHistory(strSmeUserId, strConsultingUserId, strPjtCode, strPjtCodePart, strQuart, strSeq)
	{
		param  = "?strSmeUserId="+strSmeUserId;
		param += "&strPjtCode="+strPjtCode;
		param += "&strPjtCodePart="+strPjtCodePart;
		param += "&strQuart="+strQuart;
		param += "&strSeq="+strSeq;
		param += "&strConsultingUserId="+strConsultingUserId;

		var url = "/jsp/smbacon/business/contract/proposal/ViewProposalReportHistory.jsp"+param;
		window.open(url,"viewProposalReportHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	
	/************************************************
	 * 함수명  : popProposalRequestReport(str)
	 * 기 능	 : 제안요청서 내용보기 팝업
	 ************************************************/
	function popProposalRequestReport(strSmeUserId, strConsultingUserId, strPjtCode, strPjtCodePart, strQuart, strSeq, strStatus)
	{
		var param  = "strSmeUserId="+strSmeUserId+"&strConsultingUserId="+strConsultingUserId+"&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart+"&strQuart="+strQuart+"&strSeq="+strSeq+"&strStatus="+strStatus;
		var url = "/jsp/common/ViewProposalRequestReport.jsp?"+param;
		window.open(url,"viewProposalRequestReport","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	/** ============================================================================================================================= **/
	/** ================================================ 여기까지 제안요청 ============================================================== **/
	/** ============================================================================================================================= **/
	
	
	
	/** ============================================================================================================================= **/
	/** ================================================ 여기부터 제안서    ============================================================== **/
	/** ============================================================================================================================= **/
	/************************************************
	 * 함수명  : popProposalReport(str)
	 * 기 능	 : 제안서 내용보기 팝업
	 ************************************************/
	function popProposalReport(strSmeUserId, strConsultingUserId, strPjtCode, strPjtCodePart, strQuart, strSeq)
	{
		var param  = "strSmeUserId="+strSmeUserId+"&strConsultingUserId="+strConsultingUserId+"&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart+"&strQuart="+strQuart+"&strSeq="+strSeq;
		var url = "/jsp/common/ViewProposalReport.jsp?"+param;
		window.open(url,"viewProposalRequestReport","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	
	/** ============================================================================================================================= **/
	/** ================================================ 여기부터 수행계획서   ============================================================== **/
	/** ============================================================================================================================= **/
	
	/**********************************************
     * 함수명 : printExecutePlanEstimateReport()
     * 기   능 : 수행계획서 평가표를 프린트한다..
    ***********************************************/
    function printExecutePlanEstimateReport(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq, isPrinted)
    {
    	var param  = "strSmeUserId="+strSmeUserId+"&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart+"&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId+"&strContractSeq="+strContractSeq+"&isPrinted="+isPrinted;
		var url = "/jsp/common/PrintExecutePlanEstimateReport.jsp?"+param;
		window.open(url,"viewProposalRequestReport","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
    }
    
    /**********************************************
     * 함수명 : _popExecutePlanEstimateHistory()
     * 기   능 : 수행계획서 평가이력을 조회한다.
    ***********************************************/
    function _popExecutePlanEstimateHistory(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
    {
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq
		var url = "/jsp/common/ViewExecutePlanEstimateHistory.jsp?"+param;
		window.open(url,"_viewExecutePlanEstimateHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
    }
    
    /**********************************************
     * 함수명 : _popExecutePlanEstimateHistoryUserGubun()
     * 기   능 : 수행계획서 평가이력을 조회한다.
    ***********************************************/
    function _popExecutePlanEstimateHistoryUserGubun(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq, strEstStatus)
    {
    	if('E33'!=strEstStatus)
				{
					alert('[ERROR]\n수행계획검토가 승인 된 항목만 조회가 가능 합니다.');
				}
		else 
		{
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq
		var url = "/jsp/common/ViewExecutePlanEstimateHistory.jsp?"+param;
		window.open(url,"_viewExecutePlanEstimateHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
		}
    }

    /**********************************************
     * 함수명 : _popRegularContractHistory()
     * 기   능 : 표준계약 이력을 조회한다.
    ***********************************************/
    function _popRegularContractHistory(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
    {
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq
		var url = "/jsp/common/ViewRegularContractHistory.jsp?"+param;
		window.open(url,"_viewRegularContractHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
    }

    /**********************************************
     * 함수명 : _popViewExecutePlanReport()
     * 기   능 : 수행계획서 내용보기 팝업.
    ***********************************************/
    function _popViewExecutePlanReport(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
    {
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq
		var url = "/jsp/common/ViewExecutePlanReport.jsp?"+param;
		window.open(url,"_viewExecutePlanReport","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
    }


     /**********************************************
     * 함수명 : _popRegularContractDocument()
     * 기   능 : 표준계약서  내용보기 팝업.
    ***********************************************/
    function _popRegularContractDocument(strSmeUserId, strConsultingUserId, strPjtCode, strPjtCodePart, strQuart, strContractSeq, isPrinted)
    {
    	var url = "/jsp/smbacon/business/contract/RegularContractAgreement.jsp";
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq;
		url = url + "?" + param;
		window.open(url,"viewRegularcontractDocument","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
    }
    
    
    
    /**********************************************
     * 함수명 : openRegularContractDocumentation()
     * 기   능 : 표준계약의 문서관련 링크를 팝업으로 연결시킴
    ***********************************************/
	function openRegularContractDocumentation(strGbn)
	{
		var cnt = checkedCnt('chk[]');
		if(cnt <1)
		{
			alert('항목을 선택하여 주십시오');
			return false;
		}
		else if(cnt > 1)
		{
			alert('항목을 하나만 선택하여 주십시오');
			return false;
		}
		else
		{
			//중소기업아이디|컨설팅사아이디|년도별사업코드|세부사업코드|분기|계약일련번호|요청서일련번호
			var str = checkedOnlyValue('chk[]');
			var arr = str[0].split("|");
			
			switch(strGbn)
			{
				//제안요청서
				case "REQUEST":
					//중소기업아이디,컨설팅사아이디,년도별사업코드,세부사업코드,분기,요청서일련번호,상태
					popProposalRequestReport(arr[0], arr[1], arr[2], arr[3], arr[4], arr[6],"");
					break;
				//제안서
				case "PROPOSAL":
					//중소기업아이디,컨설팅사아이디,년도별사업코드,세부사업코드,분기,요청서일련번호
					popProposalReport(arr[0], arr[1], arr[2], arr[3], arr[4], arr[6]);
					break;
				//수행계획서
				case "EXECUTEPLAN":
					//중소기업아이디,년도별사업코드, 세부사업코드, 분기, 컨설팅사아이디, 계약일련번호
					_popViewExecutePlanReport(arr[0], arr[2], arr[3], arr[4], arr[1], arr[5]);
					break;
				//수행계획 검토표
				case "PLANESTIMATE":
					//중소기업아이디,년도별사업코드, 세부사업코드, 분기, 컨설팅사아이디, 계약일련번호, 출력유무
					printExecutePlanEstimateReport(arr[0], arr[2], arr[3], arr[4], arr[1], arr[5], "");
					break;
				//표준계약서
				case "CONTRACTDOC":
					//중소기업아이디,컨설팅사아이디,년도별사업코드,세부사업코드,분기, 계약일련번호, 출력유무
					_popRegularContractDocument(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], "");
					break;
				default:
					alert('해당 요청사항을 처리 하실 수 없습니다.');
					break;
			}
		}
	}
	
	/**********************************************
     * 함수명 : viewMoneyAccountHistory()
     * 기   능 : 정산(착수금, 중도금, 잔금)의 처리이력을 조회
    ***********************************************/
	function viewMoneyAccountHistory(strGbn, strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
	{
		var url = "/jsp/common/MoneyAccountHistory.jsp";
		var param  = "strGbn="+strGbn;
			param += "&strSmeUserId="+strSmeUserId+"&strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart
			param += "&strQuart="+strQuart+"&strConsultingUserId="+strConsultingUserId+"&strContractSeq="+strContractSeq;
		url = url + "?" + param;
		window.open(url,"viewMoneyAccountHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
	
	/**********************************************
     * 함수명 : viewSatisfyInfoHistory()
     * 기   능 : 만족도 조사서의 처리이력을 조회
    ***********************************************/
	function viewSatisfyInfoHistory(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
	{
		var url = "/jsp/common/ViewSatisfyInfoHistory.jsp";
		var param  = "strSmeUserId="+strSmeUserId+"&strPjtCode="+strPjtCode+"&strPjtCodePart="+strPjtCodePart
			param += "&strQuart="+strQuart+"&strConsultingUserId="+strConsultingUserId+"&strContractSeq="+strContractSeq;
		url = url + "?" + param;
		window.open(url,"viewSatisfyInfoHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
    
    /**********************************************
     * 함수명 : _popCompleteInspectHistory()
     * 기   능 : 완료점검 보고서 이력을 조회
    ***********************************************/
    function _popCompleteInspectHistory(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
    {
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq
		var url = "/jsp/common/ViewCompleteInspectHistory.jsp?"+param;
		window.open(url,"_viewCompleteInspectHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
    }


    /**********************************************
     * 함수명 : _viewcompleteInspectReport()
     * 기   능 : 완료점검 보고서 조회
    ***********************************************/
	function _viewcompleteInspectReport(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
	{
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq
		var url = "/jsp/smbacon/business/complete/CompleteInspectReportHistoryList.jsp?"+param;
		window.open(url,"_viewCompleteInspectReport","width=750, height=500, toolbars=no, scrollbars=yes, status=yes");
	} 


    /**********************************************
     * 함수명 : _viewHalfwayInspectReport()
     * 기   능 : 중간점검 보고서 조회
    ***********************************************/
	function _viewHalfwayInspectReport(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
	{
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq
		var url = "/jsp/common/ViewHalfwayInspectReport.jsp?"+param;
		window.open(url,"_viewHalfwayInspectReport","width=750, height=500, toolbars=no, scrollbars=yes, status=no");
	}
	
	
	/**********************************************
     * 함수명 : _viewHalfwayInspectReport()
     * 기   능 : 중간점검 보고서 조회
    ***********************************************/
	function _viewSatisfyInfo(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
	{
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq
		var url = "/jsp/common/ViewSatisfyInfo.jsp?"+param;
		window.open(url,"_viewSatisfyInfo","width=750, height=500, toolbars=no, scrollbars=yes, status=no");
	}


    /**********************************************
     * 함수명 : _viewRegularContractAlterHistory()
     * 기   능 : 계약변경 완료 내역 리스트 팝업
    ***********************************************/
	function _viewRegularContractAlterHistory(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId)
	{
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
		var url = "/jsp/common/ViewRegularContractAlterHistory.jsp?"+param;
		window.open(url,"_viewRegualContractAlterHistory","width=750, height=500, toolbars=no, scrollbars=yes, status=yes");
	}
     
	/************************************************
	* 함수명  : viewHalfwayReportHistory(str)
	* 기 능	 : 중간보고서처리 이력 팝업
	************************************************/
 	function viewHalfwayReportHistory(userGbn)
 	{
 		var cnt = checkedCnt('chk[]');

 		if(cnt<1)
 		{
 			alert('보고서를 선택하세요');
 		}
 		else if(cnt>1)
 		{
 			alert('보고서를 하나만 선택해 주세요');
 		}
 		else
 		{
 			var val = checkedOnlyValue('chk[]');
 			var arr = val[0].split('|');
 			var param  = "";

 			if(arr[1] == '')
 			{
 				alert('작성되지 않은 보고서의 이력을 열람 하실 수 없습니다.');
 				return false;
 			}
 			
 			if(userGbn == 'R_SME' && (arr[1] == 'D11' || arr[1]=='D15'))
 			{
 				alert('제출되지 않은 보고서의 이력은 열람하실 수 없습니다.');
 				return false;
 			}
 			//중소기업아이디 | 년도별사업코드 | 세부사업코드 | 분기코드 | 컨설팅사아이디 |
			//표준계약일련번호 | 표준계약상태 | 중간보고상태 | 계약 상태
 			param  = "strStatus="+arr[7]+"&strSmeUserId="+arr[0]+"&strConsultingUserId="+arr[4];
 			param += "&strPjtCode="+arr[1]+"&strPjtCodePart="+arr[2]+"&strQuart="+arr[3]+"&strSeq="+arr[5];
 			
 			//alert ("arr[5]="+arr[5]); 
 			//alert ("arr[6]="+arr[6]);

 			var url = "/jsp/smbacon/business/halfway/report/ViewHalfwayReportHistory.jsp?"+param;
 			window.open(url,"viewHalfwayReportHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
 		}
 	}
	
   /**********************************************
    * 함수명 : _popHalfwayInspectHistory()
    * 기   능 : 중간점검 보고서 이력을 조회
   ***********************************************/
   function _popHalfwayInspectHistory(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId, strContractSeq)
   {
   	var param  = "strSmeUserId="+strSmeUserId;
   		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
			param += "&strContractSeq="+strContractSeq
		var url = "/jsp/common/ViewHalfwayInspectHistory.jsp?"+param;
		window.open(url,"_viewHalfwayInspectHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
   }
   
   
    /**********************************************
     * 함수명 : _popContractAlterReportHistory()
     * 기   능 : 계약변경 이력을 조회
    ***********************************************/
    function _popContractAlterReportHistory(strSmeUserId, strPjtCode, strPjtCodePart, strQuart, strConsultingUserId)
    {
    	var param  = "strSmeUserId="+strSmeUserId;
    		param += "&strPjtCode="+strPjtCode;
			param += "&strPjtCodePart="+strPjtCodePart;
			param += "&strQuart="+strQuart;
			param += "&strConsultingUserId="+strConsultingUserId;
		var url = "/jsp/common/ViewContractAlterReportHistory.jsp?"+param;
		window.open(url,"_viewContractAlterReportHistory","width=695, height=500, toolbars=no, scrollbars=yes, status=yes");
    }