jQuery(function($){

	/* Menu for index page */

	var services = $('#services');	
			
	$(services).find('table.block').bind('mouseenter', function(){
		$(this).addClass('active');
	}).bind('mouseleave', function(){
		$(this).removeClass('active');	
	});

	$(services).find('table.block').bind('click', function(){
		location.href = $(this).find('a').attr('href');
	});

	/* Header logo */
	$('#gheader div.logo0').bind('mouseenter', function(){
		$(this).css('cursor', 'pointer');
	});

	/* Site order calculator */

	var sum = 0;
	var sitedev = $('table.sitedev');
		
	$(sitedev).find('td a').bind('click', function(){
		return false;
	});

	$(sitedev).find('td.marker a').bind('click', function(){
		var marker = $(this).parent();
		var markerClass = $(marker).attr('class');
		var price = parseInt($(marker).parent().parent().find('td div.price').text());

		if (markerClass == 'redbull')
		{
			$(marker).removeClass('redbull');
			$(marker).addClass('graybull');
			sum -= price;
		}
		
		if (markerClass == 'graybull')
		{
			$(marker).removeClass('graybull');
			$(marker).addClass('redbull');
			sum +=price;
		}
		
		$(sitedev).find('tr.prices td.sum').text(sum);	
		return false;
	});

});
