function hideShowPassword()
{

	var name = $('#MC_notecaPassword').attr('name'); // grab name of original
	var value = $('#MC_notecaPassword').attr('value'); // grab value of original

	if ($('#hide_show').html() == 'Hide')
	{
		var html = '<input type="password" name="'+name+'" id="'+name+'"  value="'+value+'" />';
		$('#MC_notecaPassword').after(html).remove(); // add new, then remove original input
		$('#hide_show').html('Show');
	}
	else
	{
		var html = '<input type="text" name="'+name+'" id="'+name+'"  value="'+value+'" />';
		$('#MC_notecaPassword').after(html).remove(); // add new, then remove original input
		$('#hide_show').html('Hide');
		
	}
}

function ponDominio(campo){
	var dominio = $(campo).val();
	$('#yourDomain').html('http://' + dominio + '.noteca.com');
	
	$('#yourDomain').attr ('href', 'http://' + dominio + '.noteca.com');
}



// Build the composed 'custom' value for PayPal
function buildSpecialFields()
{
	var sep = '|';

	$('#custom').val ( 'S' + sep + $('#item_number').val() + sep + $('#MC_notecaFirstName').val() + sep 
			+ $('#MC_notecaLastName').val() + sep + $('#MC_notecaEmail').val() + sep 
			+ $('#MC_notecaCompany').val() + sep + $('#MC_notecaPassword').val() + sep 
			+ $('#MC_notecaSubdomain').val() + sep + $('#MC_notecaUsername').val());
	
	if ($('#MC_notecaBetaCode').val() != '') 
	{
		value = ($('#a3').val()) * 0.65;
		$('#signup_form').append('<input type"hidden" name="a2" value="' + value + '">');
		$('#signup_form').append('<input type"hidden" name="p2" value="1">');
		$('#signup_form').append('<input type"hidden" name="t2" value="M">');
		$('#custom').val ( $('#custom').val() + '-' + $('#MC_notecaBetaCode').val() );
	}
			
	$('#return').val ( 'http://' + $('#MC_notecaSubdomain').val() + '.noteca.com/login/index');
}


function initFront() 
{
	
	$('#show-initial-configuration').click(function(){				
		$('#initial-configuration').fadeIn('fast');
		$('#ic_company_name').focus();
		return false;
	});	
	
	$('#done-initial-configuration').click(function(){		
		$('#show-initial-configuration').addClass('saved').text('Your initial configuration help request has been registered');
		$('#initial-configuration').hide();
		$('#ic_initial_configuration_on').val(1);
		return false;
	});	
	
	$('#cancel-initial-configuration').click(function(){		
		$('#initial-configuration').hide();
		$('#show-initial-configuration').removeClass('saved').text('Help me with the initial configuration');		
		return false;
	});
	
	

}
