//this function needs to be called on the wish button on the softcode of the product page, like this: onclick=\"return(go_thru_shopper_lookup())\"
function go_thru_shopper_lookup()
{
	var selectedsku = document.getElementById('sku').value;
	if (selectedsku=="")
	{
		alert("Please select from the dropdown and try again.");
		return false;
	}
	else
	{
		if (product_var)
		{
			for (j=0;j< product_var.length ;j++)
			{
				if(product_var[j].sku==document.getElementById("sku").value)
				{
					visitargs('shopper_lookup.asp','target=xt_orderform_additem.asp&addto=4&dept_id='+dept_id+'&pf_id='+pf_id+'&sku='+product_var[j].sku+'&attr_value1='+escape(product_var[j].attr_value1)+'&attr_value2='+escape(product_var[j].attr_value2)+'&attr_value3='+escape(product_var[j].attr_value3)+'&attr_value4='+escape(product_var[j].attr_value4)+'&attr_value5='+escape(product_var[j].attr_value5)+'&','');
					return false;
					break;
				}
			}
		}
	}
}

//the only reason this is in here is because the default draw_sku_option doesn't have ID=sku for the SELECT input
function draw_sku_option()
{
	if (product_var.length >= 1 ){
		if(product_var.length==1){
			document.write("<TD> ");
			//document.write("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR VALIGN=TOP ><TD class=ProductAttrlabel>" + attr_label[0] + "</TD><TD>");
			//document.write("&nbsp;" + product_var[0].attr_value1 + "</TD></TR>");
			//document.write("<TR VALIGN=TOP ><TD class=ProductAttrlabel>" + attr_label[1] + "</TD><TD>");
			//document.write("&nbsp;" + product_var[0].attr_value2 + "</TD></TR></TABLE>");
			document.write("<INPUT TYPE=HIDDEN id=\"sku\" NAME=\"sku\" VALUE=\"" + product_var[0].sku + "\" ></TD>");
		}else{	
			document.write("<TD> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
			document.write("<TR VALIGN=TOP ><TD class=ProductAttrlabel ><b>Select From:</b><br></TD></TR><TR><TD>");
			document.write("<SELECT class=ProductAttr NAME=\"sku\" ID=\"sku\" >");
			i=0;
			labelstr="";
			while (attr_label[i]!= "" && i < attr_values.length ) {
				labelstr=labelstr + attr_label[i] + " ";
				i++;
			}
			writeoption("",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_value1 + " - " + product_var[atn].attr_value2 + " - $"+ OKStrOfPenny(product_var[atn].price_sale)) + "" ,sel_values[0]);
					}else{
						writeoption(product_var[atn].sku,(product_var[atn].attr_value1 + " - " + product_var[atn].attr_value2 + " - $"+ OKStrOfPenny(product_var[atn].price_list)) + "" ,sel_values[0]);
					}
				}else{
					if (product_var[atn].avail_msg==""){
						product_var[atn].avail_msg="on back order";
					}
					writeoption(product_var[atn].sku,(product_var[atn].attr_value1 + " - " + product_var[atn].attr_value2) + "",sel_values[0]);
				}
			}
			document.write("</SELECT></TD>");	
			document.write("</TR></TABLE></TD>");
		}
	}
} //end draw_sku_option