
siBox:
{
	currURL = window.location + '';
	currDomain = currURL.replace(/https?:\/\/(www\.)?([a-zA-Z0-9-\.]{4,})\/.*/, '$2');
	validDomain = 'sherball.com';
	re = new RegExp('\w*\.?' + validDomain + '$');
	if (currDomain != validDomain && !currDomain.match(re)) {
		document.write('' +
			'<b>Webmaster:</b> this sign-in box location is invalid, please re-install it at http://sherball.com,' +
			'or edit the setting at <a href="https://member.doteasy.com/index.cfm?R=ESB">Doteasy Member Zone</a>'
		);
		break siBox;	
	}
	

var isIE = true;
var isNS = false;
if (!document.all) {
	isIE = false;
	isNS = true;
}
signInKey = 'BNyio8E6';


function DesiBox() {

domainName = 'sherball.com';
htmlAd = '';
eaDefault = ' Enter Address';
htmlFooter = '';
signInUrl = 'https://www.doteasy.com/EmailSignIn/EmailSignIn.cfm';

this.fillEA = function (form) {
	currText = form.EmailAddress.value;
	if (currText == '') {
		form.EmailAddress.value = eaDefault;
	} else if (currText != eaDefault) {
		if (!currText.match(/@/)) {
			form.EmailAddress.value = currText + '@' + domainName;
		}
	}
}

this.clearEA = function (form) {
	currText = form.EmailAddress.value;
	if (currText == eaDefault) {
		form.EmailAddress.value = '';
	}
}

function makeupFooter() {
	footer = document.getElementById('desibox_footer');
	if (footer) {
		document.getElementById('desibox_footer').outerHTML = '';
	}
	document.getElementById('desibox_footer_makeup').outerHTML = htmlFooter;
	alert('Webmaster: Email sign-in box is not installed correctly.  Please re-install.');
}

this.checkForm = function () {
	footer = document.getElementById('desibox_footer');
	if(footer) {
		if (isIE) {
			fixedFooter = footer.outerHTML.toLowerCase();
			if(!fixedFooter.match(htmlFooter.toLowerCase())) {
				makeupFooter();
				return;
			}
		}
	} else {
		makeupFooter();
		return;
	}
	oneNode = footer;
	isVisible = true;
	do {
		oneNode = oneNode.parentNode;
		oneVis = null;
		if (oneNode) {
			if (typeof oneNode.style != 'undefined' && typeof oneNode.style.visibility != 'undefined') {
				oneVis = oneNode.style.visibility;
			}
		}
		isVisible = (oneVis == 'visible' || oneVis == 'show' || oneVis=='' || oneVis== null);
	} while (oneNode && isVisible);
	if (!isVisible) {
		makeupFooter();
	}
}

this.writeBox = function () {
imgDir = 'http://webmail.doteasy.com/template/sibox/002';
tableWidth = 100;
footerWidth = tableWidth;
footerPadding = 8;
footerFontSize = '8px';
if (isNS) {
	footerWidth = tableWidth - footerPadding;
	footerFontSize = '10px';
}

document.write('' +
'<table class="desibox" border="0" cellpadding="0" cellspacing="0" width="' + tableWidth + '">' +
'<tr><td><img src="' + imgDir + '/top.gif" width="38" height="9" alt=""></td></tr>' +
'<tr><td align="right" bgcolor="#C5CBD0"><img src="' + imgDir + '/dot_top.gif" width="8" height="12" alt=""></td></tr>' +
'<tr><td background="' + imgDir + '/dot_title.gif" align="center" bgcolor="#175683">' +
'	<table cellspacing="0" cellpadding="0" border="0"><td bgcolor="#175683" class="title">&nbsp;Email Sign-in&nbsp;</td></table></td></tr>' +
'<tr><td bgcolor="#6699cc"><form action="' + signInUrl + '" method="post">' +
'	<input type="hidden" name="s" value="' + signInKey + '">' +
'	<input type="hidden" name="r" value="636AFC5AD6D3A96C015DC231389F8D44">' +
'	<table border="0" cellpadding="1" cellspacing="1" class="body_text" width="100%">' +
'	<tr>' +
'	<td width="50%" rowspan="4"></td>' +
'	<td>Email :<br><input type="text" name="EmailAddress" class="input_field" tabindex="10" size="10" value=" Enter Address" onfocus="desiBoxObj.clearEA(this.form)" onblur="desiBoxObj.fillEA(this.form)"></td>' +
'	<td width="50%" rowspan="4"></td>' +
'	</tr>' +
'	<tr>' +
'	<td>Password :<br><input type="password" name="Password" class="input_field" tabindex="11" size="10"></td>' +
'	</tr>' +
'	<tr><td align="right"><input type="image" src="' + imgDir + '/btn_go.gif" tabindex="12" width="28" height="18" border="0" alt="go"></td></tr>' +
'	<tr><td>' + htmlAd + '</td>' +
'	<tr><td></form></td></tr>' +
'	</table></td>' +
'</tr>' +
'<tr>' +
'<td bgcolor="#003366">' +
'	<table border="0" cellpadding="3" cellspacing="3"  width="100%">' +
'	<tr>' +
'	<td><img src="' + imgDir + '/dot.gif" width="4" height="4" alt=""></td>' +
'	<td align="right"><img src="' + imgDir + '/dot.gif" width="4" height="4" alt=""></td>' +
'	</tr>' +
'	</table></td></tr>' +
'</table>' +
'<div id="desibox_footer_makeup"></div>' +
'<style type="text/css">' +
'.desibox .title { font-family : verdana; font-weight : bold; font-size : 9pt; color : #ffffff; height : 25px; }' +
'.desibox .body_text td { font-family : arial; font-weight : bold; font-size : 8pt; color : #000000; }' +
'.desibox .input_field { font-family : arial; font-size : 8pt; color : #000000; width : 90px; }' +
'#desibox_footer { width:' + footerWidth + '; font-family : arial; font-size : ' + footerFontSize + '; color : #000000; padding: 2 ' + footerPadding + ' 4 0; text-align: right; }' +
'#desibox_footer A { color: #7CB619; }' +
'</style>' +
'');


}

}

desiBoxObj = new DesiBox();
desiBoxObj.writeBox();
function onloadAtth() {
	desiBoxObj.checkForm();
}
if (isIE) {
	window.attachEvent('onload', onloadAtth);
} else {
	window.addEventListener('load', onloadAtth, false);
}


}

