// JavaScript Document
function fnCheck()
{
	if(name.value.length<2)
		{
			alert("Please enter your full name.");
			name.focus();
			return false;
		}
		
		if(email.value.indexOf("@")==-1 || email.value.indexOf(".")==-1 || ema.value==(""))
		{
			alert("please enter a correct email address.");
			email.focus();
			return false;
		}
		return true;
}

function fnUnlim()
{
	cost.value = "Unlimited costs $100/month";
}

function fn100()
{
	cost.value = "100 Megs Download costs $60/month";
}

function fn40()
{
	cost.value = "40 Megs Download costs $30/month";
}

function fnEmail()
{
	cost.value = "Email only costs $20/month";
}





function fnChoice()
{
		var choice = "";
		
			if(aa.checked==true)
			{
				choice = choice + "week days 9-5; \n";
			}
			if(bb.checked==true)
			{
				choice = choice + "week nights; \n";
			}
			if(cc.checked==true)
			{
				choice = choice + "weekends; \n";
			}
		document.getElementById("txtTime").value = choice;	
 	
}





function fnPrint()
{
	print();
}


function fnOpen()
{
	open("help.html","","width=600px,height=400px,left=400px,top=200px,status=yes,scrollbars=yes,resizable=yes");
}






var formX = document.getElementById("formtest");
var name = document.getElementById("txtName");
var email = document.getElementById("txtEmail");

var a = document.getElementById("rbUnlim");
var b = document.getElementById("rb100");
var c = document.getElementById("rb40");
var d = document.getElementById("rbEmail");
var cost = document.getElementById("txtCost");

var aa = document.getElementById("cb95");
var bb = document.getElementById("cbNights");
var cc = document.getElementById("cbwknds");
var time = document.getElementById("txtTime");

var printform = document.getElementById("btnPrint");
var help = document.getElementById("btnHelp");




/* document.getElementById("txtName").focus(); */


formX.onsubmit = fnCheck;
printform.onclick = fnPrint;
help.onclick = fnOpen;



if(a.addEventListener)
{
	a.addEventListener('click', fnUnlim, false);
	b.addEventListener('click', fn100, false);
	c.addEventListener('click', fn40, false);
	d.addEventListener('click', fnEmail, false);
}

if(a.attachEvent)
{
	a.attachEvent('onclick', fnUnlim);
	b.attachEvent('onclick', fn100);
	c.attachEvent('onclick', fn40);
	d.attachEvent('onclick', fnEmail);
}

if(aa.addEventListener)
{
	aa.addEventListener('click', fnChoice, false);
	bb.addEventListener('click', fnChoice, false);
	cc.addEventListener('click', fnChoice, false);
	
}

if(aa.attachEvent)
{
	aa.attachEvent('onclick', fnChoice);
	bb.attachEvent('onclick', fnChoice);
	cc.attachEvent('onclick', fnChoice);
	
}


					 