// 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(2);
	$('.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: 2, 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((1)+"TB");
      $('.ram p').text((512)+"MB");
      $('.storage p').text((20)+"GB");
      $('.price p').text("$"+(24.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=116');
	  break;
	  
	  case 2:
	  $('.cpu p').text((1.5)+"TB");
      $('.ram p').text((1)+"GB");
      $('.storage p').text((40)+"GB");
      $('.price p').text("$"+(39.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=117');
	  break;
	  
	  case 3:
	  $('.cpu p').text((2)+"TB");
      $('.ram p').text((2)+"GB");
      $('.storage p').text((60)+"GB");
      $('.price p').text("$"+(59.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=118');
	  break;
	  
	  case 4:
	  $('.cpu p').text((3)+"TB");
      $('.ram p').text((3)+"GB");
      $('.storage p').text((80)+"GB");
      $('.price p').text("$"+(79.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=119');
	  break;
	  
	  case 5:
	  $('.cpu p').text((4)+"TB");
      $('.ram p').text((4)+"GB");
      $('.storage p').text((100)+"GB");
      $('.price p').text("$"+(99.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=120');
	  break;
	  
	  case 6:
	  $('.cpu p').text((5)+"TB");
      $('.ram p').text((5)+"GB");
      $('.storage p').text((120)+"GB");
      $('.price p').text("$"+(119.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=131');
	  break;
	  
	  case 7:
	  $('.cpu p').text((6)+"TB");
      $('.ram p').text((6)+"GB");
      $('.storage p').text((140)+"GB");
      $('.price p').text("$"+(139.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=132');
	  break;
	  
	  case 8:
	  $('.cpu p').text((7)+"TB");
      $('.ram p').text((7)+"GB");
      $('.storage p').text((160)+"GB");
      $('.price p').text("$"+(159.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=133');
	  break;
	  
	  case 9:
	  $('.cpu p').text((8)+"TB");
      $('.ram p').text((8)+"GB");
      $('.storage p').text((180)+"GB");
      $('.price p').text("$"+(169.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=134');
	  break;
	  
	  case 10:
	  $('.cpu p').text((9)+"TB");
      $('.ram p').text((9)+"GB");
      $('.storage p').text((200)+"GB");
      $('.price p').text("$"+(179.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=135');
	  break;
	  
	  case 11:
	  $('.cpu p').text((10)+"TB");
      $('.ram p').text((10)+"GB");
      $('.storage p').text((220)+"GB");
      $('.price p').text("$"+(189.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=136');
	  break;
	  
	  case 12:
	  $('.cpu p').text((11)+"TB");
      $('.ram p').text((11)+"GB");
      $('.storage p').text((240)+"GB");
      $('.price p').text("$"+(199.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=137');
	  break;
	  
	  case 13:
	  $('.cpu p').text((12)+"TB");
      $('.ram p').text((12)+"GB");
      $('.storage p').text((260)+"GB");
      $('.price p').text("$"+(219.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=138');
	  break;
	  
	  case 14:
	  $('.cpu p').text((14)+"TB");
      $('.ram p').text((14)+"GB");
      $('.storage p').text((300)+"GB");
      $('.price p').text("$"+(259.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=139'); 
	  break;
	  
	  case 15:
	  $('.cpu p').text((16)+"TB");
      $('.ram p').text((16)+"GB");
      $('.storage p').text((340)+"GB");
      $('.price p').text("$"+(299.95)+"/mo");
	  $('.order p a').attr('href', 'http://www.dmehosting.com/clients/cart.php?a=add&pid=152'); 
	  break;
	  
	  }
	  
  }} ); 
    
});

