$(document).ready(function(){
	$("body").css({"overflow-y":"scroll"});
	$("#main .item  p").css({"opacity":0});
	$(".item img").hover(function(){
		$(".item p").stop().animate({"opacity":0});
		$(this).parent().parent().children("p").stop().animate({"opacity":1});
	});
	$("ul#controls a").click(function(){
		var isselected = $(this).attr("class");
		if(isselected != "selected") {
			$("ul#controls a").removeClass("selected");
			$(this).addClass("selected");
			var attribute = $(this).attr("rel");
			$("#feature-cont div:not(" + attribute + ")").fadeOut(500, function(){
				$("#feature-cont").load("feature/" + attribute + ".html").fadeIn(500);
			});
		};
		return false;
	});
	$("div.aservice img").css({"opacity":0.6});
	$("div.aservice").hover(function(){
		$(this).children("img").stop().animate({"opacity" : 1},500);
		}, function(){
			$(this).children("img").stop().animate({"opacity": 0.6},500);
	});
	$("form#contactform li input").focus(function(){
		$(this).parent().children("label").children("span").fadeIn();
	});
	$("form#contactform li input").blur(function(){
		$(this).parent().children("label").children("span").fadeOut();
	});
		$("form#contactform").submit(function() {
			var url = 'send.php';
			$.post(url,{
				name:$('#name').val(),
				email:$('#email').val(),
				website:$('#website').val(),
				message:$('#message').val()
				}, function() {
					$("form#contactform input, textarea").css({"background-color" : "#ebebeb"}).attr({disabled: "disabled"})
					$("input#submit").animate({"opacity": 0},500, function(){
						$("li#thanks").fadeIn();
					});
				});
			return false;
		});
});