// DFS Homepage JavaScript
var currentPane = 1;

var overlayArray = new Array();
overlayArray['user-id-popup'] = "<h3>Creating a Good User ID</h3><p>Your user ID helps protect the confidentiality of your Account and enables us to verify your identity.</p><p> Follow these tips to create a good user ID:</p><ul><li>Create a user ID that others can't guess but is easy for you to remember</li><li>Use a combination of letters and numbers (e.g., jim14my or my2dog5is)</li><li>Avoid using family or pet names, your birthday, your anniversary or your social security number</li><li>Use a word you can remember, but replace some of the letters with numbers (e.g., s1cr1t)</li></ul><p>Your user ID must be 6–16 characters and can contain any character found on your computer's keyboard except spaces. As an added security measure, your user ID and password cannot be the same.</p>";
overlayArray['security-popup'] = "<h3>Secure Account Center Log In</h3><p>Discover Card is serious about safeguarding your personal information online.</p><p>When you access your account and perform transactions on the Discover site we use 128-bit-Secure Sockets Layer (SSL) encryption technology—the most widely used method of securing internet transactions available today.</p>";
overlayArray['remember-userid-popup'] = "<h3>Remember User ID</h3><p>Checking \"Remember User ID\" will save your user ID on the computer you are using so you don't have to retype it every time you log in. To protect the security of your account, we can only save your user ID; we cannot save your account number.</p><ul><li>To turn off this feature, just uncheck the box and your user ID will not appear the next time you log in</li><li>Security Tip: when you save your user ID, it's stored on the computer you are using; therefore, you should never save your user ID on a public computer (e.g., in a library or airport).</li></ul>";
overlayArray['need-help'] = "<h3>Need help?</h3><p><a href=\"/customer-service/account/id-password.html\">View the User ID and Password FAQ</a> or call us toll-free<br/>1-800-DISCOVER (1-800-347-2683).</p><p>Please note: the 4-digit PIN you use to get cash is not the same as your Account Center user ID or password.</p>";
overlayArray['need-help-sm'] = "<h3>Need help?</h3><p>Call us toll-free<br/>1-800-DISCOVER (1-800-347-2683).</p>";
overlayArray['sm-security-popup'] = "<h3>Secure Message Center Log In</h3><p>Discover Card is serious about safeguarding your personal information online.</p><p>When you access your account and perform transactions on the Discover site we use 128-bit-Secure Sockets Layer (SSL) encryption technology—the most widely used method of securing internet transactions available today.</p>";


function initOverlays(){
	var popups = document.getElementsByTagName('a');
	for(var i = 0; i < popups.length; i++){
		if(popups[i].className == 'question-popup'){
			popups[i].onclick = showOverlay;
		}
	}

	if(document.getElementById('hint-overlay-close')){
		document.getElementById('hint-overlay-close').onclick = function(){
			document.getElementById('hint-overlay').style.display = 'none';
			return false;
		}
	}
}
function showOverlay(){
	if(document.getElementById('hint-overlay')){
		var overlay = document.getElementById('hint-overlay');
		var pos = findPos(this);
		var content = overlayArray[this.id];
		if(document.getElementById('overlay-content')){
			document.getElementById('overlay-content').innerHTML = content;
			overlay.style.left = pos[0] + this.offsetWidth + 1 + 'px';
			overlay.style.top = pos[1] - 2 + 'px';
			overlay.style.display = 'block';
			if(document.all && overlay.getElementsByTagName('iframe')[0]){
				overlay.getElementsByTagName('iframe')[0].style.display = 'block';
				overlay.getElementsByTagName('iframe')[0].style.height = overlay.offsetHeight - 25 + 'px';
			}
		}
	}
	return false;
}

addLoadEvent(initOverlays);