var clicked = 0;

function signinsubmitonMouseover()
{
	if(clicked == 0)
	{
		document.getElementById('signinsubmit').src = '/images/n4d_login_submit2.gif';
	}
}

function signinsubmitonMouseout()
{
	if(clicked == 0)
	{
		document.getElementById('signinsubmit').src = '/images/n4d_login_submit1.gif';
	}
}

function signinsubmitGo()
{
	if(clicked == 0)
	{
		if(smartloginform.signin_account.value == '')
		{
			document.getElementById('signinsubmit').src = '/images/n4d_login_submit1.gif';

			smartloginform.signin_account.focus();
		}
		else if(smartloginform.signin_password.value == '')
		{
			document.getElementById('signinsubmit').src = '/images/n4d_login_submit1.gif';

			smartloginform.signin_password.focus();
		}
		else
		{
			actualsmartloginform.signin_account.value = smartloginform.signin_account.value;
			actualsmartloginform.signin_password.value = smartloginform.signin_password.value;

			document.getElementById('div_signin_account').innerHTML = "Logging In...";
			document.getElementById('div_signin_password').innerHTML = "Logging In...";

			document.getElementById('div_signin_submit').innerHTML = '<img src=/images/n4d_login_submit3.gif>';

			clicked = 1;

			window.setTimeout('SendForm()', 1000);
		}
	}
}

function SendForm()
{
	actualsmartloginform.submit();
}

//==============================================================================

var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

var xoffset = 15;
var yoffset =  5;

var doc = "document.";
var sty = "";

if(ns){doc = "document."; sty = ""}
if(ie){doc = "document.all."; sty = ".style"}

var initialize = 0
var Ex, Ey, ContentInfo

if(ie)
{
	Ex = "event.x"
	Ey = "event.y"
}
//else
//{
//	window.captureEvents(event.MouseMove);
//	window.onMouseMove = overhere;
//}

if(ns)
{
	Ex = "event.screenX"
	Ey = "event.screenY"

	window.captureEvents(event.MOUSEMOVE);
	
	window.onmousemove = overhere;
}

//==============================================================================

logindesc = new Array(11);

logindesc[0]  = 'Allows online account management just like your bank.  Manage services, pay bills, review invoices, contact support and more.';
logindesc[1]  = 'Is our bulk user and reseller system allowing clients to integrate our domain and hosting services for resale on their site.';
logindesc[2]  = 'Is where you manage the email and web content related to your account.';
logindesc[3]  = 'Is where you manage your official domain registration record. This is also where you can got to renew your domain.';
logindesc[4]  = 'Our domain service uses a contact id system to allow bulk domain owners to easly manage all their domains, if you move just update your id.';
logindesc[5]  = 'Is the optional entry-level hosting plan available with domain registration.';
logindesc[6]  = 'Is the free web/dns/email plan available with domain registration.';
logindesc[7]  = 'Allows web based access to your email, great for when you travel or access email out of the home or office.';
logindesc[8]  = 'Bulk domain managers with vDNS service can point numerous domains to the IP on/off network of their choice.';
logindesc[9]  = 'Allows 4Domains registrar clients to end the DNS related to their domain registration.';
logindesc[10] = 'Is our sitebuilder software which allows you to quickly publish a website from many professional templates.';
logindesc[11] = 'Is our MySQL database manager which lets clients create and manage multi-user mysql databases related to their hosting accounts.';

logintopic = new Array(11);

logintopic[0]  = 'My Account';
logintopic[1]  = 'Domain Reseller Backroom';
logintopic[2]  = 'Hosting Control Panel';
logintopic[3]  = 'Domain Registration';
logintopic[4]  = 'Domain Contact';
logintopic[5]  = 'Domain Account Pro';
logintopic[6]  = 'Domain Account Value';
logintopic[7]  = 'Web Based Email';
logintopic[8]  = 'vDNS Nameserver Access';
logintopic[9]  = 'Domain Nameserver Access';
logintopic[10] = 'Rembrandt SiteBuilder';
logintopic[11] = 'Apollo Database Manager';

exacct = new Array(11);

exacct[0]  = 'An example account number would be <font color=#00aa00><i>1234</font></i>';
exacct[1]  = 'An example backroom username would be <font color=#00aa00><i>myuser</font></i>';
exacct[2]  = 'An example username would be <font color=#00aa00><i>myuser</font></i>, usually the first 8 characters of your domain';
exacct[3]  = 'For account use your domain like <font color=#00aa00><i>yourdomain.com</font></i>';
exacct[4]  = 'Use your contact id which is alwats the letter C followed by number like <font color=#00aa00><i>C123</font></i>';
exacct[5]  = 'An example username would be <font color=#00aa00><i>myuser</font></i>, usually the first 8 characters of your domain';
exacct[6]  = 'For account use your domain like <font color=#00aa00><i>yourdomain.com</font></i>';
exacct[7]  = 'Use your email address like <font color=#00aa00><i>address@yourdomain.com</font></i>';
exacct[8]  = 'An example username would be <font color=#00aa00><i>myuser</font></i>, usually the first 8 characters of your domain';
exacct[9]  = 'For account use your domain like <font color=#00aa00><i>yourdomain.com</font></i>';
exacct[10] = 'An example username would be <font color=#00aa00><i>myuser</font></i>, usually the first 8 characters of your domain';
exacct[11] = 'An example username would be <font color=#00aa00><i>myuser</font></i>, usually the first 8 characters of your domain';

expass = new Array(11);

expass[0]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[1]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[2]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[3]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[4]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[5]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[6]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[7]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[8]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[9]  = 'Is a password either assigned with new service or set by the client in the control panel';
expass[10] = 'Is a password either assigned with new service or set by the client in the control panel';
expass[11] = 'Is a password either assigned with new service or set by the client in the control panel';

resendkey = new Array(11);

resendkey[0]  = 'myaccount';
resendkey[1]  = 'domainresellerbackroom';
resendkey[2]  = 'hostingcontrolpanel';
resendkey[3]  = 'domainregistration';
resendkey[4]  = 'domaincontact';
resendkey[5]  = 'domainaccountpro';
resendkey[6]  = 'domainaccountvalue';
resendkey[7]  = 'webbasedemail';
resendkey[8]  = 'vdnsnameserveraccess';
resendkey[9]  = 'domainnameserveraccess';
resendkey[10] = 'rembrandtsitebuilder';
resendkey[11] = 'apollodatabasemanager';

function loginhelp(showIndex)
{
	var logintext  = '<font size=1 face=verdana,arial><b>' + logintopic[showIndex]  + '</b><br><font color=#999999>' + logindesc[showIndex]  + '</font>	<p><b>Account</b><br><font color=#999999>' + exacct[showIndex]  + '</font>.<br><b>Password</b><br><font color=#999999>' + expass[showIndex]  + '... Forgot password? <a href="/cgi-bin/smartlogin/resend_login.cgi?system=' + resendkey[showIndex]  + '"><font size=1 face=verdana,arial color=#aa0000>Email it!</font></a><p><a href="Javascript:loginreset(); keepAnim();">Back to System List</a></font></font>';

	document.getElementById('loginsystemdetail').innerHTML = logintext;

	keepAnim();
}

function keepAnim()
{
	window.setTimeout('document.getElementById(\'n4d_loginlogo\').src = \'/images/n4d_login_anim.gif\';',10);
}

function loginreset()
{
	var newhtml = '';

	for(x=0;x<=11;x++)
	{
		if(x <= 3)
		{
			newhtml = newhtml + '<a class=loginlinks onMouseover="JavaScript:EnterContent(\'helpwindow\',\'' + x + '\',\'center\'); JavaScript:Activate(); Javascript:loginimg(\'loginmenuicon' + x + '\',\'nd4_larrow_red.gif\');" onMouseout="JavaScript:deActivate(); Javascript:loginimg(\'loginmenuicon' + x + '\',\'nd4_larrow_green.gif\');" href="JavaScript:donothing(); " onClick="JavaScript:deActivate(); Javascript:loginhelp(' + x + ');" ><img id="loginmenuicon' + x + '" src="/images/nd4_larrow_green.gif" width=9 height=12 border=0 hspace=3>' + logintopic[x] + '</a><br>\n';
		}
		else
		{
			newhtml = newhtml + '<a class=loginlinks onMouseover="JavaScript:EnterContent(\'helpwindow\',\'' + x + '\',\'center\'); JavaScript:Activate(); Javascript:loginimg(\'loginmenuicon' + x + '\',\'nd4_larrow_red.gif\');" onMouseout="JavaScript:deActivate(); Javascript:loginimg(\'loginmenuicon' + x + '\',\'nd4_larrow_green.gif\');" href="JavaScript:donothing(); " onClick="JavaScript:deActivate(); Javascript:loginhelp(' + x + ');" ><img id="loginmenuicon' + x + '" src="/images/nd4_larrow_green.gif" width=9 height=12 border=0 hspace=3>' + logintopic[x] + '</a><br>\n';
		}

		if(x == 0 || x == 3)
		{
			newhtml = newhtml + '<img src=/images/clear.gif width=1 height=6><br>\n';
		}
	}

	document.getElementById('loginsystemdetail').innerHTML = newhtml;
}

function loginimg(object,image)
{
	document.getElementById(object).src = '/images/' + image;
}

function Movehelpwindow(layerName, FromTop, FromLeft)
{
	document.getElementById(layerName).style.top = eval(FromTop) + yoffset;
	document.getElementById(layerName).style.left = eval(FromLeft) + xoffset;
}

function ReplaceContent(layerName)
{
	document.getElementById('helpwindow').innerHTML = ContentInfo;
}

function Activate(){initialize=1}
function deActivate(){initialize=0}

function donothing(){}

var initiallogin = 1;

function overhere(event)
{
	if(initialize)
	{
		Movehelpwindow('helpwindow', Ey, Ex)
		document.getElementById('helpwindow').style.visibility = 'visible';
	}
	else
	{
		Movehelpwindow('helpwindow', 0, 0)
		document.getElementById('helpwindow').style.visibility = 'hidden';
	}
	
	if(initiallogin == 1)
	{
		loginreset();
		initiallogin = 0;
	}
}

function EnterContent(layerName, contentId,LRorient)
{
	if(LRorient == 'right')
	{
		xoffset = -310;
		yoffset =  5;
	}
	else if(LRorient == 'center')
	{
		xoffset = 0;
		yoffset = 15;
	}
	else if(LRorient == 'lcenter')
	{
		xoffset = 13;
		yoffset = 0;
	}
	else
	{
		xoffset = 15;
		yoffset =  5;
	}

	ContentInfo = '<table border="0" width="220" cellspacing="0" cellpadding="0">'+
	'<tr><td width="100%" bgcolor="#E0E6EE">'+
	'<table border="1" width="100%" cellspacing="0" cellpadding="1" bordercolor=#2565AE>'+
	'<tr><td width="100%" bgcolor=#E0E6EE>'+
	'<table border="0" width="95%" cellspacing="0" cellpadding="4" align="center">'+
	'<tr><td width="100%">'+
	'<font size=3 face=arial color=#000000><b>' + logintopic[contentId] + '</b></font>'+
	'</td></tr>'+
	'</table>'+
	'</td></tr>'+
	'<tr><td width="100%" bgcolor=#ffffff>'+
	'<table border="0" width="95%" cellpadding="0" cellspacing="4" align="center">'+
	'<tr><td width="100%">'+
	'<font size=2 face=arial color=#000000>' + logindesc[contentId] + '</font>'+
	'</td></tr>'+
	'</table>'+
	'</td></tr>'+
	'</table>'+
	'</td></tr>'+
	'</table>';

	ReplaceContent(layerName)
}

function signinEntersubmit(event)
{
	if( (event.which && event.which == 13) || (event.keyCode && event.keyCode == 13) )
	{
		signinsubmitGo();
		return false;
	}
	else
	{
		return true;
	}
}
