﻿
// 탭 변경1
function LayerShowTab(ViewID , Id_Array)
{
    var Id_Ar = Id_Array.split(",");
    for(var ii = 0 ; ii < Id_Ar.length ; ii++)
    {
        var IdVar = "#"+Id_Ar[ii];
        var ImgSrc = "";
 
        if(ViewID == Id_Ar[ii])
        {
            $(IdVar).show();
		    try
		    {
		    //BtnTabOut_G.gif(선택) /BtnTabOut_P.png(비선택)
		        ImgSrc = $(IdVar + "_Img").attr("src").replace("BtnTabOut_G.gif","BtnTabOut_P.png");
		        ImgSrc = ImgSrc.replace("BtnTabOut_P.png","BtnTabOut_G.gif");
		    }
		    catch(e)
		    {}
        }
        else
        {
            $(IdVar).hide();
		    try
		    {
		    ImgSrc = $(IdVar + "_Img").attr("src").replace("BtnTabOut_G.gif","BtnTabOut_P.png");
		    }
		    catch(e)
		    {}
        }
         
        try
        {
            $(IdVar + "_Img").attr({ src: ImgSrc });
        }
        catch(e)
        {}

		        
    }
}

// 탭 변경2
function LayerShowTab2(ViewID , Id_Array)
{
    var Id_Ar = Id_Array.split(",");
    for(var ii = 0 ; ii < Id_Ar.length ; ii++)
    {
        var IdVar = "#"+Id_Ar[ii];
        var ImgSrc = "";
 
        if(ViewID == Id_Ar[ii])
        {
            $(IdVar).show();
		    try
		    {
		    //BtnTabOver.gif(선택) /BtnTabOut_B.png(비선택)
		        ImgSrc = $(IdVar + "_Img").attr("src").replace("BtnTabOver.gif","BtnTabOut_B.gif");
		        ImgSrc = ImgSrc.replace("BtnTabOut_B.gif","BtnTabOver.gif");
		    }
		    catch(e)
		    {}
        }
        else
        {
            $(IdVar).hide();
		    try
		    {
		    ImgSrc = $(IdVar + "_Img").attr("src").replace("BtnTabOver.gif","BtnTabOut_B.gif");
		    }
		    catch(e)
		    {}
        }
         
        try
        {
            $(IdVar + "_Img").attr({ src: ImgSrc });
        }
        catch(e)
        {}        
    }
}


// 탭 변경3
function LayerShowTab3(ViewID , Id_Array)
{
    var Id_Ar = Id_Array.split(",");
    for(var ii = 0 ; ii < Id_Ar.length ; ii++)
    {
        var IdVar = "#"+Id_Ar[ii];
        var ImgSrc = "";
        
        if(ViewID == Id_Ar[ii])
        {
            $(IdVar).show();
        }
        else
        {
            $(IdVar).hide();
        }     
    }
}













function getVersion()	// 익스플로러 버젼을 float 로 얻어온다.
{
	version_str = new String(clientInformation.appVersion);
	index = version_str.lastIndexOf("MSIE ") + 5;
	return ( parseFloat( version_str.substring(index, version_str.length) ) );
}

var DropDown_ClientVer = getVersion();

function richDropDownShow(box)
{
//	alert(box);
//	if(box="fList") box = "fList";
  document.all[box].style.visibility = 'visible';

}

function richDropDownHide(box)
{
//	alert(box);
//	if(box="fList") box = "fList";
  if( window.event.toElement == null )  // 윈도우 간 이동시 애러 방지
	return;

  if( window.event.toElement.id != box && window.event.toElement.id != box+"Item")
	  document.all[box].style.visibility = 'hidden';
}

 

function effect_on( target,bgcolor )
{
	if (DropDown_ClientVer > 5.5)	// 버젼에 따라서 배경색 변경 효과를 준다.
		target.style.filter='progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FED8D1, EndColorStr=#FFFFFF);';
	else
		target.style.background = bgcolor;
}

function effect_off( target,bgcolor )
{
	if (DropDown_ClientVer > 5.5)
		target.style.filter="";
	else
		target.style.background = bgcolor;
}

// 롤오버이미지
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Brand 레이어
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//상품후기 보이기 감추기
function ShowHideColumn (strTableID) {
  var objTable = document.all ? eval('document.all.' + strTableID) : document.getElementById(strTableID);
	if(objTable.style.display == "none"){
		objTable.style.display = 'block';
	}else{
		objTable.style.display = 'none';
	}
}

//새창
function OpenWin(TargetUrl,WinName,W,H,S){
 	var OpenWin = window.open(TargetUrl,WinName,'top=0,left=0,resizable=no,width=' + W + ',height=' + H + ',scrollbars=' + S);
	OpenWin.focus();
 }

//게시판 리스트에 마우스 오버 아웃 시 배경색상 변경
function bgChange(TheRow,ChangeColor){
  TheRow.style.background = ChangeColor;
}

// 값이 존재하는지만 체크(공백제거 안함)
function ChkType_1(frmEle) {
	var val = frmEle.value;
	var len = val.length;

	if (len == 0) {
		return true;
	}

	if (val.replace(/\s/g,"") == "") {		// 공백만 입력되었을때
		return true;
	}

	for (i = 0;i < len ;i++ ) {		// 문자의 길이만큼 루프를 돌며 공백을 제외하고 문자가 나오면 바로 종료
		if (val.charAt(i) != " ") {
			return false;
		}
	}
	return true;
}

// 값이 존재하는지 체크하고 앞뒤 공백제거후 반환
function ChkType_2(frmEle) {
	var val = frmEle.value;
	var len = val.length;
	var cnt = 0;

	if (len == 0) {		// 아무값도 입력되지 않았을때
		return true;
	}
	if (val.replace(/\s/g,"") == "") {		// 공백만 입력되었을때
		return true;
	}
	for (i = 0;i < len ;i++ ) {		// 문자의 길이만큼 루프를 돌며 공백을 제외하고 처음 나오는 문자까지의 길이 조회
		if (val.charAt(i) != " ") {
			cnt = i;
			break;
		}
	}
	if (cnt != 0) {		// 앞쪽에 공백이 있다면
		val = val.substring(cnt,len); 		// 앞쪽 공백을 제외한 나머지 값을 저장
		len = val.length;
	}
	for (i = len-1;i > 0 ;i-- ) {		// 오른쪽부터 좌측으로 공백이 아닌 처음 문자위치 조회
		if (val.charAt(i) != " ") {
			cnt = i;
			break;
		}
	}
	if (cnt != len) {
		val = val.substring(0,cnt+1);		// 우측 공백 제외
	}
	frmEle.value = val;		// 좌우측 공백 제외한 값을 폼에 저장
	return false;

}

// 공백체크(비밀번호같이 공백이 있어서는 안되는 형식)
function ChkType_3(frmEle) {
	var val = frmEle.value;
	frmEle.value = val.replace(/\s/g,"");
	val = val.replace(/\s/g,"");

	if(!(/^[^\s]+$/.test(val))) {
		return true;	// 공백이 있을때
	}
	return false;
}

// 문자,숫자형식체크(아이디 같이 문자와 숫자만으로 되어 있는지 체크)
function ChkType_4(frmEle) {
	var val = frmEle.value;
	frmEle.value = val.replace(/\s/g,"");
	val = val.replace(/\s/g,"")

	if(!(/^[a-zA-Z0-9]+$/.test(val))) {
		return true;	// 문자와 숫자가 아닐때
	}
	return false;
}

// 문자형식체크(알파벳만으로 되어 있는지 체크)
function ChkType_5(frmEle) {
	var val = frmEle.value;
	frmEle.value = val.replace(/\s/g,"");
	val = val.replace(/\s/g,"")

	if(!(/^[a-zA-Z]+$/.test(val))) {
		return true;	// 알파벳이 아닐때
	}
	return false;
}

// 숫자형식체크(숫자만으로 되어 있는지 체크)
function ChkType_6(frmEle) {
	var val = frmEle ;
	val = val.replace(/\s/g,"")

	if(!(/^[0-9]+$/.test(val))) {
		return true;	// 숫자가 아닐때
	}
	return false;
}

// 주민등록번호 체크(하나의 텍스트박스에 '-' 포함해서 쓸때. 만약 안쓰면 ChkType_6 을 사용)
function ChkSSN(frmEle) {
	var val = frmEle.replace(/\s/g,"");

 if (!(/^\d{6}-\d{7}$/.test(val))) {		// 한칸에 '-' 포함 쓸때
		return true;
	}

	return false;
}

// 이메일 형식 검사
function ChkEmail(frmEle) {
	var val = frmEle.value;
	frmEle.value = val.replace(/\s/g,"");
	val = val.replace(/\s/g,"")

// 정규식 설명:
// 처음값은 '_',숫자,대소문자알파벳,'-'만 들어가고 그 문자가 한번이상 나오고
// 그 다음은 '.'은 연속해서 나올수 없고 '.' 다음에는 반드시 '_',숫자,대소문자알파벳,'-'이 한번이상 들어가야하고 ex) -a.b.c (O), -a.b..c(x) 이 합쳐진 문자열(ex)-a.b.c)들이 0번 또는 여러번 나오고
// 그 다음은 '@'이가 한번 나오고
// 그 다음은 숫자,대소문자알파벳,'-'이 한번이상 나오고
// 그 다음은 점이 한번이상 나오고
// 그 다음은 알아서 나옴.(쓰기 귀찮음)
	if(!(/^[_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+)*@[0-9a-zA-Z-]+(\.)+([0-9a-zA-Z-]+)([\.0-9a-zA-Z-])*$/.test(frmEle.value))) {
		return true;
	}
	return false;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//
//	주민등록번호 형식 검사
//
///////////////////////////////////////////////////////////////////////////////////////////////////
function CheckSsn(headNum,tailNum) {	// 앞 6자리, 뒤 7자리

	var h1=headNum.substring(0,1);
	var h2=headNum.substring(1,2);
	var h3=headNum.substring(2,3);
	var h4=headNum.substring(3,4);
	var h5=headNum.substring(4,5);
	var h6=headNum.substring(5,6);

	var hap = h1*2 + h2*3 + h3*4 + h4*5 + h5*6 + h6*7;

	var t1=tailNum.substring(0,1);
	var t2=tailNum.substring(1,2);
	var t3=tailNum.substring(2,3);
	var t4=tailNum.substring(3,4);
	var t5=tailNum.substring(4,5);
	var t6=tailNum.substring(5,6);
	var t7=tailNum.substring(6,7);

	hap = hap + t1*8 + t2*9 + t3*2 + t4*3 + t5*4 + t6*5;

	hap=hap%11;
	hap=11-hap;
	hap=hap%10;

	if (hap != t7){
        return true; // 형식에 맞지 않을때
    } else {
		return false;	// 형식에 맞을때
	}
}

// 외국인 등록번호 검사
function Check_fgnno(fgnno) {
        var sum=0;
        var odd=0;
        buf = new Array(13);
        for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); }
        odd = buf[7]*10 + buf[8];
        if(odd%2 != 0) { return false; }
        if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) {
                return false;
        }
        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]); }
        sum = 11 - (sum%11);
        if(sum >= 10) { sum -= 10; }
        sum += 2;
        if(sum >= 10) { sum -= 10; }
        if(sum != buf[12]) { return true }		// 형식에 맞지 않을때
        return false;							// 형식에 맞을때
}

//	새창띄우기
function WinPopUp(theURL,winName,winWidth,winHeigth,lftPosi,rigPosi,sclOnOff){
	  var WinPopUp = window.open(theURL, winName, 'width='+winWidth+',height='+winHeigth+',left='+lftPosi+',top='+rigPosi+',fullscreen=no,titlebar=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars='+sclOnOff+',resizable=no');
	  WinPopUp.focus();
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//
//	체크박스의 체크된 개수 반환
//
///////////////////////////////////////////////////////////////////////////////////////////////////
function chkCheckBox(theForm, theName) {
	var frmEle = theForm.elements;
	var eleLen = frmEle.length;
	var chkCount = 0;

	for (var i=0;i<eleLen;i++) {
		if (frmEle[i].name == theName) {
			if (frmEle[i].checked) {
				chkCount++;
			}
		}
	}
	return chkCount;
}

//포커스 이동
function moveFocus(num,fromform,toform)
{
	var str = fromform.value.length;
	if ( str == num )
	toform.focus();
}

//회원 금지 아이디 비교(회원 가입할때만 사용)
function ForbiddenUserID(UserID) {
	UserID = UserID.toLowerCase();

	if (UserID.indexOf("master") != -1 || UserID.indexOf("admin") != -1 || UserID.indexOf("buyguest") != -1){
		return true;  // 사용불가능
	}

	return false;	// 사용가능
}

/*
	if (ForbiddenUserID(theform.UserID.value)) {
		alert("입력하신 아이디는 사용할수 없습니다.	");
		theform.UserID.select();
		return false;
	}
*/

//--------------------------------------------------------
//작성자 : 행복지킴이
//작성일 : 2004.11.05
//주내용 : 공지사항 및 이벤트게시판관련
//--------------------------------------------------------


//공지사항과 이벤트를 변경하면서 보여줌
function ChangeNoticeOrEvent(sw)
{
	if(sw == "E")	//이벤트보기
	{
		document.all.News.src="http://image.halfclub.com/Images_Templet/title/M_News.gif"
		document.all.Event.src="http://image.halfclub.com/Images_Templet/title/M_Event_On.gif"
		document.all.DivMainNotice.style.display = "none";
		document.all.DivMainEvent.style.display = "";
	}
	else if(sw == "N") //공지사항보기
	{
		document.all.News.src="http://image.halfclub.com/Images_Templet/title/M_News_On.gif"
		document.all.Event.src="http://image.halfclub.com/Images_Templet/title/M_Event.gif"
		document.all.DivMainEvent.style.display = "none";
		document.all.DivMainNotice.style.display = "";
	}
}
 

// 라디오버튼의 체크유무 확인
function RadioIsChecked(rd)
{
	for(i = 0 ; i < rd.length; i++)
	{
		if(rd[i].checked)
		{
			return true;
		}
	}
	return false;
}


/*
// 플래시 호출 flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드)
function flashWrite(url,w,h,id,bg,vars,win){
	// 플래시 코드 정의
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always'>"+
	"<param name='movie' value='"+url+"'>"+
	"<param name='FlashVars' value='"+vars+"'>"+
	"<param name='wmode' value='"+win+"'>"+
	"<param name='menu' value='false'>"+
	"<param name='quality' value='high'>"+
	"<param name='bgcolor' value='"+bg+"'>"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>"+
	"</object>";

	// 플래시 코드 출력
	document.write(flashStr);
}
*/

// 플래시 호출 flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드)
function flashWrite(url,width,height){
	// 플래시 코드 정의
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always'>"+
	"<param name='movie' value='"+url+"'>"+
	"<param name='menu' value='false'>"+
	"<param name='quality' value='high'>"+
	"<param name='bgcolor' value='#FFFFFF'>"+
	"<param name='wmode' value='transparent'>"+
	"<embed src='"+url+"' menu='false' quality='high' width='"+width+"' height='"+height+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>"+
	"</object>";

	// 플래시 코드 출력
	document.write(flashStr);
}

// 쿠키값 저장
function SetCookie(name,value,expireday){
	var pop_today = new Date();
	//alert(pop_today.toGMTString());
	pop_today.setDate(pop_today.getDate() + expireday);
	//alert(pop_today.toGMTString());

	if(expireday != "")
		document.cookie = name + "=" + escape(value) + "; path=/; expires=" + pop_today.toGMTString() + ";";
	else
		document.cookie = name + "=" + escape(value) + "; path=/;";
}

// 쿠키값 가져오기
function getCookie(name)
{
	var nameOfCookie = name + "=";
	var x = 0;
	//alert(document.cookie);
	while (x <= document.cookie.length)
	{
		var y = (x+nameOfCookie.length);
		//alert(x +","+ y);alert(document.cookie.substring( x, y ));
		if(document.cookie.substring(x,y) == nameOfCookie){
			if((endOfCookie=document.cookie.indexOf( ";", y )) == -1){
				//alert(endOfCookie);
				endOfCookie = document.cookie.length;
			}
			//alert(unescape( document.cookie.substring( y, endOfCookie ) ));
			return unescape(document.cookie.substring(y,endOfCookie));
		}
		x = document.cookie.indexOf(" ",x) + 1;
		if(x == 0)
			break;
	}
	return "";
}

/*----------------------------------------------------------------------------------------
'	개발자/개발일시	: 개발팀 이효준 / 2006. 08. 89
'	주 내 요		: 객체의 document를 기준으로 하는 x 좌표를 가져옴
'	수정자/수정일시	:
'	수정 내용		:
----------------------------------------------------------------------------------------*/
function controlGetX (obj)
{
    var x = 0;
    do
    {
        x += obj.offsetleft;
        obj = obj.offsetParent;
    }
    while (obj);
    return x;
}

/*----------------------------------------------------------------------------------------
'	개발자/개발일시	: 개발팀 이효준 / 2006. 08. 89
'	주 내 요		: 객체의 document를 기준으로 하는 y 좌표를 가져옴
'	수정자/수정일시	:
'	수정 내용		:
----------------------------------------------------------------------------------------*/
function controlGetY (obj)
{
    var y = 0;
    do
    {
        y += obj.offsettop;
        obj = obj.offsetParent;
    }
    while (obj);
    return y;
}
/*
'############################################
'#
'#	개발자/개발일시	: 개발팀 이효준 / 2006. 02. 27
'#	수정자/수정일시	:
'#	페이지 설명		: 하프클럽 메인페이지에서의 상품 로테이션에 쓰임
'#	수정 내용		:
'#
'############################################

	// 사용예제

	<table border="1" width="100%">
		<tr>
			<td><a href="javascript:NA.uprev();">이전</a></td>
			<td>
				<script language="javascript">
				NA					= new HMRolling();
				NA.name				= "NA";
				NA.scrollspeed		= 3000;
				NA.itemdivision		= 5;
				NA.AutoRepli		= true;
				NA.AutoRolling		= true;
				NA.pausemouseover	= true;
				NA.HeaderText		= '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>';
				NA.FooterText		= '</tr></table>';
				NA.add("<td>1</td>");
				NA.add("<td>2</td>");
				NA.add("<td>3</td>");
				NA.add("<td>4</td>");
				NA.add("<td>5</td>");
				NA.add("<td>6</td>");
				NA.add("<td>7</td>");
				NA.start();
				</script>
			</td>
			<td><a href="javascript:NA.unext();">다음</a></td>
		</tr>
	</table>

*/

function HMRolling()
{
	this.version = "1.0.6.0227";
	this.name = "HMRolling";			// 객체생성시 생성된 객체의 인스턴트 명을 이용
	this.HeaderText = "";				// 테이블 시작태그	예) <table><tr>
	this.FooterText = "";				// 테이블 끝태그	예) </tr></table>

	this.item = new Array();			//외부에서 add함수로 들어오는 아이템을 담는 변수
	this.itemcount = 0;
	this.mitem = new Array();			//내부적으로 사용됨[itemdivision에 의하여 객수가 결정됨]
	this.mitemcount = 0;
	this.curmitemidx = 0;
	this.itemdivision = 5;				// 레이어 갯수

	this.AutoRepli = true;				// true면 빈자리를 채운다
	this.AutoRolling = true;			// true면 레이어 Rolling

	this.ContentType = "full";			//full : 보이는 부분전체가 롤링되는 경우, private:하나의 아이템씩 로링되는 경우

	this.currentspeed = 0;
	this.scrollspeed = 1000;			// 움직이는 속도, 1000 = 1초
	this.pausedelay = 1000;

	this.pausemouseover = false;		// true면 마우스를 갖다댈때 멈춘다
	this.stop = false;

	this.add = function()
	{
		var text = arguments[0];
		this.item[this.itemcount] = text;
		this.itemcount = this.itemcount + 1;
	}//add
	this.start = function()
	{
		//아이템이 없는경우
		if(this.itemcount == "")
		{
			return;
		}


		var curitemidx = 0;		//마스트 아이템을 등록함
		var contents = "";		//출력될 내용
		var lp; 				//최대마스트 아이템수 계산
		//full 전체가 롤링되는 경우
		if(this.ContentType == "full")
		{
			//레이어의 갯수 구하기
			if(this.itemcount % this.itemdivision == 0)
			{
				lp = parseInt(this.itemcount / this.itemdivision);
			}
			else
			{
				lp = parseInt(this.itemcount / this.itemdivision) + 1;
			}
			//레이어 적용하기
			for(i = 0 ; i < lp ; i++)
			{
				for(j = 0 ; j < this.itemdivision ; j ++)
				{

					if(curitemidx >= this.itemcount)
					{
						if (this.AutoRepli == false)
						{
							break;
						}
						else
						{
							curitemidx = 0;
						}
					}
					contents += this.item[curitemidx];
					curitemidx++;
				}
				this.mitem[i] = contents;
				contents = ""
				this.mitemcount = this.mitemcount + 1;
			}
		}
		//그외는 모두 하나의 아이템씩 롤링되는 경우로 처리됨
		else
		{
			curitemidx = 0;
			for(i = 0 ; i < this.itemcount ; i++)
			{
				for(j = 0 ; j < this.itemdivision ; j ++)
				{
					if((i+j) < this.itemcount)
					{
						contents += this.item[i+j];
					}
					else
					{
						contents += this.item[(i+j) % this.itemcount];
					}
				}
				this.mitem[i] = contents;
				contents = "";
				this.mitemcount = this.mitemcount + 1;
			}

		}
		this.display();
		this.currentspeed = this.scrollspeed;
		this.stop = true;
		setTimeout(this.name+'.rolling()',this.currentspeed);
		window.setTimeout(this.name+".stop = false", this.pausedelay);
	}//start
	this.display = function()
	{
		document.write('<div id="'+this.name+'" style="position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">');
		document.write(this.HeaderText);
		document.write(this.mitem[0]);
		document.write(this.FooterText);
		document.write('</div>');
	}//display
	this.rolling = function()
	{
		if(this.AutoRolling == false) return;

		if (this.stop == false)this.next();
		window.setTimeout(this.name+".rolling()",this.scrollspeed);
	}//rolling
	this.next = function()
	{
		if(this.curmitemidx >= this.mitemcount - 1)
		{
			this.curmitemidx = 0;
		}
		else
		{
			this.curmitemidx++;
		}
		var obj = document.getElementById(this.name);
		var contents = "";
		contents = this.HeaderText;
		contents += this.mitem[this.curmitemidx];
		contents += this.FooterText;
		obj.innerHTML = contents;

	}//next
	this.move = function(lngTab)
	{
		var obj = document.getElementById(this.name);
		var contents = "";
		contents = this.HeaderText;
		contents += this.mitem[lngTab-1];
		contents += this.FooterText;
		obj.innerHTML = contents;

	}//next
	
	
	this.prev = function()
	{
		if((this.curmitemidx) <= 0)
		{
			this.curmitemidx = this.mitemcount - 1;
		}
		else
		{
			this.curmitemidx--;
		}
		var obj = document.getElementById(this.name);
		var contents = "";
		contents = this.HeaderText;
		contents += this.mitem[this.curmitemidx];
		contents += this.FooterText;
		obj.innerHTML = contents;
	}//prev
	this.unext = function ()
	{
		this.onmouseover();
		this.next();
		window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}//unext
	this.uprev = function ()
	{
		this.onmouseover();
		this.prev();
		window.setTimeout(this.name+".onmouseout()",this.pausedelay);
	}//uprev
	this.onmouseover = function()
	{
		if(this.pausemouseover) this.stop = true;
	}//onmouseover
	this.onmouseout = function()
	{
		if(this.pausemouseover) this.stop = false;
	}//onmouseout
}//HMScroll


/*
'############################################
'#
'#	개발자/개발일시	: 개발팀 이동석 / 2006. 08. 28
'#	수정자/수정일시	:
'#	페이지 설명		: 텍스트 스크롤에 쓰임(카테고리 페이지)
'#	수정 내용		:
'#
'############################################

	// 사용예제

	<table border="1" width="100%">
		<tr>
			<td>

				<div id='scr' style="width:347px; height:50px; position:relative; top:0px; left:0px; visibility:visible; border: 0px #000000 solid; overflow:hidden;" onMouseover="SC.isMove=false" onMouseout="SC.isMove=true">

					<SCRIPT LANGUAGE="JavaScript">
						SC				= new HMSrolling();
						SC.name			= "SC";
						SC.divName		= "scr_";
						SC.lineHeight	= 24;
						SC.showLines	= 3;
						SC.delayNum		= 20;
						SC.sleepCnt		= 3;
						SC.add("aaaaaaa");
						SC.add("bbbbbbb");
						SC.add("ccccccc");
						SC.add("ddddddd");
						SC.setScrl();
					</SCRIPT>

				</div>

			</td>
		</tr>
	</table>

*/

function HMSrolling()
{
	// 수정가능한 변수
	this.name = "HMSrolling";
	this.lineHeight = 24;		// 줄간격(숫자가 클수록 멀리 떨어짐)
	this.showLines = 3;			// 한번에 보여줄 줄의 개수(화면엔 항상 여기서 지정한 수만큼의 줄만 보인다. (이값을 변경하면 아래에 있는 <div id='scr' style="width:500px; height:40px 에서 height 값을 적당히 변경해야 보임
	this.delayNum = 20;			// 스크롤 속도 : 1 ~ 1000 (1 이 제일 빠르고 1000 이 제일 느림)
	this.sleepCnt = 3;			// 스크롤이 멈춰있는시간 (단위 : 초) -> 많을수록 멈춰있는시간이 길어짐
	this.divName = "scr_";

	// 수정불가능한 변수
	this.resetSleepCnt = this.sleepCnt;
	this.isMove = true;			// 스크롤이 진행이 되는지여부 (true : 진행, false : 멈춤)
	this.aryText = new Array();	// 스크롤이 될 문장들이 담길 변수
	this.aryLen = 0;			// 스크롤링되는 문장의 개수
	this.aryDiv = new Array();	// 각각의 Div 를 담는 배열
	this.html = "";
	this.moveTimer = null;
	this.moveLen = 0;
	this.isFirstDiv = 0;		// 현재 가장 위에 있는 div 를 알아보기위한 변수

	this.add = function()
	{
		var text = arguments[0];
		this.aryText[this.aryLen] = text;
		this.aryLen = this.aryLen + 1;
	}//add

	// 스크롤링 보여줌
	this.setScrl = function()
	{
		if (this.aryLen > 0) {
			for (var i = 0;i < this.aryLen ; i++) {
					html = "";
					html = "<div id='"+this.divName+i+"' style='position:absolute;top:"+(this.lineHeight*i)+"px;left:0; visibility:visible;padding-top:2;padding-left:5'>\n";
					html = html + this.aryText[i]+"\n";
					html = html + "</div>";

				document.write(html);		// 저장된 내용을 화면에 출력
				this.aryDiv[i] = eval("document.all."+this.divName+i);
			}

			if (this.aryLen > this.showLines) {
				// 자동스크롤 시작
				this.startScrl();
			}

		} else {
			html = "<table width='100%' align='center' border='0'><tr><td align='center'><BR>내용이 없습니다.</td></tr></table>";
			document.write(html);
		}
	}//setScrl

	// 스크롤링 시작
	this.startScrl = function()
	{
		if (this.isMove) {
			for (var i = 0;i < this.aryLen;i++) {
				this.aryDiv[i].style.pixeltop -= 1;
			}
			this.moveLen++;
			if (this.moveLen >= this.lineHeight) {
				this.moveLen = 0;
				this.aryDiv[this.isFirstDiv].style.pixeltop += this.lineHeight*this.aryLen;
					if (this.isFirstDiv != (this.aryLen-1)) {
						this.isFirstDiv++;
					} else {
						this.isFirstDiv = 0;
					}
				this.sleepTimer();
				return;
			}
		}
		//window.status = isFirstDiv;
		moveTimer = setTimeout(this.name+".startScrl()",this.delayNum);
	}//startScrl

	this.sleepTimer = function()
	{
		this.moveTimer = null;
		this.sleepCnt--;
		if (this.sleepCnt == 0) {
			this.moveTimer = setTimeout(this.name+".startScrl()",this.delayNum);
			this.sleepCnt = this.resetSleepCnt;
			return;
		}
		setTimeout(this.name+".sleepTimer()",1000);
	}//sleepTimer
} //HMSrolling()


 

// 이벤트를 위한 로그인 체크/로그인팝업 띄우기 및 팝업 이동
// 매개변수 : 이벤트 시작일, 종료일, 아이디, 로긴후 이동 URL, 이미 로긴했다면 띄울 팝업, 팝업 가로Size, 팝업 세로Size
function MemberCheck_LoginPopup(startYmd, endYmd, userID, rurl, goPage, pWidth, pHeight)
{
	var ToYmd		= new Date();
	var ToYear		= String(ToYmd.getYear());
	var ToMonth		= String(ToYmd.getMonth() + 1);
	var ToDay		= String(ToYmd.getDate());
	var ToHour		= String(ToYmd.getHours());
	var ToMinute	= String(ToYmd.getMinutes());
	var ToDateTime;

	ToDateTime = ToYear;

	if(ToMonth.length < 2)
		ToDateTime += "0"+ ToMonth
	else
		ToDateTime += ToMonth

	if(ToDay.length < 2)
		ToDateTime += "0"+ ToDay
	else
		ToDateTime += ToDay

	if(ToHour.length < 2)
		ToDateTime += "0"+ ToHour
	else
		ToDateTime += ToHour

	if(ToMinute.length < 2)
		ToDateTime += "0"+ ToMinute
	else
		ToDateTime += ToMinute

	//alert(ToDateTime);

	if(ToDateTime < startYmd)
	{
		alert("아직 이벤트가 시작되지 않았습니다.");
		return;
	}
	else if(ToDateTime > endYmd)
	{
		alert("이벤트가 종료되었습니다.");
		return;
	}

	if(userID == "" || userID == "BuyGuest")
	{
		alert("정회원만 이벤트에 참여할 수 있습니다.")
		LoginWindow("ReturnType=SELF_CLOSE&RefPage=EVENT&Rurl="+ rurl);
		return;
	}
	else
	{
		OpenWin(goPage,'Halfclub_Event', pWidth, pHeight, 0);
	}
}

// 배열체크
function IsArray(Obj)
{
	if(Obj.length > 1)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function onlyNumber() {
  if ((event.keyCode < 48) || (event.keyCode > 57))
	  event.returnValue = false;
}

// 숫자 체크
function checkNum(str) {
    var isNum = true;

    if (str == null || str == "") {
        isNum = false;
        return isNum;
    }

    for (var j = 0; j < str.length; j++) {
        if (str.substring(j, j + 1) != "0"
				&& str.substring(j, j + 1) != "1"
				&& str.substring(j, j + 1) != "2"
				&& str.substring(j, j + 1) != "3"
				&& str.substring(j, j + 1) != "4"
				&& str.substring(j, j + 1) != "5"
				&& str.substring(j, j + 1) != "6"
				&& str.substring(j, j + 1) != "7"
				&& str.substring(j, j + 1) != "8"
				&& str.substring(j, j + 1) != "9") {
            isNum = false;
        }
    }
    return isNum;
}

function checkEmail(str) {

    valid = false;

    if (str == "")
        alert("Email주소를 입력하여 주십시오!!");
    else if (str.indexOf(" ") != -1)
        alert("Email주소에 공백은 허용되지 않습니다!!");
    else if (str.indexOf("@") < 1)
        alert("Email주소 지정이 잘못되었습니다. '@'이 누락되었습니다!!");
    else if (str.indexOf(".") == -1)
        alert("Email주소 지정이 잘못되었습니다. '.'이 누락되었습니다!!");
    else if (str.indexOf(".") - str.indexOf("@") == 1)
        alert("Email주소 지정이 잘못되었습니다. '@' 다음에 바로 '.'이 올 수 없습니다!!");
    else if (str.charAt(str.length - 1) == '.')
        alert("Email주소 지정이 잘못되었습니다. '.'은 Email주소 끝에 올 수 없습니다!!");
    else
        valid = true;

    return valid;

}