var prices = new Array();
//NL prices
	prices['nl'] = new Array();
	prices['nl'][0] = new Array('1 Core','128MB','10GB','100GB','5.00','EUR','Xen128','1');
	prices['nl'][1] = new Array('1 Core','256MB','20GB','250GB','7.50','EUR','Xen256','2');
	prices['nl'][2] = new Array('2 Cores','512MB','40GB','1TB','10.00','EUR','Xen512','3');
	prices['nl'][3] = new Array('3 Cores','1024MB','80GB','1TB','20.00','EUR','Xen1024','4');
	prices['nl'][4] = new Array('4 Cores','2048MB','120GB','2TB','35.00','EUR','Xen2048','53');
//SE prices
	prices['se'] = new Array();
	prices['se'][0] = new Array('1 Core','128MB','10GB','100GB','5.00','EUR','Xen128','54');
	prices['se'][1] = new Array('1 Core','256MB','20GB','250GB','7.50','EUR','Xen256','55');
	prices['se'][2] = new Array('2 Cores','512MB','40GB','1TB','10.00','EUR','Xen512','56');
	prices['se'][3] = new Array('3 Cores','1024MB','80GB','1TB','20.00','EUR','Xen1024','57');
	prices['se'][4] = new Array('4 Cores','2048MB','120GB','2TB','35.00','EUR','Xen2048','58');
//US prices
	prices['us'] = new Array();
	prices['us'][0] = new Array('1 Core','128MB','10GB','100GB','5.00','EUR','Xen128','59');
	prices['us'][1] = new Array('1 Core','256MB','20GB','250GB','7.50','EUR','Xen256','60');
	prices['us'][2] = new Array('2 Cores','512MB','40GB','1TB','10.00','EUR','Xen512','61');
	prices['us'][3] = new Array('3 Cores','1024MB','80GB','1TB','20.00','EUR','Xen1024','62');
	prices['us'][4] = new Array('4 Cores','2048MB','120GB','2TB','35.00','EUR','Xen2048','63');
	//Format of the Array(ghz,RAM,Storage,Bandwidth,Cost,Currency,PackageName,PackageID);
/**	prices[0] = new Array('1 core','128MB','10GB','100GB','5.00','Xen128');
	prices[1] = new Array('1 core','256MB','20GB','250GB','7.50','Xen256');
	prices[2] = new Array('1 core','512MB','40GB','1TB','15.00','Xen512');
	prices[3] = new Array('1 core','1024MB','80GB','1TB','30.00','Xen1024');
	prices[4] = new Array('1 core','2048MB','120GB','1TB','50.00','Xen2048');
	**/
var egg = 0;		
var base_url = 'addons/themes/xen/img/ruler_';
var vps_package = 0;
var country = "";

function recalculate_box(h_package)
{
	//alert(h_package);
	//h_package = $("#order_package").val();
	//alert(h_package);
	if(typeof(h_package)=="undefined" || h_package == null ) 
	{ h_package = vps_package;}
		else 
	{vps_package = h_package;}
	var country = $("input:radio[name='country']:checked").val();
	info = prices[country][h_package];
	//alert(info[1] + "=" + h_package);
	if(h_package == "0")//Xen128
	{
		$("#order_cpu_ruler").attr("src", base_url+"1.png");
		$("#order_memory_ruler").attr("src", base_url+"1.png");
		$("#order_raid_ruler").attr("src", base_url+"2.png");
		$("#order_bandwidth_ruler").attr("src", base_url+"1.png");
	}
	if(h_package == "1")//xen256
	{
		$("#order_cpu_ruler").attr("src", base_url+"1.png");
		$("#order_memory_ruler").attr("src", base_url+"2.png");
		$("#order_raid_ruler").attr("src", base_url+"3.png");
		$("#order_bandwidth_ruler").attr("src", base_url+"2.png");
	}
	if(h_package == "2")//xen512
	{
		$("#order_cpu_ruler").attr("src", base_url+"2.png");
		$("#order_memory_ruler").attr("src", base_url+"3.png");
		$("#order_raid_ruler").attr("src", base_url+"4.png");
		$("#order_bandwidth_ruler").attr("src", base_url+"4.png");
	}
	if(h_package == "3")//xen1024
	{
		$("#order_cpu_ruler").attr("src", base_url+"4.png");
		$("#order_memory_ruler").attr("src", base_url+"4.png");
		$("#order_raid_ruler").attr("src", base_url+"5.png");
		$("#order_bandwidth_ruler").attr("src", base_url+"4.png");
	}
	if(h_package == "4")//xen2048
	{
		$("#order_cpu_ruler").attr("src", base_url+"6.png");
		$("#order_memory_ruler").attr("src", base_url+"6.png");
		$("#order_raid_ruler").attr("src", base_url+"6.png");
		$("#order_bandwidth_ruler").attr("src", base_url+"6.png");
	}
	
	currency = '&euro;';
	//if(country == 'us') currency = '$';
	
	$("#price_text .price").html(currency);
	$("#order_cpu").html(info[0]);
	$("#order_memory").html(info[1]);
	$("#order_raid").html(info[2]);
	$("#order_bandwidth").html(info[3]);
	$("#order_price").html(info[4]);
	$("#order_package").html(info[6]+ " " + country);

	
}

 $(document).ready(function() {	
    $("#box_slider").slider({ min: 0, max: 4,slide : function(event,ui) {recalculate_box(ui.value)} });
  });

function easteregg(that)
{
	egg++;
	if(egg >4)
		that.setAttribute("src", "addons/themes/xen/img/sobo.png");
}

function orderbox_popup()
{
	var country = $("input:radio[name='country']:checked").val();
	info = prices[country][vps_package];
	
	//alert(vps_package);
	//url = '/clients/order.php?step=2&pid='+info[7];
	url = 'https://www.xeneurope.com/clients/cart.php?a=add&pid='+info[7];

	window.open (url , "OrderWindow","location=0,status=0,scrollbars=1, width=1024,height=768");
}
function order_popup(id)
{

	//url = '/clients/order.php?step=2&pid='+id;
	url = 'https://www.xeneurope.com/clients/cart.php?a=add&pid='+id;

	window.open (url , "OrderWindow","location=0,status=0,scrollbars=1, width=1024,height=768");
}

