/*
function domainMessage()
{
	alert("If your email address is provided by either Comcast (comcast.net) or Roadrunner (roadrunner.com or rr.com), we are unable to send you the Health News monthly newsletter since these Internet Service Providers consider our newsletter spam.  This spam detection immediately blocks all email from the Schiff websites. " + '\n\n' + "You will be able to sign up for the Schiff Rewards program and access the online offers, but will be automatically excluded from receiving the monthly Health News Newsletter. " + '\n\n' + "If you have an alternate email address, we strongly suggest you use that email address instead. We apologize for this inconvenience.");
}

function domainMessage2()
{
	alert("If your email address is provided by either Comcast (comcast.net) or Roadrunner (roadrunner.com or rr.com), we may be unable to respond to you via email. " + '\n\n' + "These Internet Service Providers incorrectly consider our monthly Schiff newsletter spam; and this spam detection automatically blocks all email from the Schiff websites. " + '\n\n' + "If you prefer an email response and have an alternate email address, we strongly suggest you use that email address instead. We apologize for this inconvenience. You may also call us directly at 1-800-526-6251");
}
*/

function birthdateMessage()
{
	alert("We need your birthdate to verify your age.\nThis offer is valid only for adults age 18 and over.\nWe may also send additional special offers on your birthday!\n");
}

function noRedeem()
{ // Original - Replace with SELECT CASE and next three functions.
	alert("We're sorry, you either do not have enough points for this reward or you have already redeemed a reward in the past 30 days. Remember: You may only redeem one reward in any 30-day period. If you need further assistance, please contact Consumer Services at 1-800-526-6251.\n");
}

function noRedeemNEP()
{ // Not Enough Points.
	alert("We're sorry, you do not have enough points for this reward. If you need further assistance, please contact Consumer Services at 1-800-526-6251.\n");
}

function noRedeemTE()
{ // Too Early.
	alert("We're sorry, you have already redeemed a reward in the past 30 days. Remember: You may only redeem one reward in any 30-day period. If you need further assistance, please contact Consumer Services at 1-800-526-6251.\n");
}

function noRedeemNCP()
{ // No Coscto Purchases (and trying to redeem for a Costco check).
	alert("We're sorry, you have not entered a code from at least one product you purchased from Costco. If you need further assistance, please contact Consumer Services at 1-800-526-6251.\n");
}

function systemReqMessage()
{
	alert("SYSTEM REQUIREMENTS:\nCoupon printing is supported by the following operating systems. NOTE: Turn off any pop-up blockers prior to clicking the coupon button.\n\nCoupon Printing for Windows\nCoupon printing is currently supported on Windows Operating Systems Vista, XP, ME, 2000, and NT4 when used with Internet Explorer 5.5 or newer, Netscape 7 or newer, FireFox and most MSN and AOL browsers.\n\nCoupon Printing for Macintosh\nCoupon printing is also supported on Macintosh when using the Safari browser under OS X 10.3 and higher.\n");
}

function emailNotFoundMessage()
{
	alert("We could not find an account with that email address.\n\nPlease try again.\n");
}

function passwordNotFoundMessage()
{
	alert("We could not find an account with that password.\n\nPlease try again.\n");
}

function open_video_a_win()
{
	window.open("http://www.schiffloyaltyrewards.com/video_a.asp","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=475, height=505");
}

function open_video_b_win()
{
//	window.open("http://www.schiffloyaltyrewards.com/video_b.asp","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=475, height=505");
	window.open("http://www.schiffloyaltyrewards.com/video_b.asp","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=475, height=550");
}

function open_image_win()
{
	//DJ - Image is 300x350. Size window taking into account extra spacing.
	window.open("http://www.schiffloyaltyrewards.com/images/product_code_MFA+Energy.jpg","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=318, height=368");
}

function open_points_win()
{
	window.open("http://www.schiffloyaltyrewards.com/points.asp","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=575, height=650");
}

function open_pp_win()
{
	window.open("http://www.schiffloyaltyrewards.com/privacy_policy.asp","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=805, height=600");
}

function open_tac_win()
{
	window.open("http://www.schiffloyaltyrewards.com/terms_and_conditions.asp","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=805, height=600");
}

function open_faq_win()
{
	window.open("http://www.schiffloyaltyrewards.com/faqs_popup.asp","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=805, height=600");
}

function open_cu_win()
{
	window.open("http://www.schiffloyaltyrewards.com/contact_us.asp","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=805, height=600");
}

function close_this_win()
{
	this.close();
}

function isValidLoyaltyCode(input)
{
	var checkDigit;
	var checkSum = 0;
	for(i=0; i<(input.length-1); i++) { checkSum += input.charCodeAt(i) * (i+1); }
	if ((checkSum % 11) == 0) { checkDigit = String.fromCharCode(97); }
	else if ((checkSum % 11) == 1) { checkDigit = null; }
	else { checkDigit = String.fromCharCode(97 + (11 - (checkSum % 11))); }
	if (checkDigit == input.charAt(input.length-1)) { return true; } else { return false; }
}

function newLocation(x)
{
	window.location=x;
}
