/* dialog manipulations */
function ShowDialogButton(button, title, action) {
	button.html(title);
	button.click(function() { 
		if (typeof action == 'string') { eval(action); } else { action(); } 
		return HideDialog(this); 
	});
	button.show();
}

function ShowDialog(options) {
	if ($('#dialogs div.dlg' + options.id).size() > 0) { return false; }

	var dialog = $('#templates div.dialog').clone();
	dialog.addClass('dlg' + options.id);
	dialog.appendTo('#dialogs');
	var actall = '';
	if (options.title  ) { dialog.find('h2').html(options.title); }
	if (options.message) { dialog.find('p').html(options.message); }
	if (options.act1t  ) { actall += options.act1e; ShowDialogButton(dialog.find('a.act1'), options.act1t, options.act1e); }
	if (options.act2t  ) { actall += options.act2e; ShowDialogButton(dialog.find('a.act2'), options.act2t, options.act2e); }
	if (options.act3t  ) { actall += options.act3e; ShowDialogButton(dialog.find('a.act3'), options.act3t, options.act3e); }
	if (actall == '') { dialog.click(function() { dialog.remove(); return false; }); }
	dialog.fadeIn('fast');
	return false;
}

function HideDialog(node) {
	$(node).parents('div.dialog').remove();
	return false;
}


function ShowDialogAlert(message) {
	return ShowDialog({
		'id' : '',
		'title' : 'Alert',
		'message' : message,
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}


function ShowDialog1011101() {
	return ShowDialog({
		'id' : '1011101',
		'title' : 'Sign In Name is not valid',
		'message' : 'Please try again',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1011102() {
	return ShowDialog({
		'id' : '1011102',
		'title' : 'Password is not valid',
		'message' : 'Please try again',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1011103() {
	return ShowDialog({
		'id' : '1011103',
		'title' : 'Account is locked',
		'message' : 'Do you want to view the Secret Question?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : 'ShowScreen(106);'
	});
}
function ShowDialog1011104() {
	return ShowDialog({
		'id' : '1011104',
		'title' : 'Sign In Name is required',
		'message' : 'Insert Sign In Name',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}function ShowDialog1011105() {
	return ShowDialog({
		'id' : '1011105',
		'title' : 'Account not found',
		'message' : 'Please contact Administration',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1021101() {
	return ShowDialog({
		'id' : '1021101',
		'title' : 'Name or Date is not valid',
		'message' : 'Please try again',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1021102() {
	return ShowDialog({
		'id' : '1021102',
		'title' : 'Guest has already a Sign In Name',
		'message' : 'Do you want to sign in?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : 'ShowScreen(101);'
	});
}
function ShowDialog1021103() {
	return ShowDialog({
		'id' : '1021103',
		'title' : 'Unknown Error',
		'message' : 'Please contact Reception or try again',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1031101() {
	return ShowDialog({
		'id' : '1031101',
		'title' : 'Please insert Sign In Name',
		'message' : 'Sign In missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1031102() {
	return ShowDialog({
		'id' : '1031102',
		'title' : 'Sign In Name already taken',
		'message' : 'Please enter a new one',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1031103() {
	return ShowDialog({
		'id' : '1031103',
		'title' : 'Sign In Name created',
		'message' : 'you will be signed in now',
		'act1t' : 'Dismiss',
		'act1e' : ' alert("Redirect will be here")'
	});
}
function ShowDialog1031104() {
	return ShowDialog({
		'id' : '1031104',
		'title' : 'Please insert Password',
		'message' : 'Password is missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1031105() {
	return ShowDialog({
		'id' : '1031105',
		'title' : 'The passwords don\'t match',
		'message' : 'Please try again',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1031106() {
	return ShowDialog({
		'id' : '1031106',
		'title' : 'Please insert \'Repeat Password\'',
		'message' : '\'Repeat Password\' is missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1031107() {
	return ShowDialog({
		'id' : '1031107',
		'title' : 'Please insert Secret Question',
		'message' : 'Secret Question is missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1031108() {
	return ShowDialog({
		'id' : '1031108',
		'title' : 'Please insert Secret Answer',
		'message' : 'Secret Answer is missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1031109() {
	return ShowDialog({
		'id' : '1031109',
		'title' : 'Unknown Error',
		'message' : 'Please contact Reception or try again',
		'act1t' : 'Dismiss',
		'act1e' : 'ShowScreen(103);'
	});
}
function ShowDialog1061101() {
	return ShowDialog({
		'id' : '1061101',
		'title' : 'Insert Secret Answer',
		'message' : 'Secret Answer is missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1061102() {
	return ShowDialog({
		'id' : '1061102',
		'title' : 'Secret Answer is not valid',
		'message' : 'Please try again',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1061103() {
	return ShowDialog({
		'id' : '1061103',
		'title' : 'Account is locked',
		'message' : 'Contact Front Desk for new Password',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1061104() {
	return ShowDialog({
		'id' : '1061104',
		'title' : 'Secret Answer accepted',
		'message' : 'Please change password',
		'act2t' : 'No',
		'act2e' : 'ShowScreen(101);',
		'act3t' : 'Yes',
		'act3e' : 'ShowScreen(107);'
	});
}
function ShowDialog1061105() {
	return ShowDialog({
		'id' : '1061105',
		'title' : 'Sign In Name is required',
		'message' : 'Insert Sign In Name',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1071101() {
	return ShowDialog({
		'id' : '1071101',
		'title' : 'Insert New Password',
		'message' : 'New Password is missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1071102() {
	return ShowDialog({
		'id' : '1071102',
		'title' : 'Insert Repeat Password',
		'message' : 'Repeat Password is missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1071103() {
	return ShowDialog({
		'id' : '1071103',
		'title' : 'Passwords don\'t match',
		'message' : 'Please try again',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1071104() {
	return ShowDialog({
		'id' : '1071104',
		'title' : 'Insert Secret Question',
		'message' : 'Secret Question is missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1071105() {
	return ShowDialog({
		'id' : '1071105',
		'title' : 'Insert Secret Answer',
		'message' : 'Secret Answer is missing',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}
function ShowDialog1071106() {
	return ShowDialog({
		'id' : '1071106',
		'title' : 'Changes accepted',
		'message' : 'You will be signed in now',
		'act2t' : 'Cancel',
		'act2e' : 'ShowScreen(101);',
		'act3t' : 'Sign In',
		'act3e' : 'Form107SignIn();'
	});
}
function ShowDialog1101101() {
	return ShowDialog({
		'id' : '1101101',
		'title' : 'You want to sign out?',
		'message' : 'Are you sure?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : 'SignOut();'
	});
}

function ShowDialog1261102(act3) {
	return ShowDialog({
		'id' : '1261102',
		'title' : 'You are removing the selected item',
		'message' : 'Are you sure?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}
function ShowDialog1261103(act3) {
	return ShowDialog({
		'id' : '1261103',
		'title' : 'You are booking the selected item',
		'message' : 'Are you sure?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog1271102(act3) {
	return ShowDialog({
		'id' : '1271102',
		'title' : 'You are removing the selected item',
		'message' : 'Are you sure?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}
function ShowDialog1271103(act3) {
	return ShowDialog({
		'id' : '1271103',
		'title' : 'You are booking the selected item',
		'message' : 'Are you sure?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog1621002() {
	return ShowDialog({
		'id' : '1621002',
		'title' : 'Delete Message',
		'message' : 'Are you sure?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : 'DeleteMessage162();'
	});
}

function ShowDialog1661002() {
	return ShowDialog({
		'id' : '1661002',
		'title' : 'Delete Message',
		'message' : 'Do you want to delete message?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : 'DeleteMessage166();'
	});
}

function ShowDialog3171101() {
	return ShowDialog({
		'id' : '3171101',
		'title' : 'Please select Attendees',
		'message' : '',
		'act1t' : 'Ok',
		'act1e' : ''
	});
}

function ShowDialog3171102() {
	return ShowDialog({
		'id' : '3171102',
		'title' : 'Thank you for your booking',
		'message' : 'The Ticket will be delivered to your cabin',
		'act1t' : 'Ok',
		'act1e' : ''
	});
}
/*
function ShowDialog3171103() {
	return ShowDialog({
		'id' : '3171103',
		'title' : 'Please insert number of Tickets',
		'message' : '',
		'act1t' : 'Ok',
		'act1e' : ''
	});
}
*/
function ShowDialog3171104(act3) {
	return ShowDialog({
		'id' : '3171104',
		'title' : 'Do you want to recommend this Event',
		'message' : '',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog3171105(act3) {
	return ShowDialog({
		'id' : '3171105',
		'title' : 'Do you want to remove selected Guest from the booking?',
		'message' : '',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog3171106(act3) {
	return ShowDialog({
		'id' : '3171106',
		'title' : 'Are you sure you want to make this booking?',
		'message' : '',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}
function ShowDialog4181102() {
	return ShowDialog({
		'id' : '4181102',
		'title' : 'Please select available time',
		'message' : '',
		'act1t' : 'Ok',
		'act1e' : ''
	});
}

function ShowDialog4181103(act3) {
	return ShowDialog({
		'id' : '4181103',
		'title' : 'Do you want to book it now?',
		'message' : 'Are you sure?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog4181104(act3) {
	return ShowDialog({
		'id' : '4181104',
		'title' : 'Do you want to recommend it to others?',
		'message' : '',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog5171102() {
	return ShowDialog({
		'id' : '5171102',
		'title' : 'Thank you for your booking',
		'message' : 'The ticket will be delivered to your cabin',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}

function ShowDialog5181101(act2, act3) {
	return ShowDialog({
		'id' : '5181101',
		'title' : 'Booking already exists',
		'message' : 'You have a booking for this time, do you want to make a booking for other guests?',
		'act2t' : 'No',
		'act2e' : act2,
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6201102(a, act3) {
	return ShowDialog({
		'id' : '6201102',
		'title' : 'Status change request',
		'message' : 'Do you want to change the status for '+a+' from FRIEND to CONTACT?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6201103(a, act3) {
	return ShowDialog({
		'id' : '6201103',
		'title' : 'Status change request',
		'message' : 'Do you want to change the status for '+a+' from CONTACT to FRIEND?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6201104(a, act3) {
	return ShowDialog({
		'id' : '6201104',
		'title' : 'Status remove',
		'message' : 'Do you want to remove the contact status for '+a+'?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6201105(a, act3) {
	return ShowDialog({
		'id' : '6201105',
		'title' : 'New contact',
		'message' : 'Do you want to add '+a+' to your contacts?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6201106(a) {
	return ShowDialog({
		'id' : '6201106',
		'title' : 'New contact request',
		'message' : 'A contact request message will be sent to the guest',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}

function ShowDialog6201108(a) {
	return ShowDialog({
		'id' : '6201108',
		'title' : 'Info',
		'message' : a+' was removed you from cotacts',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}


function ShowDialog6211102(a, act3) {
	return ShowDialog({
		'id' : '6211102',
		'title' : 'Confirmation request',
		'message' : 'Do you want to confirm '+a+' as FRIEND?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6211103(a, act3) {
	return ShowDialog({
		'id' : '6211103',
		'title' : 'Confirmation request',
		'message' : 'Do you want to confirm '+a+' as CONTACT?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6211104(a, act3) {
	return ShowDialog({
		'id' : '6211104',
		'title' : 'Remove request',
		'message' : 'Do you want to remove the new contact request for '+a+'?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6211105(a) {
	return ShowDialog({
		'id' : '6211105',
		'title' : 'New contact request',
		'message' : 'A contact request message will be sent to the guest',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}

function ShowDialog6311101(act2) {
	return ShowDialog({
		'id' : '6311101',
		'title' : 'De-assign Interest',
		'message' : 'Are you sure to de-assign the selected Group of Interest?',
		'act2t' : 'Remove',
		'act2e' : act2,
		'act3t' : 'Cancel',
		'act3e' : ''
	});
}

function ShowDialog6601102(a, act3, act2) {
	return ShowDialog({
		'id' : '6601102',
		'title' : 'Add request',
		'message' : 'Do you want to add '+a+' to your Travel-with?',
		'act2t' : 'No',
		'act2e' : act2,
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6601103(a, act3, act2) {
	return ShowDialog({
		'id' : '6601103',
		'title' : 'Remove request',
		'message' : 'Do you want to remove '+a+' from your Travel-with?',
		'act2t' : 'No',
		'act2e' : act2,
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6601104(a, act3) {
	return ShowDialog({
		'id' : '6601104',
		'title' : 'Confirmation request',
		'message' : 'Please select Travel-with to request a Travel-with comfirmation from the selected guest',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog6601105(a) {
	return ShowDialog({
		'id' : '6601105',
		'title' : 'New Travel-with request',
		'message' : 'A Travel-with request message will be sent to the guest',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}

function ShowDialog7041101(act3) {
	return ShowDialog({
		'id' : '7041101',
		'title' : 'You want to change your Avatar?',
		'message' : 'Are you sure?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog7411101(act3) {
	return ShowDialog({
		'id' : '7411101',
		'title' : 'You have made changes to the Profile Settings',
		'message' : 'Do you want to save them?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog7511101(act3) {
	return ShowDialog({
		'id' : '7511101',
		'title' : 'You have made changes to the Delegates Settings',
		'message' : 'Do you want to save them?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog7521101(act3) {
	return ShowDialog({
		'id' : '7521101',
		'title' : 'You have made changes to the Delegates Settings',
		'message' : 'Do you want to save them?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}


function ShowDialog7711101(act3) {
	return ShowDialog({
		'id' : '7711101',
		'title' : 'You have made changes to the Parental Settings',
		'message' : 'Do you want to save them?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog7721101(act3) {
	return ShowDialog({
		'id' : '7721101',
		'title' : 'You have made changes to the Parental Control',
		'message' : 'Do you want to save them?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}
function ShowDialog7731101(act3) {
	return ShowDialog({
		'id' : '7731101',
		'title' : 'You have made changes to the Parental Settings',
		'message' : 'Do you want to save them?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog7741101(act3) {
	return ShowDialog({
		'id' : '7741101',
		'title' : 'You have made changes to the Parental Control',
		'message' : 'Do you want to save them?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog7751101(act3) {
	return ShowDialog({
		'id' : '7751101',
		'title' : 'You have made changes to the Parental Control',
		'message' : 'Do you want to save them?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}

function ShowDialog7761101(act3) {
	return ShowDialog({
		'id' : '7761101',
		'title' : 'You have made changes to the Parental Control',
		'message' : 'Do you want to save them?',
		'act2t' : 'No',
		'act2e' : '',
		'act3t' : 'Yes',
		'act3e' : act3
	});
}
function ShowDialog7771102(a) {
	return ShowDialog({
		'id' : '7771102',
		'title' : 'Please select a child to view the profile settings',
		'message' : '',
		'act1t' : 'Dismiss',
		'act1e' : ''
	});
}

