$(document).ready(function(){
	//home & products 
	setInterval( "carrier()", 3000 );
	//menu tabs
	$('#menu a').click(function(event){
		event.preventDefault();
		var tab_id = $(this).attr('id').replace(/m-/,'');
		$('#slides div').filter('[id*=s-]').css("display","none");
		//TODO: add nicer transitions
		$("#s-"+tab_id).css("display","block");
		$("#serv-down").css("display","none");
		$('#menu a').removeClass("here");
		$(this).addClass("here");
		return false;
	});
	
	
	
	$("#serv-sel p").live('click',function(){
		//event.preventDefault();
		$("#serv-down").animate({"height": "toggle"}, { duration: 100 });
		return false;
	});
	$("#serv-down p").live('click',function(){
		//event.preventDefault();
		//select service, move to serv-sel - if serv-sel wasnt empty, copy back service to serv-down
		$("#serv-sel p").clone().appendTo("#serv-down");
		$("#serv-down p.empty").remove();
		$("#serv-sel p").replaceWith(this);
		//update hidden input
		var s_id = $(this).attr('id').replace(/s/,'');
		$("#sid").attr("value",s_id);
		$("#serv-down").animate({"height": "toggle"}, { duration: 100 });
		return false;
	});
	
	
});
