
//************************************************************************************************************
//
// 	Div. JavaScript code
//
//************************************************************************************************************


  	function copyValues() {
  		var variants = '';
  		var n = 0;
  		while (document.getElementById('addBasketVariant' + n) != null) {
			select = document.getElementById('addBasketVariant' + n);
			verdi = select.options[select.selectedIndex].value;
			if (n > 0) {
				variants += ';';
			}
			variants += verdi;
  			n++;
  		}
  		document.getElementById('addShoppingListVariants').value = variants;
		if (document.getElementById('addBasketQuantity') != null) {
			document.getElementById('addShoppingListQty').value = document.getElementById('addBasketQuantity').value;
		}
  	}



//************************************************************************************************************
//
// 	These function are here to adjust heights of table cells in Boxed listing mode
// 	All cells with its class set to: adjustMyHeight will be set to have the same height
// 	as the tallest cell in it's row.
//
//************************************************************************************************************



	function getElementsByClass(searchClass,node,tag) {
		var classElements = new Array();
		if ( node == null )
		node = document;
		if ( tag == null )
		tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
		for (i = 0, j = 0; i < elsLen; i++) {
			if ( pattern.test(els[i].className) ) {
				classElements[j] = els[i];
				j++;
			}
		}
		return classElements;
	}

	allcells = getElementsByClass("adjustMyHeight");
	for (i = 0; i < allcells.length; i++) {
		// For each cell we iterate through we find all the cells in the containing row and calculate their max height
		siblingcells = allcells[i].parentNode.childNodes;
		var maxsize = 0;
		var maxroom = 0;
		for (j = 0; j < siblingcells.length;j++) {
			if (siblingcells[j].tagName == "TD") {
				if (siblingcells[j].offsetHeight > maxsize) {
					maxsize = siblingcells[j].offsetHeight;
					// Manual compensation for padding in the parent cell. The figure 5 might need
					// Too be adjusted if the padding in the template for the product boxes is changed
					// The best would be to retrieve the padding from this cell and deduct that instead
					maxroom = maxsize - 5;
				}
			}
		}

		for (j = 0; j < siblingcells.length;j++) {
			if (siblingcells[j].tagName == "TD") {
				siblingcells[j].style.height = maxsize;
				childtables = siblingcells[j].getElementsByTagName('TABLE');
				for (k = 0; k < childtables.length;k++) {
					if (childtables[k].tagName == "TABLE") {
						childtables[k].style.height = maxroom;
					}
				}
			}
		}
	}


//**********************************************************************************************************
//
//         Infinite Menus - Parameter Settings and Source Code
//         Note: Menu structure and links are defined above with UL and LI tags.
//
//**********************************************************************************************************


	function imenus_data0() {

		this.enable_visual_design_mode = false
		this.main_is_horizontal = true
		this.menu_showhide_delay = 120

		/*--------------------------------------*
		 *          Expand Icon Images          *
		 *--------------------------------------*/

		this.sub_expand_image = "images/System/ice_arrow_sub.gif"
		this.sub_expand_image_hover = "images/System/ice_arrow_sub.gif"
		this.sub_expand_image_width = "10"
		this.sub_expand_image_height = "13"
		this.sub_expand_image_offx = "0"
		this.sub_expand_image_offy = "0"

		// this.main_pointer_image = 'images/System/ice_pointer_down.gif'
		// this.main_pointer_image_width = '10'
		// this.main_pointer_image_height = '11'
		// this.main_pointer_image_offx = '-5'
		// this.main_pointer_image_offy = '-14'

		// this.sub_pointer_image = 'images/System/ice_pointer_right.gif'
		// this.sub_pointer_image_width = '11'
		// this.sub_pointer_image_height = '10'
		// this.sub_pointer_image_offx = '-13'
		// this.sub_pointer_image_offy = '-5'

		// this.sub_pointer_image0_6 = 'images/System/ice_pointer_left.gif'
		// this.sub_pointer_image_offx0_6 = '142'

		// this.sub_pointer_image0_7 = 'images/System/ice_pointer_left.gif'
		// this.sub_pointer_image_offx0_7 = '142'

		// this.sub_pointer_image0_8 = 'images/System/ice_pointer_left.gif'
		// this.sub_pointer_image_offx0_8 = '142'

		/*--------------------------------------*
		 *         Global Menu Styles           *
		 *--------------------------------------*/

		//Main Menu
		this.main_container_styles = " border-width:1px; padding-top:3px; padding-right:0px; padding-bottom:0px; padding-left:0px; "
		this.main_item_styles = "border: 1px solid white; color:#ffffff; text-align:left; font-family:Verdana; font-size:11px; font-weight:normal; text-decoration:none; padding-top:2px; padding-right:23px; padding-bottom:2px; padding-left:5px; border-style:none; border-color:#000000; border-width:0px; "
		this.main_item_hover_styles = "color:#f18e45; "
		this.main_item_active_styles = "text-decoration:none; "

		//Sub Menu
		this.subs_container_styles = "background-color:#cfdbf0; border-style:solid; border-color:#111111; border-width:1px; padding-top:5px; padding-right:5px; padding-bottom:5px; padding-left:5px; "
		this.subs_item_styles = "color:#111111; text-align:left; font-size:11px; font-weight:normal; text-decoration:none; padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; border-style:none; border-color:#000000; border-width:1px; "
		this.subs_item_hover_styles = "color:#f18e45; "
		this.subs_item_active_styles = "text-decoration:underline; "

	}

