var cart = new ShoppingCart("", "cart");
var lastPage = cart.getList().length - 1;
var currPage = lastPage;
function UpDiv(){
	var arrDiv = new Array;
	for(i=0; i <= lastPage; i++) {
		arrDiv[i] = document.getElementById('page'+i);
	}
	
	if(currPage < lastPage) currPage++;
	startPage = currPage - 3;
	
	for(i=0; i <= lastPage; i++) {
		if(startPage < i && currPage >= i) {
			arrDiv[i].style.display = 'inline';
		} else {
			arrDiv[i].style.display = 'none';
		}
	}
}
                                                    
function DownDiv(){
	var arrDiv=new Array;									
	for(i=0; i <= lastPage; i++) {
		arrDiv[i]=document.getElementById('page'+i);
	}
	
	if(currPage > 0 && currPage - 3 >= 0) currPage--;
	startPage = currPage - 3;
	
	for(i=0; i<= lastPage; i++) {
		if(startPage < i && currPage >= i) {
			arrDiv[i].style.display = 'inline';
		} else {
			arrDiv[i].style.display = 'none';
		}
	}
}

function show() {
	html = "";
	html += "<table width='74' border='0' cellpadding='0' cellspacing='0'>";
	html += "  <tr>";
	html += "    <td bgcolor='E8E8E8'>";
	html += "      <img src='http://image1.hanatour.com/main_n/left/tl_viewprod_.gif' width='74' border='0'/></td>";
	html += "  </tr>";
	html += "  <tr>";
	html += "    <td width='74' align='center' class='8pt' bgcolor='E8E8E8'>";
	html += "      <font color='#9E005D'><b>" + cart.getCount() + "</b></font>";
	html += "    </td>";
	html += "  </tr>";
	html += "  <tr>";
	html += "    <td width='74' align='center' valign='top' background='http://image1.hanatour.com/main_n/left/tl_viewprod3_.gif'>";
	html += "      <table width='74' border='0' cellpadding='0' cellspacing='0'>";
	html += "        <tr>";
	html += "          <td height='3'>";
	html += "            <img src='http://image1.hanatour.com/main_n/left/tl_viewprod2_.gif' width='74' border='0'/></td>";
	html += "        </tr>";
	html += "        <tr>";
	html += "          <td width='72' align='center' class='8pt' style='padding:0 3 0 5;'>";
	html += "            <img src='http://image1.hanatour.com/main_n/left/btn_up.gif' width='11' height='9' onClick='UpDiv()' style='cursor:hand;' border='0'/>";
	html += "            <div class='viewprod'>";
	
	prodList = cart.getList();
	pageCnt = 1;
	for(i = prodList.length - 1; i >= 0; i--) {
		if(pageCnt > 3) {
			disp = "none";
		} else {
			disp = "inline";
		}
		html += "            <div width='64' id='page" + i + "' style='display:"  + disp + ";'>";
		html += "            <table cellpading=0 cellspacing=0 border=0>";
		html += "            <tr>";
		html += "              <td>";
		html += "                <a href='/app/wsv/packageproduct/pk-12000.asp?pkg_code=" + prodList[i].code + "' style='text-decoration: none'>";
		html += "                <img src='" + prodList[i].image + "' width='58' height='46' border='0'/></a></td>";
		html += "					   </tr>";
		html += "					   <tr>";
		html += "						   <td>";
		html += "                <a href='/app/wsv/packageproduct/pk-12000.asp?pkg_code=" + prodList[i].code + "' class='gray_orange11_11'>";
		html += prodList[i].name;
		html += "                </a>";
		html += "              </td>";
		html += "					   </tr>";
		html += "				     </table>";
		html += "				     </div>";
		
		pageCnt++;
	}
	
	html += "				</div>";
	html += "				<img src='http://image1.hanatour.com/main_n/left/btn_down.gif'";
	html += "         width='11' height='9' border='0' onClick='DownDiv();' style='cursor:hand;' border='0'/></td>";
  html += "			</tr>"; html += "		</table>";
	html += "		</td>";
	html += "	</tr>";
	html += "	<tr>";
	html += "		<td><img";
	html += "			src='http://image1.hanatour.com/main_n/left/tl_viewprod4_.gif'";
	html += "			width='74' height='10' border='0'/></td>";
	html += "	</tr>";
	html += "</table>";
	
	document.write(html);
}

show();