﻿
//국가별 언어설정하기.
document.write("<script src='/lib/PortalLib/js/lang/ko.js' type='text/javascript'></script>");

//AJAX 관련
document.write("<script src='/lib/PortalLib/js/Ajax.js' type='text/javascript'></script>");

function isNothing( formName, caption ) {
	var thisvalue = formName.value;
    if( thisvalue.length == 0 ) {
        alert( caption + inputMe + "\r\nPlease enter valid value into this field" );
        formName.focus();
        return( true ); 
    }
    spacecount = 0;
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( thischar == ' ' ) spacecount++;
    }
    if( spacecount == thisvalue.length ) {
	    alert(  caption + inputMe + "\r\nAll blank characters are assumed Nothing, Please reenter!" );
        formName.focus();
	    return( true ); 
	}
	return( false );
}

function getExactCount(objMsg) {
	var nbytes = 0;
	
	for (i=0; i<objMsg.length; i++) {
		var ch = objMsg.charAt(i);
		
		if(escape(ch).length > 4) {
		  nbytes += 2;
		} else if (ch == '\n') {
			if (objMsg.charAt(i-1) != '\r') {
			    nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
		   nbytes += 4;
		} else {		
		   nbytes += 1;
		}
	}

	return nbytes;
}


function isValidBlob( formName, maxlength ) {
	var exactcount = getExactCount( formName.value ); 
    if( exactcount > maxlength ) { 
        alert( "내용이 너무 크므로 " + (exactcount-maxlength) + "자 이상을 줄이신 후 다시 시도하십시오.\r\n" + 
         "Please shorten the description by " + (exactcount-maxlength) + " characters." );
        formName.focus();
        return( false ); 
    } else {
        return( true ); 
    }
}

function isNumeric( formName ) {
    var charDetected = 0, markDetected = 0, dotCount = 0;
	var numeric = formName.value;
    if( numeric == null || numeric == "" || numeric.length == 0 ) {
	    return( false );
    }
    for( var i = 0; i < numeric.length; i++ ) {
      thischar = numeric.charAt( i ); 
      if( !((thischar >= '0') && (thischar <= '9')) ) {
	      return( false );
        }
    } //end of for
    return( true );
}


function isValidNumeric( formName, minimum, maximum ) {
    var numeric = formName.value;
    if( isNumeric( formName ) == false ) {
        alert( "본 내용에는 반드시 수치로 된 값을 입력하셔야 합니다.\r\nNothing or Non-Numeric entered, Please enter some numeric value" );
        formName.value = "";
		formName.focus();
        return( false );
    }
    var quantity = parseInt( numeric, 10 );
    if( minimum == -1 || maximum == -1 ) //range not defined
        return( true );
    if( (quantity < minimum) || (quantity > maximum) ) {
        alert( "본 값은 최소 (" + minimum + ") 부터 최대 (" + maximum + ") 까지 가능합니다. 다시 입력해 주십시오.");
        formName.value = "";
		formName.focus();
        return( false );
        
    }
    return( true );
}


// 콤마 구분 금액 표시를 리턴
function fnc_Validation_MakeMonenyFormat(objMoney)
{
	var valMoney = objMoney.value;
	var valTemp = "";
	var regExp = /^\d{4,}$/;
	if (!fnc_Validation_IsBlank(valMoney))
	{
		if(regExp.test(valMoney))
		{
			//  첫 콤마 위치
			var intFlag = valMoney.length%3
			if(intFlag)
			{
				var valTemp = valMoney.substring(0, intFlag) 
				if (valMoney.length > 3) valTemp += ","
			}
			
			for (var i=intFlag; i < valMoney.length; i+=3) 
			{
				valTemp += valMoney.substring(i, i+3); 
				// 마지막 콤마를 방지 조건
				if( i < valMoney.length-3) valTemp += ",";
			}
			
			objMoney.value = valTemp;
		}
	}
}

// 콤마를 삭제함
function fnc_Validation_DeleteCommaFormat(objName)
{
	objName.value = objName.value.replace(",","");
}


// 콤마를 삭제한 문자열을 리턴
function fncDelComma(strVal)
{
	var MileageUsedPrice = "";
    for(x = 0; x < strVal.length ; x++)
    {
        ch = strVal.substring(x,x+1)
        if( ch != ",")  MileageUsedPrice += ch;
    }	
    return MileageUsedPrice;
}


//금액에 , 찍기..
function numchk(num,objName){
    num=new String(num);
    num=num.replace(/,/gi,"");
    return numchk1(num,objName);
}

function numchk1(num,objName){
    var sign="";
    if(isNaN(num)) {
        alert("숫자만 입력할 수 있습니다");
        
		if (!isNaN(objName.value.replace(/,/gi,"")))
        {
			if (typeof(document.forms[0].HanWantQuantity)!="undefined")
				document.forms[0].HanWantQuantity.value = "";
			if (typeof(document.forms[0].ShortCmd)!="undefined")
				document.forms[0].ShortCmd.value = "";
        }
        
        
        return "";
    }
    if(num==0) {
        return num;
    }

    if(num<0){
        num=num*(-1);
        sign="-";
    }
    else{
        num=num*1;
    }
    num = new String(num)
    var temp="";
    var pos=3;
    num_len=num.length;
    while (num_len>0){
        num_len=num_len-pos;
        if(num_len<0) {
            pos=num_len+pos;
            num_len=0;
        }
        temp=","+num.substr(num_len,pos)+temp;
    }
    return sign+temp.substr(1);
}

function fnc_onlyNumber_alert(num , numobj){
	if(isNaN(num)) {
		alert("숫자만 입력할 수 있습니다"); 
		numobj.value = "";
		numobj.focus(); 
		return( false );   
	}
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}


//파일럿룸 띄우는 Fnc
function openPilotRoom(id) {
//	window.open("/pilotRoom/myunit3D.asp?rid="+id,"PilotRM","height=605,width=795,scrollbars=no,resizable=yes");
	window.open("/pilotRoom/index.asp?rid="+id, "PilotRM","height=602,width=793,scrollbars=no,resizable=yes");
	return;
}


//-------------------------------------
// 이미지 첨부시 크기제한에 걸린 이미지의 팝업이미지 보이기
//-------------------------------------

function ShowImageWithModalBox (objImage) {
	window.showModalDialog('/lib/PortalLib/asp/ShowImageWithModalBox.asp?' + objImage.src, 
	'', 
	'dialogHeight: 520px; dialogWidth: 430px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: No; scroll: No; status: Yes;');
}

function ShowThumWithModalBoxKind (brdKind, num) {
	window.showModalDialog('/lib/PortalLib/asp/ShowImageWithModalBox.asp?num=' + num + '&brdKind=' + brdKind, 
	'', 
	'dialogHeight: 520px; dialogWidth: 430px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: No; scroll: auto; status: Yes;');
}



function ShowThumWithModalBox (objImage) {
	window.showModalDialog('/lib/PortalLib/asp/ShowImageWithModalBox.asp?' + objImage, 
	'', 
	'dialogHeight: 520px; dialogWidth: 430px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: No; scroll: auto; status: Yes;');
}


function viewPhoto(strtbName, pdsIdx, sWidth, sHeight)	{

			window.open("/community/gallery/imageCom.asp?strtbName="+strtbName+"&pdsIdx="+ pdsIdx+"&sWidth="+sWidth+"&sHeight="+sHeight, "Photo","WIDTH="+sWidth+",HEIGHT="+sHeight+",resizable=no,scrollbars=no,top=0,left=0");

}


//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// 퀵메뉴창 관련 
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------

var chkQView=0;
var srid="0", srid2="0";
var div="";

document.onclick = chkClick;

function chkClick(){
	event_target = event.srcElement;
	event_target = event_target.toString();
	event_check1 = event_target.indexOf("javascript:ShowQuick1");		//0/-1 : 있다/없다
	event_check2 = event_target.indexOf("javascript:ShowQuick2");		
	event_check3 = event_target.indexOf("javascript:ShowQuick3");		

	if (!event_check1){
		div = eval("document.all.QuickView1");
		ShowQuickLayer();
	}else if(!event_check2){
		div = eval("document.all.QuickView2");
		ShowQuickLayer();
	}else if(!event_check3){
		div = eval("document.all.QuickView3");
		ShowQuickLayer();
	}else
		HideQuick();
}

function ShowQuick1(rid, rid2){	 //보통
	srid=rid;
	srid2=rid2;
	if (rid == '') {srid="Guest";}
}

function ShowQuick2(rid, rid2){	
	ShowQuick1(rid, rid2);
}

function ShowQuick3(rid, rid2){	 
	ShowQuick1(rid, rid2);
}

function ShowQuickLayer(){	 

	HideQuick();

	var ahn_width = document.body.clientWidth - event.x ;
	var ahn_height = document.body.clientHeight - event.y ;

	if (ahn_width < 200 )
		div.style.left = document.body.scrollLeft + event.x - 70 ;
	else
		div.style.left = document.body.scrollLeft + event.x + 10 ;
	if(ahn_height <100 )
		div.style.top = document.body.scrollTop + event.y - 90 ;
	else
		div.style.top = document.body.scrollTop + event.y;

	if (chkQView==0){
		div.style.display="";
		chkQView=1;
/*	}else{
		div.style.display="none";
		chkQView=0;
*/
	}
}

function HideQuick(){
	if (chkQView==1){
		document.all.QuickView1.style.display="none";
		document.all.QuickView2.style.display="none";
		document.all.QuickView3.style.display="none";
		chkQView=0;
	}
}

function musOnTD(obj){
	obj.style.cssText = "background-color:#4F84C3; color:#FFFFFF; cursor:hand;	padding-left:10px; padding-top:3px;"
}

function musOffTD(obj){
	obj.style.cssText = "letter-spacing:-1px; padding-left:10px; padding-top:3px;"
}

function musOnClick(sel){
	var rid = srid;
	var rid2 = srid2;

	switch(sel){
		case 1 :	 //파일럿룸
			openPilotRoom(rid2);
			break;
		case 2 :	 //쪽지쓰기
			if (rid=="Guest" || rid == "")
				alert("로그인 후 사용하세요!     ");
			else if (rid != rid2)
				MM_openBrWindow("/pilotRoom/SendMsgPop.asp?rid2="+rid2, "PopMsg", "width=448,height=240,resizable=no,scrollbars=no,top=100,left=200");
			break;
		case 3 :	 //친구하기
			if (rid=="Guest" || rid == "")
				alert("로그인 후 사용하세요!     ");
			else if (rid != rid2)
				document.location.href="/pilotRoom/MakeFriends.asp?rid2="+rid2+"&"+gUrlFile
			break;
		case 4 :	 //친구끊기
			if (rid=="Guest" || rid == "")
				alert("로그인 후 사용하세요!     ");
			else
				if(confirm("정말 친구 관계를 끊으시겠습니까?   ")== true)
					document.location.href="/pilotRoom/DeleteFriends.asp?rid2="+rid2+"&"+gUrlFile
				//alert("rid : " + rid + " rid2 : " +rid2+" 친구끊기 준비중 입니다. ");
			break;
		case 5 :	 //차단하기
			if (rid=="Guest" || rid == "")
				alert("로그인 후 사용하세요!     ");
			else if (rid != rid2)
				if(confirm("정말 차단하시겠습니까?   ")== true)
					document.location.href="/pilotRoom/CutOff.asp?rid2="+rid2+"&gubun=1&"+gUrlFile
			break;
		case 6 :	 //차단풀기
//			alert("rid : " + rid + " rid2 : " +rid2+" 차단풀기 준비중 입니다. ");
			if (rid=="Guest" || rid == "")
				alert("로그인 후 사용하세요!     ");
			else
				if(confirm("차단을 해지 하시겠습니까?   ")== true)
					document.location.href="/pilotRoom/CutOff.asp?rid2="+rid2+"&gubun=2&"+gUrlFile
			break;
		default :
	}
}


//------------------------------------------------------------------------------------------------------------------------------------------------------------------------

//이미지 커멘트 관련 
function roundTable(objID) {
   var obj = document.getElementById(objID);
   var Parent, objTmp, Table, TBody, TR, TD;
   var bdcolor, bgcolor, Space;
   var trIDX, tdIDX, MAX;
   var styleWidth, styleHeight;

   Parent = obj.parentNode;
   objTmp = document.createElement('SPAN');
   Parent.insertBefore(objTmp, obj);
   Parent.removeChild(obj);

   bdcolor = obj.getAttribute('rborder');
   bgcolor = obj.getAttribute('rbgcolor');
   radius = parseInt(obj.getAttribute('radius'));
   if (radius == null || radius < 1) radius = 1;
   else if (radius > 6) radius = 6;

   MAX = radius * 2 + 1;

   Table = document.createElement('TABLE');
   TBody = document.createElement('TBODY');

   Table.cellSpacing = 0;
   Table.cellPadding = 0;

   for (trIDX=0; trIDX < MAX; trIDX++) {
          TR = document.createElement('TR');
          Space = Math.abs(trIDX - parseInt(radius));
          for (tdIDX=0; tdIDX < MAX; tdIDX++) {
                 TD = document.createElement('TD');
                 
                 styleWidth = '1px'; styleHeight = '1px';
                 if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
                 else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
                 else if (radius > 2) {
                        if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
                        if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
                 }

                 if (styleWidth != null) TD.style.width = styleWidth;
                 if (styleHeight != null) TD.style.height = styleHeight;

                 if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
                 else if (tdIDX > Space && Space < MAX - tdIDX - 1)  TD.style.backgroundColor = bgcolor;
                 
                 if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
                 TR.appendChild(TD);
          }
          TBody.appendChild(TR);
   }
   Table.appendChild(TBody);
   Parent.insertBefore(Table, objTmp);
}

//툴팁
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;

function overTip(boxObj) {
	if (ie) {
	boxObj.style.visibility = "visible";
	boxObj.filters.item(0).stop();
	}
}


function outTip(boxObj) {
	if (ie) {
	boxObj.style.visibility = "visible";
	boxObj.filters.item(0).transition = 23;
	boxObj.filters.item(0).apply();
	boxObj.style.visibility = "hidden";
	boxObj.filters.item(0).play();
	}
}

/*###########################################################
	Author		  : 양명석
	Written	Date  : 2006년 4월 19일
	Comment		  : 팝업생성 함수
###########################################################*/

function openPopup(URL, popupName, width, height){	
	window.open(URL, popupName, "width="+width+",height="+height+",scroll=yes,resizable=no,scrollbars=yes,status=no");
}

/*###########################################################
	Author		  : 양명석
	Written	Date  : 2006년 4월 6일
	Comment		  : Error표시 팝업생성 함수
###########################################################*/

function errPopup(errorMSG, returnURL){	
	window.open("http://alea.sizz.net/lib/error/errorPopup.asp?errorMSG="+errorMSG+"&returnURL="+returnURL, "errorPopup", "width=300,height=200,scroll=no,resizable=no,scrollbars=no,status=no");
}

/*###########################################################
	Author		  : 양명석
	Written	Date  : 2006년 4월 10일
	Comment		  : 모달창 생성 함수
###########################################################*/

function showModal(arg){
    showModalDialog("http://alea.sizz.net/lib/error/errorPopup.asp?errorMSG="+errorMSG+"&returnURL="+returnURL , "errorPopup", "resizable: no; help: no; status: no; scroll: no; dialogWidth:300px;dialogHeight:220px;");
}

/*###########################################################
	Author		  : 양명석
	Written	Date  : 2006년 4월 6일
	Comment		  : 특정ID값을 가진 특정Tag의 감추거나 보여줌
###########################################################*/

function showOrHideSubLayer(id, tagname){
    var tagnm = document.getElementById(id).getElementsByTagName(tagname)[0];
	if (tagnm.style.display=="none") tagnm.style.display="block";
	else tagnm.style.display="none";
}

/*###########################################################
	Author		  : 양명석
	Written	Date  : 2006년 4월 6일
	Comment		  :  Flash Activating Script
	s: source url
	d: flash id
	w: source width
	h: source height
	t: wmode ("" for none, transparent, opaque ...)
###########################################################*/

function mf(s,d,w,h,t){
        return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width="+w+" height="+h+" id="+d+"><param name=wmode value="+t+" /><param name=movie value="+s+" /><param name=quality value=high /><embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"https://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+"></embed></object>";
}


// write document contents
function documentwrite(src){
        document.write(src);
}


// assign code innerHTML
function setcode(target, code){
        target.innerHTML = code;
}


function resizePop(obj){ 
	var width = eval("document.getElementById(\""+obj+"\").scrollWidth");
	var height = eval("document.getElementById(\""+obj+"\").scrollHeight");
	window.moveTo((screen.width - width) / 2, (screen.height - height) / 2); 
	parent.resizeTo(width, height); 
} 

function resizeBody(){ 
	var width = eval("document.body.scrollWidth");
	var height = eval("document.body.scrollHeight");
	window.moveTo((screen.width - width) / 2, (screen.height - height) / 2); 
	parent.resizeTo(width, height); 
}

function resizeWin(w, h){ 
	window.moveTo((screen.width - w) / 2, (screen.height - h) / 2); 
	parent.resizeTo(w, h); 
} 


function numericOnly(value){
	if(value.length != 0){
		value = value.replace(' ','');
		value = value.replace(/[^0-9]/g,'');
		return value;
	}
	else{
		return "";
	}
}
function replaceSpace(value){
	if(value.length != 0){
		value = value.replace(' ','');
		return value;
	}
	else{
		return "";
	}	
}

// ################## Script For Flash & ActiveX #########################

// Writer : 김천겸
// email : prussian@skcc.com
// Last Update : 2006-02-07


// +++++++++++++  MakeFlashString(source,id,width,height,wmode) ++++++++
// 
// source: source url --> 플래쉬 파일의 경로
// id: flash id 
// width: source width
// height: source height
// wmode: wmode --> "none, transparent, opaque"
// otherparam : 추가 파라미터 "<param name='myParam' value='myValue' />
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


// +++++++++++++  MakeObjectString(classid, codebase, name, id, width,height, param) ++++++++
// 
// classid: classid --> 플래쉬 파일의 경로
// codebase: cab파일 위치 및 버전정보 
// name :
// id :
// width: source width
// height: source height
// 
// wmode: wmode --> "none, transparent, opaque"
// param : 추가 파라미터 "<param name='myParam' value='myValue' />
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// Example 
// DocumentWrite(MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
// SetInnerHTML(document.all.mm, MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
// @@주의 사항 
//  - 상호작용 없는 컨텐츠는 DocumentWrite, SetInnerHTML 둘다 사용 가능
//  - 상호작용 있는 컨텐츠는 SetInnerHTML만 사용 가능
// #######################################################################


function MakeFlashString(source,id,width,height,wmode, otherParam)
{	
	return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"https://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+"></embed></object>";
}

function MakeObjectString(classid, codebase, name, id, width,height, param)
{
	return "<object classid="+classid+" codebase="+codebase+" name="+name+" width="+width+" height="+height+" id="+id+">"+param+"</object>";
}

// innerHTML Type
function SetInnerHTML(target, code)
{ 
	target.innerHTML = code; 
}

// Direct Write Type
function DocumentWrite(src)
{
	document.write(src);
}


function tooltip_start(id, event)
{
	var tooltip = eval("document.all." + id);

	if (!tooltip) return;

	tooltip.style.filter = 'alpha(opacity=20)';
	tooltip.style.left=event.clientX-99;
	tooltip.style.top=event.clientY;

	tooltip.style.display='block';

	setTimeout('tooltip_fade(\'' +id + '\', 20)', 0);
}

function tooltip_fade(id, opa)
{
	var tooltip = eval("document.all." + id);

	if (!tooltip) return;

	tooltip.style.filter = 'alpha(opacity='+opa+')';

	if(opa < 100)
		setTimeout('tooltip_fade(\'' +id + '\', '+(opa+30)+')', 0);
}

function tooltip_move(id, event)
{
	var tooltip = eval("document.all." + id);

	if (!tooltip) return;

	tooltip.style.left = event.clientX-99;
	tooltip.style.top = event.clientY+5;
}

function tooltip_stop(id)
{
	var tooltip = eval("document.all." + id);

	if (!tooltip) return;

	tooltip.style.display='none';
}

function tooltip_startPosision(id, eventm, width, height)
{
	var tooltip = eval("document.all." + id);

	if (!tooltip) return;

	tooltip.style.filter = 'alpha(opacity=20)';
	tooltip.style.left=event.clientX-width;
	tooltip.style.top=(event.clientY + document.body.scrollTop) - height;

	tooltip.style.display='block';

	setTimeout('tooltip_fade(\'' +id + '\', 20)', 0);
}

function tooltip_move(id, event, width, height)
{
	var tooltip = eval("document.all." + id);

	if (!tooltip) return;

	tooltip.style.left = event.clientX-width;
	tooltip.style.top = event.clientY+height;
}



/*###########################################################
	Author		  : 양명석
	Written	Date  : 2006년 6월 14일
	Comment		  : 해당 url로 페이지 이동
###########################################################*/

function goURL(url){
	location.href=url;
}

/*###########################################################
	Author		  : 양명석
	Written	Date  : 2006년 6월 14일
	Comment		  : 팝업 닫기
###########################################################*/

function popClose(){
	self.close();
}

/*###########################################################
	Author		  : 양명석
	Written	Date  : 2006년 6월 14일
	Comment		  : Const에 넣어놓은 패턴의 문자열을
					Parse해서 obj의 options로 추가

	String Pattern: 1,일반|2,신규|3,베스트|4,추천|5,판매중지|6,품절

	How to use	  : getSelectList("<%=csItemtype%>", document.searchFm.itemtype, "<%=itemtype%>", "T");
					getSelectList(페턴문자열       , 해당select object 이름    ,  selected될 값 , 전체선택 가능 플래그);
	
###########################################################*/

function getSelectList(variable, obj, selectedvalue, totalflag){
	var tmp, tmp2, len, oOption;
	
	tmp = variable.split('|'); 
	len = tmp.length;

	if(totalflag.toUpperCase() == "T"){ // 전체 선택 가능
		oOption = document.createElement("OPTION");
		oOption.value = "0";
		oOption.text = "= 전체 =";
		
		if(selectedvalue == "0"){ // 선택값과 같다면 selected 속성 적용
			oOption.setAttribute('selected',true); 
		}
		
		obj.options.add(oOption);
	}

	for(var i=0;i < len; i++)
	{			
		tmp2 = tmp[i].split(',');
		oOption = document.createElement("OPTION");
		oOption.value = tmp2[0];
		oOption.text = tmp2[1];
		
		if(tmp2[0] == selectedvalue){ // 선택값과 같다면 selected 속성 적용
			oOption.setAttribute('selected',true); 
		}
		
		obj.options.add(oOption);
	}
}


/*리턴URL*/
function ReturnUrl(Url){

	for(var i=0;i < 10;i++){

		if(Url.indexOf("&") < 0 && Url.indexOf("?") < 0)
			break;

		Url = Url.replace("&","!!");
		Url = Url.replace("?","@@");
	}

	return Url;
}

//숫자체크
function checkNumber(){
	var objEv = event.srcElement;
	var numPattern = /([^0-9])/;
	numPattern = objEv.value.match(numPattern);
	if(numPattern != null){
		alert("숫자만 입력해 주세요!!");
		objEv.value="";
		objEv.focus();
		return false;
	}
}

//소수점 몇자리만 반환
function GetNumberPosition(num, position)
{
	var result = "";
	var tmp = num.toString().split('.');
	
	result = tmp[0];
	
	if(tmp.length > 1)
	{
		result = result + "." + tmp[1].substring(0,position);
	}
	
	return result;
}