//<!-- Copyright (c) 1999-2006 UniteU Technologies Inc.  All rights reserved.   //-->
// ************************************************************************************
// ****    DO NOT MODIFY THIS FILE!!!  **************************************************
// **************************************************************************************
//This file will be re-generated any time the site is upgrade, any changes will be lost.
//	Also, This folder is NOT included in Transfers.  Please make your own js file.
// <% version = " 4.94ab 12/07/06 " %>
//<!--

function write_errors (){
	if (errors == 1){
		document.write("<TABLE WIDTH=500 >");
		document.write("<TR><TD><FONT class=BasketErrors >");
		document.write(error_msg);
		document.write("</FONT></TD></TR>");			
		document.write("</TABLE>");
	    document.write(gen_error_msg);
	} 
	if(giftlist_errors.length>0){
		document.write("<TABLE WIDTH=500 >");
		for (atn=0;atn< giftlist_errors.length ;atn++){
			document.write("<TR><TD><FONT class=BasketErrors >");
			document.write(giftlist_errors[atn].error_msg);
			document.write("</FONT></TD></TR>");			
		}
		document.write("</TABLE>");
	}       
}

function draw_messages() 
{
	if (gift_list.no_items==0)
	{
		document.write("<BLOCKQUOTE><STRONG>");
		document.write(empty_msg);
		document.write("</STRONG></BLOCKQUOTE>");	
	}else{
		document.write("<br>" + above_list_msg + "<br>");
	}
}

function draw_table() 
{
	if(gift_list.no_items > 0) 
	{
		var product_href = "";
		document.write("<br><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"SubHeadbgcolor\">");
		document.write("<tr valign=top><td>");    
		document.write("<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"center\">");
		document.write("<tr><td class=\"CartLabels\">Image</td>");
		document.write("<td class=\"CartLabels\">Description</td>");
		document.write("<td align=\"center\" class=\"CartLabels\">");
		if (page_option_5 == 1)
		{
			document.write("In Stock?");
		}else{
			document.write("Item#");
		}
		document.write("</td>");
		document.write("<td align=\"center\" class=\"CartLabels\">Desired</td>");
		document.write("<td align=\"center\" class=\"CartLabels\">Filled</td>");
		document.write("<td align=\"center\" class=\"CartLabels\">Needed</td>");
		if (page_option_1 == "1"){
			document.write("<td align=\"center\" class=\"CartLabels\">List Price</td>");
			document.write("<td align=\"center\" class=\"CartLabels\">Your Price</td>");
		}
		document.write("<td> </td></tr>");
		for (atn=0;atn< gift_list.items.length ;atn++)
		{
		  	product_href = "<a HREF=\"product.asp?dept_id=" + gift_list.items[atn].dept_id + "&pf_id="+ gift_list.items[atn].pf_id + "&wish_id="+ gift_list.event_wish_id + "&order_sid="+ order_sid + "&so_number="+ so_number + "&\" target=_top ";
			product_href += "onClick=return(visitargs('product.asp','dept_id=" + gift_list.items[atn].dept_id + "&pf_id="+ gift_list.items[atn].pf_id + "&px_id="+ gift_list.items[atn].px_id + "&wish_id="+ gift_list.event_wish_id + "&order_sid="+ order_sid + "&so_number="+ so_number + "&','URL'));>";
		  	
		  	//thumbnail image
		  	document.write("<tr class=\"tablebgcolor\" valign=top><td class=cart_list_item align=center width=\"" + item_image_width + "\">");
			if (gift_list.items[atn].image !="")
			{
				document.write(product_href + "<img src=\"assets/product_images/" + gift_list.items[atn].image + "\" border=0 width=\"" + item_image_width + "\"></A>");	
			}
			//product name and description
			document.write("&nbsp;</TD><td class=cart_list_item align=left>"); 
			document.write(product_href + gift_list.items[atn].name + "</A>");	
			document.write(" <br>&nbsp;&nbsp;");
			var tempstr ="";               	
			if (gift_list.items[atn].attr_value1 !=""){ tempstr = gift_list.items[atn].attr_value1; }
			if (gift_list.items[atn].attr_value2 !=""){ tempstr += ", " + gift_list.items[atn].attr_value2; }
			if (gift_list.items[atn].attr_value3 !=""){ tempstr += ", " + gift_list.items[atn].attr_value3; }
			if (gift_list.items[atn].attr_value4 !=""){ tempstr += ", " + gift_list.items[atn].attr_value4; }
			if (gift_list.items[atn].attr_value5 !=""){ tempstr += ", " + gift_list.items[atn].attr_value5; }                         
			if (gift_list.items[atn].info_attr1 !=""){ tempstr += ", " + gift_list.items[atn].info_attr1; }
			if (gift_list.items[atn].info_attr2 !=""){ tempstr += ", " + gift_list.items[atn].info_attr2; }
			if (gift_list.items[atn].info_attr3 !=""){ tempstr += ", " + gift_list.items[atn].info_attr3; }
			document.write(tempstr); 
			//product sku / stock msg
			document.write("</td><td class=cart_list_item align=left>"); 
			if (page_option_5 == 1)
			{
				document.write(gift_list.items[atn].stock_msg);
			}else{
				document.write(gift_list.items[atn].sku);
			}
			//desired quantity
			document.write(" </TD><td class=cart_list_item align=center>");
			document.write(gift_list.items[atn].desired_qty);
			//filled quantity
			document.write(" </TD><td class=cart_list_item align=center>");
			document.write(gift_list.items[atn].filled_qty);
			//needed quantity
			document.write(" </TD><td class=cart_list_item align=center>");
			if (gift_list.items[atn].needed_qty == "0")
			{
				document.write(fulfilled_msg);
			}else{
				document.write(gift_list.items[atn].needed_qty);
			}
			document.write("</TD> ");
			//show price
			if (page_option_1 == "1")
			{
				document.write("<td class=cart_list_item align=center>");
				document.write(" $" + OKStrOfPenny(gift_list.items[atn].item_listprice));
				document.write(" </td>");
				document.write("<td class=cart_list_item align=center>");
				document.write(" $" + OKStrOfPenny(gift_list.items[atn].item_price));
				document.write(" </td>");
			}
			document.write("<td class=cart_list_item align=center>");
			if (gift_list.items[atn].enable_basket=="1" && gift_list.items[atn].needed_qty != "0")
			{
				document.write(gift_list.items[atn].buy_URL);
				document.write("<img src=\"assets/images/" +add_image+ "\" border=0 alt=\""+  add_image_alt + "\"></a>");          
			}
			document.write(" </TD></TR>");		
		}
		document.write("</TABLE></td></tr><tr><td height=\"10\" class=\"tablebgcolor\"></td></tr></table>");
	}
}


//--------------------------------
// Structures
//--------------------------------
function gift_items_struct(){
	this.sku
	this.dept_id
	this.pf_id
	this.px_id
	this.name
	this.image
	this.attr_value1
	this.attr_value2
	this.attr_value3
	this.attr_value4
	this.attr_value5
	this.info_attr1	
	this.info_attr2
	this.info_attr3	
	this.pvendor_code	
	this.porder_code	
	this.vvendor_code	
	this.vorder_code	
	this.desired_qty
	this.filled_qty
	this.needed_qty
	this.item_listprice	
	this.item_price
	this.discount
	this.item_total
	this.avail	
	this.stock_msg
	this.enable_basket
	this.buy_URL
}

function gift_list_struct(){
	this.no_items
	this.sub_total
	this.event_date
	this.event_type
	this.event_text_info
	this.event_wish_name
	this.event_second_name
	this.event_account_name
	this.event_wish_id
	this.items	
}

function errors()
{
	this.error_msg;
}
//-->	
