var emailShowHostLocked				= false;
var emailShowHostFormObj			= null;

var showHostDialog					= null;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function doShowHostDialog(w,c) {
	if (showHostDialog != null) {
	return;
	}
var url								= "/clientServer/?section=ShowHostDialog";
showHostDialog						= document.createElement('DIV');
handleGetComplete					= 'handleStandardGetComplete';
handleDialogClose					= 'closeShowHostDialog';
doAjaxPopup('commonDialogLong',showHostDialog,url,500,400);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function closeShowHostDialog() {
closeAjaxPopup(showHostDialog);
showHostDialog						= null;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function emailShowHost_do(formObj,show) {
	if (emailShowHostLocked) {
	alert('Please wait, another message is in progress.');
	return;
	}
emailShowHostFormObj				= formObj;
var name							= formObj.NAME;
var email							= formObj.EMAIL;
var comment							= formObj.COMMENT;	
	if (name.value.length == 0) {
	alert('Please enter your name before proceeding.');
	name.focus();
	return;
	}
	if (email.value.length == 0 || !ValidateEmail(email.value)) {
	alert('Please enter a valid email address before proceeding.');
	email.focus();
	return;
	}
	if (comment.value.length == 0) {
	alert('Please enter a message before proceeding.');
	comment.focus();
	return;
	}
emailShowHostLocked					= true;
emailShowHost_toggleResponse(false);
emailShowHost_toggleTA(false);
emailShowHost_dialogSpinner();

handlePostComplete					= 'handleEmailShowHostPostComplete';
var name_s							= encodeURIComponent(name.value);
var email_s							= encodeURIComponent(email.value);
var comment_s						= encodeURIComponent(comment.value);
var params							= "section=EmailShowHost&show="+show+"&name="+name_s+"&email="+email_s+"&comment="+comment_s;
postAjaxContent('/clientServer/',params);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function emailShowHost_dialogSpinner() {
jQuery('#showHostFormContainer').html(getInnerAjaxLoader());
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function emailShowHost_dialogFinish() {
jQuery('#showHostFormContainer').html("<div class='messageReceived'>-- Message Received, Thanks --</div>");
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function emailShowHost_toggleTA(onOff) {
var container						= document.getElementById('emailShowHostTA');
var ajaxSpinner						= document.getElementById('emailShowHostLoader');
	if (container) {
	container.style.display			= (onOff) ? 'block' : 'none';
	}
	if (ajaxSpinner) {
	ajaxSpinner.style.display		= (onOff) ? 'none' : 'block';
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function emailShowHost_toggleResponse(onOff) {
var o								= jQuery('#emailShowHostResponse');
	if (onOff) {
	o.show();
	} else {
	o.hide();
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function emailShowHost_clearMessage() {
	if (emailShowHostFormObj && emailShowHostFormObj.COMMENT) {
	emailShowHostFormObj.COMMENT.value	= '';
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function emailShowHost_focusMessage() {
	if (emailShowHostFormObj && emailShowHostFormObj.COMMENT) {
	emailShowHostFormObj.COMMENT.focus();
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function handleEmailShowHostPostComplete(success,xmlHTTP) {
	if (success) {
	emailShowHost_toggleResponse(true);
	emailShowHost_toggleTA(true);
	emailShowHost_clearMessage();
	emailShowHost_focusMessage();
	emailShowHost_dialogFinish();
	}
emailShowHostLocked				= false;
}


