// Configuration Box Object
// Assumptions: 
// Id names, class names, title, alt, name values on certain elements
// The color name comes from the div title value, i dont assume case
// The capacity name comes from the div title value; i do assume it will have MB or GB attached!!
configureBox = {
currentCableLength: '',
currentFeatures: [],
colorFeatureIndex: '',
capacityFeatureIndex: '',
cableLengthFeatureIndex: '',
optionsBoxId: '', // id for the options box
optionsBoxLink: '', // the link on the options box
selectedColorShownObj: '', // placeholder for the name of the selected color
currentColorName: '', // current color - scripting format, lowercase
currentColorNameFormatted: '', // current color -formatted for showing with or without marketing color auto
colorBoxes: [], // the set of color boxes
colorBoxClass: 'colorBox', // class name used in html
currentColorBoxObj: '', // current color as object
currentColorBoxClass: 'colorSelected', // class name used in html as hook
colorImageLinks: '', // the set of links that are used in color swatch hover - have href to big image
colorImageLinkClass: 'colorImageLink', // class name used in html for color swatch hover
selectedCapacityShownObj: '', // placeholder for selected capacity
currentCapacityNumberOnly: '', // current capacity - scripting format, lowercase no MB or GB
currentCapacityNameFormatted: '', // current capacity - formatted for show - with MB or GB
capacityBoxes: [], // the set of capacity boxes
capacityBoxClass: 'capacityBox', // class name used in html
currentCapacityBoxObj: '', // placeholder for the selected capacity name
currentCapacityBoxClass: 'capacitySelected', // class name used in html as hook
capacityImageLinks: '', // the set of links that are used in capacity hover - have href to big image
capacityImageLinkClass: 'capacityImageLink', // class name used in html for capacity hover
upsellTable: '', // id of the upsell section table
currentUpsellProductId: '', // default value must be empty
upsellSelect: '',
retailPriceValue: '', // retail price placeholder
unitPriceValue: '', // unit price placeholder
priceDropRetailPriceValue: '', // placeholder
priceDropUnitPriceValue: '', // placeholder
priceDropValue: '', // placeholder
beforeRebatePriceValue: '', // placeholder
afterRebatePriceValue: '', // placeholder
rebateAmtValue: '', // placeholder
rebateSavings: '', // placeholder
shippingValue: '', // placeholder
availabilityValue: '', // placeholder
helpBoxes: [], // the set of question mark (now) help icons next to the options label
helpPopUpClass: 'helpPopUp', // class name used in html as hook
submitBtn: '', // submit btn obj
windowScrollX: 0, // Utilities: properties of this window needed for the customize box
windowScrollY: 0,
init:function() {
	if (!document.getElementsByTagName || !document.getElementById) { return false; }

	/*--- Help icon boxes ---*/
	configureBox.helpBoxes = document.getElementsByTagName("a");
	for(var i=0; i<configureBox.helpBoxes.length; i++) {
		if (DOMhelp.cssjs('check', configureBox.helpBoxes[i], configureBox.helpPopUpClass)) {
			DOMhelp.addEvent(configureBox.helpBoxes[i], 'click', configureBox.helpPopUp, false);
		}
	}

	/*--- Option1 box of alternate options ---*/
	if(document.getElementById("optionsBox") && document.getElementById("optionsBoxLink")) {
		configureBox.optionsBoxId = document.getElementById("optionsBox");
		configureBox.optionsBoxLink = document.getElementById("optionsBoxLink");
		DOMhelp.cssjs('add', configureBox.optionsBoxId, 'hide');
		DOMhelp.addEvent(configureBox.optionsBoxLink, 'click', configureBox.optionsBoxToggle, false);
	}

	/*--- Color ---*/
	// Events 
	configureBox.colorBoxes = document.getElementsByTagName("div");
	for(var i=0; i<configureBox.colorBoxes.length; i++) {
		if (DOMhelp.cssjs('check', configureBox.colorBoxes[i], configureBox.colorBoxClass)) {
			DOMhelp.addEvent(configureBox.colorBoxes[i], 'mouseover', configureBox.showColorName, false);
			DOMhelp.addEvent(configureBox.colorBoxes[i], 'mouseout', configureBox.revertToCurrentColor, false);
			DOMhelp.addEvent(configureBox.colorBoxes[i], 'click', configureBox.handleColorClick, false);
		}
	}

	/* Initialize */
	if (document.getElementById("firstColorBox")) {
		configureBox.currentColorBoxObj = document.getElementById("firstColorBox").parentNode;
		DOMhelp.cssjs('add', configureBox.currentColorBoxObj, configureBox.currentColorBoxClass);
		configureBox.currentColorName = Product.getFirstColor();
		configureBox.currentColorNameFormatted = Product.getColorFormatted(configureBox.currentColorName);
	}

	// Selected Color Placeholder
	if(document.getElementById("colorLabelValue")) {
		configureBox.selectedColorShownObj = document.getElementById("colorLabelValue");
	}

	// Color swatches links for hover effect
	configureBox.colorImageLinks = document.getElementsByTagName("a");
	for(var i=0; i<configureBox.colorImageLinks.length; i++) {
		if (DOMhelp.cssjs('check', configureBox.colorImageLinks[i], configureBox.colorImageLinkClass)) {
			DOMhelp.addEvent(configureBox.colorImageLinks[i], 'mouseover', configureBox.changeImage, false);
			DOMhelp.addEvent(configureBox.colorImageLinks[i], 'mouseout', configureBox.revertToCurrentColorImg, false);
		}
	}

	/*--- Capacity ---*/
	configureBox.capacityBoxes = document.getElementsByTagName("div");
	for(var i=0; i<configureBox.capacityBoxes.length; i++) {
		if (DOMhelp.cssjs('check', configureBox.capacityBoxes[i], configureBox.capacityBoxClass)) {
			DOMhelp.addEvent(configureBox.capacityBoxes[i], 'mouseover', configureBox.showCapacityName, false);
			DOMhelp.addEvent(configureBox.capacityBoxes[i], 'mouseout', configureBox.revertToCurrentCapacity, false);
			DOMhelp.addEvent(configureBox.capacityBoxes[i], 'click', configureBox.handleCapacityClick, false);
		}
	}

	// Initialize
	if (document.getElementById("firstCapacityBox")) {
		configureBox.currentCapacityBoxObj = document.getElementById("firstCapacityBox").parentNode;
		DOMhelp.cssjs('add', configureBox.currentCapacityBoxObj, configureBox.currentCapacityBoxClass);
		configureBox.currentCapacityNumberOnly = Product.getFirstCapacity();
		configureBox.currentCapacityNameFormatted = Product.getFirstCapacityFormatted(configureBox.currentCapacityNumberOnly);
	} 

	// Selected Capacity Placeholder
	if(document.getElementById("selectedCapacity")) {
		configureBox.selectedCapacityShownObj = document.getElementById("selectedCapacity");
	}

	// Capacity on hover image effect 
	configureBox.capacityImageLinks = document.getElementsByTagName("a");
	for(var i=0; i<configureBox.capacityImageLinks.length; i++) {
		if (DOMhelp.cssjs('check', configureBox.capacityImageLinks[i], configureBox.capacityImageLinkClass)) {
			DOMhelp.addEvent(configureBox.capacityImageLinks[i], 'mouseover', configureBox.changeImage, false);
			DOMhelp.addEvent(configureBox.capacityImageLinks[i], 'mouseout', configureBox.revertToCurrentCapacityImg, false);
		}
	}

	// Upsell
	if (Product.hasUpsellProducts()) {
		if (document.getElementById("upsellSelect")) {
			configureBox.upsellSelect = document.getElementById("upsellSelect");
			DOMhelp.addEvent(configureBox.upsellSelect, 'click', configureBox.handleUpsellSelectChange, false);
			//configureBox.currentUpsellProductId = 0;
		}
		// show the upsell section
		if (document.getElementById("upsellTable")) {
			configureBox.upsellTable = document.getElementById("upsellTable");
		}
	}	

	/*--- Feature set Values (assign current values) ---*/
	var i;
	i = 0;
	if(configureBox.currentCapacityNumberOnly) {
		configureBox.currentFeatures[i] = configureBox.currentCapacityNumberOnly;
		configureBox.capacityFeatureIndex = i;
		i = i + 1;
	}
	if(configureBox.currentColorName) {
		configureBox.currentFeatures[i] = configureBox.currentColorName;
		configureBox.colorFeatureIndex = i;
		i = i + 1;
	}
	if(configureBox.currentCableLength) {
		configureBox.currentFeatures[i] = configureBox.currentCableLength;
		configureBox.cableLengthFeatureIndex = i;
		i = i + 1;
	}
	// If none of these features were selected then the feature string is just zero - 0
	if(i==0) {
		configureBox.currentFeatures[i] = "0";
	}

	/*--- Placeholders to set values (price,etc) dynamically ---*/
	if(document.getElementById("priceDropRetailPriceValue")) {
		configureBox.priceDropRetailPriceValue = document.getElementById("priceDropRetailPriceValue");
	}
	if(document.getElementById("priceDropUnitPriceValue")) {
		configureBox.priceDropUnitPriceValue = document.getElementById("priceDropUnitPriceValue");
	}
	if(document.getElementById("priceDropValue")) {
		configureBox.priceDropValue = document.getElementById("priceDropValue");
	}
	if(document.getElementById("beforeRebatePriceValue")) {
		configureBox.beforeRebatePriceValue = document.getElementById("beforeRebatePriceValue");
	}
	if(document.getElementById("rebateAmtValue")) {
		configureBox.rebateAmtValue = document.getElementById("rebateAmtValue");
	}
	if(document.getElementById("afterRebatePriceValue")) {
		configureBox.afterRebatePriceValue = document.getElementById("afterRebatePriceValue");
	}
	if(document.getElementById("unitPriceValue")) {
		configureBox.unitPriceValue = document.getElementById("unitPriceValue");
	}
	if (document.getElementById("shippingValue")) {
		configureBox.shippingValue = document.getElementById("shippingValue");
	} 
	if (document.getElementById("availabilityValue")) {
		configureBox.availabilityValue = document.getElementById("availabilityValue");
	}	
	
	/*--- Initialize the state of the options box ---*/
	// elements are hiding by default, so show proper ones
	if (Product.hasPriceDrop(configureBox.currentFeatures)) {
		// hide price drop table
		DOMhelp.setText(configureBox.priceDropRetailPriceValue, "$" + Product.getRetailPrice(configureBox.currentFeatures));		
		DOMhelp.setText(configureBox.priceDropUnitPriceValue, "$" + Product.getUnitPrice(configureBox.currentFeatures));
		DOMhelp.setText(configureBox.priceDropValue, Product.getPriceDrop(configureBox.currentFeatures));
		configureBox.toggle(document.getElementById("priceDropTable"), 'show');

	}
	else if (Product.hasRebate(configureBox.currentFeatures)) {
		// hide the rebate table
		DOMhelp.setText(configureBox.beforeRebatePriceValue, "$" + Product.getBeforeRebatePrice(configureBox.currentFeatures));
		DOMhelp.setText(configureBox.afterRebatePriceValue, "$" + Product.getAfterRebatePrice(configureBox.currentFeatures));
		DOMhelp.setText(configureBox.rebateAmtValue, "$" + Product.getRebateAmt(configureBox.currentFeatures));
		configureBox.toggle(document.getElementById("rebateTable"), 'show');
	}
	else {
		DOMhelp.setText(configureBox.unitPriceValue, "$" + Product.getUnitPrice(configureBox.currentFeatures));
		configureBox.toggle(document.getElementById("priceTable"), 'show');
	}
	if (Product.hasFreeShipping(configureBox.currentFeatures)) {
		// hide the shipping row 
		configureBox.toggle(document.getElementById("shippingTable"), 'show');
	}
	// Availability
	DOMhelp.setText(configureBox.availabilityValue, Product.getAvailability(configureBox.currentFeatures));

	/*--- Submit button  ---*/
	if (document.getElementById("submitBtn")) {
		configureBox.submitBtn = document.getElementById("submitBtn");
		DOMhelp.addEvent(configureBox.submitBtn, 'click', configureBox.submitPurchase, false);
	}

},
optionsBoxToggle:function(e) {
	// save window x and y position
	configureBox.windowScrollX = DOMhelp.getScrollPosition('x');
	configureBox.windowScrollY = DOMhelp.getScrollPosition('y');

	// toggle
	if (DOMhelp.cssjs('check', configureBox.optionsBoxId, 'hide')) {
		// if box is hidden then show it
		DOMhelp.cssjs('swap',configureBox.optionsBoxId,'hide', 'show');
		// scroll to original position
		window.scrollTo(configureBox.windowScrollX, configureBox.windowScrollY);
	}
	else {
		// if showing then hide it
		DOMhelp.cssjs('swap',configureBox.optionsBoxId,'show', 'hide');
		// scroll to original position
		window.scrollTo(configureBox.windowScrollX, configureBox.windowScrollY);
	}
	// this is a link. cancel its click.
	var obj = DOMhelp.getTarget(e);
	if (obj != 'NULL') {
		// If the click is taken by the img node get the a tag.
		if (obj.nodeName.toLowerCase() == 'img') {
			obj = obj.parentNode; 
		}
	}
	DOMhelp.cancelClick(e); 
	return false; 
},
toggle:function(obj, a) {
	// save window x and y position
	configureBox.windowScrollX = DOMhelp.getScrollPosition('x');
	configureBox.windowScrollY = DOMhelp.getScrollPosition('y');

	if (a === 'show') {
		// toggle
		if (DOMhelp.cssjs('check', obj, 'hide')) {
			// if box is hidden then show it
			DOMhelp.cssjs('swap',obj,'hide', 'show');
			// scroll to original position
			window.scrollTo(configureBox.windowScrollX, configureBox.windowScrollY);
		}
	} 
	else if (a === 'hide') {
		// toggle
		if (DOMhelp.cssjs('check', obj, 'show')) {
			// if box is hidden then show it
			DOMhelp.cssjs('swap',obj,'show', 'hide');
			// scroll to original position
			window.scrollTo(configureBox.windowScrollX, configureBox.windowScrollY);
		}
	}
	else if (a === 'toggle') {
		// toggle
		
		if (DOMhelp.cssjs('check', obj, 'hide')) {
			// if box is hidden then show it
			DOMhelp.cssjs('swap',obj,'hide', 'show');
			// scroll to original position
			window.scrollTo(configureBox.windowScrollX, configureBox.windowScrollY);
		}
		else {
			// if showing then hide it
			DOMhelp.cssjs('swap',obj,'show', 'hide');
			// scroll to original position
			window.scrollTo(configureBox.windowScrollX, configureBox.windowScrollY);
		}
	}
},
handleColorClick:function(e) {
	DOMhelp.cancelClick(e); // cancel following this anchor tag

	configureBox.selectThisColor(e); // select the current color clicked on
	configureBox.setCurrentColorName(e); // set the color name shown to be this one
	configureBox.updatePrice(e); // update the price (etc) based on this color chosen

	return false;
},
handleCapacityClick:function(e) {
	DOMhelp.cancelClick(e); // cancel following this anchor tag

	configureBox.setCurrentCapacityName(e); // select the current capacity clicked on
	configureBox.selectThisCapacity(e); // set the capacity name shown to be this one
	configureBox.updatePrice(e); // update the price (etc) based on this capacity chosen
	
	return false;
},
showColorName:function(e) {
	// When a color box is hovered over show its name 
	var obj = DOMhelp.getTarget(e); 
	var color;
	// The div or the a may receive the hover action. The div's title has the color name
	if(obj.nodeName.toLowerCase() =='div') {
		color = obj.getAttribute("title"); 
	}
	else if (obj.nodeName.toLowerCase() == 'a') {
		color = obj.firstChild.getAttribute("title");
	}
	else if (obj.nodeName.toLowerCase()=='img') {
		color = obj.parentNode.getAttribute("title");
	}
	configureBox.selectedColorShownObj.innerHTML = Product.getColorFormatted(color);
},
setCurrentColorName:function(e) {
	configureBox.windowScrollX = DOMhelp.getScrollPosition('x');
	configureBox.windowScrollY = DOMhelp.getScrollPosition('y');

	// When the color is selected then set the current color to be this one
	var obj = DOMhelp.getTarget(e); // get the target object
	var color;
	if(obj.nodeName.toLowerCase() =='img') {
		color = obj.parentNode.getAttribute("title"); // get the color name from the div title
	}
	else if(obj.nodeName.toLowerCase()=='a') {
		color = obj.firstChild.getAttribute("title");
	}
	else if(obj.nodeName.toLowerCase() == 'div') {
		color = obj.getAttribute("title");
	}
	// Set current color and current marketing color to show as selected and for add to cart
	configureBox.currentColorName = color.toLowerCase();
	configureBox.currentColorNameFormatted = Product.getColorFormatted(configureBox.currentColorName);
	// Update feature string
	configureBox.currentFeatures[configureBox.colorFeatureIndex] = configureBox.currentColorName;

	window.scrollTo(configureBox.windowScrollX, configureBox.windowScrollY);
},
revertToCurrentColor:function(e) {
	// Reset the color value to be the currently selected one once there is no hover
	configureBox.selectedColorShownObj.innerHTML = configureBox.currentColorNameFormatted;
},
selectThisColor:function(e) {
	// When the color is clicked on then show the selected style
	// Add a class to the link
	var obj = DOMhelp.getTarget(e);
	if(obj.nodeName.toLowerCase() == 'img') {
		obj = obj.parentNode.parentNode;
	}
	else if(obj.nodeName.toLowerCase()=='a') {
		obj = obj;
	}
	else if(obj.nodeName.toLowerCase()=='div') {
		obj = obj.parentNode;
	}
	// Remove the currently selected color
	DOMhelp.cssjs('remove', configureBox.currentColorBoxObj, configureBox.currentColorBoxClass);
	// Select the current color
	DOMhelp.cssjs('add', obj, configureBox.currentColorBoxClass);
	// Set the curent color to be this new one
	configureBox.currentColorBoxObj = obj;
},
showCapacityName:function(e) {
	// When you hover over the capacity show its value
	var obj = DOMhelp.getTarget(e); 

	// get the capacity name from the div title
	var capacityFormatted;
	capacityFormatted = obj.getAttribute("title"); 

	// Set the current label to be the hovered on one
	configureBox.selectedCapacityShownObj.innerHTML = capacityFormatted;
},
setCurrentCapacityName:function(e) {
	var obj = DOMhelp.getTarget(e); // get the target object
	var capacityFormatted;
	capacityFormatted = obj.getAttribute("title"); // get the capacity name from the div title
	// has MB or GB, etc.
	configureBox.currentCapacityNameFormatted = capacityFormatted;
	// then remove the MB or GB
	configureBox.currentCapacityNumberOnly = Product.getCapacity(capacityFormatted);
	configureBox.currentFeatures[configureBox.capacityFeatureIndex] = configureBox.currentCapacityNumberOnly;
},
revertToCurrentCapacity:function(e) {
	configureBox.selectedCapacityShownObj.innerHTML = configureBox.currentCapacityNameFormatted;
},
selectThisCapacity:function(e) {
	// When the capacity is clicked on then add a selected class to it
	var obj = DOMhelp.getTarget(e);

	if(obj.nodeName.toLowerCase() == 'div') {
		obj = obj.parentNode;
	}
	// Deselect current one
	DOMhelp.cssjs('remove', configureBox.currentCapacityBoxObj, configureBox.currentCapacityBoxClass);
	// Select new one
	DOMhelp.cssjs('add', obj, configureBox.currentCapacityBoxClass);
	// Set the current one to be the new one
	configureBox.currentCapacityBoxObj = obj;
},
updatePrice:function(e) { 
	// Update the price info, shipping, and availability when options are clicked on
	// Get information from product based on the features currently chosen
	configureBox.toggle(document.getElementById("priceTable"), 'hide');
	configureBox.toggle(document.getElementById("priceDropTable"), 'hide');
	configureBox.toggle(document.getElementById("rebateTable"), 'hide');

	// Case: Price Drop
	if (Product.hasPriceDrop(configureBox.currentFeatures)) {
		DOMhelp.setText(configureBox.priceDropRetailPriceValue, "$" + Product.getRetailPrice(configureBox.currentFeatures));		
		DOMhelp.setText(configureBox.priceDropUnitPriceValue, "$" + Product.getUnitPrice(configureBox.currentFeatures));
		DOMhelp.setText(configureBox.priceDropValue, Product.getPriceDrop(configureBox.currentFeatures));
		configureBox.toggle(document.getElementById("priceDropTable"), 'show');	
	}
	// Case: Rebate	
	else if (Product.hasRebate(configureBox.currentFeatures)) {
		DOMhelp.setText(configureBox.beforeRebatePriceValue, "$" + Product.getBeforeRebatePrice(configureBox.currentFeatures));
		DOMhelp.setText(configureBox.afterRebatePriceValue, "$" + Product.getAfterRebatePrice(configureBox.currentFeatures));
		DOMhelp.setText(configureBox.rebateAmtValue, "$" + Product.getRebateAmt(configureBox.currentFeatures));
		configureBox.toggle(document.getElementById("rebateTable"), 'show');
	// Case: Equal
	} else {
		DOMhelp.setText(configureBox.unitPriceValue, "$" + Product.getUnitPrice(configureBox.currentFeatures));
		configureBox.toggle(document.getElementById("priceTable"), 'show');
	}

	// Shipping (show if free)
	if (Product.hasFreeShipping(configureBox.currentFeatures)) {
		DOMhelp.setText(configureBox.shippingValue, Product.getShipping(configureBox.currentFeatures));
		configureBox.toggle(document.getElementById("shippingTable"), 'show');
	}

	else {
		configureBox.toggle(document.getElementById("shippingTable"), 'hide');
	}
	// Availability
	DOMhelp.setText(configureBox.availabilityValue, Product.getAvailability(configureBox.currentFeatures));

},
submitPurchase:function(e) {
	var obj = DOMhelp.getTarget(e);
	if (obj != 'NULL') {
		// if the click is taken by the img node get the a tag around it.
		if (obj.nodeName.toLowerCase() != 'a') {
			obj = obj.parentNode; 
		}
	}
	// Append the current product id to the link
	// href will be /store/AddToCart.aspx?product_id=
	var id = Product.getProductId(configureBox.currentFeatures);
	var loc = obj.getAttribute("href") + id;
	if (Product.hasUpsellProducts()) {
		if (configureBox.getCurrentUpsellProductId()){
			loc = loc + "," + configureBox.getCurrentUpsellProductId();
		}
	}
	if (Product.getCategoryID()) {
		// if there is a categoryID then send that as well
		loc = loc +  "&category_id=" + Product.getCategoryID();
	}

	// Go here - add to cart
	window.location = loc;

	DOMhelp.cancelClick(e);
	return false;
},
changeImage:function(e) {
	var obj = DOMhelp.getTarget(e);
	if (obj != 'NULL') {
		// if the click is taken by the img node then get the a tag around it.
		if (obj.nodeName.toLowerCase() != 'a') {
			obj = obj.parentNode; 
		}
	}
	if(obj.nodeName.toLowerCase() == 'div') { obj = obj.parentNode; }
	// get the big image container and if it not here then exit return true to follow click
	if(!document.getElementById("productImage")) { return true; }
	var productImage = document.getElementById("productImage");
	// get the links href which is the source file of the big image
	var source = obj.getAttribute('href');
	// set the image container source to be this href value
	productImage.setAttribute('src', source);
},
revertToCurrentCapacityImg:function(e) {
	var obj = DOMhelp.getTarget(e);
	if(obj.nodeName.toLowerCase() == 'div') { obj = obj.parentNode; }
	if(!document.getElementById("productImage")) { return true; }
	var productImage = document.getElementById("productImage");
	// when hover effect goes off, revert image to the currently selected (clicked) one
	var source = configureBox.currentCapacityBoxObj.getAttribute('href');
	productImage.setAttribute('src', source); 
},
revertToCurrentColorImg:function(e) {
	var obj = DOMhelp.getTarget(e);
	if(obj.nodeName.toLowerCase() == 'div') { obj = obj.parentNode; }
	if(!document.getElementById("productImage")) { return true; }
	var productImage = document.getElementById("productImage");
	// when hover effect goes off, revert image to the currently selected (clicked) one
	var source = configureBox.currentColorBoxObj.getAttribute('href');
	productImage.setAttribute('src', source); 
},
handleUpsellSelectChange:function(e) {
	configureBox.setCurrentUpsellProductId(e);
},
setCurrentUpsellProductId:function(e) {
	var obj = DOMhelp.getTarget(e);
	// get the select box that was clicked 
	if (obj != null) {
		if (obj.nodeName != 'SELECT') {
			// Mozilla is not getting the right value for e.target
			// Resetting it to e.currentTarget
			obj = e.currentTarget; 
		}
	}
	// get the one that is currently chosen right now
	var idIndex = obj.selectedIndex;
	var idValue = obj.options[idIndex].getAttribute('value');
	// set the configureBox.currentUpsellProductId = this value
	configureBox.currentUpsellProductId = idValue;
},
getCurrentUpsellProductId:function() {
	if (configureBox.currentUpsellProductId == '' || configureBox.currentUpsellProductId == 0) {
		return false;
	}
	else {
		return configureBox.currentUpsellProductId;
	}
},
cancelThisClick:function(e) {
	DOMhelp.cancelClick(e);
	return false;
},
helpPopUp:function(e) {
	var obj = DOMhelp.getTarget(e);
	if(obj.nodeName.toLowerCase() == 'a') {
		URL = obj.getAttribute("href");	
	}
	else if (obj.nodeName.toLowerCase() == 'img') {
		URL = obj.parentNode.getAttribute("href");
	}
	var page;
	eval("page = window.open(URL, 'Help', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=300');");
	page.focus();
	DOMhelp.cancelClick(e);
	return false;
}

}	
DOMhelp.addEvent(window,'load', configureBox.init, false);





