var the_qty1 = '';
var the_qty2 = 0;
var color_choice = '';
var mcode_choice = '';
var mkey3x = '';
var srow1_holder = 0;
var brandid_holder = "";
var catid_holder = "";
var subcatid_holder = "";
var xcount = 0;

function shopadd(id,what_config,hascolors,bulb_ids, bulb_qtys) 
{
	if(id==0 || id=="") {return;}
	the_qty1 = 'document.foreform.qty';
	the_qty2 = eval(the_qty1).value;
	if(the_qty2=='' || the_qty2<0) 
	{
	the_qty2 = 0;
	}
	color_choice = "";
	if(hascolors=="yes") 
	{
		if(typeof document.foreform.thecolor.length != 'undefined') 
		{
			if(document.foreform.thecolor.length != null) 
			{
				for(xcount = 0; xcount < document.foreform.thecolor.length; xcount++) 
				{
					if(document.foreform.thecolor[xcount].checked) 
					{
						color_choice = document.foreform.thecolor[xcount].value;
					}
				}
			}
		}
	}

	if(document.foreform.mcode) 
	{

		mcode_choice = '&' + "mcode" + '=' + escape(document.foreform.mcode.options[document.foreform.mcode.selectedIndex].value);
	}

	mkey3x = document.foreform.mkey3x.value;
	srow1_holder = document.foreform.srow1_holder.value;
	brandid_holder = document.foreform.brandid_holder.value;
	catid_holder = document.foreform.catid_holder.value;
	subcatid_holder = document.foreform.subcatid_holder.value;
	thebulbs = bulb_ids;
	thebulbs_qty = bulb_qtys;
	if(hascolors=="yes")
	{
		document.location = theserver+'shop1.cfm?id='+escape(id)+mcode_choice+'&thecolor='+escape(color_choice)+'&qty='+escape(the_qty2)+'&catid='+escape(the_catid)+'&subcatid='+escape(the_subcatid)+'&mkey3x='+escape(mkey3x)+'&srow1_holder='+escape(srow1_holder)+'&brandid_holder='+escape(brandid_holder)+'&catid_holder='+escape(catid_holder)+'&subcatid_holder='+escape(subcatid_holder)+'&addbulbsqty='+escape(thebulbs_qty)+'&addbulbs='+escape(thebulbs)+the_link;
	}
	else
	{
		document.location = theserver+'shop1.cfm?id='+escape(id)+mcode_choice+'&qty='+escape(the_qty2)+'&catid='+escape(the_catid)+'&subcatid='+escape(the_subcatid)+'&mkey3x='+escape(mkey3x)+'&srow1_holder='+escape(srow1_holder)+'&brandid_holder='+escape(brandid_holder)+'&catid_holder='+escape(catid_holder)+'&subcatid_holder='+escape(subcatid_holder)+'&addbulbsqty='+escape(thebulbs_qty)+'&addbulbs='+escape(thebulbs)+the_link;
	}
}

function customize_page(id,what_config,hascolors,selectedoption) 
{
	if(id==0 || id=="") 
	{
		return;
	}
	the_link="";
	the_qty1 = 'document.foreform.qty_cus';
	// the_qty1 = 'document.foreform.qty_'+id;
	the_qty2 = eval(the_qty1).value;
	if(the_qty2=='' || the_qty2<0) 
	{
		the_qty2 = 0;
	}

	var xcount = 0;

	color_choice = "";
	if(hascolors=="yes") 
	{
		if(typeof document.foreform.thecolor.length != 'undefined') 
		{
			if(document.foreform.thecolor.length != null) 
			{
				for(xcount = 0; xcount < document.foreform.thecolor.length; xcount++) 
				{
					if(document.foreform.thecolor[xcount].checked) 
					{
						color_choice = document.foreform.thecolor[xcount].value;
					}
				}
			}
		}
	}

	if(document.foreform.mcode) 
	{

		mcode_choice = '&' + "mcode" + '=' + escape(document.foreform.mcode.options[document.foreform.mcode.selectedIndex].value);
	}

	the_option=selectedoption;

	mkey3x = document.foreform.mkey3x.value;

	var mysid      = document.foreform.mysid.value;
	var mysiq      = document.foreform.mysiq.value;
	var mysid_list = document.foreform.mysid_list.value;
	var mysiq_list = document.foreform.mysiq_list.value;

	if(hascolors=="yes")
	{
		document.location = theserver+'prod_two.cfm?id='+escape(id)+'&do_shown='+escape(1)+'&thecolor='+escape(color_choice)+'&qty='+escape(the_qty2)+'&catid='+escape(the_catid)+'&subcatid='+escape(the_subcatid)+'&mkey3x='+escape(mkey3x)+mcode_choice+'&sid='+escape(mysid)+'&siq='+escape(mysiq)+'&sid_list='+escape(mysid_list)+'&siq_list='+escape(mysiq_list)+'&selectedoption='+escape(the_option);
	}
	else
	{
		document.location = theserver+'prod_two.cfm?id='+escape(id)+'&do_shown='+escape(1)+'&qty='+escape(the_qty2)+'&catid='+escape(the_catid)+'&subcatid='+escape(the_subcatid)+'&mkey3x='+escape(mkey3x)+mcode_choice+'&sid='+escape(mysid)+'&siq='+escape(mysiq)+'&sid_list='+escape(mysid_list)+'&siq_list='+escape(mysiq_list)+'&selectedoption='+escape(the_option);
	}
}