﻿function goCategoryList_Row(Category, RowNum, CurrentPage, AllYN, price, size, order)
{
	if(RowNum != "" && AllYN != "Y" && Category.toLowerCase().indexOf("tbt") == -1){
		if(parseInt(RowNum) > 25){
			var temp = (RowNum % 25);

			if(temp == 0){
				temp = 25;
			}

			RowNum = temp;
		}
	}

	if(CurrentPage == ''){
		CurrentPage = '1';
	}	
   if(Category.toLowerCase() == 'topseller'){
	   location.href = '/Product/BestSeller.aspx';
   }else if(Category.toLowerCase() == 'mdpick'){
	   location.href = '/Product/MDPick.aspx';
   }else if(Category.toLowerCase() == 'newarrivals'){
	   location.href = '/Product/NewArrivals.aspx';
   }else if(Category.toLowerCase() == 'sale'){
	   location.href = '/Product/Sale.aspx';
   }else if((Category.toLowerCase() == 'shopbytrend') || (Category.toLowerCase().indexOf('sbtrend') != -1)){
	   location.href = '/ShopbyTrend/Default.aspx';
   }else if(Category.toLowerCase() == 'shopbyoutfit'){
	   location.href = '/ShopbyOutfit/Default.aspx';
   // Added by Kitae Park, 04/26/2010, case#013-9678 Daily special layout
   }else if(Category.toLowerCase() == 'dailyspecial'){
      location.href = '/Product/dailyspecial.aspx';
   }else if(Category.toLowerCase() == 'fab_finds'){
	   location.href = '/Product/FabulousFinds.aspx';
   }else if(Category.toLowerCase() == 'promo_drama'){
	   location.href = '/Product/PromoDrama.aspx';
	// Added by 05/13/2010, Kitae Park, Case#014-2219[SUIT YOURSELF]
	}else if(Category.toLowerCase().indexOf("promo_suityourself") != -1){
		location.href = '/promo/suityourself.aspx';	
    //Added by Sangmin Shim, 04/22/2010, case# 014-0416 White hot
   }else if(Category.toLowerCase().indexOf('promo_whitehot') != -1){
	   location.href = '/promo/productlist.aspx?category=promo_whitehot';
   }else{
	   if(Category.toLowerCase().indexOf('81') != -1){
		   location.href = '/Heritage1981/Products.aspx?Category=' + Category + '&RowNum=' + RowNum + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order + '#RowNumber' + RowNum;
	   }else if(Category.toLowerCase().indexOf('tbt') != -1){
		   location.href = '/Twelve/Products.aspx?Category=' + Category + '&RowNum=' + RowNum + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order + '#RowNumber' + RowNum;
	   }else if(Category.toLowerCase().indexOf('love21') != -1){
		   location.href = '/Love21/Products.aspx?Category=' + Category + '&RowNum=' + RowNum + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order + '#RowNumber' + RowNum;
	   }else if(Category.toLowerCase().indexOf('21men') != -1){
		   location.href = '/21Men/Products.aspx?Category=' + Category + '&RowNum=' + RowNum + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order + '#RowNumber' + RowNum;
	   }else{
		   location.href = '/Forever21/Products.aspx?Category=' + Category + '&RowNum=' + RowNum + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order + '#RowNumber' + RowNum;
	   }
   }
}

function goProductInfo_Row(ProductId, Category, RowNum, ColorCode, CurrentPage, AllYN, price, size, order)
{
	if(CurrentPage == '' || CurrentPage == undefined){
		CurrentPage = '1';
	}

	if(price == undefined) price = '';
	if(size == undefined) size = '';
	if(order == undefined) order = '';

	if(Category.toLowerCase().indexOf('81') != -1){
		location.href = '/Heritage1981/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum + '&ColorCode=' + ColorCode + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order;
	}else if(Category.toLowerCase().indexOf('tbt') != -1){
		if((Category.toLowerCase() == 'tbt_whatsnew') || (Category.toLowerCase() == 'tbt_sale')){
			location.href = '/Twelve/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&ColorCode=' + ColorCode;
		}else{
			location.href = '/Twelve/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum + '&ColorCode=' + ColorCode + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order;
		}
	}else if(Category.toLowerCase().indexOf('love21') != -1){
		location.href = '/Love21/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum + '&ColorCode=' + ColorCode + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order;
	}else if(Category.toLowerCase().indexOf('21men') != -1){
		location.href = '/21Men/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum + '&ColorCode=' + ColorCode + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order;
	}else{
		location.href = '/Forever21/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum + '&ColorCode=' + ColorCode + '&CurrentPage=' + CurrentPage + '&AllYN=' + AllYN + '&paramprice=' + price + '&paramsize=' + size + '&paramorder=' + order;
	}
}

// Category : Product Category(ex:f21_top,81_top,tbt_top...)
function goCategoryList(Category, PromoType)
{
   if(PromoType=="")
   {
      if(Category.toLowerCase() == 'topseller'){
	      location.href = '/Product/BestSeller.aspx';
      }else if(Category.toLowerCase() == 'mdpick'){
	      location.href = '/Product/MDPick.aspx';
      }else if(Category.toLowerCase() == 'newarrivals'){
	      location.href = '/Product/NewArrivals.aspx';
      }else if(Category.toLowerCase() == 'sale'){
	      location.href = '/Product/Sale.aspx';
      }else if((Category.toLowerCase() == 'shopbytrend') || (Category.toLowerCase().indexOf('sbtrend') != -1)){
	      location.href = '/ShopbyTrend/Default.aspx';
      }else if(Category.toLowerCase() == 'shopbyoutfit'){
	      location.href = '/ShopbyOutfit/Default.aspx';
      }else if(Category.toLowerCase() == 'fab_finds'){
	      location.href = '/Product/FabulousFinds.aspx';
      // Added by Kitae Park, 04/26/2010, case#013-9678 Daily special layout
      }else if(Category.toLowerCase() == 'dailyspecial'){
	      location.href = '/Product/dailyspecial.aspx';		
      }else if(Category.toLowerCase().indexOf("promo_suityourself") != -1){
	      location.href = '/promo/suityourself.aspx';			
      }else if(Category.toLowerCase() == 'promo_drama'){
	      location.href = '/Product/PromoDrama.aspx';
	  //7/05/2010 sm.shim added intimate on Foreve21 landing
	  }else if(Category.toLowerCase() == 'f21_intim'){
	      location.href = '/Intimates/Default.aspx';
      }else{
	      if(Category.toLowerCase().indexOf('81') != -1){
		      location.href = '/Heritage1981/Products.aspx?Category=' + Category;
	      }else if(Category.toLowerCase().indexOf('tbt') != -1){
		      location.href = '/Twelve/Products.aspx?Category=' + Category;
	      }else if(Category.toLowerCase().indexOf('love21') != -1){
		      location.href = '/Love21/Products.aspx?Category=' + Category;
	      }else if(Category.toLowerCase().indexOf('21men') != -1){
		      location.href = '/21men/Products.aspx?Category=' + Category;
	      }else{
		      location.href = '/Forever21/Products.aspx?Category=' + Category + '&RowNum=1&CurrentPage=1&AllYN=N';
	      }
      }
   }
   else
   {
      if(Category.toLowerCase().indexOf('promo_lovebreezysummer') != -1)
         location.href = "/promo/love21promolist.aspx?promotype="+PromoType+"&category=" + Category;
      else if (Category.toLowerCase().indexOf('promo') != -1)
         location.href = "/promo/promolist.aspx?promotype="+PromoType+"&category=" + Category;
   }
}

function goPromoCategoryList(Category, PromoType)
{
   if(PromoType !="")
   {
      if (Category.toLowerCase().indexOf('promo') != -1)
         location.href = "/promotion/productlist.aspx?promotype="+PromoType+"&category=" + Category;
   }
   else
   {
      if (Category.toLowerCase().indexOf("promo") != -1)
         location.href = "/promotion/products.aspx?category=" + Category;
   }
}

function goProductDetail(ProductId, Category)
{
   if(Category.toLowerCase().indexOf('81') != -1){
	   location.href = '/Heritage1981/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId;
   }else if(Category.toLowerCase().indexOf('tbt') != -1){
	   location.href = '/Twelve/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId;
   }else if(Category.toLowerCase().indexOf('21men') != -1){
	   location.href = '/21men/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId;
	// Modified, 6/1/2010, Kitae Park, Add Love21
	}else if(Category.toLowerCase().indexOf('love21') != -1){
	   location.href = '/Love21/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId;
   }else{
	   location.href = '/Forever21/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId;
   }
}
// Added by 05/19/2010, Kitae Park, Case#014-2504 / goPromoProductDetail
function goPromoProductDetail(ProductId, Category, Promotype)
{
   location.href = "/Forever21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&type="+Promotype;
}

function goLove21PromoProductDetail(ProductId, Category, Promotype)
{
   location.href = "/Love21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&type="+Promotype;
}

function goProductInfo(ProductId, Category, RowNum)
{
	if(Category.toLowerCase().indexOf('81') != -1){
		location.href = '/Heritage1981/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum;
	}else if(Category.toLowerCase().indexOf('tbt') != -1){
		if((Category.toLowerCase() == 'tbt_whatsnew') || (Category.toLowerCase() == 'tbt_sale')){
			location.href = '/Twelve/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId;
		}else{
			location.href = '/Twelve/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum;
		}
	}else if(Category.toLowerCase().indexOf('love21') != -1){
		location.href = '/Love21/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum;
	}else if(Category.toLowerCase().indexOf('21men') != -1){
		location.href = '/21men/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum;
	}else{
		location.href = '/Forever21/ProductView.aspx?Category=' + Category + '&ProductId=' + ProductId + '&RowNum=' + RowNum;
	}
}

function goSearch(SearchType, SearchResult)
{
	var SearchText, SearchOption;
	if(SearchType == 'R'){
		SearchText = document.getElementById('clSearch2');
		SearchOption = document.getElementById('clSearchOption2').value;

		if(SearchText.value == ''){
			alert('검색할 단어를 입력하세요');
			SearchText.focus();
			return false;
		}

		location.href='/Product/Search.aspx?SearchType='+SearchType+'&SearchText='+SearchText.value+'&SearchOption='+SearchOption+'&SearchResult='+SearchResult;
	}else{
		SearchText = document.getElementById('clSearch');
		SearchOption = document.getElementById('clSearchOption').value;

		if(SearchText.value == ''){
			alert('검색할 단어를 입력하세요');
			SearchText.focus();
			return;
		}

		location.href='/Product/Search.aspx?SearchType='+SearchType+'&SearchText='+SearchText.value+'&SearchOption='+SearchOption;
	}

	return false;
}
function browserType()
{
	var appname = navigator.appName;
	var useragent = navigator.userAgent;
	var browsertype; //1:IE, 2:FF, 3:SF

	if(useragent.toLowerCase().indexOf('firefox') != -1){
		browsertype = '2';
	}else if(useragent.toLowerCase().indexOf('safari') != -1){
		browsertype = '3';
	}else{
		browsertype = '1';
	}

	return browsertype;
}

var discount = 20;

function openQuickView(ProductID, Categroy)
{
	document.getElementById('t').src='/Control/QuickView.aspx?ProductID='+ProductID+'&Category='+Categroy;
	document.getElementById('dQuickView').style.display = 'block';
	document.getElementById('dQuickView').style.top = '30%';

	var sTop = document.body.scrollTop;
	var sLeft = document.documentElement.scrollLeft;

	if(sTop == 0) sTop = document.documentElement.scrollTop;

	tmpTop = sTop + ((document.documentElement.scrollHeight - 350) / 3);
	tmpLeft = sLeft + ((document.documentElement.scrollWidth - 660) / 2);

	document.getElementById('dQuickView').style.position = 'absolute';
	document.getElementById('dQuickView').style.left = tmpLeft;
	document.getElementById('dQuickView').style.top = tmpTop
	document.getElementById('t').style.height=490;
	document.getElementById('t').style.width=650;
}

function openQuickView(ProductID, Categroy, ColorCode)
{
	document.getElementById('t').src='/Control/QuickView.aspx?ProductID='+ProductID+'&Category='+Categroy+'&ColorCode='+ColorCode;
	document.getElementById('dQuickView').style.display = 'block';
	document.getElementById('dQuickView').style.top = '30%';

	var sTop = document.body.scrollTop;
	var sLeft = document.documentElement.scrollLeft;

	if(sTop == 0) sTop = document.documentElement.scrollTop;

	tmpTop = sTop + ((document.documentElement.scrollHeight - 350) / 3);
	tmpLeft = sLeft + ((document.documentElement.scrollWidth - 660) / 2);

	document.getElementById('dQuickView').style.position = 'absolute';
	document.getElementById('dQuickView').style.left = tmpLeft;
	document.getElementById('dQuickView').style.top = tmpTop
	document.getElementById('t').style.height=640;
	document.getElementById('t').style.width=680;
}

function closeQuickView()
{
	document.getElementById('t').src='/Control/Blank.aspx';
	document.getElementById('dQuickView').style.display = 'none';
}

function fQuickView(id, v)
{
	var browsertype = browserType();

	if(browsertype == '1'){
		var sQuick = eval(document.getElementById(id));
		sQuick.style.visibility = v;
	}
}

function fFAQ(id, v)
{
	var sFAQ = eval(document.getElementById(id));
	sFAQ.style.visibility = v;
}

function fLoginPress(e)
{
}

function fZipCode()
{
	var X = ((document.body.clientWidth) / 2) - (417 / 2);
	var Y = ((document.body.clientHeight) / 2) - (500 / 2) + 50;
	config = 'toolbar=no,directories=no,menubar=no,titlebar=no,status=no,scrollbars=yes,width=417,height=500,left=' + X + ',top=' + Y;
	window.open('/common/ZipCode.aspx', 'ZipCode', config);

	return false;
}

function fTracking(trackingnumber)
{
	var X = ((document.body.clientWidth) / 2) - (600 / 2);
	var Y = ((document.body.clientHeight) / 2) - (250 / 2) + 50;
	config = 'toolbar=no,directories=no,menubar=no,titlebar=no,status=no,scrollbars=yes,width=600,height=250,left=' + X + ',top=' + Y;
	window.open('http://www.hydex.net/ehydex/jsp/home/distribution/tracking/tracingNView.jsp?param1=338284&param2=' + trackingnumber, '배송조회', config);
}

function fnLogout()
{
	var text = '로그아웃하시겠습니까?';

	if(confirm(text)) location.href='/Member/Logout.aspx';
}

function fnQnAView(HiddenID)
{
	var div = eval('document.all.'+HiddenID);

	if(div.style.display == 'block') div.style.display = 'none';
	else div.style.display = 'block';
}

function fnQnAViewAll(HiddenID, num, maxnum)
{
    var x = 1;
    
    if(num == 0)
    {
        x = 0;
    }
    
	for(i=x; i<= maxnum; i++){
		var div = eval('document.all.'+HiddenID+i);

		if(i == num){
			if(div.style.display == 'block') div.style.display = 'none';
			else div.style.display = 'block';
		}else{
			div.style.display = 'none';
		}
	}
}

function fnGetElementById(HiddenID, num, maxnum)
{
	for(i=1; i<= maxnum; i++){
		var div = document.getElementById(HiddenID+i);

		if(i == num){
			if(div.style.display == 'block') div.style.display = 'none';
			else div.style.display = 'block';
		}else{
			div.style.display = 'none';
		}
	}
}

function show(div)
{
	if(div.style.display == 'none') div.style.display = 'block';
	else div.style.display = 'none';
}

// Rollover
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_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];
		}
	}
}

// JScript 파일
function go_pd(ProudctID,CatalogName)
{
	if(ProudctID == '9000000001'){
		location.href= '../eCard/ListeCardItem.aspx?variantid='+CatalogName;
	}else{
		location.href = '/Product/ProductView.aspx?ProductID='+ProudctID+'&Catalog=Forever21Kor&Category='+CatalogName;
	}
}

function go_pd1(ProudctID,CatalogName, RowNum)
{
	if(ProudctID == '9000000001'){
		location.href= '/eCard/ListeCardItem.aspx?variantid='+CatalogName;
	}else{
		location.href = '/Product/ProductView.aspx?ProductID='+ProudctID+'&Catalog=Forever21Kor&Category='+CatalogName+'&intRowNum='+RowNum;
	}
}

function go_pd2(ProudctID,CatalogName, RowNum)
{
	if(ProudctID == '9000000001'){
		location.href= '/eCard/ListeCardItem.aspx?variantid='+CatalogName;
	}else{
		location.href = '/Product/GiftProductView.aspx?ProductID='+ProudctID+'&Catalog=Forever21Kor&Category='+CatalogName+'&intRowNum='+RowNum;
	}
}

function MoneyPay(pay)
{
	var idx=0;
	arrRev = new Array();
	var lpay = '';
	pay = pay.toString();
	arr = pay.split('');

	for(i = arr.length; i > 0 ; i--){
		arrRev[idx] = arr[i-1];
		idx++;

		if((idx ==3 || idx == 7 || idx == 11 || idx == 15 || idx == 19) && (i != 1)){
			arrRev[idx] = ',';
			idx++;
		}
	}

	for(i=arrRev.length; i>0; i--){
		lpay += arrRev[i-1];
	}

	return lpay;
}

function fnPress(e,type)
{
	var SearchText, SearchOption, SearchMode, reCheck;
	var hdsMode, hdsText, hdsOption;

	if(e.keyCode ==13){
		if(type == 'top'){
			SearchText = document.getElementById('ctl00_SearchText');
			SearchOption = document.getElementById('ctl00_SearchOption').value;
			SearchMode = 'all';
			reCheck = false;
		}else{
			SearchText = document.forms[0].SearchText;
			SearchOption = document.forms[0].SearchOption.value;
			SearchMode = document.forms[0].SearchMode.value;
		}

		if(SearchText.value == ''){
			alert('검색할 단어를 입력하세요');
			SearchText.focus();
			return false;
		}

		location.href='../Product/Search.aspx?SearchText='+SearchText.value+'&SearchOption='+SearchOption+'&SearchMode='+SearchMode;

		return false;
	}
}

function CheckNumber(val)
{
	for(i=0;i<val.length;i++){
		if(val.charCodeAt(i) <= 47 || val.charCodeAt(i) >= 58)
			return false;
	}

	return true;
}

function fn_findid()
{
	window.open('FindID.aspx','FindID','width=400,height=300');
	return false;
}

function fn_findpw()
{
	window.open('FindPW.aspx','FindID','width=400,height=300');
	return false;
}

function fn_PopSubscribe()
{
	window.open('../member/unsubscribe.aspx','','width=450,height=180');
}

var agent = navigator.userAgent;
var ie;
if(agent.toLowerCase().indexOf('firefox') != -1){
	ie = false;
}else if(agent.toLowerCase().indexOf('safari') != -1){
	ie = false;
}else{
	ie = true;
}

function OnlyString(e)
{
	if(ie){
		if(event.keyCode >=48 && event.keyCode <=57) //0~9
			return false;
		else if(event.keyCode == 59 || event.keyCode == 47) // ;,/
			return false;
		else if(event.keyCode == 8 || event.keyCode == 45 || event.keyCode == 40 || event.keyCode == 41 || event.keyCode == 32)          //backspace,-,(,),sp
			return true;
		else
			return true;
	}else{
		if(e.which >=48 && e.which <=57) //0~9
			return false;
		else if(e.which == 59 || e.which == 47) // ;,/
			return false;
		else if(e.which == 8 || e.which == 45 || e.which == 40 || e.which == 41 || e.which == 32)       //backspace,-,(,),sp
			return true;
		else
			return true;
	}
}

function OnlyAlphabet(e)
{
	if(ie){
		if(event.keyCode >=65 && event.keyCode <=90) //A~Z
			return true;
		else if(event.keyCode >=97 && event.keyCode <=122) //a~z
			return true;
		else if(event.keyCode ==32 || event.keyCode == 8 || event.keyCode == 46) //space,backspace,del
			return true;
		else
			return false;
	}else{
		if(e.which >=65 && e.which <=90) //A~Z
			return true;
		else if(e.which >= 97 && e.which <= 122) //a~z
			return true;
		else if(e.which == 32 || event.which == 8 || event.which == 46)    //space,backspace,del
			return true;
		else
			return false;
	}
}

function OnlyStringNumber(e)
{
	if(ie){
		if(event.keyCode >=48 && event.keyCode <=57) //0~9
			return true;
		else if(event.keyCode == 8 || event.keyCode == 45 || event.keyCode == 40 || event.keyCode == 41 || event.keyCode == 32 ||  event.keyCode == 13)             //backspace,-,(,),sp,enter
			return true;
		else if(event.keyCode >=65 && event.keyCode <=90 || event.keyCode >=97 && event.keyCode <=122)  //a~z,A~Z
			return true;
		else
			return false;
	}else{
		if(e.which >=48 && e.which <=57) //0~9
			return true;
		else if(e.which == 8 || e.which == 45 || e.which == 40 || e.which == 41 || e.which == 32 ||  e.which == 13)       //backspace,-,(,),sp,enter
			return true;
		else if(e.which >=65 && e.which <=90 || e.which >=97 && e.which <=122)  //a~z,A~Z
			return true;
		else
			return false;
	}
}

function OnlyNumber(e)
{
	if(ie){
		if(event.keyCode >=48 && event.keyCode <=57) //0~9
			return true;
		else if(event.keyCode == 8 || event.keyCode == 45 || event.keyCode == 40 || event.keyCode == 41 || event.keyCode == 32)          //backspace,-,(,),sp
			return true;
		else
			return false;
	}else{
		if(e.which >=48 && e.which <=57) //0~9
			return true;
		else if(e.which == 8 || e.which == 45 || e.which == 40 || e.which == 41 || e.which == 32)       //backspace,-,(,),sp
			return true;
		else
			return false;
	}
}