// JavaScript Document

//=================== Show/Hide Script ===================-->
var indent=5;						//set here the left indent in pixels 
var iup='../images/icons/plus.gif';	//set here the up arrow relative location 
var idrop='../images/icons/minus.gif';	//set here the drop arrow relative location 

function coll()
{
	/* add try/catch block to eliminate error notification on pages without 'quiz' */
	try
	{
		var dd=document.getElementById('quiz').getElementsByTagName('div');
		var aa=document.getElementById('quiz').getElementsByTagName('img');
		for (var i=1;i<dd.length;i=i+2)
		{
			dd[i].style.position='relative';
			dd[i].style.display='none';
			dd[i].style.left=indent+'px';
		}
		for (var j=0;j<aa.length;j++)
		{
			im=aa[j].getAttribute('src');
			if(im==idrop)
			{
				aa[j].setAttribute('src',iup);break
			}
		}
	}
	catch ( x )
	{
		// ignore error 'x' on page without a quiz section 	
	}	
}

function activ(w)
{
	var d=w.parentNode.getElementsByTagName('div')[0];
	var a=w.firstChild;
	if(d.style.display=='none')
	{
		coll();
		d.style.display='block'; /* changed from 'inline' */
		a.setAttribute('src',idrop);
	}
	else
	{
		d.style.display='none';
		a.setAttribute('src',iup);
	}
	return false;
}

if ( window.attachEvent ) {	
	window.attachEvent("onload",coll);
	}
else if ( window.addEventListener ) {
	window.addEventListener("load",coll,true);
	}
//================ END Show/Hide Script ===================-->

//================ Display Date Script ====================-->
function displayDate()
{
var month=new Array(12);	
month[1]="January";		
month[2]="February";
month[3]="March";
month[4]="April";
month[5]="May";
month[6]="June";
month[7]="July";
month[8]="August";
month[9]="September";
month[10]="October";
month[11]="November";
month[12]="December";

var the_day=new Date();				

var the_month=month[the_day.getMonth() + 1];
var the_date=the_day.getDate();
var the_year=the_day.getFullYear();
var the_daynum = the_day.getDay() + 1;

if(the_daynum==1) day = "Sunday";
if(the_daynum==2) day = "Monday";
if(the_daynum==3) day = "Tuesday";
if(the_daynum==4) day = "Wednesday";
if(the_daynum==5) day = "Thursday";
if(the_daynum==6) day = "Friday";
if(the_daynum==7) day = "Saturday";

var the_daysdate = (the_month + " " + day + " " + the_year);

return the_daysdate;}
//=============== END Display Date Script ==================-->
