gohosting	= {
	init: 				function()
	{
		gohosting.initPlaceholders();
		gohosting.initExplanations();
		gohosting.initHostingTabs();
	},
	initPlaceholders: 	function()
	{
		$('label.with_placeholder span').click(function(){
			$(this).siblings(':input').focus();
		});
		
		$('label.with_placeholder input').focus(function(){
			$(this).siblings('span').hide();
		});
		
		$('label.with_placeholder input').blur(function(){
			if ($(this).val() != ''){
				return;
			}
			$(this).siblings('span').show();
		});
		
		// Init
		$('label.with_placeholder input').each(function(){
			if ($(this).val() != ""){
				$(this).siblings('span').hide();
			}
		}).click().focus().blur();
	},
	initExplanations: 	function()
	{
		$('table div.explanation a').attr('href','#null').mouseover(
			function ()
			{
				$(this).siblings('p').addClass('visible').css({display:'none'}).fadeIn({duration:200});
			}
		).mouseout(
			function ()
			{
				$(this).siblings('p').removeClass('visible').css({display:'none'});
			}
		);
		/*
		$('table div.explanation a').toggle(
			function(){
				$(this).siblings('p').css({display:'none'}).addClass('visible').slideDown(150);
				return false;
			}, 
			function(){
				$(this).siblings('p').slideUp(150, function(){ 
						$(this).removeClass('visible');
					});
				return false;
			});
			*/
	},
	initHostingTabs:function()
	{
		$("li.service a").click(
			function()
			{
				var tabType = 'cpanel';
				// Find whether the parent tab is cpanel or plesk.
				if ($(this).parent().hasClass("plesk")) {
					tabType = "plesk";
				}
				$("li.service").removeClass("selected");
				$("div.pricing-wrapper").removeClass("selected");
				// Mark the current tabs as selected.
				$(this).parent().addClass("selected");
				$("#pricing-"+tabType).addClass("selected");
			}
		).attr('href', '#pricing-panel');
	}
}

$().ready(function() {
	gohosting.init();
});
