// ¸ð´Þ	À©µµ¿ì ÇÔ¼ö	(IE	Àü¿ë)
function modalWindow(vWidth, vHeight,	vUrl)	{
	var	mdWindow=null;
	//var	kiho = (vUrl.indexOf("?")<0)?"?":"&";
	var	x=(screen.width-vWidth)/2;
	var	y=(screen.height - vHeight)/2;
	opt="status:no;	help:no; edge:raised;";
	opt=opt+"dialogWidth:"+vWidth+"px; dialogHeight:"+vHeight+"px; dialogLeft:"+x+";scroll:no; dialogTop:"+y+";";
	var	mdWindow=showModalDialog(vUrl,'',opt);
}

// ÆË¾÷À©µµ¿ì	ÇÔ¼ö(¿øÇÏ´Â	Å©±â·Î Åø¹Ù¾øÀÌ	È­¸é °¡¿îµ¥	¶ç¿ì±â)
function openWindow(vWidth,	vHeight, vUrl, vOpt) {
	var	mdWindow = null;
	var	x	=	(screen.width	-	vWidth)/2;
	var	y	=	(screen.height - vHeight)/2;
	var	opt;
	if (vOpt ==	"" ||	vOpt ==	null)	vOpt = 0;
	opt	=			"width=" + vWidth	+	",height=" + vHeight;
	opt	=	opt	+	",scrollbars=" + vOpt	+	",toolbar=0,menubars=0,locationbar=0,historybar=0,statusbar=0";
	opt	=	opt	+	",outerWidth=" + vWidth	+	",outerHeight="	+	vHeight	+	",resizable=0";
	opt	=	opt	+	",left=" + x + ",top=" + y;
	opt	=	opt	+	",channelmode=no,	titlebar=no";
	var	mdWindow = window.open(vUrl, "", opt,	false);
}
// ÆË¾÷Ã¢´Ý±â
function ClosePop()
{
	opener.ClearFrmIDVal();
	window.close();
}


//ÀÎ½ºÅÏ½ºÀÌ¸§ ÀÖ´Â	Ã¢ ¿­±â.
function openNameWindow(vWidth,	vHeight, vUrl, vName,	vOpt)	{
	var	mdWindow = null;
	var	x	=	(screen.width	-	vWidth)/2;
	var	y	=	(screen.height - vHeight)/2;
	var	opt;
	if (vOpt ==	"" ||	vOpt ==	null)	vOpt = 0;
	opt	=			"width=" + vWidth	+	",height=" + vHeight;
	opt	=	opt	+	",scrollbars=" + vOpt	+	",toolbar=0,menubars=0,locationbar=0,historybar=0,statusbar=0";
	opt	=	opt	+	",outerWidth=" + vWidth	+	",outerHeight="	+	vHeight	+	",resizable=0";
	opt	=	opt	+	",left=" + x + ",top=" + y;
	opt	=	opt	+	",channelmode=no,	titlebar=no";
	var	mdWindow = window.open(vUrl, vName,	opt, false);
	if(!mdWindow){
		alert("ÆË¾÷Â÷´ÜÀ»	ÇØÁ¦ÇØÁÖ¼¼¿ä.");
		return false;
	}
	mdWindow.focus();
}

function checkPattern(sType, str)	//Çü½Ä Ã¼Å©
{
	var	pattern	=	new	String() ;
	switch (sType){
		case "NUM" :	// ¼ýÀÚ¸¸
			pattern	=/^[0-9]+$/;
			break;
		case "PHONE" :
			pattern	=/^[0-9]{2,4}-[0-9]{3,4}-[0-9]{4}$/;										 //ÀüÈ­¹øÈ£	Çü½Ä : 033-1234-5678
			break;
		case "EMAIL" :
			pattern	=/^[_a-zA-Z\d\-\.]+@([_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+)/;						//¸ÞÀÏ
			break;
		case "DOMAIN"	:
			pattern	=/^[.a-zA-Z0-9-]+.[a-zA-Z]+$/; ///¿µÀÚ ¼ýÀÚ¿Í	.	´ÙÀ½µµ ¿µÀÚ
			break;
		case "ENG" : //¿µÀÚ¸¸
			pattern	=/^[a-zA-Z]+$/;
			break;
		case "ENGNUM"	:	//¿µÀÚ¿Í ¼ýÀÚ
			pattern	=/^[a-zA-Z0-9]+$/;
			break;
		case "HAN" : //	ÇÑ±Û¸¸
			pattern	=/^[°¡-ÆR]*$/;
			break;
		case "USERID"	:	//Ã¹±ÛÀÚ´Â ¿µÀÚ	±×µÚ¿£ ¿µ¾î¼ýÀÚ	4ÀÌ»ó	15ÀÚ¸® ÀÌÇÏ
			pattern	=/^[a-zA-Z]{1}[a-zA-Z0-9_-]{4,15}$/;
			break;
		case "DATE"	:	// ³¯Â¥	:	2002-08-15
			pattern	=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
			break;
		case "PASS"	:	// ³¯Â¥	:	2002-08-15
			pattern	=/^[;:`~!@#$%\^&*\(\)_a-zA-Z0-9-]{4,15}$/;
			break;
		default :
		  return false;
		  break;
	}

	//alert(str	+	"|"	+	pattern);

	if(!pattern.test(str)){
			return false;
	}
	return true;
}

//ÇØ´çÆÐÅÏÀ¸·Î °Ë»çÈÄ	¸Þ¼¼Áö Ãâ·Â
function isValidType(field,	type,	msg)
{
	if(!checkPattern(type, field.value))
	{
		if(msg !=	"")	alert(msg);
		field.focus();
		return false;
	}
	return true;

}

//Á¤±ÔÇ¥Çö½ÄÀ¸·Î ¹®ÀÚ¿­	Ä¡È¯
function strReplace(str){	// \º¯È¯
	str	=	str.replace("'", "\'");
//	str	=	str.replace(chr(13), "\n");
	str	=	str.replace("\\",	"/");
	return str
}

//»óÅÂÃ¢¿¡ ÁÖ¼Ò	¾È¶ß°Ô
function no_msg(){
	window.status="";
	return true;
}

//if(document.layers)
//	document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
//	document.onmouseover = no_msg;
//	document.onmouseout	=	no_msg;


//var	CheckBoxAll
//CheckBoxAll	=	false

function CheckAll(CheckBoxAll, InputName)//¸ðµÎ ¼±ÅÃÇÏ±â
{
//	if (CheckBoxAll	== true) CheckBoxAll = false;
//	else	CheckBoxAll	=	true;

	var	i;
	for	(i=0;i<document.forms[0].elements.length;i++){
		var	e	=	document.forms[0].elements[i];

			if(e.name	== InputName)
				e.checked	=	CheckBoxAll;
	}
}



//¼ýÀÚ¸¸ ´­¸®°Ô	ÇÏ±â , ¹æÇâÅ°	+	Delele + BackSpace Æ÷ÇÔ
function onlynum() {
	var	iCode	=	event.keyCode;
	if(!(	((iCode	>= 48) &&	(iCode <=	57)) ||	((iCode	>= 37) &&	(iCode <=	40)) ||	(iCode ==	8	)	|| (iCode	== 46	)||	(iCode ==	9	)	|| ((iCode	>= 96) &&	(iCode <=	105))  )) event.returnValue = false;
}

// TRIM!
function trim(val){
	if (val	!= null)
		val	=	val.replace(/	/g,'');
	return val;
}

//¿£ÅÍÃ¼Å©..
function F_CheckEnter(frm)
{
	if(event.keyCode==13)
		frm.submit();
}

function goPage(formNm,	PageNo)	{
	f=eval("document."+formNm);
	f.page.value=PageNo;
	f.submit();
}

function goPageMove(url){
	document.location.href = url;
}

function onlyNumericValue(frmField,	msg)
{
	if(frmField.value	=="")	return;
	if (isNaN(frmField.value)){
		if(typeof(msg)!="undefined"){
		  alert(msg);
		}
		frmField.value="";
		frmField.focus();
	}
}

// ³¯Â¥	À¯È¿¼ºÃ¼Å©
function isValidDate(yyyy, mm, dd, limitYearS, limitYearE) {
	var	arrLastDay = [31,	28,	31,	30,	31,	30,	31,	31,	30,	31,	30,	31];
	if (!/^[0-9]{4}$/.test(yyyy))	return false;
	if (!/^[0-9]{1,2}$/.test(mm))	return false;
	if (!/^[0-9]{1,2}$/.test(dd))	return false;

	if(limitYearS	!= null	&& limitYearE	!= null){
		if(yyyy	<	limitYearS &&	yyyy > limitYearE) return	false;
	}
	if(limitYearS	!= null){
		if(yyyy	<	limitYearS)	return false;
	}
	if(limitYearE	!= null){
		if(yyyy	>	limitYearE)	return false;
	}

	if (yyyy%1000	!= 0 &&	yyyy%4 ==	0) arrLastDay[1] = 29; //	À±³â
	if (dd > arrLastDay[mm-1]	|| dd	<	1) return	false; //	³¯Â¥ Ã¼Å©
	if (mm < 1 ||	mm > 12) return	false; //	¿ù Ã¼Å©
	if (mm%1 !=	0	|| yyyy%1	!= 0 ||	dd%1 !=	0) return	false; //	Á¤¼ö Ã¼Å©

	return true;
}

// ÁÖ¹Î¹øÈ£	Ã¼Å©
function checkJumin(formname1,formname2){
	var	chk=0
	var	yy=formname1.value.substring(0,2)
	var	mm=formname1.value.substring(2,4)
	var	dd=formname1.value.substring(4,6)
	var	sex=formname2.value.substring(0,1)
	if((formname1.value.length!=6)||(yy<25||mm<1||mm>12||dd<1)){
		formname1.select();
		return false;
	}
	if((sex!=1&&sex!=2)||(formname2.value.length!=7)){
		formname2.select();
		return false;
	}
	for(var	i=0;i<=5;i++){
		chk=chk+((i%8+2)*parseInt(formname1.value.substring(i,i+1)))
	}
	for(var	i=6;i<=11;i++){
		chk=chk+((i%8+2)*parseInt(formname2.value.substring(i-6,i-5)))
	}
	chk=11-(chk	%11)
	chk=chk%10
	if(chk!=formname2.value.substring(6,7)){
		formname2.select();
		return false;
	}
	return true;
}

function CheckValid(String,	space)
{
	 var retvalue	=	false;
	 for (var	i=0; i<String.length;	i++)
	 {		//StringÀÌ 0(""	ÀÌ³ª null)ÀÌ¸é ¹«Á¶°Ç	false
			if (space	== true)
			{
				 if	(String.charAt(i)	== ' ')
				 {			//StringÀÌ 0ÀÌ ¾Æ´Ò¶§	space°¡	ÀÖ¾î¾ß¸¸ true(valid)
						retvalue = true;
						break;
				 }
			}	else {
				 if	(String.charAt(i)	!= ' ')
				 {			//stringÀÌ 0ÀÌ ¾Æ´Ò¶§	space°¡	¾Æ´Ñ ±ÛÀÚ°¡	ÀÖ¾î¾ß¸¸ true(valid)
						retvalue = true;
						break;
				 }
			}
	 }
	 return	retvalue;
}

function checkJuminFrgn(frmname1, frmname2) {
    var sum = 0;
    var odd = 0;
    var reg_no = frmname1.value +""+ frmname2.value;
    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 isEmpty(field,	error_msg)
{
	// error_msg°¡ ""ÀÌ¸é	alert¿Í	focusingÀ» ÇÏÁö	¾Ê´Â´Ù
	if(error_msg ==	"")	{
		if(!CheckValid(field.value,	false))		{
			return true;
		}	else {
			return false;
		}
	}	else {
		if(!CheckValid(field.value,	false))	{
			alert(error_msg);
			field.focus()	;
			return true;
		}	else {
			return false;
		}
	}
}

//½ÃÀÛÀÏ, Á¾·áÀÏ °Ë»ç (Á¾·áÀÏÀÌ ´õ Å«Áö..)
function dateCompare(objStartDate, objEndDate, point, msg){
	//³â ¿ùÀÏ·Î ºÐ¸® ÇÑ´Ù.
	var start_Date = new Array(3);
	var end_Date = new Array(3);

	if(point != "")
	{
		start_Date = objStartDate.value.split(point);
		end_Date = objEndDate.value.split(point);

		if(start_Date.length != 3 && end_Date.length != 3)
		{
			alert("Àß¸øµÈ ³¯Â¥ÀÔ´Ï´Ù.");
			return false;
		}
	}
	else
	{
		start_Date[0] = objStartDate.substring(0,4);
		start_Date[1] = objStartDate.substring(4,6);
		start_Date[2] = objStartDate.substring(6,9);

		end_Date[0] = objEndDate.substring(0,4);
		end_Date[1] = objEndDate.substring(4,6);
		end_Date[2] = objEndDate.substring(6,9);
	}

	//Date °´Ã¼¸¦ »ý¼ºÇÑ´Ù.
	var sDate = new Date(start_Date[0], start_Date[1], start_Date[2]);
	var eDate = new Date(end_Date[0], end_Date[1], end_Date[2]);

	if(sDate > eDate){
		alert(msg);
		return false;
	}

	return true;
}

//¹®ÀÚ¿­ ±æÀÌ	Á¦ÇÑ
function isOutOfRange(field, min,	max, error_msg)
{
	if(strLength(field)	<	min	|| strLength(field)	>	max)
	{
		alert(error_msg);
		field.focus();
		field.select();
		return true;
	}
	return false;
}

//¹®ÀÚ¿­±æÀÌ ¹ÝÈ¯
function strLength(field)
{
	 var Length	=	0;
	 var Nav = navigator.appName;
	 var Ver = navigator.appVersion;
	 var IsExplorer	=	false;
	 var ch;
	 if	(	(Nav ==	'Microsoft Internet	Explorer') &&	(Ver.charAt(0) >=	4) )
	 {
			IsExplorer = true;
	 }
	 if(IsExplorer)
	 {
			for(var	i	=	0	;	i	<	field.value.length;	i++)
			{
				 ch	=	field.value.charAt(i);
				 if	((ch ==	"\n")	|| ((ch	>= "¤¿") &&	(ch	<= "È÷"))	||
						 ((ch	>="¤¡")	&& (ch <="¤¾")))
		{
				Length +=	2;
		}	else
		{
				Length +=	1;
				}
		}
	 }else {
			Length = field.value.length	;
	 }
	 return	Length;
}

//¹®ÀÚ¿­ ±æÀÌ	Á¦ÇÑ
function isOutOfByteRange(field, min,	max, error_msg)
{
	if(byteLength(field)	<	min	|| byteLength(field)	>	max)
	{
		alert(error_msg);
		field.focus();
		field.select();
		return true;
	}
	return false;
}

//¹®ÀÚ¿­ ¹ÙÀÌÆ® ±æÀÌ ¹ÝÈ¯
function byteLength(field) {
  var tmpStr;
  var temp=0;
  var onechar;
  var tcount;
  tcount = 0;

  tmpStr = new String(field.value);
  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++; }
  }

  return tcount;
}


//Ã¼Å©¹Ú½º(¹è¿­Æ÷ÇÔ)¿¡ Ã¼Å©µÇ¾îÀÖ´ÂÁö	È®ÀÎ
function isCheckedBox(frm,msg)
{
	var	check_length = frm.length;
	var	check_ = false;

	if(typeof(check_length)=="undefined"){
		if(frm.checked ==	false){
			alert(msg);
			frm.focus();
			return false;
		}
	}	else {
		for(i=0;i<check_length;i++){
			if(frm[i].checked){
				check_ = true;
			}
		}
		if(check_	== false)
		{
			alert(msg);
			frm[0].focus();
			frm[0].blur();
			return false;
		}
	}
	return true;
}

//¶óµð¿À¹öÆ° Ã¼Å©
function isNotCheckedRadio(field,	error_msg) {
	if ( field ==	null ) {
		alert(error_msg);
		return true;
	}

	if ( field.length	== null	)	{
		if ( field.checked ==	true ) {
			return false;
		}	else {
			alert(error_msg);
			return true;
		}
	}

	for(i	=	0; i < field.length; i++)	{
		if(field[i].checked	== true) {
			return false;
		}
	}
	alert(error_msg);
	field[0].focus();
	field[0].blur();
	return true;
}

// ¼±ÅÃµÇ¾îÀÖ´Â	¶óµð¿À¹öÆ° °ª
function getRadioVal(field)	{
	for(i	=	0; i < field.length; i++)	{
		if(field[i].checked	== true)
			return field[i].value;
	}
	return "";
}

//¼ýÀÚ¸¦ ±Ý¾×´ÜÀ§·Î	º¯È¯(ÄÞ¸¶Âï±â)
function formatNumber(num) {
//	num	=	num.replace(/,/g,	"");
	var	num_str	=	num.toString();
	var	result = ''

	for(var	i=0; i<num_str.length; i++)	{
		var	tmp	=	num_str.length-(i+1);
		if(i%3==0	&& i!=0) result	=	','	+	result;
		result = num_str.charAt(tmp) + result;
	}
	return result;
}

// ÀÏÁ¤±æÀÌ°¡	³Ñ¾î°¡¸é ´ÙÀ½À¸·Î	Æ÷Ä¿½º ³Ñ±â±â..
function skip_length(this_obj, next_obj, length){
	if(this_obj.value.length==length){
		next_obj.focus();
	}
}

/******************************************************************************/

function changeStoreIDFromXML(objFld, pCategory)
{
  var XMLURL = "";

	while (objFld.options.length > 1)
	{
		objFld.options[1] = null;
	}

  XMLURL = "/common/inc/store_name.xml.asp?category="+pCategory;

	if (XMLURL != "")
	{
		var xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHTTP.open("GET", XMLURL, false);
		xmlHTTP.send("");

		if (xmlHTTP.statusText == "OK")
		{
			var xmlDOM = xmlHTTP.responseXML;
			rows = xmlDOM.getElementsByTagName("SID");
			count = rows.length;

			for (var i=0; i<count; i++)
				objFld.options[i+1] = new Option(rows[i].text.split("||")[1], rows[i].text.split("||")[0]);

			rows = null;
			xmlDOM = null;
			xmlHTTP = null;
		}
	}
}

// ·¹ÀÌ¾î º¸ÀÌ°í °¨Ãß±â
var curLayerName = new String();
function showLayer(val)
{
  if(typeof(eval(val))=="undefined")
  {
    alert("'"+val+"' Layer not found");
    return;
  }

  if(curLayerName == val){
    eval(curLayerName).style.display = "none";
    curLayerName = "";
    return;
  }

  if(curLayerName!="") {
    eval(curLayerName).style.display = "none";
  }

  eval(val).style.display = "";
  curLayerName = val;
}

// ·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½ºÀÏ°æ¿ì ·Î±×ÀÎ ¾È³».
function reqLogin(returnURL)
{
  if(confirm("·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½ºÀÔ´Ï´Ù.\n\n·Î±×ÀÎÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?")){
    location.href="/member/login.asp?returnURL="+ returnURL;
  }
}

/******************************************************************************/
// ÆÄÀÏÃ·ºÎ½Ã ¼±ÅÃÇÑ ÀÌ¹ÌÁö ¹Ì¸®º¸±â - ´õ¹ÌÀÌ¹ÌÁö ÁØºñ
function iniPreviewImage(){
  document.write("<img name='imgPreviewLayer' src='/image/common/blank.gif' style='display:none' style='position:absolute;'>");
}

// ÆÄÀÏÃ·ºÎ½Ã ¼±ÅÃÇÑ ÀÌ¹ÌÁö ¹Ì¸®º¸±â - ´õ¹ÌÀÌ¹ÌÁö¿¡ ÀÌ¹ÌÁö°æ·Î ³Ö°í º¸¿©ÁÖ±â
function viewPreviewShow(pSrc, pW, pH) {
  var pattern = new String();
  pattern = /^.*(jpg|gif)$/;

  if(pSrc != "" && pattern.test(pSrc.toLowerCase())){
    var imgLayer = document.all["imgPreviewLayer"];
    imgLayer.style.posLeft = event.x - event.offsetX + document.body.scrollLeft;
  	imgLayer.style.posTop = event.y - event.offsetY + document.body.scrollTop + 20;
  	imgLayer.style.display = "";
  	imgLayer.style.border = "2px solid black";
  	imgLayer.style.width = pW;
  	//imgLayer.style.height = pH;
  	if (imgLayer.src != pSrc)
  	  imgLayer.src = pSrc;
  }
}

// ÆÄÀÏÃ·ºÎ½Ã ¼±ÅÃÇÑ ÀÌ¹ÌÁö ¹Ì¸®º¸±â - ´õ¹ÌÀÌ¹ÌÁö ¼û±â±â
function viewPreviewHide()
{
  var imgLayer = document.all["imgPreviewLayer"];
  imgLayer.style.display = "none";
}
/******************************************************************************/

// ½ºÅ©·¦ µî·Ï
function userScrap(pCategory, pHref, pMemo)
{
  //alert("½ºÅ©·¦ ºÐ·ù : "+pCategory +"\nÁÖ¼Ò : "+pHref +"\nÁ¦¸ñ : "+ pMemo);
  scrap_js.src="/common/js/scrap.js.asp?category="+ pCategory +"&href="+ pHref +"&memo="+ pMemo;
}

// ÄÚ¿¢½º¸ô ¸Ê (¸ÊÀ§Ä¡, ¸ÅÀå¹øÈ£)
function openCoexMallMap(sect, poscode)
{
  openNameWindow(1000, 700, "/intro/coexmall_map.asp?sect="+sect+"&poscode="+poscode, "coexmall_map", "0");
}

// Åõ¸í PNG »ç¿ëÇÏ±â
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 '';
}


/*************************************************************************/
/* È¸¿ø°¡ÀÔ ÀÚµ¿Â÷ Ä«Å×°í¸®..2008-02-20
/******************************************************************a*******/
function changeStCategoryFromXML(objFld1, objFld2, objFld3, val1, num)
{
  var XMLURL = "";

	while (objFld1.options.length > 1)
	{
		objFld1.options[1] = null;
	}

  if (typeof(objFld2)!= "undefinded" && objFld2 != '')
  {
  	while (objFld2.options.length > 1)
  	{
  		objFld2.options[1] = null;
  	}
  }

  if (typeof(objFld3)!= "undefinded" && objFld3 != '')
  {
  	while (objFld3.options.length > 1)
  	{
  		objFld3.options[1] = null;
  	}
  }

  XMLURL = "/members/category_xml.asp?carIdx="+ escape(val1)+"&num="+escape(num);

	if (XMLURL != "")
	{
		var xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHTTP.open("GET", XMLURL, false);
		xmlHTTP.send("");

		if (xmlHTTP.statusText == "OK")
		{
			var xmlDOM = xmlHTTP.responseXML;
			rows = xmlDOM.getElementsByTagName("DATA");
			count = rows.length;

			for (var i=0; i<count; i++)
				objFld1.options[i+1] = new Option(rows[i].text.split("||")[1], rows[i].text.split("||")[0]);

			rows = null;
			xmlDOM = null;
			xmlHTTP = null;
		}
	}
}
/*************************************************************************/
/* Á¦Ç°°ü¸® Á¦Ç° Ä«Å×°í¸®..2008-02-28
/******************************************************************a*******/
function changeCategoryFromXML(objFld1, objFld2, objFld3, val1, num)
{

  var XMLURL = "";

	while (objFld1.options.length > 1)
	{
		objFld1.options[1] = null;
	}

  if (typeof(objFld2)!= "undefinded" && objFld2 != '')
  {
  	while (objFld2.options.length > 1)
  	{
  		objFld2.options[1] = null;
  	}
  }

  if (typeof(objFld3)!= "undefinded" && objFld3 != '')
  {
  	while (objFld3.options.length > 1)
  	{
  		objFld3.options[1] = null;
  	}
  }
//location.href="/community/category_xml.asp?carIdx="+ escape(val1)+"&num="+escape(num);
  XMLURL = "/community/category_xml.asp?carIdx="+ escape(val1)+"&num="+escape(num);
	if (XMLURL != "")
	{
		var xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHTTP.open("GET", XMLURL, false);
		xmlHTTP.send("");

		if (xmlHTTP.statusText == "OK")
		{
			var xmlDOM = xmlHTTP.responseXML;
			rows = xmlDOM.getElementsByTagName("DATA");
			count = rows.length;

			for (var i=0; i<count; i++)
				objFld1.options[i+1] = new Option(rows[i].text.split("||")[1], rows[i].text.split("||")[0]);

			rows = null;
			xmlDOM = null;
			xmlHTTP = null;
		}
	}

}
//11¿ù 12ÀÏ ¼­¹ÌÁ¤ Ãß°¡ ¸µÅ© Á¡¼± ¾ø¾Ö±â
//function bluring(){
//if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
//}
//document.onfocusin=bluring;



///////////////////////////////// FAQ ·¹ÀÌ¾î  2008-02-13 ¼­¸íÁö
function InfoFaqView(obj){
	infoFaqHidden();
	document.all.popLayer2[obj].style.display = "";
	document.all.popLayer1[obj].style.display = "none";
}

function infoFaqHidden(obj){
	for(k=0;k<document.all.popLayer2.length;k++)
	{
		document.all.popLayer2[k].style.display = "none";
		document.all.popLayer1[k].style.display = "";
	}
}

/*
	.trim()
*/
String.prototype.trim = function() {
    return this.replace(/(^ *)|( *$)/g, "");
}

/*
	.ltrim()
*/
String.prototype.ltrim = function() {
    return this.replace(/(^ *)/g, "");
}

/*
	.rtrim()
*/
String.prototype.rtrim = function() {
    return this.replace(/( *$)/g, "");
}

/*
	¼±ÅÃ Çß´Â Áö °Ë»ç
	obj = ¶óµð¿À/Ã¼Å© ¹Ú½º
	return = boolean
*/
function isCheck(obj){
	var rtn = false;

	if(obj != null){
		if(obj.length == null || obj.length == 1){
			rtn = obj.checked;
		}else{
			for(i = 0; i < obj.length; i++){
				if(obj[i].checked){
					rtn = true;
					i = obj.length;
				}
			}
		}
	}

	return rtn;
}


// ¿¡µðÅÍ¿¡ ÆÄÀÏ Á¾·ù Ã¼Å©ÇÒ¶§ ÇÊ¿ä 2008-09-04
function checkFile(filename){
	var notEtc = new Array("php", "jsp", "asp", "aspx", "cgi", "pl", "php3", "php4", "exe", "com", "bat", "htm", "html", "js");//ÀÔ·Â ºÒ°¡ È®ÀåÀÚ
	var rtn;
	var etcName;

	rtn = false;
	etcName	= filename.substring(filename.lastIndexOf(".")+1,filename.length);
	etcName = etcName.toLowerCase();
	for(i = 0; i < notEtc.length; i++){
		if(notEtc[i] == etcName){
			rtn = true;
			i = notEtc.length;
		}
	}

	return rtn;
}

///////////////////////////////// FAQ ·¹ÀÌ¾î  2008-02-13 ¼­¸íÁö
function InfoFaqView(obj){
	infoFaqHidden();
	document.all.popLayer2[obj].style.display = "";
	document.all.popLayer1[obj].style.display = "none";
}

function infoFaqHidden(obj){
	for(k=0;k<document.all.popLayer2.length;k++)
	{
		document.all.popLayer2[k].style.display = "none";
		document.all.popLayer1[k].style.display = "";
	}
}

/*
	ÀÌ¹ÌÁö ÆÄÀÏ
	filename = ÆÄÀÏ¸í
	return = boolean
*/
function checkImgFile(filename){
	var imgExt = new Array("jpg", "jpeg", "gif");
	var rtn;
	var etcName;

	rtn = false;
	etcName	= filename.substring(filename.lastIndexOf(".")+1,filename.length);
	etcName = etcName.toLowerCase();
	for(i = 0; i < imgExt.length; i++){
		if(imgExt[i] == etcName){
			rtn = true;
			i = imgExt.length;
		}
	}

	return rtn;
}
function viewImg(imgSrc){
	window.open("/common/imgView.asp?upimgName=" + imgSrc, "", "width=500,height=500,top=0,left=0,scrollbars=yes");
}
function upImageStillCut(strImg, strtname)
{
	window.open("/common/imgView.asp?upimgName=" + strImg, "upImage", "width=300,height=300,scrollbars=yes");
}

function downLoad(upUrl, downName){
	window.location.href = "/common/download.asp?upUrl=" + upUrl + "&downName=" + downName;
}

function isValidEmail(obj) {
	var format = /^((w|[-.])+)@((w|[-.]|[_.])+).([A-Za-z]+)$/;
	return isValidFormat(obj,format);
}

/*
	Çü½Ä °Ë»ç
	obj = ÀÎÇ²¹Ú½º
	format = Çü½Ä
	return = boolean
*/
function isValidFormat(obj, format) {
	if (obj.search(format) != -1) {
		return true;//¿Ã¹Ù¸¥ Æ÷¸Ë Çü½Ä
	}
	return false;
}

//Ãâ»ý³âµµ·Î ³ªÀÌ ±¸ÇÏ±â - ÇÑ±¹³ªÀÌ
function getAgeAsBirth(val)
{
	var d = new Date();
	return d.getFullYear() - Number(val) + 1;
}




//quick navi 2009-03-27
function floatLayer(target,position,topLimit,btmLimit) {
	if (!target)
		return false;
	var obj = document.getElementById(target);
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;
	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}
	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 500;
		}
	}
	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}
		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;
		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 10)
}
function float() {
	document.getElementById("quick");
	floatLayer("quick",38,38,640);
}

var elem = "tr";
var rClick;
function rowHiligh() {
	if(document.getElementsByTagName) {
		var el = document.getElementsByTagName(elem);
		for(var i=0; i<el.length; i++) {
			if(el[i].childNodes[0].tagName != "th"
			&& el[i].parentNode.parentNode.className.indexOf("tabular") != -1) {
				if(i%2 == 1) {
					el[i].className = "first";
					el[i].oldClassName = "first";
					el[i].onmouseout  = function() {
						this.className = "first";
					}
				}
				else {
					el[i].className = "second";
					el[i].oldClassName = "second";
					el[i].onmouseout  = function() {
						this.className = "second";
					}
				}
				el[i].onmouseover = function() {
					if(this.className == this.oldClassName) {
						this.className = "hover";
					}
					if(this.onmouseout == null && this.className != "click") {
						this.onmouseout = function() {
							this.className = this.oldClassName;
						}
					}
				}
				el[i].onclick = function() {
					if(this.className != "click") {
						this.className = "click";
					}
					else {
						this.className = this.oldClassName;
					}
					this.onmouseout = null;
				}
			}
		}
	}
}


//ÇÁ·Î¸ð¼Ç ÅÇ 2009-04-01
function promotion_view(n)
{
	for(var i=1;i<=7;i++){
		if(i==n){		
			if(document.getElementById("n_btn"+i) != null){
				document.getElementById("n_btn"+i).src = "/images/main/pro_btn0"+i+"_on.gif";
			}
			if(document.getElementById("promotion_dis"+i) != null){
				document.getElementById("promotion_dis"+i).style.display="block";
			}
		} 
	}
	for(var i=1;i<=7;i++){
		if(i!=n){		
			if(document.getElementById("n_btn"+i) != null){
				document.getElementById("n_btn"+i).src = "/images/main/pro_btn0"+i+".gif";
			}
			if(document.getElementById("promotion_dis"+i) != null){
				document.getElementById("promotion_dis"+i).style.display="none";
			}
		} 
	}
}


//°øÁö»çÇ× ´º½º 2009-04-01
function notice_view(n)
{
	for(var i=1;i<=2;i++){
		if(i==n){		
			if(document.getElementById("n2_btn"+i) != null){
				document.getElementById("n2_btn"+i).src = "/images/main/h2_tit_notice0"+i+"_on.gif";
			}
			if(document.getElementById("notice_dis"+i) != null){
				document.getElementById("notice_dis"+i).style.display="block";
			}
		} 
	}
	for(var i=1;i<=3;i++){
		if(i!=n){		
			if(document.getElementById("n2_btn"+i) != null){
				document.getElementById("n2_btn"+i).src = "/images/main/h2_tit_notice0"+i+".gif";
			}
			if(document.getElementById("notice_dis"+i) != null){
				document.getElementById("notice_dis"+i).style.display="none";
			}
		} 
	}
}

/*
ÅÇ
*/
function tab_change(id,t,n,c) {
	var t =t+1;
	for (i=1; i<t; i++) {
		
		if (i==n) {
			tabImgId = document.getElementById(id + i);
			if (tabImgId != null) {
				(tabImgId.src.match(/(_on.gif)$/))? "" : tabImgId.src = tabImgId.src.replace(".gif","_on.gif");
			}
			conId = document.getElementById(c + i);
			if (c != null) {
				if(conId != null) {
				conId.style.display="block";
			    }
			}
		} else {
			tabImgId = document.getElementById(id + i);
			if (tabImgId != null) {
				(tabImgId.src.match(/(_on.gif)$/))? tabImgId.src = tabImgId.src.replace("_on.gif",".gif") : "" ;
			}

			conId = document.getElementById(c + i);
			if (c != null) {
				if(conId != null) {
				conId.style.display="none";
				}
			}
		}
	}
}

function layerView(layer) {
	var obj = document.getElementById(layer);
	if ( !obj.style.display || obj.style.display == "none" ) {
		obj.style.display = "block";
	} else {
		obj.style.display = "none";
	}
}

/* ½ÇÀûÁ¶È¸ */
function toggleView(target){
    var sTarget = target.href.split("#");
    var aTarget = document.getElementById(sTarget[sTarget.length-1]);
    if(aTarget.style.display == "none") aTarget.style.display = "block";
    else aTarget.style.display = "none";
}