// JavaScript Document
function selectImages(relPath)
{
	var imgNames = new Array("clock.gif", "LAandR1.gif", "LAandR2.gif", "LAandR3.gif", "MandVA1.gif", "MandVA2.gif", "MandVA3.gif", "math.gif", "money.gif", "PEandH1.gif", "PEandH2.gif", "PEandH3.gif", "science1.gif", "science2.gif", "science3.gif", "socialScience1.gif", "socialScience2.gif", "socialScience3.gif");
	
	document.writeln("<table width='230' border='0' align='left' cellpadding='0' cellspacing='0' style='margin-top: 4px;'><tr>");
	for( x = 0; x < 3; x++)
	{
		whichImg = "";
		while( whichImg == "" )
		{
			rndNumb = Math.round((Math.random() * (imgNames.length + 1))) - 1;
			if( rndNumb < imgNames.length && rndNumb >= 0)
				whichImg = imgNames[rndNumb];
		}
		
		imgNames[rndNumb] = "";
		
		document.writeln("<td align='center' valign='bottom'><img src='" + relPath + "_images/icons/" + whichImg + "' alt='' width='76' height='64' /></td>");
	}
    document.writeln("</tr></table>");
}
// view course content
function vcc(whichCourse)
{
	vccWin = open(whichCourse);
}

function confirm_delete(delDesc)
{
  return confirm("Are you sure you want to delete the " + delDesc + "?\n\nPress \'Ok\' to continue or \'Cancel\' to return to the page.");
}

function select_deselectAll (checkState) 
{ 
    var frm = document.forms[0];
    // Loop through all elements
    for (i=0; i<frm.length; i++) 
    {
		if( frm.elements[i].type == "checkbox")
			frm.elements[i].checked = checkState;
    }
}

function multiple_confirmDelete(frm, delDesc) 
{ 
    // loop through all elements
    for (i=0; i<frm.length; i++) 
    {
        // Look for our checkboxes only
        if (frm.elements[i].name.indexOf("DeleteThis") !=-1) 
        {
            // If any are checked then confirm alert, otherwise nothing happens
            if(frm.elements[i].checked) 
				return confirm ("Are you sure you want to delete the " + delDesc + "?\n\nPress \'Ok\' to continue or \'Cancel\' to return to the page.");
        }
    }
    
    return false;
}
