(jQuery(function($) {
	$('#hiveinput, #searchinput').selfdescribinginput({
		textClass: 'text',
		descriptionClass: 'description'
	});
	$('a[href*="csr-reports"]').click(function(event) {
		var link = $(this);
		var location = link.attr('href');
		event.preventDefault();
		var features = ""
			+ "toolbar=0,"
			+ "menubar=0,"
			+ "scrollbars=0,"
			+ "status=0,"
			+ "fullscreen=no,"
			+ "location=no,"
			+ "width=1022,"
			+ "height=690,"
			+ "resizable=1";
		var root = window.open(location, name, features);
		root.focus();
	});
	$('#phone11').keyup(function(event) {
		if ($('#phone11').val().length == 3)
			$('#phone12').focus();
	});
	$('#phone12').keyup(function(event) {
		if ($('#phone12').val().length == 3)
			$('#phone13').focus();
	});
	
	$('#HiveSignupAjaxForm').submit(function(event) {
		event.preventDefault();
		$.fn.callJSONcontroller($(this),$(this).find(".loading-message"), $(this).find(".email-signup-status-msg"));
	});
	
	$('#HiveSignupAjaxForm input[name=hiveemail], #HiveSignupAjaxForm button').focus(function(event) {
		$(this).parents('form').eq(0).find('.footerHiveMessages').fadeIn();
	});
	
}));
