﻿/* 
 * ==========================================================================
 * 주 시스템 		: E-Service
 * 서브시스템 		: Rate Request
 * 프로그램 명  	: 
 * 프로그램 버젼 	: 
 * 프로그램 개요 	: 
 * 작성자		: 
 * 작성일		: YYYY.MM.DD.
 * ==========================================================================
 * 수정이력		:
 * ==========================================================================
 * 기타사항		:
 *
 * Copyrights 2005 by Cyberlogitec. All right reserved.
 *
 * ==========================================================================
*/

/**
 * @type   : function
 * @access : public
 * @desc   : 팝업창을 보인다.
 * <pre>사용예 :
 *
 *     cfOpenPopup( openUrl, winNm, h, w );
 *
 * </pre>
 * @sig    : 
 * @param  : Url
 * @param  : winNm : window 이름
 * @param  : h height
 * @param  : w width
 * @return : none
 * @author : 이영혜
 */
function cfOpenPopup( openUrl, winNm, h, w  ) {
  //pop화면의 가로,세로크기

  
  var varWidth = w;
  var varHeight = h;
  
	window.open(openUrl,winNm,
              "width=" + varWidth + ",height=" + varHeight + ",top=" + (screen.height - varHeight)/2 + ",left=" + (screen.width - varWidth)/2 +
              "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=yes, copyhistory=1");
}


/**
 * @type   : function
 * @access : public
 * @desc   : jsp 화면에서 mail을 보내는 함수 
 * <pre>사용예 :
 *
 *     sendMail(title);
 *
 *     - title   : 
 * </pre>     
 * @sig    : 
 * @param  : title
 * @return : none
 * @author :  
 */
function sendMail(loc){
	if (document.all.mail_print != null){
		cfOpenPopup( "/en/common/sendEmailInWCM.jsp?loc="+loc, "Mail", 200, 500 );
	}else{
	  alert("Sorry this page is not support Mail");
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : jsp 화면에서 print하는 함수
 * <pre>사용예 :
 *
 *     sendPrint();
 *
 * </pre>     
 * @sig    : 
 * @param  : none
 * @return : none
 * @author :  
 */

function sendPrint(loc){
	if (document.all.mail_print != null){
		cfOpenPopup( "/en/common/sendPrintWCM.jsp?loc="+loc, "Print", 500, 800 );
	}else{
	  alert("Sorry this page is not support Print");
	}
}

/**
 * @type   : function
 * @access : public
 * @desc   : 현재 일자를 리턴해준다.
 * <pre>사용예 :
 *
 *     cfGetToday(); => 20030411
 * </pre>
 * @sig    :
 * @param  :
 * @return : 현재일자(YYYYMMDD)
 * @author : 이영혜
 */
function cfGetToday( splitForm ) {
	var day = new Date();
	var year = day.getYear();
	var month = day.getMonth()+1;
	var mdate = day.getDate();

	if( month < 10 ) month = "0" + month;
	if( mdate < 10 ) mdate = "0" + mdate;
	if( splitForm == null ) splitForm = "";
	
	var currentDate = year + splitForm + month + splitForm + mdate;

	return currentDate;
}