
function TopNEW(bodynum)
{
	
	var req = getXMLHTTP();

	req.onreadystatechange = function()
	{
		if(req.readyState == 4)
		{	
			showIndicatorLoading('close');
			stepcarousel.stepTo('mygallery',document.getElementById('body_number').value);
			if (req.status == 200)
			{
				handleNEWResponse(eval("("+req.responseText+")"),bodynum);
			}
		}
		else
		{
			showIndicatorLoading('show');
		}
	}
	
	req.open('POST',"/call/call_NEW.asp",true);
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	req.send(null);
}

function handleNEWResponse(result,bodynum)
{
	var bodytop = document.getElementById("body_top0"+bodynum);
	var bodycenter = document.getElementById("body_center0"+bodynum);
	var bodybottom = document.getElementById("body_bottom0"+bodynum);

	if (result.result == "ok")
	{
		bodytop.innerHTML =
			"<table width=100% border=0 cellspacing=0 cellpadding=0 background=/img/order/subtit_bg.gif>"
		+"  <tr>"
		+"	<td width=15 >&nbsp;</td>"
		+"	<td height=42><img src=/img/top/new_title.gif ></td>"
		+"	<td>&nbsp;</td>"
		+"	<td align=right class=location>HOME &gt;  <b>NEW</b> </td>"
		+"	<td width=15 >&nbsp;</td>"
		+"  </tr>"
		+"  <tr><td height=1 bgcolor=black colspan=5 ></td></tr>"
		+"  <tr>"
		+"	<td height=33 valign=top style=padding-top:7px colspan=5><table width=811  border=0 cellspacing=0 cellpadding=0 >"
		+"	  <tr>"
		+"		<td width=10></td>"
		+"		<td width=9><img src=/img/order/arrow.gif width=9 height=10></td>"
		+"		<td class=subtit>½Å»óÇ°</td>"
		+"	  </tr>"
		+"	</table></td>"
		+"  </tr>"
		+"</table>";


		var listHTML = 
			"<br><table><tr><td width=10></td><tD><table width=812 border=0 cellspacing=0 cellpadding=0 height=100%>";
		var line_change = 0;
		namuji = result.sub.length % 4;

		for (i=0;i<result.sub.length;i++)
		{
			
			
			if (i==(4*line_change))//ÇÑÁÙ¿¡ 4°³¾¿
			{
				line_change = line_change + 1
				listHTML = listHTML + "<tr align=center>";
			}

			if (result.sub[i].standard != '')
			{
				var standard = "<br><font style=font-family:µ¸¿ò;font-size:11px;letter-spacing:-1px;color:#BFBFBF;>±Ô°Ý: "+ result.sub[i].standard +"</font>";
			}else{ var standard = '';}
			

			//¹«·á¹è¼Û ÀÌ¹ÌÁö´Þ±â
			if (result.sub[i].freedeli == "1" || result.sub[i].price >= 50000)
			{
				var list_image = "<div style='width:130px;height:130px;'><div style='position:fixed; _position:absolute;width:43px;height:43px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src=/img/common/freedeli_list.png);'></div><a href=javascript:body_change('Goods="+result.sub[i].code+"');>"
							+"		<img src=/goods_img/"+ result.sub[i].image+" width=130 height=130 border=0 style=cursor:hand;></a></div></div>";
			}else{
				var list_image = "<a href=javascript:body_change('Goods="+result.sub[i].code+"');>"
							+"		<img src=/goods_img/"+ result.sub[i].image+" width=130 height=130 border=0 style=cursor:hand;></a>";
			}
			///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

			listHTML = listHTML +"<td>"
			+"<table width=203 border=0 cellspacing=0 cellpadding=0><tr><td colspan=2>"
			+	"<table width=190 border=0 cellspacing=1 cellpadding=0>"
			+"		<tr><td height=155 align=center bgcolor=#FFFFFF>"
			+	list_image
		
			
			+"			</td></tr></table>"
			+"		</td></tr>"
			
			+		"<tr><td bgcolor=#E3E3E3 height=2 colspan=2></td></tr><tr><td align=center>"
			+"		<table cellpadding=0 cellspacing=0 height=70 width=160 align=center><tr><td height=10></td></tr><tr><td align=center style='cursor:hand' class=subtit valign=top><a href=javascript:body_change('Goods="+result.sub[i].code+"'); >"+ result.sub[i].name+"</a>"
			+			 "<br><font style='color:#BFBFBF;font-weight:bold;'>£Ü"+ GetFormatMoney(result.sub[i].price) +"</font>"+standard+"</td></tr></table></td></tr><tr><td colspan=2 height=1 bgcolor=#E3E3E3></td></tr>"
			+"</table></td>";


			
			

			if (i==(result.sub.length-1))
			{	
				if (namuji != 0)
				{
					for (k=0;k<4-namuji ;k++ )
					{
						listHTML = listHTML + "<td width=203>"
						+"<table width=203 border=0 cellspacing=0 cellpadding=0><tr><td colspan=2>"
						+	"<table width=190 border=0 cellspacing=1 cellpadding=0>"
						+"		<tr><td height=155 align=center bgcolor=#FFFFFF>"
						
						+"			</td></tr></table>"
						+"		</td></tr>"

						+		"<tr><td bgcolor=#E3E3E3 height=2 colspan=2></td></tr>"

						+"		<tr height=70><td><table><tr><td align=center style='cursor:hand' class=subtit>"
						+"		</td>"
						+"		<td align=center class=subtit></td></tr></table>"
						+"		</td></tr><tr><td colspan=2 height=1 bgcolor=#E3E3E3></td></tr>"
						+"</table>"
						
						+"</td>";
					}
				}
				
				listHTML = listHTML + "</tr></table></td></tr></table>";
				
			}

			
		}	

		bodycenter.innerHTML = listHTML;
	
	}
	else
	{
		bodytop.innerHTML = "";
		bodycenter.innerHTML = "¼³Á¤µÈ ½Å»óÇ°ÀÌ ¾ø½À´Ï´Ù.";
	}

	bodybottom.innerHTML = 
"		<br><br> <table width=844 border=0 cellspacing=0 cellpadding=0> <tr>"
+"			 <tr>"
+"				<td height=1 bgcolor=#CCCCCC></td>"
+"			 </tr>"
+"			<td height=30><table border=0 cellspacing=0 cellpadding=0 align=center>"

+"			  <tr>"
+"				<td height=28><img src=/img/main/footer_01.gif width=39 height=13 border=0 onclick=javascript:CompanyIntro('show','1'); style=cursor:hand;></td>"
+"				<td><img src=/img/main/footer_00.gif width=17 height=13></td>"
+"				<td><img src=/img/main/footer_02.gif width=39 height=13 border=0 onclick=body_change('Recruit') style=cursor:hand;></td>"
+"				<td><img src=/img/main/footer_00.gif width=17 height=13></td>"
+"				<td><img src=/img/main/footer_03.gif width=85 height=13 border=0 onclick=PartnerhShip(); style=cursor:hand;></td>"
+"				<td><img src=/img/main/footer_00.gif width=17 height=13></td>"
+"				<td><img src=/img/main/footer_04.gif width=39 height=13 border=0 onclick=LargeBuy(); style=cursor:hand;></td>"
+"				<td><img src=/img/main/footer_00.gif width=17 height=13></td>"
+"				<td><img src=/img/main/footer_05.gif width=39 height=13 border=0 onclick=B2B(); style=cursor:hand;></td>"
+"				<td><img src=/img/main/footer_00.gif width=17 height=13></td>"
+"				<td><img src=/img/main/footer_06.gif width=39 height=13 border=0 onclick=body_change('UseAgreement') style=cursor:hand;></td>"
+"				<td><img src=/img/main/footer_00.gif width=17 height=13></td>"
+"				<td><img src=/img/main/footer_07.gif width=75 height=13 border=0 onclick=body_change('Privacy') style=cursor:hand;></td>"
+"				<td><p><img src=/img/main/footer_00.gif width=17 height=13></p>          </td>"
+"				<td><img src=/img/main/footer_08.gif width=102 height=13 border=0 onclick=body_change('EmailRejection') style=cursor:hand;></td>"
+"			  </tr>"
+"			</table></td>"
+"		  </tr>"
+"		  <tr>"
+"			<td height=1 bgcolor=#CCCCCC></td>"
+"		  </tr>"
+"		</table>"
+"		<table width=844 border=0 cellspacing=0 cellpadding=0>"
+"		  <tr>"
+"			<td height=45 valign=bottom class=footer>»ç¾÷ÀÚµî·Ï¹øÈ£ : 212-81-41001 ¤Ó Åë½ÅÆÇ¸Å¾÷ ½Å°í¹øÈ£ : °­µ¿±¸Ã»Á¦ 25-775È£ ¤Ó ´ëÇ¥ÀÌ»ç : ±è´ëÇö<br>"
+"			  ÁÖ¼Ò : ¼­¿ï½Ã °­µ¿±¸ ±æµ¿ 414-10 °­µ¿ÇÑ½ÅÈÞÇÃ·¯½º ÁöÇÏ 1Ãþ (ÁÖ)ÆäÀÌÆÞÀ¯Åë ¤Ó TEL : 02-474-3950 ¤Ó FAX : 02-488-7022<br>°³ÀÎÁ¤º¸°ü¸®Ã¥ÀÓÀÚ : ¼­ÀºÃ¶ºÎÀå (sec@papearl.com)</td>"
+"		  </tr>"
+"		  <tr>"
+"			<td height=22 valign=bottom class=copyright>Copyright(c) 2009 Papearl, All right reserved. </td>"
+"		  </tr>"
+"		</table>";
}
