
	$(function() {
				
		$("select, :file, :checkbox, :radio").uniform();
		$(".selector span").css("width", "465px");
		
		$("input[type=reset]")
			.button()
			.css({"float":"left"})
			.live('click', function(e) {
				$.uniform.update();
				$(".missing-field").clearField({}, function() {
					$(this).css("background", "none");
				});
			});
		
		
		$("input[type=button]")
			.button({buttonStyle:"default"})
			.css({"float":"right"})
			.live('click', function(e) {
				
				var emailVal = $("input[name=email]").val();
				var subjectVal = $("select[name=subject]").val();
				var commentVal = $("textarea[name=comments]").val();					
				
				if ( emailVal != "" && emailVal != "Email Address" && subjectVal && commentVal != "" && commentVal != "Your Comment" ) {
					
					$.post("http://twss.macfanatic.net/support/submit/", {email:emailVal,subject:subjectVal,comment:commentVal}, function() {
						$('#submit-ticket-content').html('<h2>Thank You</h2><p>Thank you for your feedback.</p><p>I will contact you if I need more information regarding the issue.</p></div>');
						$('#submit-ticket').click();						
					});
					
				} else {
					
					if ( emailVal == "" || emailVal == "Email Address" ) {
						$("input[name=email]").flashField();
					}
					
					if ( commentVal == "" || commentVal == "Your Comment" ) {
						$("textarea[name=comments]").flashField();
					}
					
				}
									
			});		
		
		
		
		$('#feature-links a').click(function(e) {
		
			e.preventDefault();
			$this = $(this);
			var element = $('#'+$this.attr("id")+"-content");

			$('#feature-pointer').animate({
				left: Math.floor($this.position().left + ($this.width()/2)) - 10
			}, 1000, function() {
				
				$('#success-message').fadeOut('slow', function() {
					$(this)
						.html(element.html())
						.fadeIn("slow");
				});	
				
			});

		});
		
		$('#submit-ticket').click();
		
	});
