function draw_related(){if (page_option_4!=1){ if (nRelated>0){  for (atn=0;atn< nRelated ;atn++){    document.write("<BR>");      if(Related_prod[atn].image !="" && rel_image_enable !="NONE" ){   document.write(" <TR class=relProduct ><TD class=relProduct WIDTH=100% VALIGN=TOP ALIGN=CENTER >");   document.write("<A HREF=\"product.asp?pf_id=" + Related_prod[atn].pf_id + "&dept_id=" + Related_prod[atn].dept_id + "&\" onClick=return(visitargs('product.asp','pf_id=" + Related_prod[atn].pf_id + "&dept_id=" + Related_prod[atn].dept_id + "&')); >");   if (rel_image_width !=""){   document.write("<img ALIGN=CENTER ");   document.write(" WIDTH =\"" + rel_image_width + "\" ");   document.write("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 WIDTH =\"" + Related_prod[atn].width + "\" BORDER=0  VSPACE=0  HSPACE=0  ALT=\"" + Related_prod[atn].name + "\" SRC=\"assets/product_images/"+ Related_prod[atn].image +"\"></A>");   }   document.write("</TD></TR>");   }        document.write(" <TR class=relProduct ><TD class=relProduct WIDTH=100% VALIGN=TOP ALIGN=CENTER >");  document.write("<A HREF=\"product.asp?pf_id=" + Related_prod[atn].pf_id + "&dept_id=" + Related_prod[atn].dept_id + "&\" onClick=return(visitargs('product.asp','pf_id=" + Related_prod[atn].pf_id + "&dept_id=" + Related_prod[atn].dept_id + "&')); >");  document.write(Related_prod[atn].name + "</A>");        if (page_option_5== 1){   if (Related_prod[atn].list_price!="" && Related_prod[atn].sale_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!="" && Related_prod[atn].sale_price=="" ){    document.write("<font class=ListPricewoSaleR >" + rel_our_pricelab + Related_prod[atn].list_price + " </font>");    }   }        }        document.write("</TD>");  }   document.write("</TR>");  }} if (page_option_4==1){ if (nRelated>0){  document.write(" <TABLE BORDER=0>");  for (atn=0;atn< nRelated ;atn++){   if(Related_prod[atn].image !="" && rel_image_enable !="NONE" ){   document.write("<TR class=relProduct ><TD class=relProduct WIDTH=100% VALIGN=TOP ALIGN=CENTER >");   if (rel_image_width !=""){   document.write("<img ALIGN=CENTER ");   document.write(" WIDTH =\"" + rel_image_width + "\" ");   document.write("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 WIDTH =\"" + Related_prod[atn].width + "\" BORDER=0  VSPACE=0  HSPACE=0  ALT=\"" + Related_prod[atn].name + "\" SRC=\"assets/product_images/"+ Related_prod[atn].image +"\"></A>");   }   document.write("</TD></TR>");   }        document.write(" <TR class=relProduct ><TD class=relProduct WIDTH=100% VALIGN=TOP ALIGN=CENTER >");  document.write("<A HREF=\"product.asp?pf_id=" + Related_prod[atn].pf_id + "&dept_id=" + Related_prod[atn].dept_id + "&\" onClick=return(visitargs('product.asp','pf_id=" + Related_prod[atn].pf_id + "&dept_id=" + Related_prod[atn].dept_id + "&')); >");  document.write(Related_prod[atn].name + "</A>");        if (page_option_5== 1){   if (Related_prod[atn].list_price!="" && Related_prod[atn].sale_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!="" && Related_prod[atn].sale_price=="" ){    document.write("<font class=ListPricewoSaleR >"+ rel_our_pricelab + Related_prod[atn].list_price + " </font>");    }   }        }        document.write("</TD> </TR>");  } }document.write("</TABLE>");} }     function draw_sku_option(){  if (product_var.length >= 1 ){	if(product_var.length==1){	  document.write("<TD> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");	  document.write("<TR VALIGN=TOP><TD>");	  	  if (product_var[0].avail != "0") {   		num_avail=1;   		if(product_var[0].attr_value1 =="" || product_var[0].attr_value1==" ")			document.write("<td><select class=\"ProductAttr\"><option>Select Size</option><option>One Size - In stock</option></select></TD>");		else			document.write("<td><select class=\"ProductAttr\"><option>Select Size</option><option>" + product_var[0].attr_value1 + " - In stock</option></select></TD>");   	  }else{   		document.write("<font color='red'>SOLD OUT</font>");   	  }   	  document.write("<INPUT TYPE=HIDDEN  NAME=sku VALUE=\"" + product_var[0].sku + "\" >");   	  document.write("</TD></TR></TABLE></TD>");   	}else{	  //at least 1+ products in array	  	  var sellable=false;	  for (j=0;j<product_var.length;j++){		if(product_var[j].avail != "0"){sellable=true;}	  }	  if(sellable==true){		document.write("<TD> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");		document.write("<TR VALIGN=TOP><TD>");		document.write("<SELECT class=ProductAttr NAME=sku  >");			i=attr_values.length-1;			labelstr="";			while (attr_label[i]!= "" && i >=0 ) {			labelstr=labelstr + attr_label[i] + " ";			i=i-1;			}			writeoption("","Select "+labelstr ,sel_values[0]);			for (atn=0;atn< product_var.length ;atn++){				if (useVariantPrice=="True"){					if (on_sale=="True"){					writeoption(product_var[atn].sku,(product_var[atn].attr_value2 + " - " + product_var[atn].attr_value1 + " $"+ OKStrOfPenny(product_var[atn].price_sale)) ,sel_values[0]);					} else {					writeoption(product_var[atn].sku,(product_var[atn].attr_value2 + " - " + product_var[atn].attr_value1 + " $"+ OKStrOfPenny(product_var[atn].price_list)) ,sel_values[0]);					}				} else {					writeoption(product_var[atn].sku,(product_var[atn].attr_value2 + product_var[atn].attr_value1 + " - " + product_var[atn].avail_msg) ,sel_values[0]);				}			}		document.write("</SELECT>");			document.write("</TD></TR></TABLE></TD>");	  }else{	  	document.write("<TD> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");		document.write("<TR VALIGN=TOP><TD>");		document.write("<font color='red'>SOLD OUT</font>");		document.write("<INPUT TYPE=HIDDEN  NAME=sku VALUE=\"" + product_var[0].sku + "\" >");   	  	document.write("</TD></TR></TABLE></TD>");	  }	}  }else{  	document.write("<TD> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");	document.write("<TR VALIGN=TOP><TD>");	document.write("<font color='red'>SOLD OUT</font>");	document.write("</TD></TR></TABLE></TD>");  }}function draw_image_2(){	if (product_image[1].scr=="PRODUCT" && product_image[1].image!="" ) { 		if (product_image[1].image_show=="TARGET REG" || product_image[1].image_show=="TARGET" ){			if (product_image[1].image_show=="TARGET REG"){				if (user_guid==""){					document.write("<A HREF=\"shopper_lookup.asp?target=" + product_image[1].target + "&\" onClick=return(visitargs('shopper_lookup.asp',\"target=" + product_image[1].target + "&\")); target=\"_top\" >");				}else {					document.write("<A HREF=\"" + product_image[1].target + "\" onClick=return(visitargs('" + product_image[1].target + "')); target=\"_top\" >");				}			}else {				document.write("<a HREF=\"" + product_image[1].target + "\" target=\"_top\">");			}			document.write("<img ALIGN =" + product_image[1].align + " "); 			if (product_image[1].width!=""){document.write("WIDTH =" + product_image[1].width + " ");}			// jat 1/11/08- removing border around main image			document.write(" border=\"0\" class=\"mainimage\" ALT=\"" + product_image[1].alt_text + "\" ");         			document.write(" SRC=\"" + porder_code + pvendor_code +"a.jpg\" name=\"big\" id=\"big\"></a>");		}else{			document.write("<img ALIGN =\"" + product_image[1].align + "\" "); 			if (product_image[1].width!=""){document.write("WIDTH =" + product_image[1].width + " ");}			// jat 1/11/08 - removing border around main image			document.write(" border=\"0\" class=\"mainimage\" ALT=\"" + product_image[1].alt_text + "\" ");    						// ** jat 1/30/08 - removing pvendor_code from main image url			//document.write(" SRC=\"" + porder_code + pvendor_code +"a.jpg\" name=\"big\" id=\"big\">");			document.write(" SRC=\"" + porder_code +"a.jpg\" name=\"big\" id=\"big\">");		}  			}}function popUp(URL) {day = new Date();id = day.getTime();eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=536,height=460,left = 372,top = 302');");}function swapJImg(img, state){	var tmpsrc = img.src;	if(state == 0){		// display the 'on' image		img.src = (img.src).replace("_off", "_on");	}else{		// display the 'off' image		img.src = (img.src).replace("_on", "_off");	}}