bookPrice=[95,155,310,465,190,385,575,15.50,75,80.50,150.00]

function calculate(){

total=0

for(var i=0;i<bookPrice.length;i++){

if(document.forms["form1"]["item"+i].checked){
currentPrice = bookPrice[i]
} 
else{
currentPrice = 0
}

document.forms["form1"]["item"+i].value=currentPrice
total +=currentPrice
}

document.forms["form1"]["result"].value=total
} 


function uncheckLoad() 
{
var ins = document.getElementsByTagName('input');
for (var i=0; i<ins.length; i++) 
{
if (ins[i].getAttribute('type') == 'checkbox') 
{
ins[i].checked = false;
}
}
}


function uncheckAll() {
for (var j = 1; j <= 2; j++) {
box = eval("document.form1.chkModuleRe" + j); 
if (box.checked == true) box.checked = false;
   }
}

function uncheckModule() {
for (var j = 1; j <= 2; j++) {
box = eval("document.form1.chkModule" + j); 
if (box.checked == true) box.checked = false;
   }
}

function showMe(id) { // This gets executed when the user clicks on the checkbox
	var obj = document.getElementById(id);
if (obj.style.visibility=="hidden") { // if it is checked, make it visible, if not, hide it
	obj.style.visibility = "visible";
} else {
	obj.style.visibility = "hidden";
}
}

function hideMe(id) { // This gets executed when the user clicks on the checkbox
	var obj = document.getElementById(id);
if (obj.style.visibility=="visible") { // if it is checked, make it visible, if not, hide it
	obj.style.visibility = "hidden";
} else {
	obj.style.visibility = "visible";
}
}


