function DrawRightColumn(){

	// Draw newsletter block
	DrawBlock("EmailSignup");

}

function DrawBlock(BlockName){

	// Output buffer
	var UU_Output = "";

	switch(BlockName){
	
		case "EmailSignup":

			// Draw block
			UU_Output += "<div class=\"Block\">";
			UU_Output += "	<div class=\"Block-Title\">Newsletter</div>";
			UU_Output += "	<div class=\"Block-Body\">";
			UU_Output += "		Please enter your email address below to sign up for the Cross & Co. Newsletter.";
			//UU_Output += "		<div align=\"center\">";
			UU_Output += "		<script language=\"javascript\" type=\"text/javascript\">";
			UU_Output += "		email_signup();";
			UU_Output += "		</script>";
			//UU_Output += "		</div>";
			UU_Output += "	</div>";
			UU_Output += "</div>";
			
			break;
		
		case "FeaturedBrands":
			
			// Draw block
			UU_Output += "<div class=\"Block\">";
			UU_Output += "	<div class=\"Block-Title\">Featured Brands</div>";
			UU_Output += "	<div class=\"Block-Body\">";
			UU_Output += "		<a href=\"dept.asp?dept_id=5010\" onClick=\"return(visitargs('dept.asp','dept_id=5010','URL'))\"><img style=\"padding-bottom: 10px;\" src=\"assets/images/FeaturedBrand1.gif\" /></a><br />";
			UU_Output += "		<a href=\"dept.asp?dept_id=5020\" onClick=\"return(visitargs('dept.asp','dept_id=5020','URL'))\"><img style=\"padding-bottom: 10px;\" src=\"assets/images/FeaturedBrand2.gif\" /></a><br />";
			UU_Output += "		<a href=\"dept.asp?dept_id=5030\" onClick=\"return(visitargs('dept.asp','dept_id=5030','URL'))\"><img style=\"padding-bottom: 10px;\" src=\"assets/images/FeaturedBrand3.gif\" /></a><br />";
			UU_Output += "	</div>";
			UU_Output += "</div>";
			
			break;

		case "DepartmentCrossPromos":
			
			// Draw block
			UU_Output += "		<script language=\"javascript\" type=\"text/javascript\">";
			UU_Output += "		draw_related_dept('0','1','Related Items','0','80','<BR> ','<BR>SALE PRICE ','<BR>');";
			UU_Output += "		draw_related_dept('1','1','Accessories','0','80','<BR> ','<BR>SALE PRICE ','<BR>');";
			UU_Output += "		</script>";
			
			break;

		case "ProductCrossPromos":
			
			// If cross promos are enabled
			if (page_option_4!=1 && nRelated>0){
				
				// Draw block
				UU_Output += "		<script language=\"javascript\" type=\"text/javascript\">";
				UU_Output += "		draw_related_product('0','1','Related Items','0','160','<BR> ','<BR>SALE PRICE ','<BR>');";
				UU_Output += "		</script>";
			}
			
			break;
	}

	// Write output
	document.write(UU_Output);
}

function email_signup() {
	//document.write("<TD>");
	document.write("<div id=\"EmailSignup\">");
	if (user_email == "") {
		document.write("<form name=\"surveynew\" method=\"POST\" action=\"shopper_new.asp\">");
		document.write("<input type=\"hidden\" name=shopper_country value=\"USA\">");
		document.write("<input type=\"hidden\" name=\"Validate\" value=\"1\">");
	} else {
		var AUTO_email = user_email.substring(0, user_email.lastIndexOf("_"));
		if (AUTO_email == "AUTO") {
			document.write("<form name=\"surveynew\" method=\"POST\" action=\"shopper_new.asp\">");
			document.write("<input type=\"hidden\" name=shopper_country value=\"USA\">");
			document.write("<input type=\"hidden\" name=\"Validate\" value=\"1\">");
		} else {
			document.write("<form name=\"surveynew\" method=\"POST\" action=\"shopper_unsubscribe.asp\">");
		}
	}
	document.write("<input type=\"hidden\" name=target value=\"text_4.asp\">");
	document.write("<input type=\"hidden\" name=s_id value=\"0\">");
	document.write("<input type=\"hidden\" name=\"shopper_pref_1\" value=\"YES\">");
	//document.write("<div style=\"float: left; margin-right: 5px; \">");
	document.write("<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tr><td>");
	drawinput("TEXT", "shopper_email", "", 24, 1, "Form-Field", null);
	document.write("</td><td>&nbsp;</td><td>");
	//document.write("</div>");
	//document.write("<div style=\"float: left;\"> ");
	//document.write("</td><td><input type=image src=\"assets/images/btngo.gif\" NAME=email > ");
	document.write("<input type=\"image\" src=\"assets/images/btngo.gif\" NAME=\"email\">");
	//document.write("</td></form>");
	//document.write("</div>");
	document.write("</td></tr></table>");
	//document.write("<div class=\"Clear\"></div>");
	document.write("</form>");
	document.write("</div>");
}

// Override to work with blocks
function draw_related_dept(type, display, message, rel_image_enable, rel_image_width, rel_list_pricelab, rel_sale_pricelab, rel_our_pricelab) {
    var prodlink = "";
    var typematch = 0;
    var show_price = 1;
    if (typeof type == "undefined") {
        type = "0";
    }
    if (typeof display == "undefined") {
        display = 1;
    }
    if (typeof message == "undefined") {
        message = "";
    }
    if (typeof rel_image_enable == "undefined") {
        rel_image_enable = "PRODUCT";
    }
    if (typeof rel_image_width == "undefined") {
        rel_image_width = "";
    }
    if (typeof rel_list_pricelab == "undefined") {
        rel_list_pricelab = "Price ";
    }
    if (typeof rel_sale_pricelab == "undefined") {
        rel_sale_pricelab = "Sale Price";
    }
    if (typeof rel_our_pricelab == "undefined") {
        rel_our_pricelab = "Our Price";
    }
    if (Related_prod.length > 0) {
        for (itematn = 0; itematn < Related_prod.length; itematn++) {
            for (atn = 0; atn < Related_prod[itematn].related.length; atn++) {
                if (Related_prod[itematn].related[atn].crosstype == type) {
                    typematch = 1;
                }
            }
        }
    }
    if (typematch == 1) {
		document.write("<div class=\"Block\">");
		document.write("<div class=\"Block-Title\">");
		document.write(message);
		document.write("</div>");
		document.write("<div class=\"Block-Body\">");
		//document.write("<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"SubHeadbgcolor\"><tr><td>");
        //document.write("<table cellpadding=\"10\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"tablebgcolor\"><tr><td class=CartLabels>");
        //document.write(message);
        //document.write("</td></tr><tr><td>");
    }
    if (Related_prod.length > 0) {
        document.write("<Table border=0 cellpadding=2 cellspacing=2 width=\"100%\">");
        document.write("<TR valign=\"bottom\">");
        for (itematn = 0; itematn < Related_prod.length; itematn++) {
            for (atn = 0; atn < Related_prod[itematn].related.length; atn++) {
                if (Related_prod[itematn].related[atn].crosstype == type) {
                    if (user_guid != " ") {
                        prodlink = "<A HREF=\"" + Related_prod[itematn].related[atn].link + "s_id=" + i_jscript_uu_sid + "&mscssid=" + user_guid + "&\">";
                    } else {
                        prodlink = "<A HREF=\"" + Related_prod[itematn].related[atn].link + "s_id=" + i_jscript_uu_sid + "&\">";
                    }
                    if (display == 1) {
                        document.write("<TD class=relProduct WIDTH=\"100%\" VALIGN=TOP ALIGN=CENTER>");
                    } else {
                        document.write("<TD class=relProduct VALIGN=TOP ALIGN=CENTER>");
                    }
                    if (Related_prod[itematn].related[atn].image != "" &&
                        rel_image_enable != "NONE") {
                        document.write(prodlink);
                        if (rel_image_width != "") {
                            document.write("<img ALIGN=CENTER WIDTH =\"" + rel_image_width + "\" BORDER=0  VSPACE=0  HSPACE=0  ALT=\"" + Related_prod[itematn].related[atn].name + "\" SRC=\"assets/product_images/" + Related_prod[itematn].related[atn].image + "\"></A>");
                        } else {
                            document.write("<img ALIGN=CENTER BORDER=0  VSPACE=0  HSPACE=0  ALT=\"" + Related_prod[itematn].related[atn].name + "\" SRC=\"assets/product_images/" + Related_prod[itematn].related[atn].image + "\"></A>");
                        }
                        if (display == 1) {
                            document.write("</TD></TR><TR class=relProduct><TD class=relProduct WIDTH=100% VALIGN=TOP ALIGN=CENTER>");
                        } else {
                            document.write("<BR>");
                        }
                    }
                    document.write(prodlink + Related_prod[itematn].related[atn].name + "</A>");
                    if (show_price == 1 &&
                        Related_prod[itematn].related[atn].list_price != "") {
                        if (Related_prod[itematn].related[atn].on_sale != "False" &&
                            Related_prod[itematn].related[atn].sale_price != "" &&
                            Related_prod[itematn].related[atn].sale_price != "$0.00" &&
                            Related_prod[itematn].related[atn].sale_price != Related_prod[itematn].related[atn].list_price) {
                            document.write("<font class=ListPricewSaleR>" + rel_list_pricelab + Related_prod[itematn].related[atn].list_price + " </font>");
                            document.write("<font class=SalePriceR>" + rel_sale_pricelab + Related_prod[itematn].related[atn].sale_price + " </B></font>");
                        } else {
                            document.write("<font class=ListPricewoSaleR>" + rel_our_pricelab + Related_prod[itematn].related[atn].list_price + " </font>");
                        }
                    }
                    document.write("</TD>");
                    if (display == 1) {
                        document.write("</TR>");
                    }
                }
            }
            if (display != 1) {
                if ((itematn + 1) % 3 == 0 &&
                    itematn + 1 != packages_array[itematn].children.length) {
                    document.write("</TR>");
                }
            }
            document.write("</Table>");
        }
    }
    if (typematch == 1) {
        document.write("</TD></TR></TABLE></TD></TR></TABLE>");
		document.write("</div>");
		document.write("</div>");
    }
}

// Override to work with blocks
function draw_related_product(type, display, message, rel_image_enable, rel_image_width, rel_list_pricelab, rel_sale_pricelab, rel_our_pricelab) {
    var prodlink = "";
    var typematch = 0;
    if (typeof type == "undefined") {
        type = "0";
    }
    if (typeof display == "undefined") {
        display = page_option_4;
    }
    if (typeof message == "undefined") {
        message = "";
    }
    if (nRelated > 0) {
        for (atn = 0; atn < nRelated; atn++) {
            if (Related_prod[atn].crosstype == type) {
                typematch = 1;
            }
        }
    }
    if (typematch == 1) {
		document.write("<div class=\"Block\">");
		document.write("<div class=\"Block-Title\">");
        document.write(message);
		document.write("</div>");
		document.write("<div class=\"Block-Body\">");
    }
    if (nRelated > 0) {
        document.write("<Table border=0 cellpadding=2 cellspacing=2>");
        if (display != 1) {
            document.write("<TR>");
        }
        for (atn = 0; atn < nRelated; atn++) {
            if (Related_prod[atn].crosstype == type) {
                prodlink = "<A HREF=\"" + Related_prod[atn].link + "\">";
                if (display == 1) {
                    document.write("<TR class=relProduct><TD class=relProduct WIDTH=\"100%\" VALIGN=TOP ALIGN=CENTER>");
                } else {
                    document.write("<TD class=relProduct VALIGN=TOP ALIGN=CENTER>");
                }
                if (Related_prod[atn].image != "" &&
                    rel_image_enable != "NONE") {
                    document.write(prodlink);
                    if (rel_image_width != "") {
                        document.write("<img ALIGN=CENTER WIDTH =\"" + rel_image_width + "\" BORDER=0  VSPACE=0  HSPACE=0  ALT=\"" + Related_prod[atn].name + "\" SRC=\"assets/product_images/" + Related_prod[atn].image + "\"></A>");
                    } else {
                        document.write("<img ALIGN=CENTER BORDER=0  VSPACE=0  HSPACE=0  ALT=\"" + Related_prod[atn].name + "\" SRC=\"assets/product_images/" + Related_prod[atn].image + "\"></A>");
                    }
                    if (display == 1) {
                        document.write("</TD></TR><TR class=relProduct><TD class=relProduct WIDTH=100% VALIGN=TOP ALIGN=CENTER>");
                    } else {
                        document.write("<BR>");
                    }
                }
                document.write(prodlink + Related_prod[atn].name + "</A>");
                if (page_option_5 == 1 &&
                    Related_prod[atn].list_price != "") {
                    if (Related_prod[atn].on_sale != "False" &&
                        Related_prod[atn].sale_price != "" &&
                        Related_prod[atn].sale_price != "$0.00" &&
                        Related_prod[atn].sale_price != Related_prod[atn].list_price) {
                        if (Related_prod[atn].list_price != "") {
                            document.write("<font class=ListPricewSaleR>" + rel_list_pricelab + Related_prod[atn].list_price + " </font>");
                        }
                        document.write("<font class=SalePriceR>" + rel_sale_pricelab + Related_prod[atn].sale_price + " </B></font>");
                    } else {
                        if (Related_prod[atn].list_price != "") {
                            document.write("<font class=ListPricewoSaleR>" + rel_our_pricelab + Related_prod[atn].list_price + " </font>");
                        }
                    }
                }
                document.write("</TD>");
                if (display == 1) {
                    document.write("</TR>");
                }
            }
        }
        if (display != 1) {
            document.write("</TR>");
        }
        document.write("</Table>");
		document.write("</div>");
		document.write("</div>");
    }
}
