$(document).ready(function(){
	//alert('test'); 
		
	$(".custom-select").selectBox();
	
	$('.other-feature-input').parent().hide();
	$('.other-feature-label').hide();
	
	$('#fsc_ex_field1_9_8, #fsc_ex_field2_12_9').click(
         function () {
            $('.other-feature-input').parent().slideToggle('fast');
			$('.other-feature-label').slideToggle('fast');
    });

	
	// colorbox
	$('.portfolio a').colorbox({transition:'elastic'});
	
	// Price Slider
	$.priceSlider({
      default_blocks: (function() {
        var blocks = $.cookie('db-slider', {domain: '.dotblock.com'});
        if (blocks) {
          return parseInt(blocks, 0);
        } else {
          return 1;
        }
      })()
    }); 
	
	//Hourly breakdown Tooltip
    $('#slider-price-box').tooltip({}); 
	
	
	//Dotblock Popup
	$('.db-link').click(function() {
		var a = this;
		
		$('#dotblock-popup').dialog({
			autoOpen: true,
			draggable: false,
			modal: true,
			resizable: false,
			width: 572,
			position: 'top',
			dialogClass: 'dotblock-popup-container',
			buttons: [
				{
					text: 'Stay at HostRocket',
					click: function() { $(this).dialog('close'); }
				},
				{
					text: 'Visit DotBlock',
					click: function() { window.location = a.href; }
				}
			]
		});
		
		return false;
		
		
	});
    
	//Filter Installs
		$('#filter a').click(function() {  
		$('#filter .current').removeClass('current');  
		$(this).parent().addClass('current');
		var filterVal = $(this).text().toLowerCase().replace(' ','-');
		if(filterVal == 'all') {
			$('#software li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			$('#software li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).hide().addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}
		
		return false;  
    }); 
});
