// JavaScript Document

$(document).ready(function(){
	$('div.expander div:not("div.expander div div")').hide().end();
	$('div.expander h4').wrapInner('<a href="javascript:void(0)"></a>').end();
	$('div.expander h4.more a').append('<span>More Information</span>')
	$('div.expander h4 a').click(function() {
		var $expander = $(this).parent().next('div');
		if ($expander.is(":hidden")) {
			$expander.slideDown();
			if ($(this).parent().hasClass('more')) {
				$(this).children('span').html('Hide');
			}
		} else {
			$expander.slideUp();
			if ($(this).parent().hasClass('more')) {
				$(this).children('span').html('More Information');
			}
		}
	});
	
	$("input[type=submit]").hover( function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
	
	$("blockquote").before("<span class='tquote'>&ldquo;</span>");  
	$("blockquote").after("<span class='bquote'>&rdquo;</span>"); 
	
	$('table.addon').attr({cellspacing: '0', cellpadding: '0'});
	$('table.addon tr td:first-child').next().addClass('col2');
	$('table.addon tr td:first-child').next().next().addClass('col3');
	$('div.addon div.expander.linux-pp ul li:odd').addClass('even');
	$('div.addon div.expander.windows-pp ul li:odd').addClass('even');
	
	$('table.light').attr({cellspacing: '0', cellpadding: '0'});
	$('table.light:first').before(
		'<p class="fs_change">Font Size <a href="javascript:void(0)" class="font1 active">A</a> <a href="javascript:void(0)" class="font2">A</a> <a href="javascript:void(0)" class="font3">A</a></p>'
	);
	$('p.fs_change a').click ( function() {
		if ($(this).hasClass('font1')) {
			var fonts = '11px';
		}
		if ($(this).hasClass('font2')) {
			var fonts = '13px';
		}
		if ($(this).hasClass('font3')) {
			var fonts = '18px';
		}
		$('p.fs_change a').removeClass('active');
		$(this).addClass('active');
		$('table.light tr td').animate({ fontSize: fonts});
	});
	$('table.light tr:first-child').addClass('row1');
	$('table.light tr th:first-child').addClass('col1');
	$('table.light tr th:last-child').addClass('col4');
	$('table.light tr td:last-child').addClass('col4');
	$('.compact').hide().after('<a href="javascript:void(0)" class="showmore">More Features</a>');
	$('.showmore').click( function() {
		if ($(this).prev('div.compact').is(":hidden")) {
			$(this).html('Hide Features');
			$(this).prev('div.compact').slideDown();
		} else {
			$(this).prev('div.compact').slideUp();
			$(this).html('More Features');
		}
	});

	//FAQ VPS
	$('div.faq-expand p, div.faq-expand ul, div.faq-expand ol').hide();
	$('div.faq-expand h3').addClass('more').click(function (event) {
		 if ($(this).nextAll().is(":hidden")) 
		 {
			$(this).addClass('less');
        	$(this).nextAll().slideDown();
      	 } 
	  	else {
			$(this).removeClass('less');
       	 	$(this).nextAll().slideUp();
      	}
	});

});

