$(document).ready(function() {
	// Drop down menu
	$('div#navigation ul li.submenu').hover(function() {
		$("ul", this).show();
	}, function() {
		$("ul", this).hide();
	});
	
	// jQuery Slides
	$(".slides").slides({
		pagination: false,
		generatePagination: false,
		preload: true,
		play: 5000,
		pause: 2500,
		hoverPause: true,
		generateNextPrev: true,
		randomize: true
	});
	
	//
	$("a.playground_service_link").click(function() {
		if ($("div#playground_services").length > 0) {
			var service = $(this).attr("href").split('#');
			loadPlaygroundServices(service[1]);
		};
	});
});

function loadPlaygroundServices (service) {
	if (service == null)
		var hash = window.location.hash.substring(1);
	else
		var hash = service;
	
	$("div.playground_service").hide();
	$("div#playground_services").show();
	
	if (hash == null || hash == "") {
		$("div#chips").show();
	} else {
		$("div#"+hash).show();
	};
};
