intAddress = function () {
	new Effect.SwitchOff('address_row', {delay: 0, duration: 1});
	new Effect.Appear('address_row_2', {delay: 1, duration: 1});		
}

usAddress = function () {
	new Effect.SwitchOff('address_row_2', {delay: 0, duration: 1});
	new Effect.Appear('address_row', {delay: 1, duration: 1});		
}

editMeal = function(row_id) {
	new Effect.Appear('meal_row_' + row_id, {delay: 0, duration: 1});
}

closeMeal = function(row_id) {
	new Effect.Fade('meal_row_' + row_id, {delay: 0, duration: 1});
}


editDay = function(date,them,action) {
	new Ajax.Updater(('row_' + date), '/files_includes/meals_table_row.php?action=' + action + '&d=' + date + '&t=' + them);
}

closeMeal2 = function(date,them) {
	new Ajax.Updater(('row_' + date), '/files_includes/meals_table_row.php?d=' + date + '&t=' + them);
}

submitMeal = function(date,them) {
	new Ajax.Updater(('row_' + date), '/files_includes/meals_table_row.php?d=' + date + '&t=' + them, {parameters:Form.serialize('meal_' + date), method: 'POST', evalScripts: true});	
}

confirmRemove = function(date,them,meal,action) {
	new Ajax.Updater(('row_' + date), '/files_includes/meals_table_row.php?action=' + action + '&d=' + date + '&t=' + them + '&m=' + meal);
}

reallyRemove = function(date,them,meal,action2) {
	new Ajax.Updater(('row_' + date), '/files_includes/meals_table_row.php?action2=' + action2 + '&d=' + date + '&t=' + them + '&m=' + meal);
}

confirmCancel = function(date,them,action) {
	new Ajax.Updater(('row_' + date), '/files_includes/meals_table_row.php?action=' + action + '&d=' + date + '&t=' + them);
}

reallyCancel = function(date,them,action2) {
	new Ajax.Updater(('row_' + date), '/files_includes/meals_table_row.php?action2=' + action2 + '&d=' + date + '&t=' + them);
	new Effect.SwitchOff('row_spacer_' + date, {delay: 0, duration: 0});
}

addCustom = function(date,them,action2) {
	new Ajax.Updater(('row_' + date), '/files_includes/meals_table_row.php?add_custom=1&action2=' + action2 + '&d=' + date + '&t=' + them);
	document.getElementById("row_" + date).className = "content_cell"
}

showFriends = function(them) {
	new Ajax.Updater(('friends_form'), '/files_includes/friends_table.php', {parameters:Form.serialize('friends_form'), method: 'POST', evalScripts: true});
}

hideFriends = function() {
	new Effect.Fade('friends_table', {delay: 0, duration: 1});
}

addFriend = function() {
	new Ajax.Updater(('friends_form'), '/files_includes/friends_table.php', {parameters:Form.serialize('friends_form'), method: 'POST', evalScripts: true});	
}

addOldFriend = function(old_friend,id_them) {
	new Ajax.Updater(('friends_table_shell'), '/files_includes/friends_table.php', {parameters:{'old_friend': old_friend, 'id_them': id_them}, method: 'POST', evalScripts: true});	
}

function confirm_remove(link) {
	var answer = confirm ("Are you sure you would like to remove this person from the meal schedule?")
	if (answer) {
		window.location=(link)
	}
}

function confirm_cancel(link) {
	var answer = confirm ("Are you sure you would like to cancel the need for a meal on this day?")
	if (answer) {
		window.location=(link)
	}	
}

function confirm_disable(link) {
	var answer = confirm ("Are you sure you would like to disable this account?")
	if (answer) {
		window.location=(link)
	}	
}

function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}

function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}

showPros = function() {
	new Effect.Appear('pros_table', {delay: 0, duration: 1});
}

hideScroll = function() {
	new Effect.Fade('scroll_down', {delay: 4, duration: 2});
}

