function toggle() {
	var myVerticalSlide = [];
	for (var i = 0; i <= 4; i++) {
		if ($('vertical_slide' + i)) {
			var sl = new Fx.Slide('vertical_slide' + i);
			sl.hide();
			$('vertical_slide' + i).style.display = "block";
			sl.hide();
			myVerticalSlide.push(sl);
		}
	}
	myVerticalSlide.each(function(slider, i) {
		$$('.readLink' + i).addEvent('click', function(e) {
			e.stop();
			slider.toggle();
		});

	})
}
function setNewProductList() {
	var myRequest = new Request.HTML({
		url: '/images/productCongig.html',
		method: 'get',
		onSuccess: function(responseHTML) {
			//$('ProductConfigurator').set('text','');
			var oldElSel = $$('.OptionSelect_ProductInfo');
			var newDisc = $("oldDescription").get('text');
			var newProdName = $("oldProductName").get('text');
			$('ContentContainer_TBL').destroy();
			$('Main_TD').adopt(responseHTML);
			$("newDescription").set('text', newDisc);
			$("newProductName").set('text', newProdName);
			var newElSel = $$('.newElSel');
			$$('.newElSel').each(function(el, i) {
				//el.options = oldElSel[i].options;
				for (var m = 0; m < oldElSel[i].options.length; m++) {
					new Element('option', {
						'text': oldElSel[i].options[m].text,
						'value': oldElSel[i].options[m].value,
						'price': oldElSel[i].options[m].getAttribute('price')
					}).inject(el);
				}
				el.addEvent('change', function() {
					if ($(this.id + "_count").value == 0) $(this.id + "_count").value = 1;
					if (this.options[this.selectedIndex].value != 0) {
						$(this.id + "_price").value = $(this.id + "_count").value * parseInt(this.options[this.selectedIndex].getAttribute('price'));
						$(this.id + "_price").value += ".00";
					} else {
						$(this.id + "_price").value = "0.00";
						$(this.id + "_count").value = 0;
					}
					recountAll();
				});
				$(el.id + "_count").addEvent('change', function() {
					if (el.options[el.selectedIndex].value != 0) {
						$(el.id + "_price").value = $(el.id + "_count").value * parseInt(el.options[el.selectedIndex].getAttribute('price'));
						$(el.id + "_price").value += ".00";
					} else {
						$(el.id + "_price").value = "0.00";
						$(el.id + "_count").value = 0;
					}
					recountAll();
				});
			});
			$('mainproduct_count').addEvent('change', function() {
				$('select_3_price').value = $('mainproduct_count').value * 69;
				$('select_3_price').value += ".00";
				recountAll();
			});
			$('kob').addEvent('click', function() {
				for (var i = 0; i < 3; i++) {
					$('amaunt' + (i + 1)).value = $("select_" + i + "_count").value;
				}
				$('amount').value = $('mainproduct_count').value;
				$('forma').submit();
			});
		}
	}).send();
}
function recountAll() {
	var m = 0;
	for (var i = 0; i < 4; i++) {
		m = m + parseInt($("select_" + i + "_price").value);
	}
	$("_price").value = m + ".00";
}
//window.addEvent('domready', function() {
//	
//});

window.onload = function() {
	if ($$('.readLink0').length != 0) {
		toggle();
	}
	if ($('ProductConfigurator')) {
		// ARO: Removed skinning of order
		// setNewProductList();
	}
	if ($('PayMethodsContainer')) {
		/*
		var el = document.getElementsByName('PaymethodID');
		el[0].checked = true;
		GetMethods('ShippingMethods','59',document.getElementById('ShippingMethodsContainer'),'')
		gotoOrderStep3();
		*/
	}
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("top-menu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
