var home_page = false;

function hideQuickWin () {
	MM_showHideLayers('quick_layer','','hide');
	}

function insertSubscriber_cb () {
	var email = document.getElementById("quick_email").value;
	var x = getX('subloc');
	var y = getY('subloc');
	if (home_page) x += 200;
		else x -= 250;
	moveItSimple ('quick_layer', x, y - 25);
	tmp = document.getElementById ('quick_layer');
	var msg = '<a href="#" onClick="hideQuickWin(); return (false)"><img src="/images/close.gif" alt="close window" title="close window" width="10" height="10" align="right" border="0"></a>';
	msg += '<p><b>Success!</b></p><p>The following email address has been added to the XBigMan Xtra E-Newsletter Subscription list.</p><p style="margin-left: 25px">' + email + '</p><p><b>Please Note!</b><br> Your subscription is <b>NOT active</b> until you click the link included in the confirmation email that has been sent to this email address.</p>';
	tmp.innerHTML = msg;
	MM_showHideLayers('quick_layer','','show');
	}

/* These two functions are for the Quick Subscribe field */
function checkForDup_cb (err) {
	var email = document.getElementById("quick_email").value;
	if (err) {
		var x = getX('subloc');
		var y = getY('subloc');
		if (home_page) x += 200;
			else x -= 250;
		moveItSimple ('quick_layer', x, y - 25);
		tmp = document.getElementById ('quick_layer');
		var msg = '<a href="#" onClick="hideQuickWin(); return (false)"><img src="/images/close.gif" alt="close window" title="close window" width="10" height="10" align="right" border="0"></a>';
		if (err == 'subscribed') {
			msg += '<h1>Subscription Notice!</h1><p>Our records indicate that this email address is already subscribed:</p><p style="margin-left: 25px">' + email + '</p>';
			}
		else {
			msg += '<h1>Subscription Warning!</h1><p>Our records indicate that the email address: <b>' + email + '</b> has already been subscribed, but has NOT been confirmed.</p><p>Check the email for this address and follow the instructions included in the XBigMan Subscription Confirmation email.</p><p>If you no longer have your confirmation email, <a href="mai' + 'lto:new' + 'sletter@xbi' + 'gman.com?subj' + 'ect=XBigMan Xtra E-Newsletter Subscription Inquiry">send us an email</a>.';
			}
		tmp.innerHTML = msg;
		MM_showHideLayers('quick_layer','','show');
		}
	else {
		x_insert_subscriber (email, insertSubscriber_cb);
		}
	}
	
function checkQuick (loc) {
	var tmp = document.getElementById("quick_email").value;
	if (tmp == "") {
		alert ('You must enter a valid "Email Address" to subscribe.');
		return (false);
		}
	if (!validate_email(tmp)) return (false);
	x_check_for_dup (tmp, checkForDup_cb);
	}
