function sizeOn(){
	document.getElementById('layerArea').style.height = 300;
	document.getElementsTagName('div').style.zIndex=8;
	document.getElementById('layerArea').style.zIndex=9999;
}
function sizeOff(){
	document.getElementById('layerArea').style.height = 51;
	document.getElementsTagName('div').style.zIndex=1;					
}

function UserSearch(UserCode,UserId,UserName,UserHP,UserEmail,Flag,PlanerCode){   // 회원정보 가지고 오기
	var CRObj = new Object();
	if(UserCode!=''){CRObj.UserCode = document.getElementById(UserCode)};
	if(UserId!=''){CRObj.UserId = document.getElementById(UserId)};
	if(UserName!=''){CRObj.UserName = document.getElementById(UserName)};
	if(UserHP!=''){CRObj.UserHP = document.getElementById(UserHP)};
	if(UserEmail!=''){CRObj.UserEmail = document.getElementById(UserEmail)};
	if(PlanerCode!=''){CRObj.PlanerCode = document.getElementById(PlanerCode)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/UserSearch.php?PlanerCode="+PlanerCode+"&Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:490px;center:yes;status:no;scroll:no");
}
function PlanerSearch(UserCode,UserId,UserName,UserHP,UserEmail,Flag){   // 회원정보 가지고 오기
	var CRObj = new Object();
	if(UserCode!=''){CRObj.UserCode = document.getElementById(UserCode)};
	if(UserId!=''){CRObj.UserId = document.getElementById(UserId)};
	if(UserName!=''){CRObj.UserName = document.getElementById(UserName)};
	if(UserHP!=''){CRObj.UserHP = document.getElementById(UserHP)};
	if(UserEmail!=''){CRObj.UserEmail = document.getElementById(UserEmail)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/PlanerSearch.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:490px;center:yes;status:no;scroll:no");
}
function UserAllSearch(UserCode,UserId,UserName,UserHP,UserEmail,UserZip1,UserZip2,UserAddr1,UserAddr2,UserJumin,Flag){   // 회원정보 가지고 오기
	var CRObj = new Object();
	if(UserCode!=''){CRObj.UserCode = document.getElementById(UserCode)};
	if(UserId!=''){CRObj.UserId = document.getElementById(UserId)};
	if(UserName!=''){CRObj.UserName = document.getElementById(UserName)};
	if(UserHP!=''){CRObj.UserHP = document.getElementById(UserHP)};
	if(UserEmail!=''){CRObj.UserEmail = document.getElementById(UserEmail)};
	if(UserZip1!=''){CRObj.UserZip1 = document.getElementById(UserZip1)};
	if(UserZip2!=''){CRObj.UserZip2 = document.getElementById(UserZip2)};
	if(UserAddr1!=''){CRObj.UserAddr1 = document.getElementById(UserAddr1)};
	if(UserAddr2!=''){CRObj.UserAddr2 = document.getElementById(UserAddr2)};
	if(UserJumin!=''){CRObj.UserJumin = document.getElementById(UserJumin)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/UserAllSearch.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:490px;center:yes;status:no;scroll:no");
}
function INIMemberSearch(UserCode,UserId,UserName,UserTel,UserHP,UserEmail,UserZip1,UserZip2,UserAddr1,UserAddr2,Flag){   // 회원정보 가지고 오기
	var CRObj = new Object();
	if(UserCode!=''){CRObj.UserCode = document.getElementById(UserCode)};
	if(UserId!=''){CRObj.UserId = document.getElementById(UserId)};
	if(UserName!=''){CRObj.UserName = document.getElementById(UserName)};
	if(UserTel!=''){CRObj.UserTel = document.getElementById(UserTel)};
	if(UserHP!=''){CRObj.UserHP = document.getElementById(UserHP)};
	if(UserEmail!=''){CRObj.UserEmail = document.getElementById(UserEmail)};
	if(UserZip1!=''){CRObj.UserZip1 = document.getElementById(UserZip1)};
	if(UserZip2!=''){CRObj.UserZip2 = document.getElementById(UserZip2)};
	if(UserAddr1!=''){CRObj.UserAddr1 = document.getElementById(UserAddr1)};
	if(UserAddr2!=''){CRObj.UserAddr2 = document.getElementById(UserAddr2)};

    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/INIMemberSearch.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:490px;center:yes;status:no;scroll:no");
}
function INIWeddingHallSearch(BusCode,BusName,Flag){   // 회원정보 가지고 오기
	var CRObj = new Object();
	if(BusCode!=''){CRObj.BusCode = document.getElementById(BusCode)};
	if(BusName!=''){CRObj.BusName = document.getElementById(BusName)};

    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/WeddingHallSearch.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:490px;center:yes;status:no;scroll:no");
}
function BusSearch(BusCode,BusName,BusTel,BusFax,Flag){   // 업체정보 가지고 오기
	var CRObj = new Object();
	if(BusCode!=''){CRObj.BusCode = document.getElementById(BusCode)};
	if(BusName!=''){CRObj.BusName = document.getElementById(BusName)};
	if(BusTel!=''){CRObj.BusTel = document.getElementById(BusTel)};
	if(BusFax!=''){CRObj.BusFax = document.getElementById(BusFax)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/BusSearch.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:490px;center:yes;status:no;scroll:no");
}

function BusWSearch(BusCode,BusName,BusTel,BusFax,Flag){   // 업체정보 가지고 오기
	var CRObj = new Object();
	if(BusCode!=''){CRObj.BusCode = document.getElementById(BusCode)};
	if(BusName!=''){CRObj.BusName = document.getElementById(BusName)};
	if(BusTel!=''){CRObj.BusTel = document.getElementById(BusTel)};
	if(BusFax!=''){CRObj.BusFax = document.getElementById(BusFax)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/BusWSearch.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:490px;center:yes;status:no;scroll:no");
}

function BusSearch_dev(BusCode,BusName,BusTel,BusFax,Flag){   // 업체정보 가지고 오기
	var CRObj = new Object();
	if(BusCode!=''){CRObj.BusCode = document.getElementById(BusCode)};
	if(BusName!=''){CRObj.BusName = document.getElementById(BusName)};
	if(BusTel!=''){CRObj.BusTel = document.getElementById(BusTel)};
	if(BusFax!=''){CRObj.BusFax = document.getElementById(BusFax)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/BusSearch_dev.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:490px;center:yes;status:no;scroll:no");
}
function ConsulCallerSearch(ConsulCallerCode,ConsulCallerUserName,Flag){   // 상담코드 가지고 오기 Flag='Y'이면 모든자료가 다나오고 'N'이면 해당 플레너 자료만 나온다
	var CRObj = new Object();
	if(ConsulCallerCode!=''){CRObj.ConsulCallerCode = document.getElementById(ConsulCallerCode)};
	if(ConsulCallerUserName!=''){CRObj.ConsulCallerUserName = document.getElementById(ConsulCallerUserName)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/ConsulCaller.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:700px;center:yes;status:no;scroll:no");
}
function CustomerContract(CustomerContractCode,Flag){   // 계약코드 가지고 오기 Flag='Y'이면 모든자료가 다나오고 'N'이면 해당 플레너 자료만 나온다
	var CRObj = new Object();
	if(CustomerContractCode!=''){CRObj.CustomerContractCode = document.getElementById(CustomerContractCode)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/CustomerContract.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:700px;center:yes;status:no;scroll:no");
}
function CustomerContract3(CustomerContractCode,Flag){   // 계약코드 가지고 오기 Flag='Y'이면 모든자료가 다나오고 'N'이면 해당 플레너 자료만 나온다
	var CRObj = new Object();
	if(CustomerContractCode!=''){CRObj.CustomerContractCode = document.getElementById(CustomerContractCode)};
    CRObj.TOP = top;
 	window.showModalDialog("/_admin/Search/CustomerContract3.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:700px;center:yes;status:no;scroll:no");
}
function CustomerContract2(CustomerContractCode,Birdegroom_UserName,Bride_UserName,EarnestMoney,MiddleMoney,FindMoney,TotalSalePrice,Flag){   // 계약코드 가지고 오기 Flag='Y'이면 모든자료가 다나오고 'N'이면 해당 플레너 자료만 나온다
	var CRObj = new Object();
	if(CustomerContractCode!=''){CRObj.CustomerContractCode = document.getElementById(CustomerContractCode)};
	if(Birdegroom_UserName!='')	{CRObj.Birdegroom_UserName = document.getElementById(Birdegroom_UserName)};
	if(Bride_UserName!='')		{CRObj.Bride_UserName = document.getElementById(Bride_UserName)};
	if(EarnestMoney!='')		{CRObj.EarnestMoney = document.getElementById(EarnestMoney)};
	if(MiddleMoney!='')			{CRObj.MiddleMoney = document.getElementById(MiddleMoney)};
	if(FindMoney!='')			{CRObj.FindMoney = document.getElementById(FindMoney)};
	if(TotalSalePrice!='')		{CRObj.TotalSalePrice = document.getElementById(TotalSalePrice)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/CustomerContract2.php?Flag="+Flag, CRObj,"dialogHeight:520px;dialogWidth:635px;center:yes;status:no;scroll:no");
}
function BusGoodSearch(BG_Gubn1,BG_Gubn2,BG_GubnName1,BG_GubnName2,BUS_Name,BG_Name,BG_Price,BG_SalePrice,BusinessCode,BusinessGood_Code,Gubn1Flag,Gubn2Flag){   // 상품 정보 가지고 오기
	var CRObj = new Object();
								
	if(BG_Gubn1!=''){CRObj.BG_Gubn1 = document.getElementById(BG_Gubn1)};          
	if(BG_Gubn2!=''){CRObj.BG_Gubn2 = document.getElementById(BG_Gubn2)};          
	if(BG_GubnName1!=''){CRObj.BG_GubnName1 = document.getElementById(BG_GubnName1)};          
	if(BG_GubnName2!=''){CRObj.BG_GubnName2 = document.getElementById(BG_GubnName2)};          
	if(BUS_Name!=''){CRObj.BUS_Name = document.getElementById(BUS_Name)};          
	if(BG_Name!=''){CRObj.BG_Name = document.getElementById(BG_Name)};           
	if(BG_Price!=''){CRObj.BG_Price = document.getElementById(BG_Price)};          
	if(BG_SalePrice!=''){CRObj.BG_SalePrice = document.getElementById(BG_SalePrice)};        
	if(BusinessCode!=''){CRObj.BusinessCode = document.getElementById(BusinessCode)};      
	if(BusinessGood_Code!=''){CRObj.BusinessGood_Code = document.getElementById(BusinessGood_Code)};
	//alert(Gubn1Flag+" | "+Gubn2Flag);
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/BusGoodSearch.php?Gubn1Flag="+Gubn1Flag+"&Gubn2Flag="+Gubn2Flag, CRObj,"dialogHeight:520px;dialogWidth:610px;center:yes;status:no;scroll:no");
}

function ContractPlacingRebate(ContractPlacingCode){  //리베이트 리스트 가지고 오기
	var CRObj = new Object();
	if(ContractPlacingCode!=''){CRObj.ContractPlacingCode = document.getElementById(ContractPlacingCode)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/PlacingSearch.php", CRObj,"dialogHeight:520px;dialogWidth:700px;center:yes;status:no;scroll:no");
}


function ZipAddSearch(Zip1,Zip2,Addr1,Addr2){   // 우편번호 검색
	var CRObj = new Object();
	if(Zip1!=''){CRObj.UserCode = document.getElementById(Zip1)};
	if(Zip2!=''){CRObj.UserId = document.getElementById(Zip2)};
	if(Addr1!=''){CRObj.UserName = document.getElementById(Addr1)};
	if(Addr2!=''){CRObj.UserHP = document.getElementById(Addr2)};
    CRObj.TOP = top;
   	window.showModalDialog("/_admin/Search/ZipAddrSearch.php", CRObj,"dialogHeight:520px;dialogWidth:490px;center:yes;status:no;scroll:no");
}
/* 플래시를 위한 스크립트 */
<!--// flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 윈도우모드)
function flashWrite(url,w,h,id,bg,win){

	//codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' <--object안에 이부분 삭제 2008.08.20 홍기상
	// 플래시 코드 정의
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	// 플래시 코드 출력
	document.write(flashStr);

}
/* 플래시를 위한 스크립트 끝*/

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Code:고유코드번호 ,Contents : 컨텐츠 코드,gubn : 컨텐츠 구분,count : 순서 : FieldName : 주소를 돌려줄 필드이름
function InIPhotoInsert(Code,Contents,gubn,count,ContentGubn,FieldName){  
		var InIPhotoObj = new Object();
		InIPhotoObj.FieldName=document.getElementById(FieldName);
		InIPhotoObj.TOP = top;
  	window.showModalDialog("../Search/InIPhotoInsert.php?Code="+Code+"&Contents="+Contents+"&gubn="+gubn+"&count="+count+"&ContentGubn="+ContentGubn, InIPhotoObj,"dialogHeight:230px;dialogWidth:500px;center:yes;status:no;scroll:no");
}



//스크롤바를 따라다니는 레이어
function initMoving(target, topPosition, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = topPosition;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 500;
		}
	}
	obj.move = setInterval(function() {
		//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		pos = obj.getTop() + topPosition;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 5;
		obj.style.top = obj.top + "px";
	}, 30)
} //스크롤바를 따라다니는 레이어 끝



///<!-- 큰그림보기 스크립트 -->//////////
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all

function enlarge(which,e,L){
if(!L) L= -600;
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (crossobj.style.visibility=="hidden"){
crossobj.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX+L
crossobj.style.top=ns6? pageYOffset+e.clientY : document.documentElement.scrollTop +event.clientY
crossobj.innerHTML='<div id=previewScore align=right style=background:#0A246A;><img onClick=closepreview() src=/images/close.gif style=cursor:hand;margin:3px;></div><img id="previewScore2" onClick=closepreview()  src="'+which+'">'
crossobj.style.visibility="visible"
}
else
crossobj.style.visibility="hidden"
return false
}
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0 ></a>')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
else
return true
}
function closepreview(){
crossobj.style.visibility="hidden"
}
////////////////////////////////////////////////////
//큰그림 보기 무빙
////////////////////////////////////////////////////
var nsx,nsy,nstemp

function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}


function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
}
return false
}

function initializedrag(e){
if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
//<!-- 큰그림보기 스크립트 -->////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////
//바이트 단위로 문자열 잘라내기 시작
//////////////////////////////////////////////////////////////////////////////////////////////////////
//InIcal_pre(Chr,ch,CntView)
//Chr			: 문자가 들어가는 input textarea id
//ch			: 제한할 문자의 byte수
//CntView : 현재 적혀있는 문자의 갯수를 나타낼 id

var InIChrLenght=0;
var InIChrValue='';
var InICountView='';
function InIcal_pre(Chr,ch,CntView){
        InIChrLenght=ch;
		InIChrValue=Chr;
		InICountView=CntView;
        var tmpStr;

        tmpStr = document.getElementById(InIChrValue).value;
        InIcal_byte(tmpStr);
}

function InIcal_byte(aquery) 
{

        var tmpStr;
        var temp=0;
        var onechar;
        var tcount;
        tcount = 0;

        tmpStr = new String(aquery);
        temp = tmpStr.length;

        for (k=0;k<temp;k++)
        {
                onechar = tmpStr.charAt(k);
                if (escape(onechar) =='%0D') { } else if (escape(onechar).length > 4) { tcount += 2; } else { tcount++; }
        }

        document.getElementById(InICountView).value = tcount;
        if(tcount>InIChrLenght) {
                reserve = tcount-InIChrLenght;
                alert("이 내용은 "+InIChrLenght+"바이트 이상 입력 하실수 없습니다.\n쓰신 내용은 "+reserve+"바이트가 초과되었습니다.\n초과된 부분은 자동으로 삭제됩니다."); 
                InIcutText();
        return;
        }        

}

function InIcutText()
{
        InInets_check(document.getElementById(InIChrValue).value);
}

function InInets_check(aquery)
{

        var tmpStr;
        var temp=0;
        var onechar;
        var tcount;
        tcount = 0;

        tmpStr = new String(aquery);
        temp = tmpStr.length;

        for(k=0;k<temp;k++)
        {
                onechar = tmpStr.charAt(k);

                if(escape(onechar).length > 4) {
                        tcount += 2;
                } else {
                        // 엔터값이 들어왔을때 값(rn)이 두번실행되는데 첫번째 값(n)이 들어왔을때 tcount를 증가시키지 않는다.
                        if(escape(onechar)=='%0A') {
                        } else {
                                tcount++;
                        }
                }

                if(tcount>InIChrLenght) {
                        tmpStr = tmpStr.substring(0,k);
                        break;
                }

        }
        document.getElementById(InIChrValue).value = tmpStr;
        InIcal_byte(tmpStr);

}

function InIcal_pre2(Chr,ch,CntView){
        InIChrLenght=ch;
		InIChrValue=Chr;
		InICountView=CntView;
        var tmpStr;

        tmpStr = document.getElementById(InIChrValue).value;
        InIcal_byte2(tmpStr);
}

function InIcal_byte2(aquery) 
{
        var tmpStr;
        var temp=0;
        var onechar;
        var tcount;
        tcount = 0;

        tmpStr = new String(aquery);
        temp = tmpStr.length;

        for (k=0;k<temp;k++)
        {
                onechar = tmpStr.charAt(k);
                if (escape(onechar) =='%0D') { } else if (escape(onechar).length > 4) { tcount += 2; } else { tcount++; }
        }

        document.getElementById(InICountView).innerHTML = tcount;

		var char_type = document.getElementById('sms_type').value;

        if(tcount>InIChrLenght && char_type=="0") {
			//reserve = tcount-InIChrLenght;
			document.getElementById('sms_gubn').innerHTML = "장문";
			document.getElementById('sms_gubn').style.color = "red";
			document.getElementById('sms_type').value = "5";
			//InIcutText();
        return;
        } 
		if(tcount<=InIChrLenght && char_type=="5") {
			document.getElementById('sms_gubn').innerHTML = "단문";
			document.getElementById('sms_gubn').style.color = "black";
			document.getElementById('sms_type').value = "0";
		}

}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//바이트 단위로 문자열 잘라내기 끝
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



function ININumFormat() {				
	src = window.event.srcElement;
	var n = src.value; /* 입력된 값 불러오기 */ 
	var nlen = n.length; /* 입력된 값의 길이 계산 */ 
	var a = ""; 
	var y = 0; 
	for (var x=nlen; x>=0; x--) {  /* 컴마 제거를 위해 길이 만큼 루프를 거꾸로 돌린다. */ 
		var b = n.charAt(x); 
		if (b != ",") { /* 컴마가 없는 경우에만 숫자를 붙인다 */ 
			if (y%3 == 0 && y != 0){ /* 세자리 마다 컴마를 붙인다. */ 
				a = b + "," + a 
				y++; 
			} else 	{ 
				a = b + a; 
				y++; 
			} 
		} 
	} 
	src.value = a; 
}

// 숫자 3자리마다 , 넣기
function comma_input(soli,where) { 
	var moneyorg = soli.value; /* 입력된 값 불러오기 */ 
	var moneyorglen = moneyorg.length; /* 입력된 값의 길이 계산 */ 
	var money = ""; 

	if(where == 1){// 백스페이스를 눌렀을경우 
		var y = -1; 
		moneyorglen--; 
	}else{ 
		var y = 0; 
	} 
	//alert(moneyorg); 
	for (var x=moneyorglen; x>=0; x--)  /* 컴마 제거를 위해 길이 만큼 루프를 거꾸로 돌린다. */ 
	{ 
		var moyo = moneyorg.charAt(x); 

		if (moyo != ",")  /* 컴마가 없는 경우에만 숫자를 붙인다 */ 
		{ 
			if (y%3 == 0 && y != 0) /* 세자리 마다 컴마를 붙인다. */ 
			{ 
				money = moyo + "," + money 
				y++; 
			} 
			else 
			{ 
				money = moyo + money; 
				y++; 
			} 
		}      
	} 
	soli.value = money; 
}

function ININumFormat2(num) {				
	var n = num.toString();
	var nlen = n.length; /* 입력된 값의 길이 계산 */ 
	var a = ""; 
	var y = -1; 
	for (var x=nlen; x>=0; x--) {  /* 컴마 제거를 위해 길이 만큼 루프를 거꾸로 돌린다. */ 
		var b = n.charAt(x); 
		if (b != ",") { /* 컴마가 없는 경우에만 숫자를 붙인다 */ 
			if (y%3 == 0 && y != 0){ /* 세자리 마다 컴마를 붙인다. */ 
				a = b + "," + a 
				y++; 
			} else 	{ 
				a = b + a; 
				y++; 
			} 
		} 
	} 
	return a; 
}


// 숫자 , 지우기
function NumCommaDel(no) {
	var newno = parseInt(no.replace(/,/gi,''));
	if(isNaN(newno)) {
		newno = 0;
	}
	return newno;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//3자리 수마다 콤마 넣기  2010-01-27 남형진
//<input type="text" onkeyup="onlyNum(this);this.value=this.value.comma();" value='1,000,000' /> //
///////////////////////////////////////////////////////////////////////////////////////////////////
String.prototype.comma = function() {
    tmp = this.split('.');
    var str = new Array();
	var nrt='';
    var v = tmp[0].replace(/,/gi,'');

	var nrtV=v*1;
	if(nrtV<0 ){
		nrt='-';
	    var v = v.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 =nrt + str.reverse().join('').replace(/\./gi,',');
    return (tmp.length==2) ?  str + '.' + tmp[1] : str;
}

function onlyNum(obj) {
    var val = obj.value;
    var re = /[^0-9\.\,\-]/gi;
    obj.value = val.replace(re, '');
}

function INIHiddenId() {	
	try{document.getElementById('INI_WeddingHallPhoto').style.display="none";}catch(ex){}
	try{document.getElementById('bbs_search_combo').style.display="none";}catch(ex){}
	try{document.getElementById('BGH_Theme').style.display="none";}catch(ex){}
	try{document.getElementById('BUS_Gubn').style.display="none";}catch(ex){}
	try{document.getElementById('MemWed').style.display="none";}catch(ex){}	
	try{document.getElementById('scheduleSelect').style.display="none";}catch(ex){}			// 스케쥴 관리 결혼예정일
	try{document.getElementById('MyBudget').style.display="none";}catch(ex){}				// 일정짜기. 예상 일정
	//메인페이지
	try{document.getElementById('MainWeddingCombo1').style.display="none";}catch(ex){}
	try{document.getElementById('MainWeddingCombo2').style.display="none";}catch(ex){}
	try{document.getElementById('MainWeddingCombo3').style.display="none";}catch(ex){}
	try{document.getElementById('MainWeddingCombo4').style.display="none";}catch(ex){}
	try{document.getElementById('MainWeddingCombo5').style.display="none";}catch(ex){}
}
function INIShowId() {
	try{document.getElementById('INI_WeddingHallPhoto').style.display="";}catch(ex){}
	try{document.getElementById('bbs_search_combo').style.display="";}catch(ex){}
	try{document.getElementById('BGH_Theme').style.display="";}catch(ex){}
	try{document.getElementById('BUS_Gubn').style.display="";}catch(ex){}
	try{document.getElementById('MemWed').style.display="";}catch(ex){}	
	try{document.getElementById('scheduleSelect').style.display="";}catch(ex){}
	try{document.getElementById('MyBudget').style.display="";}catch(ex){}
	//메인페이지
	try{document.getElementById('MainWeddingCombo1').style.display="";}catch(ex){}
	try{document.getElementById('MainWeddingCombo2').style.display="";}catch(ex){}
	try{document.getElementById('MainWeddingCombo3').style.display="";}catch(ex){}
	try{document.getElementById('MainWeddingCombo4').style.display="";}catch(ex){}
	try{document.getElementById('MainWeddingCombo5').style.display="";}catch(ex){}
}

function ConsulGubn(ch) {
	var consulgubn="";
	switch(ch) {
		case 'FCG' : consulgubn = "무료상담신청"; break;
		case 'CCG' : consulgubn = "방문상담신청"; break;
		case 'NCG' : consulgubn = "우선예약상담"; break;
		case 'SCG' : consulgubn = "소개고객 상담"; break;
		case 'BUD' : consulgubn = "예산짜기 상담"; break;
		case 'WHC' : consulgubn = "웨딩홀 상담"; break;
		case 'WHE' : consulgubn = "웨딩홀 이벤트 상담"; break;
		case 'PCG' : consulgubn = "플래너 상담"; break;
		case 'EVT' : consulgubn = "이벤트 상담"; break;
		case 'HON' : consulgubn = "무료허니문 견적"; break;
		case 'QIC' : consulgubn = "빠른상담신청"; break;
		case 'PSQ' : consulgubn = "임직원서비스 상담"; break;
		case 'ETC' : consulgubn = "상담신청"; break;
	}
	return consulgubn;
}


// banner_roll("div태그 id", 배너1개높이, 딜레이, 1칸이동속도, 0); 
function banner_roll(div_id, banner_height, banner_delay, banner_speed, this_height){ 
	if(eval(div_id + "_mouseEvent")){ 
		var div_tag = document.getElementById(div_id); 
		var a_tag, i; 
		this_height++; 
		if(this_height < banner_height){ 
			div_tag.style.top = -this_height; 
			setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ");", banner_speed); 
		} 
		else{ 
			a_tag = div_tag.getElementsByTagName("TABLE"); 
			div_tag.appendChild(a_tag[0]); 
			div_tag.style.top = 0; 
			setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", 0);", banner_delay); 
		} 
	} 
	else{ 
		setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ");", banner_speed); 
	} 
	return true; 
} 


//정성혜  아이니웨딩 약도 팝업 띄우기
function ViewLocation() {
	window.open("/INIwedding/location.htm","","width=690,height=320, menubars=no, scrollbars=no");
}

//정성혜  1주년 초대전 신청폼 팝업 띄우기
function ViewInvite() {
	window.open("/event/eventBanner/20091008invite/popup_invite.htm","","width=644,height=500, menubars=no, scrollbars=no");
}

//정성혜  2009 사랑받는 허니문 BEST 5
function ViewHoneymoon() {
	window.open("/event/eventBanner/20090814honeymoon/popup_honeymoon.htm","","width=644,height=550, menubars=no, scrollbars=no");
}

function CheckStr(temp_str, temp_type) {
	// temp_str : 입력데이터
	// temp_type : 체크타입  HAN-한글만 입력가능, HP-숫자와 '-'만 입력가능(전화번호)
	var Hpattern = /[^가-힣]+$/;	
	var Npattern = /[^0-9-]+$/;

	if(temp_type =='HAN') {		
		if(Hpattern.test(temp_str)) {
			return false;
		}
	}
	if(temp_type=='HP') {
		if(Npattern.test(temp_str)) {
			return false;
		}
	}
}
/////////////////////////////////////////////////////
//웨딩컬렉션, 임직원 컬렉션 상담 뛰우기
/////////////////////////////////////////////////////
function WeddingConsulting(ConsulGubn, PKGGubn, MB_ID) {
	//code    : CFG,CCG,NCG,ETC,EVT 등
	//PL_code : 플레너 코드
	//csgubn  : 코멘트내용(기타 문의 사항)
	//EvtCode :
	var Cwidth = 500;
	//var Cheight = '510';
	var Cheight = '610';
	if(LoginMemberID==''){
		var Cheight = '610';
		//var Cheight = '520';
	}
	var CTop  = (screen.height-Cheight)/2;
	var CLeft = (screen.width-Cwidth)/2 ;
	var Curl = "/consultation/WeddingConsult.htm?ConsulGubn="+ConsulGubn+"&PKGGubn="+PKGGubn; 
	window.open(Curl,'con','top='+CTop+',left='+CLeft+',width='+Cwidth+',height='+Cheight+',menubars=no, scrollbars=no');
}

// 이메일 select 선택시
function selEmail(v, targetID, hiddenID) {
	// v = 선택한 이메일 값
	// targetID = 선택한 이메일이 입력될 곳
	// hiddenID = 숨길 select 창 ID
	if(v != '') {
		document.getElementById(targetID).value = v;
		document.getElementById(hiddenID).style.display = "none";
	}
}


// 코멘트창 띄우기
function NewMSG(CCode,BCode) {
	var WLeft = (document.body.clientWidth/2)-250;
	var WTOP  =  (document.body.clientHeight/2)-100;
	var url = '/_admin/Contract/BUS_CommentList.php?ConsulCaller_Code='+CCode+'&BUS_Code='+BCode;
	var Wname = 'Comment';
	var opt = 'width=600, height=400, scrollbars=no, menubars=no, top='+WTOP+', left='+WLeft;
	window.open(url,Wname,opt);
}
function setPng24(obj) {
	obj.width=obj.height=1; 
	obj.className=obj.className.replace(/\bpng24\b/i,''); 
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"; 
	obj.src=''; 
	return ''; 
}

function strTrim(str)
{
	var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
	str = str.replace(pattern, "");
	return str;
}
function isNumberKey(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode;
	if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;

	return true;
}
