
/******************************************************************
*
*	Function Group
*
******************************************************************/

//**********************************************************************************//
// ÆË¾÷ (ÀÏ¹Ý)
//	wClientUrl			: ÆË¾÷ URL
//	wClientName			: ÆË¾÷ ÀÌ¸§
//  wClientScrollbars	: ÆË¾÷ ½ºÅ©·Ñ¹Ù »ç¿ë ¿©ºÎ
//	wClientWidth		: ÆË¾÷ ³ÐÀÌ
//	wClientHeight		: ÆË¾÷ ³ôÀÌ
//**********************************************************************************//
function winPopOpen(wClientUrl,wClientName,wClientScrollbars,wClientWidth,wClientHeight){
	var iClientWidth   = (screen.Width-wClientWidth)/2;
	var iClientHeight  = (screen.Height-wClientHeight)/2;

	window.open(wClientUrl,wClientName,"statebar=no,scrollbars="+wClientScrollbars+",width="+wClientWidth+",height="+wClientHeight+",left="+iClientWidth+",top="+iClientHeight);
}

//**********************************************************************************//
//¸ð´Þ ´ÙÀÌ¾ó·Î±× (ÀÏ¹Ý)
//	varUrl	: ´ÙÀÌ¾ó·Î±× URL
//	varName	: ´ÙÀÌ¾ó·Î±× ÀÌ¸§
//	varWidth	: ´ÙÀÌ¾ó·Î±× ³ÐÀÌ
//	varHeight : ´ÙÀÌ¾ó·Î±× ³ôÀÌ
//**********************************************************************************//
var objCode;
var objValue01;
var objValue02;
var objValue03;

function fncModalDialogOpenSize(objCodeId, objCodeValueId01, objCodeValueId02, objCodeValueId03, varUrl, varWidth, varHeight, varScroll)
{

	//window.hasModal = false;
	//return returnValue;

	objCode = objCodeId;
	objValue01 = objCodeValueId01;
	objValue02 = objCodeValueId02;
	objValue03 = objCodeValueId03;

	//window.hasModal = true;

	var varOption = "dialogHeight: " + varHeight + "px; dialogWidth: " + varWidth + "px; edge: Raised; center: Yes; help: no; resizable: no; status: no; scroll: " + varScroll + "; unadorned: no;";
	

	var returnObject = {};
	returnObject.Code = "";	//¸ð´Þ·Î °ª Àü´Þ½Ã »ç¿ë °¡´É
	returnObject.Value01 = "";	//¸ð´Þ·Î °ª Àü´Þ½Ã »ç¿ë °¡´É
	returnObject.Value02 = "";	//¸ð´Þ·Î °ª Àü´Þ½Ã »ç¿ë °¡´É
	
	if (window.showModalDialog) {
		var returnValue = window.showModalDialog(varUrl+"&Width="+varWidth+"&Height="+varHeight + "&keyword=" + objCodeId.value, window, varOption);
		if (returnValue) {
			UpdateFields(returnValue.Code, returnValue.Value01, returnValue.Value02);
		}
	}
	else {
		var iClientWidth   = (screen.Width-varWidth)/2;
		var iClientHeight  = (screen.Height-varHeight)/2;

		// similar functionality in Opera, but its not modal!
		var modal = window.open(varUrl + "&keyword=" + objCodeId.value,"modal","statebar=no,scrollbars="+varScroll+",width="+varWidth+",height="+varHeight+",left="+iClientWidth+",top="+iClientHeight, null);
		modal.dialogArguments = returnObject;
	}
}

function UpdateFields(newCode, newValue01, newValue02)
{
	objCode.value = newCode;
	objValue01.value = newValue01;
	if (objValue02 != "")
	{
		objValue02.value = newValue02;
	}
	objValue03.focus();
}



//**********************************************************************************//
// Å¬¸³º¸µå º¹»ç
//**********************************************************************************//
function copy_text(obj,j) {

	var doc = eval("obj.copy_text"+j).createTextRange();
	eval("obj.copy_text"+j).select();
	doc.execCommand('copy');
	alert('³»¿ëÀ» º¹»çÇß½À´Ï´Ù. ¿øÇÏ½Ã´Â °÷¿¡ ºÙ¿©³Ö±â¸¦ ÇØÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.');
	return;
}


//**********************************************************************************//
// ³¯Â¥ °Ë»ö ³Ö±â - ¾ÆÁ÷ ¹Ì¿Ï
//**********************************************************************************//
function daySearch(obj_01,obj_02,obj_03,comp){
	
	objValue01 = obj_01;
	objValue02 = obj_02;
	objValue03 = obj_03;

	var sd = obj_01.value;
	var ed = obj_02.value;

	var varUrl = "/framework/lib/mini_cal.asp?comp="+comp+"&inform="+obj_03+"&sd="+sd+"&ed="+ed
	var varOption = "dialogHeight: 240px; dialogWidth: 187px; edge: Raised; center: Yes; help: no; resizable: no; status: no; scroll: no; unadorned: no;";
	
	var returnObject = {};
	returnObject.Code = "";	//¸ð´Þ·Î °ª Àü´Þ½Ã »ç¿ë °¡´É
	returnObject.Value01 = "";	//¸ð´Þ·Î °ª Àü´Þ½Ã »ç¿ë °¡´É
	returnObject.Value02 = "";	//¸ð´Þ·Î °ª Àü´Þ½Ã »ç¿ë °¡´É
	
	if (window.showModalDialog) {
		var returnValue = window.showModalDialog(varUrl, window, varOption);
		if (returnValue) {
			UpdateFields(returnValue.Code, returnValue.Value01, returnValue.Value02);
		}
	}
	else {
		var iClientWidth   = (screen.Width-varWidth)/2;
		var iClientHeight  = (screen.Height-varHeight)/2;

		// similar functionality in Opera, but its not modal!
		var modal = window.open(varUrl,"modal","statebar=no,scrollbars=no,width=187,height=240,left="+iClientWidth+",top="+iClientHeight, null);
		modal.dialogArguments = returnObject;
	}
}


//**********************************************************************************//
// SELECT BOX VALUE CHECK SET
//**********************************************************************************//
function selectBoxValueSet(selectId,SetValue)
{
	var elSel = document.getElementsByName(selectId);

	var SetSelectId;
	for (i=0;i<elSel.length ;i++)
	{
		if (elSel[i].tagName == "SELECT")
		{
			SetSelectId = elSel[i];
			break;
		}
	}

	if (SetSelectId != undefined)
	{
		if (SetValue == "")
		{
			SetSelectId.selectedIndex = 0;
		}
		else
		{
			for (var i=0;i<SetSelectId.childElementCount ;i++)
			{
				SetSelectId.selectedIndex = i;
				if (SetSelectId.value == SetValue)
				{
					break;
				}
			}
		}
	}
	else
	{
		alert("not get Element Id!!\n\nId recheck please!!");
	}
}

//**********************************************************************************//
// Process execute Next Page redirect
//**********************************************************************************//
function getProcessRedirect(strNextPageUrl,strQueryString) {
	location.href = strNextPageUrl + strQueryString;
}


//**********************************************************************************//
// iframe auto resize
//**********************************************************************************//
function autoResize(i)
{
	var iframeHeight=(i).contentWindow.document.body.scrollHeight;
	(i).height=iframeHeight+20;
}

//**********************************************************************************//
// Social security number check
//**********************************************************************************//
function checkSSN(ssn) {

	// ÁÖ¹Î¹øÈ£ÀÇ ÇüÅÂ¿Í 7¹øÂ° ÀÚ¸®(¼ºº°) À¯È¿¼º °Ë»ç
	fmt = /^\d{6}-[1234]\d{6}$/;
	if (!fmt.test(ssn)) {
		return false;
	}

	// ³¯Â¥ À¯È¿¼º °Ë»ç
	birthYear = (ssn.charAt(7) <= "2") ? "19" : "20";
	birthYear += ssn.substr(0, 2);
	birthMonth = ssn.substr(2, 2) - 1;
	birthDate = ssn.substr(4, 2);
	birth = new Date(birthYear, birthMonth, birthDate);

	if (birth.getYear() % 100 != ssn.substr(0, 2) ||
		birth.getMonth() != birthMonth ||
		birth.getDate() != birthDate) {
		return false;
	}

	// Check Sum ÄÚµåÀÇ À¯È¿¼º °Ë»ç
	buf = new Array(13);
	for (i = 0; i < 6; i++) buf[i] = parseInt(ssn.charAt(i));
	for (i = 6; i < 13; i++) buf[i] = parseInt(ssn.charAt(i + 1));

	multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
	for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);

	if ((11 - (sum % 11)) % 10 != buf[12])
	{
		return false;
	}

	return true;
}

//**********************************************************************************//
// ¼ýÀÚ 3ÀÚ¸®¸¶´Ù ÄÞ¸¶(,)Âï±â
//**********************************************************************************//
String.prototype.comma = function() {
    tmp = this.split('.');
    var str = new Array();
    var v = tmp[0].replace(/,/gi,'');
    for(var i=0; i<=v.length; i++) {
        str[str.length] = v.charAt(v.length-i);
        if(i%3==0 && i!=0 && i!=v.length) {
            str[str.length] = '.';
        }
    }
    str = str.reverse().join('').replace(/\./gi,',');
    return (tmp.length==2) ? str + '.' + tmp[1] : str;
}

//**********************************************************************************//
// ¹øÈ£¸¸ ÀÔ·Â¹Þ±â(point, hyphen, comma Æ÷ÇÔ)
//**********************************************************************************//
function onlyNum(obj) {
    var val = obj.value;
    var re = /[^0-9\.\,\-]/gi;
    obj.value = val.replace(re, '');
}


//**********************************************************************************//
// À¯È¿ ÀüÈ­¹øÈ£¸¸ ÀÔ·Â¹Þ±â
//**********************************************************************************//
function OnCheckPhone(oTa) { 
    var oForm = oTa.form ; 
    var sMsg = oTa.value ; 
    var onlynum = "" ; 
    var imsi=0; 
    onlynum = RemoveDash2(sMsg);  //ÇÏÀÌÇÂ ÀÔ·Â½Ã ÀÚµ¿À¸·Î »èÁ¦ÇÔ 
    onlynum =  checkDigit(onlynum);  // ¼ýÀÚ¸¸ ÀÔ·Â¹Þ°Ô ÇÔ 
    var retValue = ""; 

    //if(event.keyCode != 12 ) { 
        if(onlynum.substring(0,2) == 02) {  // ¼­¿ïÀüÈ­¹øÈ£ÀÏ °æ¿ì  10ÀÚ¸®±îÁö¸¸ ³ªÅ¸³ª±³ ±× ÀÌ»óÀÇ ÀÚ¸®¼ö´Â ÀÚµ¿»èÁ¦ 
                if (GetMsgLen(onlynum) <= 1) oTa.value = onlynum ; 
                if (GetMsgLen(onlynum) == 2) oTa.value = onlynum + "-"; 
                if (GetMsgLen(onlynum) == 4) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,3) ; 
                if (GetMsgLen(onlynum) == 4) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,4) ; 
                if (GetMsgLen(onlynum) == 5) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,5) ; 
                if (GetMsgLen(onlynum) == 6) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,6) ; 
                if (GetMsgLen(onlynum) == 7) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,5) + "-" + onlynum.substring(5,7) ; ; 
                if (GetMsgLen(onlynum) == 8) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,6) + "-" + onlynum.substring(6,8) ; 
                if (GetMsgLen(onlynum) == 9) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,5) + "-" + onlynum.substring(5,9) ; 
                if (GetMsgLen(onlynum) == 10) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,6) + "-" + onlynum.substring(6,10) ; 
                if (GetMsgLen(onlynum) == 11) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,6) + "-" + onlynum.substring(6,10) ; 
                if (GetMsgLen(onlynum) == 12) oTa.value = onlynum.substring(0,2) + "-" + onlynum.substring(2,6) + "-" + onlynum.substring(6,10) ; 
        } 
        if(onlynum.substring(0,2) == 05 ) {  // 05·Î ½ÃÀÛµÇ´Â ¹øÈ£ Ã¼Å© 
            if(onlynum.substring(2,3) == 0 ) {  // 050À¸·Î ½ÃÀÛµÇ´ÂÁö µûÁö±â À§ÇÑ Á¶°Ç¹® 
                    if (GetMsgLen(onlynum) <= 3) oTa.value = onlynum ; 
                    if (GetMsgLen(onlynum) == 4) oTa.value = onlynum + "-"; 
                    if (GetMsgLen(onlynum) == 5) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,5) ; 
                    if (GetMsgLen(onlynum) == 6) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,6) ; 
                    if (GetMsgLen(onlynum) == 7) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,7) ; 
                    if (GetMsgLen(onlynum) == 8) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,8) ; 
                    if (GetMsgLen(onlynum) == 9) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,7) + "-" + onlynum.substring(7,9) ; ; 
                    if (GetMsgLen(onlynum) == 10) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,8) + "-" + onlynum.substring(8,10) ; 
                    if (GetMsgLen(onlynum) == 11) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,7) + "-" + onlynum.substring(7,11) ; 
                    if (GetMsgLen(onlynum) == 12) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,8) + "-" + onlynum.substring(8,12) ; 
                    if (GetMsgLen(onlynum) == 13) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,8) + "-" + onlynum.substring(8,12) ; 
          } else { 
                if (GetMsgLen(onlynum) <= 2) oTa.value = onlynum ; 
                if (GetMsgLen(onlynum) == 3) oTa.value = onlynum + "-"; 
                if (GetMsgLen(onlynum) == 4) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,4) ; 
                if (GetMsgLen(onlynum) == 5) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,5) ; 
                if (GetMsgLen(onlynum) == 6) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,6) ; 
                if (GetMsgLen(onlynum) == 7) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) ; 
                if (GetMsgLen(onlynum) == 8) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,6) + "-" + onlynum.substring(6,8) ; ; 
                if (GetMsgLen(onlynum) == 9) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,9) ; 
                if (GetMsgLen(onlynum) == 10) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,6) + "-" + onlynum.substring(6,10) ; 
                if (GetMsgLen(onlynum) == 11) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,11) ; 
                if (GetMsgLen(onlynum) == 12) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,11) ; 
          } 
        } 

        if(onlynum.substring(0,2) == 03 || onlynum.substring(0,2) == 04  || onlynum.substring(0,2) == 06  || onlynum.substring(0,2) == 07  || onlynum.substring(0,2) == 08 ) {  // ¼­¿ïÀüÈ­¹øÈ£°¡ ¾Æ´Ñ ¹øÈ£ÀÏ °æ¿ì(070,080Æ÷ÇÔ // 050¹øÈ£°¡ ¹®Á¦±º¿ä) 
                if (GetMsgLen(onlynum) <= 2) oTa.value = onlynum ; 
                if (GetMsgLen(onlynum) == 3) oTa.value = onlynum + "-"; 
                if (GetMsgLen(onlynum) == 4) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,4) ; 
                if (GetMsgLen(onlynum) == 5) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,5) ; 
                if (GetMsgLen(onlynum) == 6) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,6) ; 
                if (GetMsgLen(onlynum) == 7) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) ; 
                if (GetMsgLen(onlynum) == 8) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,6) + "-" + onlynum.substring(6,8) ; ; 
                if (GetMsgLen(onlynum) == 9) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,9) ; 
                if (GetMsgLen(onlynum) == 10) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,6) + "-" + onlynum.substring(6,10) ; 
                if (GetMsgLen(onlynum) == 11) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,11) ; 
                if (GetMsgLen(onlynum) == 12) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,11) ; 

        } 
        if(onlynum.substring(0,2) == 01) {  //ÈÞ´ëÆùÀÏ °æ¿ì 
            if (GetMsgLen(onlynum) <= 2) oTa.value = onlynum ; 
            if (GetMsgLen(onlynum) == 3) oTa.value = onlynum + "-"; 
            if (GetMsgLen(onlynum) == 4) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,4) ; 
            if (GetMsgLen(onlynum) == 5) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,5) ; 
            if (GetMsgLen(onlynum) == 6) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,6) ; 
            if (GetMsgLen(onlynum) == 7) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) ; 
            if (GetMsgLen(onlynum) == 8) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,8) ; 
            if (GetMsgLen(onlynum) == 9) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,9) ; 
            if (GetMsgLen(onlynum) == 10) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,6) + "-" + onlynum.substring(6,10) ; 
            if (GetMsgLen(onlynum) == 11) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,11) ; 
            if (GetMsgLen(onlynum) == 12) oTa.value = onlynum.substring(0,3) + "-" + onlynum.substring(3,7) + "-" + onlynum.substring(7,11) ; 
        } 

        if(onlynum.substring(0,1) == 1) {  // 1588, 1688µîÀÇ ¹øÈ£ÀÏ °æ¿ì 
            if (GetMsgLen(onlynum) <= 3) oTa.value = onlynum ; 
            if (GetMsgLen(onlynum) == 4) oTa.value = onlynum + "-"; 
            if (GetMsgLen(onlynum) == 5) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,5) ; 
            if (GetMsgLen(onlynum) == 6) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,6) ; 
            if (GetMsgLen(onlynum) == 7) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,7) ; 
            if (GetMsgLen(onlynum) == 8) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,8) ; 
            if (GetMsgLen(onlynum) == 9) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,8) ; 
            if (GetMsgLen(onlynum) == 10) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,8) ; 
            if (GetMsgLen(onlynum) == 11) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,8) ; 
            if (GetMsgLen(onlynum) == 12) oTa.value = onlynum.substring(0,4) + "-" + onlynum.substring(4,8) ; 
        } 
    //} 
} 

function RemoveDash2(sNo) { 
var reNo = "" 
for(var i=0; i<sNo.length; i++) { 
    if ( sNo.charAt(i) != "-" ) { 
    reNo += sNo.charAt(i) 
    } 
} 
return reNo 
} 

function GetMsgLen(sMsg) { // 0-127 1byte, 128~ 2byte 
var count = 0 
    for(var i=0; i<sMsg.length; i++) { 
        if ( sMsg.charCodeAt(i) > 127 ) { 
            count += 2 
        } 
        else { 
            count++ 
        } 
    } 
return count 
} 

function checkDigit(num) { 
    var Digit = "1234567890"; 
    var string = num; 
    var len = string.length 
    var retVal = ""; 

    for (i = 0; i < len; i++) 
    { 
        if (Digit.indexOf(string.substring(i, i+1)) >= 0) 
        { 
            retVal = retVal + string.substring(i, i+1); 
        } 
    } 
    return retVal; 
} 

function hangul() 
{ 
	if((event.keyCode < 12592) || (event.keyCode > 12687)) 
	event.returnValue = false 
} 


//**********************************************************************************//
// À¯È¿ ³¯Â¥¸¸ ÀÔ·Â¹Þ±â
//**********************************************************************************//
function chkDate(obj) {
  var input = obj.value.replace(/-/g,"");
  var inputYear = input.substr(0,4);
  var inputMonth = input.substr(4,2) - 1;
  var inputDate = input.substr(6,2);
  var resultDate = new Date(inputYear, inputMonth, inputDate);
  if ( resultDate.getFullYear() != inputYear ||
       resultDate.getMonth() != inputMonth ||
       resultDate.getDate() != inputDate) {
    obj.value = "";
  } else {
    obj.value = inputYear + "-" + input.substr(4,2) + "-" + inputDate;
  }
}


//**********************************************************************************//
//»ç¿ëÀÚ ÀÔ·ÂÆû ÀÔ·Â¿©ºÎ Ã¼Å©
//	varObject	: document.form.radio
//	varName		: ¼±ÅÃÆû ÀÌ¸§
//**********************************************************************************//
function fncCheckUserRadioButton(varObject, varName, idName)
{
	var chkRadio = 0;

	for(var i=0; i < varObject.length ; i++)
	{
		if(varObject[i].checked == true) 
		{
			chkRadio++
			return true;
		}
	}

	var idNames = document.getElementById(idName);
	if(chkRadio == 0){
		if (idName != "")
		{
			if (!idNames)
			{
				alert(varName + " ¼±ÅÃÇØ ÁÖ¼¼¿ä");
			} else {
				idNames.innerHTML = varName + " ¼±ÅÃÇØ ÁÖ¼¼¿ä";
				idNames.style.display = "inline";
			}
		}
		else
		{
			alert(varName + " ¼±ÅÃÇØ ÁÖ¼¼¿ä");
		}

		varObject[0].focus();
		return false;
	}

	idNames.innerHTML = "";
	idNames.style.display = "none";
}


//**********************************************************************************//
// Ã·ºÎÆÄÀÏ ÀÌ¹ÌÁö ¹Ì¸®º¸±â
//	El	: Ã·ºÎÆÄÀÏ °æ·Î
//	no	: ¹øÈ£
//**********************************************************************************//
function preview(El,no)
{
	var tmp = eval("document.getElementById('prvImg" + no +"')");
	//tmp.innerHTML = "<a href='javascript:input(" + no + ")'><img src='" + El + "' width=50 onLoad=\"if(this.height>this.width){this.height=50}\" onError=\"this.style.display='none'\"></a>";
	tmp.innerHTML = "<img src='" + El + "' width=50 onLoad=\"if(this.height>this.width){this.height=50}\" onError=\"this.style.display='none'\">";
}

//**********************************************************************************//
// ÀÌ¹ÌÁö»çÀÌÁî º¯°æ
//**********************************************************************************//
function imgSizeChange(ImgName,SizeWidth) {
	var cnj_img = document[ImgName];
	if (cnj_img.width > SizeWidth)
	{
		cnj_img.width = SizeWidth;
	//cnj_img.height = SizeHeight;
	}
}

//**********************************************************************************//
//ÇÁ¸°Æ® °ü·Ã ½ºÅ©¸³Æ® div ¿µ¿ª¸¸ ÇÁ¸°Æ®ÇÔ
//**********************************************************************************//
function print(printThis) 
{
	var win=null;
	win = window.open();
	self.focus();
	win.document.open();
	win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
	win.document.write('body, td { font-family: Verdana; font-size: 10pt;}');
	win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'><'+'table'+' width="760"><'+'tr'+'><'+'td'+'>');
	win.document.write(printThis);
	win.document.write('<'+'/'+'td'+'><'+'/'+'tr'+'><'+'/'+'table'+'><'+'/'+'body'+'><'+'/'+'html'+'>');
	win.document.close();
	win.print();
	//win.close();
}


//**********************************************************************************//
// div ¿µ¿ª visibility control
//**********************************************************************************//
function divDisplay(divId, bool) 
{
	if(document.getElementById(divId)){
		document.getElementById(divId).style.Display = bool;
	}
}


//**********************************************************************************//
// Pageing Link Script
//**********************************************************************************//
function getPageLink(strUrl,Page)
{
	location.href = strUrl + "&" + Page;
}


//**********************************************************************************//
// radio or select enabled Script
//**********************************************************************************//
function enabledSet(strElementId)
{
	if(document.getElementById(strElementId)){
		document.getElementById(strElementId).disabled = true;
	}
}

//**********************************************************************************//
// iframe resize
//**********************************************************************************//
function autoResize(i)
{
    var iframeHeight=
    (i).contentWindow.document.body.scrollHeight;
    (i).height=iframeHeight+20;
}

function resizeHeight(id)
{
    var the_height = top.document.getElementById(id).contentWindow.document.body.scrollHeight;
    top.document.getElementById(id).height = the_height + 30;
}


/************************************************************************
* 1. ÆÄÀÏ¸í : snsConnectTest.js          *
* 2. ¿ë  µµ : °¢Á¾ SNS ¼­ºñ½º¿Í ¿¬µ¿ÀÛ¾÷À» Á¦¾îÇÑ´Ù.     *
* 3. °³¹ßÀÚ : Á¶µ¿Èñ         *
* 4. ¹ö  Àü : ver 1.0.0            *
* 5. ·Î  ±×               *
*  - ver 1.0.0 ( 2010³â 11¿ù 11ÀÏ ) : ÃÖÃÊ ¼öÁý     *

<a href="#" onclick="sendTwitter('Ç¥½Ã¸Þ½ÃÁö', '°Ô½Ã±Û url');return false;">Æ®À§ÅÍ</a> 
<a href="#" onclick="sendFaceBook('Ç¥½Ã¸Þ½ÃÁö', '°Ô½Ã±Û url');return false;">ÆäÀÌ½ººÏ</a> 
<a href="#" onclick="sendMe2Day('Ç¥½Ã¸Þ½ÃÁö', '°Ô½Ã±Û url', 'ÅÂ±×1,ÅÂ±×2,ÅÂ±×3');return false;">¹ÌÅõµ¥ÀÌ</a> 
<a href="#" onclick="sendYozmDaum('°Ô½Ã±Û url','Ç¥½Ã¸Þ½ÃÁö','Ç¥½Ã¸Þ½ÃÁö');return false;">¿äÁò</a> 
<a href="#" onclick="sendClog('°Ô½Ã±Û url', '°Ô½Ã±Û Á¦¸ñ', '½æ³×ÀÏ url', '±Û¿ä¾à', '±Û¾´ÀÌ');return false;">C·Î±×</a>

*************************************************************************/
/************************************************************************
* 1. ÇÔ¼ö¸í : goYozmDaum(link,prefix,parameter)      *
* 2. ¿ë  µµ : ¿äÁò SNS ¼­ºñ½º¿Í ¿¬µ¿ÀÛ¾÷À» Á¦¾îÇÑ´Ù.     *
* 3. °³¹ßÀÚ : Á¶µ¿Èñ         *
* 4. ¹ö  Àü : ver 1.0.0            *
* 5. ·Î  ±×               *
*  - ver 1.0.0 ( 2010³â 11¿ù 11ÀÏ ) : ÃÖÃÊ ¼öÁý     *
*************************************************************************/
function goYozmDaum(link,prefix,parameter) 
{
 var href = "http://yozm.daum.net/api/popup/prePost?link=" + encodeURIComponent(link) + "&prefix=" + encodeURIComponent(prefix) + "&parameter=" + encodeURIComponent(parameter);
 var a = window.open(href, 'yozmSend', 'width=466, height=356');
 if ( a ) {
 a.focus();
 }
}

/************************************************************************
* 1. ÇÔ¼ö¸í : sendTwitter(title,url)         *
* 2. ¿ë  µµ : Æ®À§ÅÍ SNS ¼­ºñ½º¿Í ¿¬µ¿ÀÛ¾÷À» Á¦¾îÇÑ´Ù.    *
* 3. °³¹ßÀÚ : Á¶µ¿Èñ         *
* 4. ¹ö  Àü : ver 1.0.0            *
* 5. ·Î  ±×               *
*  - ver 1.0.0 ( 2010³â 11¿ù 11ÀÏ ) : ÃÖÃÊ ¼öÁý     *
*************************************************************************/
function sendTwitter(title,url) 
{
 var wp = window.open("http://twitter.com/home?status=" + encodeURIComponent(title) + " " + encodeURIComponent(url), 'twitter', '');
 if ( wp ) {
 wp.focus();
 }
}

/************************************************************************
* 1. ÇÔ¼ö¸í : sendMe2Day(title,url,tag)        *
* 2. ¿ë  µµ : ¹ÌÅõµ¥ÀÌ SNS ¼­ºñ½º¿Í ¿¬µ¿ÀÛ¾÷À» Á¦¾îÇÑ´Ù.    *
* 3. °³¹ßÀÚ : Á¶µ¿Èñ         *
* 4. ¹ö  Àü : ver 1.0.0            *
* 5. ·Î  ±×               *
*  - ver 1.0.0 ( 2010³â 11¿ù 11ÀÏ ) : ÃÖÃÊ ¼öÁý     *
*************************************************************************/
function sendMe2Day(title,url,tag) 
{
 title = "\""+title+"\":"+url;
 var wp = window.open("http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(title) + "&new_post[tags]=" + encodeURIComponent(tag), 'me2Day', '');
 if ( wp ) {
 wp.focus();
 }
}

/************************************************************************
* 1. ÇÔ¼ö¸í : sendFaceBook(title,url)         *
* 2. ¿ë  µµ : ÆäÀÌ½ººÏ SNS ¼­ºñ½º¿Í ¿¬µ¿ÀÛ¾÷À» Á¦¾îÇÑ´Ù.    *
* 3. °³¹ßÀÚ : Á¶µ¿Èñ         *
* 4. ¹ö  Àü : ver 1.0.0            *
* 5. ·Î  ±×               *
*  - ver 1.0.0 ( 2010³â 11¿ù 11ÀÏ ) : ÃÖÃÊ ¼öÁý     *
*************************************************************************/
function sendFaceBook(title,url) 
{
 var wp = window.open("http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(title), 'facebook', 'width=600px,height=420px');
 if ( wp ) {
 wp.focus();
 }
}

/************************************************************************
* 1. ÇÔ¼ö¸í : sendCyWorld(url,title,thumbnail,summary)    *
* 2. ¿ë  µµ : ½ÎÀÌ¿ùµå SNS ¼­ºñ½º¿Í ¿¬µ¿ÀÛ¾÷À» Á¦¾îÇÑ´Ù.    *
* 3. °³¹ßÀÚ : Á¶µ¿Èñ         *
* 4. ¹ö  Àü : ver 1.0.0            *
* 5. ·Î  ±×               *
*  - ver 1.0.0 ( 2010³â 11¿ù 11ÀÏ ) : ÃÖÃÊ ¼öÁý     *
*************************************************************************/
function sendCyWorld(url,title,thumbnail,summary) 
{
 var wp = window.open("http://csp.cyworld.com/bi/bi_recommend_pop.php?url="+encodeURIComponent(url)+"&title="+encodeURIComponent(title)+"&thumbnail="+encodeURIComponent(thumbnail)+"&summary="+encodeURIComponent(summary),"xu","width=400px,height=364px")
 if ( wp ) {
 wp.focus();
 }
}

/************************************************************************
* 1. ÇÔ¼ö¸í : sendSms(title,code)          *
* 2. ¿ë  µµ : sms ¼­ºñ½º¿Í ¿¬µ¿ÀÛ¾÷À» Á¦¾îÇÑ´Ù.      *
* 3. °³¹ßÀÚ : Á¶µ¿Èñ         *
* 4. ¹ö  Àü : ver 1.0.0            *
* 5. ·Î  ±×               *
*  - ver 1.0.0 ( 2010³â 11¿ù 11ÀÏ ) : ÃÖÃÊ ¼öÁý     *
*************************************************************************/
function sendSms(title,code) 
{
 var wp = window.open("/pages/etc/tosms.php?code="+code+"&title="+encodeURIComponent(title),"","width=445px,height=420px")
 if ( wp ) {
 wp.focus();
 }
}

/************************************************************************
* 1. ÇÔ¼ö¸í : sendMail(title,code)          *
* 2. ¿ë  µµ : ¸ÞÀÏ ¼­ºñ½º¿Í ¿¬µ¿ÀÛ¾÷À» Á¦¾îÇÑ´Ù.      *
* 3. °³¹ßÀÚ : Á¶µ¿Èñ         *
* 4. ¹ö  Àü : ver 1.0.0            *
* 5. ·Î  ±×               *
*  - ver 1.0.0 ( 2010³â 11¿ù 11ÀÏ ) : ÃÖÃÊ ¼öÁý     *
*************************************************************************/
function sendMail(title,code) 
{
 var wp = window.open("/pages/etc/tomail.php?code="+code+"&title="+encodeURIComponent(title),"","width=445px,height=420px");
 if ( wp ) {
 wp.focus();
 }
}

/************************************************************************
* 1. ÇÔ¼ö¸í : goCyWorld(code)           *
* 2. ¿ë  µµ : ½ÎÀÌ¿ùµå ¼­ºñ½º¿Í ¿¬µ¿ÀÛ¾÷À» Á¦¾îÇÑ´Ù.     *
* 3. °³¹ßÀÚ : Á¶µ¿Èñ         *
* 4. ¹ö  Àü : ver 1.0.0            *
* 5. ·Î  ±×               *
*  - ver 1.0.0 ( 2010³â 11¿ù 11ÀÏ ) : ÃÖÃÊ ¼öÁý     *
*************************************************************************/
function goCyWorld(code) 
{
 var href = "http://api.cyworld.com/openscrap/post/v1/?xu=http://jjunda.net/cyworldApi.php?code=" + code +"&sid=s0300011";
 var a = window.open(href, 'cyworld', 'width=450,height=410');
 if ( a ) {
 a.focus();
 }
}





