window.addEvent('domready', function(){
	var mySlide1 = new Fx.Slide('notes1');
	var mySlide2 = new Fx.Slide('notes2');
	var mySlide1a = new Fx.Slide('os-details1');
	var mySlide1b = new Fx.Slide('os-details2');
	var mySlide2a = new Fx.Slide('type-details1');
	var mySlide2b = new Fx.Slide('type-details2');
	var mySlide2c = new Fx.Slide('type-details3');
	var mySlide3a = new Fx.Slide('disk-details1');

	 
	$('toggle1').addEvent('click', function(e){
		e = new Event(e);
		mySlide1.toggle();
		mySlide1a.toggle();
		mySlide1b.toggle();
		e.stop();
	});
	$('toggle2').addEvent('click', function(e){
		e = new Event(e);
		mySlide2.toggle();
		mySlide2a.toggle();
		mySlide2b.toggle();
		mySlide2c.toggle();
		e.stop();
	});
	$('toggle3').addEvent('click', function(e){
		e = new Event(e);
		mySlide3a.toggle();
		e.stop();
	});
	
	
	//Hide the info boxes at first
	mySlide1.hide();
	mySlide2.hide();
	mySlide1a.hide();
	mySlide1b.hide();
	mySlide2a.hide();
	mySlide2b.hide();
	mySlide2c.hide();
	mySlide3a.hide();
	
	
	/* Tips code */
	var Tips1 = new Tips($$('.Tips1'), {
		initialize:function(){
			this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
		},
		onShow: function(toolTip) {
			this.fx.start(1);
		},
		onHide: function(toolTip) {
			this.fx.start(0);
		}
	});	
	
	//Code for automatically checking how many plans meet the criteria
	$$('.wizardChoice').addEvent('click', function(e) {
		var operating_system;
		var plan_type;
		var disk_space;
		
		//find out which options are checked
		for (i=0;i<document.wizard_form.operating_system.length;i++) {
			if (document.wizard_form.operating_system[i].checked) {
				operating_system = document.wizard_form.operating_system[i].value;
			}
		}
		for (i=0;i<document.wizard_form.plan_type.length;i++) {
			if (document.wizard_form.plan_type[i].checked) {
				plan_type = document.wizard_form.plan_type[i].value;
			}
		}

		disk_space = document.wizard_form.disk_space.value;
		var priceLoad = $('priceLoad').addClass('ajax-loading'); //Shows spinning indicator
		var url = "ajax_price_range.html?operating_system="+operating_system+"&plan_type="+plan_type+"&disk_space="+disk_space;
		
		
		new Ajax(url, {
			method: 'get',
			update: $('ajaxPrice'),
			onComplete: function() { //Removes spinning indicator
				priceLoad.removeClass('ajax-loading');
			}
		}).request();
	});
	
	document.wizard_form.op_linux.click(); //Get prices onDocument Load
});