function flash_view(flash_name,flash_width,flash_height)
{
	str = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\""+ flash_width +"\" height=\""+ flash_height +"\">"
	 + "<param name=\"movie\" value=\"" + flash_name + "\">"
	 + "<param name=\"quality\" value=\"high\">"
	 + "<param name=wmode value=\"transparent\">"
	 + "<param name=\"menu\" value=\"false\">"
	 + "<param name=\"allowScriptAccess\" value=\"always\">"	 
	 + "<embed src=\"" + flash_name + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+ flash_width +"\" height=\""+ flash_height +"\"></embed>"
	 + "</object>"

	 document.write(str)
}

// 숫자 체크
function chkInteger(Form1) {
	for( i=0 ; i < Form1.value.length ; i++ ) {
		if((Form1.value.charAt(i)<"0") || (Form1.value.charAt(i)>"9")) {  
			alert("숫자만 입력가능합니다."); 
			Form1.value=""
			Form1.focus();
	    return false; 
		} 
		
  } // end for 
	return true;
}

function chkInteger2(Form1) {
	for( i=0 ; i < Form1.value.length ; i++ ) {
		if((Form1.value.charAt(i)<"0") || (Form1.value.charAt(i)>"9")) {  
			alert("Only number."); 
			Form1.value=""
			Form1.focus();
	    return false; 
		} 
		
  } // end for 
	return true;
}

function LengthCheck(str,name,len,d)
{

	var	length=0;
	var	strlen=str.length;
	var	hanlen = len/2;
	
	if(strlen > 0)	{
		for(i=0; i<strlen; i++)
		{
			if(str.charCodeAt(i) >= 128)
					length += 2;   
			else
					length += 1;   
		}

		if(length > len)
		{
			alert( name + " 항목은 "+len+" 자리를 초과할수 없습니다.");
			return	false;
		}
	}
	else{
		if(d){
			alert( name + " 항목을 입력해 주세요.");
			return	false;
		}
	}
	return	true;
}

function LengthCheck2(str,name,len,d)
{

	var	length=0;
	var	strlen=str.length;
	var	hanlen = len;
	
	if(strlen > 0)	{
		for(i=0; i<strlen; i++)
		{
			if(str.charCodeAt(i) >= 128)
					length += 2;   
			else
					length += 1;   
		}

		if(length > len)
		{
			alert( name + " 항목은 영문"+len+"(한글"+hanlen+")자리를 초과할수 없습니다.");
			return	false;
		}
	}
	else{
		if(d){
			alert( name + " 항목을 입력해 주세요.");
			return	false;
		}
	}
	return	true;
}

function LengthCheck3(str,name,len,d)
{

	var	length=0;
	var	strlen=str.length;
	var	hanlen = len;
	
	if(strlen > 0)	{
		for(i=0; i<strlen; i++)
		{
			if(str.charCodeAt(i) >= 128)
					length += 2;   
			else
					length += 1;   
		}

		if(length > len)
		{
			alert( name + " 항목은 영문"+len+"(한글"+hanlen+")자리를 초과할수 없습니다.");
			return	false;
		}
	}
	else{
		if(d){
			alert( "Please enter the "+ name +".");
			return	false;
		}
	}
	return	true;
}

function IsAllNumber(str, name)
{
	var 	i;
	for(i=0; i<str.length; i++)
	{
		if(str.charCodeAt(i) < 48 || str.charCodeAt(i) > 57)
		{
			alert( name + " 항목은 숫자로 입력하셔야 합니다.");
			return false;
		}
	}
	return true;
}

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !containsElement(filter,keyCode)) {
	input.value = input.value.slice(0, len);
	input.form[(getIndex(input)+1) % input.form.length].focus();
}

function containsElement(arr, ele) {
	var found = false, index = 0;
	while(!found && index < arr.length)
	if(arr[index] == ele)
	found = true;
	else
	index++;
	return found;
}

function getIndex(input) {
	var index = -1, i = 0, found = false;
	while (i < input.form.length && index == -1)
	if (input.form[i] == input)index = i;
	else i++;
	return index;
	}

	return true;
}

function isValidDate( v_year, v_month, v_day)
{
	 var today = new Date();
	 var d_year = v_year*1;
	 var d_month = v_month*1;
	 var d_day = v_day*1;
	 
	 //alert("isValidDate arg1 : " + v_year + ", arg2 : " + v_month + ", arg3 : " + v_day );
	 //alert("isValidDate" + (today.getMonth()*1+1));
	 
	 /* 과거 날짜여야 함. */ 
	 if( v_year > today.getYear() )
			 return 'N';
	 else if( v_year == today.getYear() && v_month*1 > (today.getMonth()*1+1))
			 return 'N';
	 else if( v_year == today.getYear() && v_month*1 == (today.getMonth()*1+1) && v_day > today.getDate())
			 return 'N';
	 
	 /* 달별 일 check */
	 if( d_month == 1 || d_month == 3 || d_month == 5 || d_month == 7 || d_month == 8 || d_month == 10 || d_month == 12){
			 if( d_day > 31 || d_day < 1) return 'N';
	 }
	 else if(d_month == 4 || d_month == 6 || d_month == 9 || d_month == 11 ){
			 if( d_day > 30 || d_day < 1 ) return 'N'; 
	 }
	 else if( d_month == 2 )
	 {
		 if( ((d_year%4) == 0 && (d_year%100)!= 0) || ((d_year%100) == 0 && (d_year%400) == 0) ){
				 if( d_day > 29 || d_day < 1 ) return 'N';
		 }
		 else {
				 if( d_day > 28 || d_day < 1 ) return 'N';
		 }
	 }
	 
	 return 'Y';
}
//14세 이상 체크
function isMoreThan14age(socno1, checkYear)
{
	 var u_year;
	 var u_month;
	 var u_day;
	 var v_age;
	 var v_today = new Date();
	 
	 /* alert( socno1 + ", " + checkYear); */
	 if( checkYear > 0 &&  checkYear < 3)
			u_year = "19" + socno1.substring(0, 2)
	 else if(checkYear > 2 &&  checkYear < 5)
			u_year = "20" + socno1.substring(0, 2)
	 else return 'wrong';     // 2002.10.8 주민등록뒷자리 첫번째 번호 유효성 체크 (1,2,3,4) are only valid  -- by muse     

	 u_month = socno1.substring(2, 4);
	 u_day = socno1.substring(4);
	 /* alert( socno1.substring(0, 2) + "-" + u_year + ", " + u_month + ", " + u_day );        */
	 
	 var rVal = isValidDate(u_year, u_month, u_day );
	 if( rVal == 'N' ) return 'I';
	 else if( rVal == 'Y' ){
			 v_age = v_today.getYear()*1 - u_year*1;
			 if( u_month*1 > (v_today.getMonth*1+1) ){
					 v_age -= 1; 
			 }     
			 else if( u_month*1 == (v_today.getMonth()*1+1) && u_day*1 > v_today.getDate()*1 ){
					 v_age -= 1;
			 }
	 }
	 
	 if( v_age < 14 ) return 'N';
	 else if( v_age >= 14 && v_age < 18 ) return 'M';
	 else return 'Y';
}

// 성년 Check(합성된 주민번호(perno+perno1)
function underAgeCheck(perno) {
	var today = new Date() ;
	var year = today.getYear();
	var month = today.getMonth() + 1;
	var day = today.getDate();
	var perSub1,perSub2,perSub3,dateString;

		// 익스플로러가 아니면 1900을 year에 붙임
		if(navigator.userAgent.indexOf("MSIE") == -1)  
		year= 1900 + year;


			if(month < 10)
					dateString = year.toString() + "0" + month.toString();
			else
					dateString = year.toString() + month.toString();
			if(day < 10)
					dateString = dateString + "0" + day.toString();
			else
					dateString = dateString + day.toString();

	if(perno.length == 13) {
		perSub1 = perno.substring(0,2);
		if(parseInt(perSub1,10) < 10)
			perSub1 = "20" + perSub1;
		else 
			perSub1 = "19" + perSub1;

		perSub1 = perSub1 + perno.substring(2,4);
		perSub1 = perSub1 + perno.substring(4,6);

		//수정 필요
		if(parseInt(dateString,10) - parseInt(perSub1,10) < 140000) {
			return false;
		}
				
	}
	return true;
}

function dateCheck(chkdate)
{
	if(chkdate.length != 8)
		return false;

	nYear	= Number(chkdate.substring(0,4));
	nMonth	= Number(chkdate.substring(4,6));
	nDay	= Number(chkdate.substring(6,8));

	// ??
	if(nYear <=1800 || nYear >=2100)
		return false;

	if(nDay>31 || nDay <1)
		return false;
	if(nMonth == 4 || nMonth == 6 || nMonth == 9 || nMonth == 11)
	{
		if(nDay>30)
			return false;
	}
	else  if(nMonth == 2) 
	{
		if(((nYear%4==0) && (nYear%100)!=0) || (nYear%400==0))
		{
			// 윤년
			if(nDay>29)
				return false;
		}
		else
		{
			if(nDay>28)
				return false;
		}
	}
	return true;
}

function pernoCheck(perno) {
	var	w_c, w_e, w_f,w_tot,i;

	if(isNaN(perno) == true) {
		return false;
	}
	if(perno.length != 10 && perno.length != 13) {
		return false;
	}
	
	if(perno.length == 10) {		// 사업자 번호 Check
		w_c=perno.charAt(8)*5;
		w_e=parseInt(w_c/10);
		w_f=w_c%10;
		
		w_tot=perno.charAt(0) * 1;
		w_tot+=perno.charAt(1) * 3;
		w_tot+=perno.charAt(2) * 7;
		w_tot+=perno.charAt(3) * 1;
		w_tot+=perno.charAt(4) * 3;
		w_tot+=perno.charAt(5) * 7;
		w_tot+=perno.charAt(6) * 1;
		w_tot+=perno.charAt(7) * 3;
		w_tot+=perno.charAt(9) * 1;
		w_tot+=(w_e + w_f);

		if(!(w_tot%10)) {
			return true;

		} 
		else {
			return false;
		}		
	}
	else {			// 주민번호 Check
		birth = null; 
		if(perno.charAt(6) == '3' || perno.charAt(6) == '4')
		{
			birth = '20' + perno.substring(0,6);
		}
		else
		{
			birth = '19' + perno.substring(0,6);
		}
		if(dateCheck(birth) == false)
		{
			//alert("date is not valid!!");
			return false;
		}
		// --------------------------------- by syrup, 2002/03/29
		w_c = 0;
		w_e = 0;
		w_f = 0;
		w_tot = 0;

		w_e = w_e + parseInt(perno.charAt(0),10) * 9;
		w_e = w_e + parseInt(perno.charAt(1),10) * 8;
		w_e = w_e + parseInt(perno.charAt(2),10) * 7;
		w_e = w_e + parseInt(perno.charAt(3),10) * 6;
		w_e = w_e + parseInt(perno.charAt(4),10) * 5;
		w_e = w_e + parseInt(perno.charAt(5),10) * 4;
		w_e = w_e + parseInt(perno.charAt(6),10) * 3;
		w_e = w_e + parseInt(perno.charAt(7),10) * 2;
		w_e = w_e + parseInt(perno.charAt(8),10) * 9;
		w_e = w_e + parseInt(perno.charAt(9),10) * 8;
		w_e = w_e + parseInt(perno.charAt(10),10) * 7;
		w_e = w_e + parseInt(perno.charAt(11),10) * 6;

		w_f = (w_e % 11);
		if(w_f == 0)
			w_f = 1;
		else if(w_f == 10)
			w_f = 0;
		if(w_f != parseInt(perno.charAt(12),10)) {
			return false;
		}
	}
	return true;
}

//외국인 등록번호 관련
function fgn_no_chksum(reg_no) {
	var sum = 0;
	var odd = 0;
	
	buf = new Array(13);
	for (i = 0; i < 13; i++) buf[i] = parseInt(reg_no.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 false;
	}
	else {
			return true;
	}
}
//외국인 등록번호 관련 끝

function setEmailcode(setObject,selectObject,index)
{
	setObject.value = selectObject[index].text;
	if ( selectObject.value == "0") {
				setObject.value = '';
		setObject.focus();
	}else if ( selectObject.value == "9") {
	//	alert("기타 도메인을 입력하세요!");
		setObject.focus();
	}
	else
		setObject.blur();			
}

function setEmailEnable(emailcodeObject,ipmenu2Object) {
	if ( emailcodeObject.value == "9") {
		ipmenu2Object.value = "";
		ipmenu2Object.focus();
	}
	else
		ipmenu2Object.blur();
}

// 새창열기
function openBW(theURL,winName,w,h,scroll,resize){
	var win= null;
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var setting  ='height='+h+',';
      setting +='width='+w+',';
      setting +='top='+wint+',';
      setting +='left='+winl+',';
      setting +='scrollbars='+scroll+',';
      setting +='resizable='+resize+'';
  win=window.open(theURL,winName,setting);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function open_zip(doc, aa) {
	ref = "/common/zipsearch.asp?form=" + doc + "&num=" + aa;
	window.open(ref, "_searchzip", "width=420,height=310,left=300,top=200,scrollbars=yes,toolbars=no, resize=no");
}

function confirmaddr(targetform, aa) {
	doc = eval("opener.document." + targetform);

	if (aa=="") {
		doc.zip1.value = document.all.zip1.value;
		doc.zip2.value = document.all.zip2.value;
//		doc.addr1.value = document.all.addr1.value + " " + document.all.addr2.value;
		doc.addr1.value = document.all.addr1.value;
		doc.addr2.value = document.all.addr2.value;
		self.close();
	} 
	else {

		switch (aa) {
			case "1":		//회원가입,회원정보수정
				tzip1 = doc.zip1;
				tzip2 = doc.zip2;
				taddr1 = doc.addr1;
				taddr2 = doc.addr2;
				break;
			case "2":		//경매 배송 정보
				tzip1 = doc.dzip1;
				tzip2 = doc.dzip2;
				taddr1 = doc.daddr1;
				taddr2 = doc.daddr2;
				break;
			case "3":
				tzip1 = doc.delivery_zip1;
				tzip2 = doc.delivery_zip2;
				taddr1 = doc.delivery_addr;
				taddr2 = doc.delivery_addr;
				break;
			case "4":
				tzip1 = doc.zip1_1;
				tzip2 = doc.zip2_1;
				taddr1 = doc.addr_1;
				taddr2 = doc.addr_1;
				break;
			case "5":
				tzip1 = doc.zip1_2;
				tzip2 = doc.zip2_2;
				taddr1 = doc.addr_2;
				taddr2 = doc.addr_2;
				break;
			default :
				tzip1 = eval("doc.order_receive_" + aa + "_zip1");
				tzip2 = eval("doc.order_receive_" + aa + "_zip2");
				taddr1 = eval("doc.order_receive_" + aa + "_addr1");
				taddr2 = eval("doc.order_receive_" + aa + "_addr2");
				break;
		}

		tzip1.value = document.all.zip1.value;
		tzip2.value = document.all.zip2.value;
		taddr1.value = document.all.addr1.value;
		taddr2.value = document.all.addr2.value;
		self.close();
	}
}
/*
function openDuplCheckID(id) {
	var url;
	if(IsValidID()){
		window.document.domain = "starshop.com" ;
		url = "http://www.starshop.com/member/?userid="+id;
		window.open(url, 'id_check', 'width=510,height=225,scrollbars=no,toolbars=no');
	}
}
*/
function getEmailHost(mailhost){
	var mailhosts= new Array(11);
	mailhosts[0] = "gmail.com";
	mailhosts[1] = "hanafos.com";	
	mailhosts[2] = "hanmail.net";
	mailhosts[3] = "hansetel.com";
	mailhosts[4] = "hotmail.com";
	mailhosts[5] = "korea.com";
	mailhosts[6] = "msn.com";
	mailhosts[7] = "nate.com";
	mailhosts[8] = "naver.com";
	mailhosts[9] = "paran.com";
	mailhosts[10] = "yahoo.co.kr";	

	var str="";

	if( mailhost == ""){
		str +="<option value=0 selected>선택하세요</option>\n";
		str +="<option value=9>직접기입(direct)</option>\n";
	}else{
	//	str +="<option value=0>선택하세요</option>\n";
	//	str +="<option value=9 selected>직접기입(direct)</option>\n";
		str +="<option value=0>Select</option>\n";
		str +="<option value=9 selected>direct input</option>\n";
	}

	for( i=0; i < mailhosts.length; i++){
		if( mailhosts[i]==mailhost )
			str +="<option value='"+mailhosts[i]+"' selected>"+mailhosts[i]+"</option>\n";
		else
			str +="<option value='"+mailhosts[i]+"'>"+mailhosts[i]+"</option>\n";
	}

	document.write(str);
}

function getHandPhoneCode(handtel1){
	var ht= parseInt(handtel1,10);
    var HPCode= new Array(6);
    HPCode[0] = 10;
    HPCode[1] = 11;
    HPCode[2] = 16;
    HPCode[3] = 17;
    HPCode[4] = 18;
    HPCode[5] = 19;

    var str="";

    str +="<option value='' selected >선택</option>\n";

    for( i=0; i < HPCode.length; i++){
        if( HPCode[i] == ht )
            str +="<option value='0"+HPCode[i]+"' selected>0"+HPCode[i]+"</option>\n";
        else
            str +="<option value='0"+HPCode[i]+"'>0"+HPCode[i]+"</option>\n";
    }
    str +="<option value='0'> 없음</option>\n";

    document.write(str);
}

function getPhoneCode(handtel1){

	var ht= parseInt(handtel1,10);
	var HPCode= new Array(6);
	HPCode[0] = 10;
	HPCode[1] = 11;
	HPCode[2] = 16;
	HPCode[3] = 17;
	HPCode[4] = 18;
	HPCode[5] = 19;
	HPCode[6] = 130;
	HPCode[7] = 31;
	HPCode[8] = 32;
	HPCode[9] = 33;
	HPCode[10] = 41;
	HPCode[11] = 42;
	HPCode[12] = 43;
	HPCode[13] = 51;
	HPCode[14] = 52;
	HPCode[15] = 53;
	HPCode[16] = 54;
	HPCode[17] = 55;
	HPCode[18] = 61;
	HPCode[19] = 62;
	HPCode[20] = 63;
	HPCode[21] = 64;

	var str="";

	str +="<option value='' selected >선택</option>\n";

	for( i=0; i < HPCode.length; i++){
			if( HPCode[i] == ht )
					str +="<option value='0"+HPCode[i]+"' selected>0"+HPCode[i]+"</option>\n";
			else
					str +="<option value='0"+HPCode[i]+"'>0"+HPCode[i]+"</option>\n";
	}
	str +="<option value='0'> 없음</option>\n";

	document.write(str);

}

function setHPcode(setObject1,setObject2,selectObject) {
	if (selectObject.value == "0") {
		setObject1.value = "";
		setObject2.value = "";
		setObject1.disabled=true;
		setObject2.disabled=true;
	} else {
		setObject1.disabled=false;
		setObject2.disabled=false;
	}
}

// 숫자 Check
function numberCheck(myform,minVal,maxVal,minLen, maxLen) {

		var len = myform.value.length;
		var str = myform.value;
		var i, check =true

		for(i = 0; i < len; i++) {
			if(str.charAt(i) < "0" || str.charAt(i) > "9") {
					check=false;
					alert("숫자만을 입력하셔야 합니다!!")
					myform.focus();
					return false;
			}

			if(minVal > -1 && maxVal > -1) {
				if(parseInt(myform.value, 10) < minVal || parseInt(myform.value, 10) > maxVal) {
						alert("정확한 값을 입력하세요.")
						myform.focus();
						return false;
				}
			}
		}
		if(minLen != -1 && myform.value != "") {
			if(i < minLen) {
				alert("정확한 값을 입력하세요.")
				myform.value = "";
				myform.focus();
				return false;
			}
		}
		if(maxLen != -1 && myform.value != "") {
			if(i > maxLen) {
				alert("정확한 값을 입력하세요.")
				myform.value = "";
				myform.focus();
				return false;
			}
		}
		if(check == false) {
			alert("숫자만을 입력하셔야 합니다!!")
			myform.focus();
		}
		return check
}

function dataCheck(myObject, checkChar,checkflag,itemIndex) {
	var len = myObject.value.length;
	if(len > 0) {
		if((myObject.value.indexOf(checkChar) < 0 && checkflag == true) ||
		 (myObject.value.indexOf(checkChar) > -1 && checkflag == false)) {
				 if(itemIndex == 1)
						 alert("E-Mail주소를 정확하게 입력 하세요!")
				 else if(itemIndex == 2)
						 alert("대화명을 정확하게 입력 하세요!(공백 또는 |,' 문자삭제 )")
				 else if(itemIndex == 3)
						 alert("회원 ID를 정확하게 입력하세요(공백(|,_,=..) 문자삭제)")
				 else if(itemIndex == 4)
						 alert("비밀번호를 정확하게 입력 하세요!(공백,\\,|,_ 문자삭제)")
				 else if(itemIndex == 5)
						alert("나머지주소를 정확하게 입력 하세요!(\\,|,_,' 문자삭제)")
				 else if(itemIndex == 6)
						alert("질문 항목을 정확하게 입력 하세요!(\\,|,_,' 문자삭제)")
				 else if(itemIndex == 7)
						alert("클럽 이름 항목을 정확하게 입력 하세요!(\\,' 문자삭제)")
				 else if(itemIndex == 8)
						alert("클럽 ID를 정확하게 입력하세요(공백(|,_,=..) 문자삭제)")

			myObject.focus();
			return false;
		}
	}
}

function	PasswdCheck(logname, passwd1, passwd2)
{
	var	passlen	= passwd1.value.length;
	var	loglen	= logname.value.length;
	var	tmppass	= passwd1.value.toUpperCase();
	var	tmplog	= logname.value.toUpperCase();

	if (logname.value == "")
	{
		alert("회원ID입력 후 비밀번호를 입력하여 주십시오");
		logname.select();
		return false;
	}

	if (passwd1.value == "")
	{
		alert("비밀번호를 반드시 입력하여 주십시오");
		passwd1.select();
		return false;
	}

	if (passwd2.value == "")
	{
		alert("비밀번호를 반드시 재입력하여 주십시오");
		passwd2.select();
		return false;
	}

	if (passwd1.value.length < 5 || passwd1.value.length > 8 ) 
	{
		alert("비밀번호의 길이는 최소 5글자, 최대 8글자 이내입니다");
		passwd1.select();
		return	false;
	}

	if(passwd1.value != passwd2.value)
	{
		alert("비밀번호와 재입력한 비밀번호가 같아야 합니다.");
		passwd1.select();
		return	false;
	}

	if(dataCheck(passwd1,'\\',false,4) == false)
		return false;

	if(dataCheck(passwd1,' ',false,4) == false)
		return false;

	if(dataCheck(passwd1,'|',false,4) == false)
		return false;
	if(dataCheck(passwd1,'\'',false,4) == false)
		return false;

	// PASSWORD EQUAL CHECK
	for(i = passlen-1; i > 0; i--)
	{
		if(passwd1.value.charAt(i) != passwd1.value.charAt(i-1))
			break;
	}
	if(i == 0)
	{
		alert("도용하기 쉬운 비밀번호입니다.");
		passwd1.select();
		return	false;
	}

	// PASSWORD SERIAL CHECK
	for(i = passlen-1; i > 0; i--)
	{
		if(parseInt(passwd1.value.charAt(i),10) == (parseInt(passwd1.value.charAt(i-1),10) + 1)) 
			continue;
		else
			break;	
	}
	if(i == 0)
	{
		alert("도용하기 쉬운 비밀번호입니다.");
		passwd1.select();
		return	false;
	}

	// PASSWORD SERIAL CHECK
	for(i = passlen-1; i > 0; i--)
	{
		if(parseInt(passwd1.value.charAt(i),10) == (parseInt(passwd1.value.charAt(i-1),10) - 1))
			continue;
		else
			break;	
	}
	if(i == 0)
	{
		alert("도용하기 쉬운 비밀번호입니다.");
		passwd1.select();
		return	false;
	}

	if(tmppass.indexOf(tmplog) != -1) 
	{
		alert("회원ID를 포함하는 비밀번호는 등록이 안됩니다.");
		passwd1.select();
		return	false;
	}

	return	true;
}

//
// Cookie Functions
//
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  //return unescape(document.cookie.substring(offset, endstr));
  return document.cookie.substring(offset, endstr);
}

function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); // dawn of (Unix) time - should be 0
  if (skew > 0)  // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew);
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return "";
}

function SetCookie (name,value) {
  document.cookie = name+"="+value+"; path=/; domain=.teststarshop.com";
}

function SetCookieExpire (name,value,days) {
  var expire = new Date();
  expire.setTime(expire.getTime()+(1000*60*60*24*days));

//  document.cookie = name+"="+value+"; path=/; domain=.starshop.com; expires="+expire.toGMTString();
	document.cookie = name+"="+value+"; path=/; domain=.teststarshop.com; expires="+expire.toGMTString();
}

function DeleteCookie (name) {
  if (GetCookie(name)) {
    var expire = new Date();
    expire.setTime(expire.getTime() - 1);

    document.cookie = name+"=; path=/; domain=.teststarshop.com; expires="+expire.toGMTString();
  }
}

function Spread(menu)
{
	thismenu = eval("document.all." + menu + ".style")
	if(thismenu.display == "block"){
		thismenu.display = "none";
	}else{
		thismenu.display = "block";
	}
	return false;
}

var oldText;
var oldCount;

// 글자수 계산
function CheckMSGLen(obj,obj2, maxlength)
{
    var temp;
    var msgcount;
    msgcount = 0;

    len = obj.value.length;
    for(k=0;k<len;k++){
        temp = obj.value.charAt(k);
        if(escape(temp).length > 4)
            msgcount += 2;
        else
            msgcount++;
    }
    obj2.value = msgcount/2;

    if (msgcount/2>maxlength) {
        alert(maxlength+"자까지만 쓰실 수 있습니다.");
        obj.value = oldText;
        obj2.value = oldCount/2;
        return;
    }else{
        oldText = obj.value;
        oldCount = msgcount;
    }

    return msgcount/2;
}

// 글자수 계산
function CheckMSGLen2(obj,obj2, maxlength)
{
    var temp;
    var msgcount;
    msgcount = 0;
    len = obj.value.length;
		for(k=0;k<len;k++){
        temp = obj.value.charAt(k);
        if(escape(temp).length > 4)
            msgcount += 2;
        else
            msgcount++;
    }
    obj2.innerHTML = msgcount/2;

    if (msgcount/2>maxlength) {
        alert(maxlength+"자까지만 쓰실 수 있습니다.");
        obj.value = oldText;
        obj2.innerHTML = oldCount/2;
        return;
    }else{
        oldText = obj.value;
        oldCount = msgcount;
    }

    return msgcount/2;
}


function $() 
{
	var ret = [];
	for(var i=0; i < arguments.length; i++) {
		if (typeof arguments[i] == 'string') {
			ret[ret.length] = document.getElementById(arguments[i]);
		} else {
			ret[ret.length] = arguments[i];
		}
	}
	return ret[1]?ret:ret[0];
}


// Quick Menu Start
// self.onError=null;
currentX = currentY = 0;  
currentX2 = currentY2 = 0;  
whichIt = null;           
lastScrollX = 0; 
lastScrollY = 0;
lastScrollX2 = 0; 
lastScrollY2 = 0;

NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
	
function Quick(qm1,qm2) {

	if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
	if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
		
	if(diffY != lastScrollY) {
		percent = .1 * (diffY - lastScrollY);
		if(percent > 0) percent = Math.ceil(percent);
		else percent = Math.floor(percent);
		if(IE) document.all.quickmenu.style.pixelTop += percent;
		lastScrollY = lastScrollY + percent;
	}
/*
	if(IE) { diffY2 = document.body.scrollTop; diffX2 = document.body.scrollLeft; }
	if(NS) { diffY2 = self.pageYOffset; diffX2 = self.pageXOffset; }
		if(diffY2 != lastScrollY) { //---여러 레이어 같이 움직일때는 이중으로 감지하면 안됨..기준은 하나여야함
			percent = .1 * (diffY2 - lastScrollY2);
			if(percent > 0) percent = Math.ceil(percent);
			else percent = Math.floor(percent);
			if(IE) document.all.quckmenu.style.pixelTop += percent;
			if(NS) document.quckmenu.top += percent; 
			lastScrollY2 = lastScrollY2 + percent;
		}
*/
}
// Quick Menu End
