
function select_tab(theId, totalIds)
{
	for(a = 1; a <= totalIds; a++)
	{
		theDiv = document.getElementById("tabbed-content-" + a);
		theDiv.style.display = 'none';
		theDiv = document.getElementById("tab-" + a);
		theDiv.style.backgroundImage = 'url(/images/tabbg.jpg)';
		theDiv.style.borderTop = '1px solid #bebebe';
		if(a > 1)
			theDiv.style.borderLeft = '1px solid #bebebe';
	}
	theDiv = document.getElementById("tabbed-content-" + theId);
	theDiv.style.display = 'block';
	theDiv = document.getElementById("tab-" + theId);
	theDiv.style.backgroundImage = 'url(/images/tabbg1.jpg)';
	theDiv.style.color = '#fff';
	theDiv.style.borderTop = '1px solid #bebebe';
}

function toggle_div(theId)
{
	theDiv = document.getElementById(theId + '_div');
	if(theDiv.style.display == 'none')
	{
		theDiv.style.display = 'inline';
	}
	else
	{
		theDiv.style.display = 'none';
	}
}








function showHelp()
{
	if(document.getElementById("helpDiv").style.display == 'inline')
	{
		document.getElementById("helpDiv").style.display = 'none';
	}
	else
	{
		document.getElementById("helpDiv").style.display = 'inline';
	}
}


function checkPayment()
{
	myOption = -1;
	for(i=document.form1.certification.length-1; i > -1; i--)
	{
		if(document.form1.certification[i].checked)
		{
			myOption = i;
			i = -1;
		}
	}
	if(myOption == -1)
	{
		alert('Please choose a payment option.');
		return false;
	}
	else
	{
		if(heardSubmit() == false)
		{
			alert("Please take a second to tell us how you heard about our courses");
			return false;
		}
		else
		{
			return true;
		}
	}
}


function heardSubmit()
{
	heardVal = document.form1.marketing_source_data.selectedIndex;
	brandVal = document.form1.marketing_source_brand.selectedIndex;
	if((heardVal == 0)||(brandVal == 0))
	{
		alert("Please take a second to tell us how you heard about our courses");
	}
	else
	{
		document.form1.submit();
	}
}

function showAdvert(course)
{
	toggle_div('preview_pane');
}

// JavaScript Document
function print_mail_to(mailto_name, mailto_domain, mailto_subject, mailto_body, mailto_style)
{
	document.write('<a href=\"mailto:');
	document.write(mailto_name+'@');
	document.write(mailto_domain+'?');
	document.write('Subject='+mailto_subject+'&amp;');
	document.write('body='+mailto_body+'\" onFocus=\"if(this.blur)this.blur()\" ');
	document.write(' class=\"'+mailto_style+'\">'+mailto_name);
	document.write('@'+mailto_domain);
	document.write('</a>');
}

function toggle_div(theDiv)
{
	divB = document.getElementById(theDiv);
	if(divB.style.display == 'inline')
	{
		divB.style.display = 'none';
	}
	else
	{
		divB.style.display = 'inline';
	}
}
