function TabGo(cNum,G_Cod,Page,Opt) {
    if(cNum=='1') {
        $('TabImg1').show();
        $('TabImg1_1').hide();
        $('TabImg2').hide();
        $('TabImg2_1').show();
        $('TabList3').className="out";
        AjaxGo('/common/ajax/Ajax_Main1.asp?G_Cod='+G_Cod);
    }
    else if(cNum=='2') {
        //$('TabImg1').hide();
        //$('TabImg1_1').show();
        $('TabImg2').show();
        $('TabImg2_1').hide();
        $('TabList3').className="out";
        AjaxGo('/common/ajax/Ajax_Main2.asp?G_Cod='+G_Cod+'&SellState='+Opt);    
    }
    else if(cNum=='3') {
        //$('TabImg1').hide();
        //$('TabImg1_1').show();
        $('TabImg2').hide();
        $('TabImg2_1').show();
        $('TabList3').className="on";
        AjaxGo('/common/ajax/Ajax_Main3.asp?G_Cod='+G_Cod+'&Page='+Page+'&Opt='+Opt);    
    }
    else if(cNum=='4') {
        //$('TabImg1').hide();
        //$('TabImg1_1').show();
        $('TabImg2').hide();
        $('TabImg2_1').show();
        $('TabList3').className="on";
        AjaxGo('/common/ajax/Ajax_Main3_2.asp?G_Cod='+G_Cod+'&Page='+Page+'&Opt='+Opt);    
    }
}

function goWabi() {
    var KeyWord=document.frmWabi.KeyWord.value;
    var flg=false;
    
    if(KeyWord==""){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿©ÁÖ¼¼¿ä.");
		frm.KeyWord.focus();
		return;
	}  
					
	if(KeyWord.length==1){
	  var checkOk = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";   
	  if(checkOk.indexOf(KeyWord)>0) { 
	       flg=true;
	  } 
	}
			 
	if(!KeyWord.match(/[0-9]|[a-z]|[A-Z]|[¤¡-ÆR]/)){
		alert("Æ¯¼ö±âÈ£´Â ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù. ");
	    return;
	}
	if(KeyWord.indexOf("<")>-1) {
		alert("Æ¯¼ö±âÈ£´Â ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù. ");
	    return;
	}
					
	if(flg==false){
		document.frmWabi.submit();
	}
	else {
		alert("¿µ¹®ÀÌ³ª ¼ýÀÚ´Â 2ÀÚ ÀÌ»óÀ¸·Î ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù.");
		return;
	}
	
}

// ´ñ±Û ¾²±â ·¹ÀÌ¾î º¸±â
function ReplyView(i) {
    $('LayerReplyWrite'+i).toggle();
}

// ´ñ±Û ¾²±â
function ReplyWrite() {
    var frm=document.frmWrite;
    var Comment=frm.Comment.value;
    if(Comment=='') {
        alert('´ñ±Û ³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
        frm.Comment.focus();
        return;
    }
    if(Comment.length<3) {
        alert('´ñ±Û ³»¿ëÀÌ ³Ê¹« Âª½À´Ï´Ù.');
        frm.Comment.focus();
        return;
    }
    if(!Comment.match(/[0-9]|[a-z]|[A-Z]|[¤¡-ÆR]/)){
		alert("Æ¯¼ö±âÈ£´Â ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù. ");
	    return;
	}
	if(Comment.indexOf("<")>-1) {
		alert("Æ¯¼ö±âÈ£´Â ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù. ");
	    return;
	}
    frm.submit();
}

// ´ñ±ÛÀÇ ´ñ±Û ¾²±â
function ReplyGo(i,Reply_Cod) {
    var frm=document.frmReply;
    var Comment=document.frmReplyList.Comment[i].value;
    if(Comment=='') {
        alert('´ñ±Û ³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
        document.frmReplyList.Comment[i].focus();
        return;
    }
    if(Comment.length<3) {
        alert('´ñ±Û ³»¿ëÀÌ ³Ê¹« Âª½À´Ï´Ù.');
        return;
    }
    if(!Comment.match(/[0-9]|[a-z]|[A-Z]|[¤¡-ÆR]/)){
		alert("Æ¯¼ö±âÈ£´Â ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù. ");
	    return;
	}
	if(Comment.indexOf("<")>-1) {
		alert("Æ¯¼ö±âÈ£´Â ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù. ");
	    return;
	}
    frm.Comment.value=Comment;
    frm.pCod.value=Reply_Cod;
    frm.submit();
}

// AjaxÃ³¸®
function AjaxGo(url){
     new Ajax.Request(
		 url,{
		method:"post",
		onComplete: showResponse
	 });
}

function showResponse(Rtxt) {
    var Result=Rtxt.responseText;
    if(Result.indexOf('#*#')>0) {
        var cnt = Result.substr(0,Result.indexOf('#*#'));
        var Result = Result.substr(Result.indexOf('#*#')+3,100000);
        $('lblReplyCnt').update('('+ cnt +')');
        $('LayerGoodsList').update(Result);
    }
    else {
        $('LayerGoodsList').update(Result);
    }
}

// ¼Ò¿øºô±â
function MyWantGo() {
    if(parseInt($('spRemain').innerHTML)>0) {
        $('devPrice').innerHTML="<strong class='odd'>¼Ò¿øºô±â ÇÑ °¡°Ý</strong>";
    }
    document.frmWant.submit();
}

// »óÇ°º¯°æ
function ChgGoods(M_Cod) {
    document.frmWant.M_Cod.value=M_Cod;
}

function DevClose() {
    $('DevList').hide();
}
function DevShow() {
    $('DevList').show();
}
function FlashUp(Price) {
    var html='';
    html = html + '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="143" HEIGHT="56" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id=ShockwaveFlash1>';
    html = html + '<PARAM NAME=movie VALUE="/images/main/price_wish.swf">';
    html = html + '<param name=quality value=high>';
    html = html + '<param name="wmode" value="transparent">';
    html = html + '<param name=menu value=false>';
    html = html + '<param name=loop value=true>';
    html = html + '<param name=FlashVars value=&Price='+Price+'>';
    html = html + '<param name=background value=white>';
    html = html + '<EMBED src="/images/main/price_wish.swf" WIDTH="143" HEIGHT="56" TYPE="application/x-shockwave-flash" PLUGINSPAGE="pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false" loop="true"></EMBED>';
    html = html + '</OBJECT>';
    $('MyWantFlash').innerHTML=html;
}