﻿$(document).ready(function(){
    Cufon.replace('h3',{fontFamily:'Century Gothic'});
    Cufon.replace('h2',{fontFamily:'Century Gothic'});
    Cufon.replace('h1',{fontFamily:'Century Gothic'});
    Cufon.replace('#phone-number',{fontFamily:'Century Gothic'});
	
	$('.submit input').click(function() {
		$(this).fadeOut().after('<p class=\'loading\'>Posting, please wait...</p>');;
	});
	
	if($('div.post').length) {
		$('div.post a').attr('target','_blank');
	}
	
	// Set initial message based on which option is selected
	if($('p#album-upload').length) {
		var current = $('p#album-upload input:checked').attr('value');
		switch(current) {
			case '6':
				message = 'With the Private setting, only you will be able to view your photo.';
				break;
			case '0':
				message = 'With the Public setting, anybody who visits MYA Space will be able to view your photo if they wish.';
				break;
			case '2':
				message = 'With the Registered Members setting, anybody who is a registered member of MYA Space will be able to view your photo.';
				break;
			case '4':
				message = 'With the Only Friends setting, only your MYA Space friends will be able to view your photo.';
				break;
			case '10':
				message = 'With the Hidden setting, the photo will be hidden.';
				break;
		}
		$('p#album-upload').prepend('<span class="message">'+message+'</span>');
	}
	// Update message on change
	$('p#album-upload input').change(function() {
		$('p#album-upload span').remove();
		var id = $(this).attr('value');
		switch(id) {
			case '6':
				message = 'With the Private setting, only you will be able to view your photo.';
				break;
			case '0':
				message = 'With the Public setting, anybody who visits MYA Space will be able to view your photo if they wish.';
				break;
			case '2':
				message = 'With the Registered Members setting, anybody who is a registered member of MYA Space will be able to view your photo.';
				break;
			case '4':
				message = 'With the Only Friends setting, only your MYA Space friends will be able to view your photo.';
				break;
			case '10':
				message = 'With the Hidden setting, the photo will be hidden.';
				break;
		}
		$('p#album-upload').prepend('<span class="message">'+message+'</span>');
	});
	
});
