// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
$(document).ready(function(){
  $('A[rel="external"]').click( function() {
    window.open( $(this).attr('href') );
    return false;
  });
$('.login-form a[rel=reqpassword]').click(function(){
    $('.login-form .reqpass').toggle();    
    return false;
  });
  
  
  slice_cost = 0
  $("#flasher").animate({"top": "+=50px"},"slow");
  $("#flasher").animate({opacity: 1.0}, 3000).animate({"top": "-=50px"},"slow");
  
  /* Slider on the signup and upgrade page */
  
	$('.slider-wrap #slider').addClass( "active");
	$('.slider-wrap #slider input').css("display","none");
	$('.slider-wrap #slider input').val(5);
	$('.slider-wrap #slider .ui-slider-handle').mousedown(function () { $(this).addClass("active");});
	$('.slider-wrap #slider .ui-slider-handle').mouseup(function () { $(this).removeClass("active");});
	$('.slider-wrap #slider.ui-slider-signup').slider({ min: 1, max: 15, startValue: 5, animate: true, slide:function(e,ui){
			var t = jQuery(this);
			var x = jQuery(t).slider( "value" );
			jQuery(t).find('input').val(x);
			for (var y = 0; y <= x; y++)
        {
           $(".slider-wrap #node-"+y).addClass("active");
        }
      for (var y = x+1; y <= 15; y++)
        {
           $(".slider-wrap #node-"+y).removeClass("active");
        }
      /*
	  $('.cpu p').text((x/5)+"GHz");
      $('.ram p').text((x*256)+"MB");
      $('.storage p').text((x*10)+"GB");
      $('.price p').text("$"+(x*100));*/
	  
	  switch(x)
	  {
	  
	  case 1:
	  $('.cpu p').text("2 x 2.2Ghz");
      $('.ram p').text((1536)+"MB");
	  $('.storage p').text((30)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(39.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=59');
	  break;
	  
	  case 2:
	  $('.cpu p').text("2 x 2.2Ghz");
      $('.ram p').text((2048)+"MB");
	  $('.storage p').text((40)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(49.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=60');
	  break;
	  
	  case 3:
	  $('.cpu p').text("2 x 2.2Ghz");
      $('.ram p').text((2560)+"MB");
	  $('.storage p').text((50)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(69.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=90');
	  break;
	  
	  case 4:
	  $('.cpu p').text("2 x 2.2Ghz");
      $('.ram p').text((3072)+"MB");
      $('.storage p').text((60)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(79.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=62');
	  break;
	  
	  case 5:
	  $('.cpu p').text("2 x 2.2Ghz");
      $('.ram p').text((3584)+"MB");
      $('.storage p').text((70)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(89.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=63');
	  break;
	  
	  case 6:
	  $('.cpu p').text("2 x 2.2Ghz");
      $('.ram p').text((4096)+"MB");
      $('.storage p').text((80)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(99.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=64');
	  break;
	  
	  case 7:
	  $('.cpu p').text("2 x 2.2Ghz");
      $('.ram p').text((4606)+"MB");
      $('.storage p').text((90)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(109.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=65');
	  break;
	  
	  case 8:
	  $('.cpu p').text("2 x 2.2Ghz");
      $('.ram p').text((5120)+"MB");
      $('.storage p').text((100)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(119.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=66');
	  break;
	  
	  case 9:
	  $('.cpu p').text("4 x 2.2Ghz");
      $('.ram p').text((5632)+"MB");
      $('.storage p').text((110)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(129.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=67');
	  break;
	  
	  case 10:
	  $('.cpu p').text("4 x 2.2Ghz");
      $('.ram p').text((6144)+"MB");
      $('.storage p').text((120)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(139.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=68');
	  break;
	  
	  case 11:
	  $('.cpu p').text("6 x 2.2Ghz");
      $('.ram p').text((6656)+"MB");
      $('.storage p').text((130)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(149.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=69');
	  break;
	  
	  case 12:
	  $('.cpu p').text("6 x 2.2Ghz");
      $('.ram p').text((7168)+"MB");
      $('.storage p').text((140)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(159.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=70');
	  break;
	  
	  case 13:
	  $('.cpu p').text("8 x 2.2Ghz");
      $('.ram p').text((7680)+"MB");
      $('.storage p').text((150)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(169.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=71');
	  break;
	  
	  case 14:
	  $('.cpu p').text("8 x 2.2Ghz");
      $('.ram p').text((8192)+"MB");
      $('.storage p').text((160)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(179.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=72');
	  break;
	  
	  case 15:
	  $('.cpu p').text("8 x 2.2Ghz");
      $('.ram p').text((8704)+"MB");
      $('.storage p').text((200)+"GB");
	  $('.bandw p').text((2000)+"GB");
      $('.price p').text("$"+(189.95)+"/mo");
	  $('.order p a').attr('href', 'https://www.banahosting.com/member/cart.php?a=add&pid=73'); 
	  break;
	  
	  }
	  
  }} ); 
    
});

