window.addEvent('domready', function(){
		var elspace = $('pointspace'),
			feedspace = $('feederspace');
			fuelspaceddd = $('setfuelspace');
			txtfuelspace = $('inputfuelspace');
			basepricespace = 0.30;
			txtpricespace = $('pricespace');
			txtspace = $('space');
	
	// Create the new slider instance
	new Slider(elspace, elspace.getElement('.knob'), {
		steps: 20,	// There are 35 steps
		range: [1],	// Minimum value is 8
		onChange: function(value){
			// Everytime the value changes, we change the font of an element
			
			//set the fuel value
			txtfuelspace.set('value', value);
			
			//set fuel on the visual slider
			var width = value*25
			fuelspaceddd.setStyle('width', width);
			
			
			
			var pricespace = basepricespace * value;
			
			txtpricespace.set('text', pricespace.toFixed(2));
			
			// Work out the spec
			var space = 1 * value;
			txtspace.set('text', space);

			window.spacevalue = pricespace;
			displayyearlyprice();
		}
	}).set(feedspace.getStyle('font-size').toInt());
	
	
	// Traffic Slider
	var eltraffic = $('pointtraffic'),
		feedtraffic = $('feedertraffic');
		fueltrafficddd = $('setfueltraffic');
		txtfueltraffic = $('inputfueltraffic');
		basepricetraffic = 0.20;
		txtpricetraffic = $('pricetraffic');
		txttraffic = $('traffic');
	
	// Create the new slider instance
	new Slider(eltraffic, eltraffic.getElement('.knob'), {
		steps: 20,	// There are 35 steps
		range: [1],	// Minimum value is 8
		onChange: function(value){
			// Everytime the value changes, we change the font of an element
			
			//set the fuel value
			txtfueltraffic.set('value', value);
			
			//set fuel on the visual slider
			var width = value*25
			fueltrafficddd.setStyle('width', width);
			
			
			
			var pricetraffic = basepricetraffic * value;
			
			txtpricetraffic.set('text', pricetraffic.toFixed(2));
			
			// Work out the spec
			var traffic = 10 * value;
			txttraffic.set('text', traffic);

			window.trafficvalue = pricetraffic;
			displayyearlyprice();
		}
	}).set(feedtraffic.getStyle('font-size').toInt());
	
	// Email Slider
	var elemail = $('pointemail'),
		feedemail = $('feederemail');
		fuelemailddd = $('setfuelemail');
		txtfuelemail = $('inputfuelemail');
		basepriceemail = 0.10;
		txtpriceemail = $('priceemail');
		txtemail = $('email');
	
	// Create the new slider instance
	new Slider(elemail, elemail.getElement('.knob'), {
		steps: 20,	// There are 35 steps
		range: [1],	// Minimum value is 8
		onChange: function(value){
			// Everytime the value changes, we change the font of an element
			
			//set the fuel value
			txtfuelemail.set('value', value);
			
			//set fuel on the visual slider
			var width = value*25
			fuelemailddd.setStyle('width', width);
			
			
			
			var priceemail = basepriceemail * value;
			
			txtpriceemail.set('text', priceemail.toFixed(2));
			
			// Work out the spec
			var email = 50 * value;
			txtemail.set('text', email);

			window.emailvalue = priceemail;
			displayyearlyprice();
		}
	}).set(feedemail.getStyle('font-size').toInt());
	
	// Domains Slider
	var eldomains = $('pointdomains'),
		feeddomains = $('feederdomains');
		fueldomainsddd = $('setfueldomains');
		txtfueldomains = $('inputfueldomains');
		basepricedomains = 0.25;
		txtpricedomains = $('pricedomains');
		txtdomains = $('domains');
	
	// Create the new slider instance
	new Slider(eldomains, eldomains.getElement('.knob'), {
		steps: 20,	// There are 35 steps
		range: [1],	// Minimum value is 8
		onChange: function(value){
			// Everytime the value changes, we change the font of an element
			
			//set the fuel value
			txtfueldomains.set('value', value);
			
			//set fuel on the visual slider
			var width = value*25
			fueldomainsddd.setStyle('width', width);
			
			
			
			var pricedomains = basepricedomains * value;
			
			txtpricedomains.set('text', pricedomains.toFixed(2));
			
			// Work out the spec
			var domains = 1 * value;
			txtdomains.set('text', domains);
			
			
			window.domainsvalue = pricedomains;
			displayyearlyprice();
			
		}
	}).set(feeddomains.getStyle('font-size').toInt());
	
	// Databases Slider
	var eldatabases = $('pointdatabases'),
		feeddatabases = $('feederdatabases');
		fueldatabasesddd = $('setfueldatabases');
		txtfueldatabases = $('inputfueldatabases');
		basepricedatabases = 0.25;
		txtpricedatabases = $('pricedatabases');
		txtdatabases = $('databases');
	
	// Create the new slider instance
	new Slider(eldatabases, eldatabases.getElement('.knob'), {
		steps: 20,	// There are 35 steps
		range: [1],	// Minimum value is 8
		onChange: function(value){
			// Everytime the value changes, we change the font of an element
			
			//set the fuel value
			txtfueldatabases.set('value', value);
			
			//set fuel on the visual slider
			var width = value*25
			fueldatabasesddd.setStyle('width', width);
			
			
			
			var pricedatabases = basepricedatabases * value;
			
			txtpricedatabases.set('text', pricedatabases.toFixed(2));
			
			
			// Work out the spec
			var databases = 5 * value;
			txtdatabases.set('text', databases);
			
			window.databasesvalue = pricedatabases;
			displayyearlyprice();
			
		}
	}).set(feeddatabases.getStyle('font-size').toInt());
	
	
	
});


window.sslvalue = 0;
window.supportvalue = 0;
window.sshvalue = 0;
window.unlimitedvalue = 0;
function checkvalidation(data) {
	inputssh = $('inputssh');
	inputssl = $('inputssl');
	inputsupport = $('inputsupport');
	inputunlimited = $('inputunlimited');
	cvalue = get_check_value(data);
	if (data == "ssl") {
		if (cvalue == "on") {
		inputssl.set('value', "yes");
		window.sslvalue = 2;
		} else {
		inputssl.set('value', "");
		window.sslvalue = 0;
		}
	}
	if (data == "support") {
		if (cvalue == "on") {
			inputsupport.set('value', "yes");
			window.supportvalue = 10;
		} else {
			inputsupport.set('value', "");
			window.supportvalue = 0;
		}
	}
	if (data == "ssh") {
		if (cvalue == "on") {
		window.sshvalue = 2;
		inputssh.set('value', "yes");
		} else {
		inputssh.set('value', "");
		window.sshvalue = 0;
		}
	}
	if (data == "unlimited") {
		if (cvalue == "on") {
		inputunlimited.set('value', "yes");
		window.unlimitedvalue = 10;
		} else {
		inputunlimited.set('value', "");
		window.unlimitedvalue = 0;
		}
	}
	displayyearlyprice();
}

function get_check_value(data)
{
var c_value = "";
var inputs = $(data).getElements('input');
for (var i=0; i < inputs.length; i++)
   {
   if (inputs[i].checked)
      {
      c_value += inputs[i].value;
      }
   }
return c_value;
}


function displayyearlyprice() {
	totalyearlytxt = $('totalyearlyy');
	totalyearlymonthtxt = $('totalyearly');
	totalmonthlytxt = $('totalmonthly');
	window.totalyearly = window.databasesvalue + window.domainsvalue + window.emailvalue + window.trafficvalue + window.spacevalue + window.sslvalue + window.supportvalue + window.sshvalue + window.unlimitedvalue;
	window.totalyearlyy = window.totalyearly * 12;
	window.totalmonthly = window.totalyearly * 1.34;
	totalmonthly = totalmonthly + 0.20;
	saving = (totalmonthly * 12) - totalyearlyy;
	saving = saving.toFixed(2);
	totalmonthly = totalmonthly.toFixed(2);
	totalyearlymonthtxt.set('text', saving);
	totalmonthlytxt.set('text', totalmonthly);
	totalyearlyy = totalyearlyy.toFixed(2);
	totalyearly = totalyearly.toFixed(2);
	totalyearlytxt.set('text', totalyearlyy);
	
}
