function expData(i) {
	var trObj = (document.getElementById) ? document.getElementById('notes' + i) : eval("document.all['notes" + i + ";]");
	if (trObj != null) {
		if (trObj.style.display=="none") {
			trObj.style.display="";
			document.getElementById('pic_' + i).src = '/mkportal/modules/questxp/images/minus.gif'}
			else {
			trObj.style.display="none";
			document.getElementById('pic_' + i).src = '/mkportal/modules/questxp/images/plus.gif'
		}
	}
}

function changeDiv(the_div,the_change)
{
  var the_style = getStyleObject(the_div);
  if (the_style != false)
  {
    the_style.display = the_change;
  }
}

function getStyleObject(objectId) {
  if (document.getElementById && document.getElementById(objectId)) {
    return document.getElementById(objectId).style;
  } else if (document.all && document.all(objectId)) {
    return document.all(objectId).style;
  } else {
    return false;
  }
}

function DropDownMenu(entered)
{
// ***************************************************************************
// DROP DOWN MENU (c) Henrik Petersen / NetKontoret 1998 - All rights reserved
// Explained along with other useful scripts at: http://www.echoecho.com/javascript.htm
// You may freely use this script as long as you do not remove this line and the 2 lines above.
// ***************************************************************************
with (entered)
{
ref=options[selectedIndex].value;
splitcharacter=ref.lastIndexOf("&");
if (splitcharacter!=-1) {loc=ref.substring(0,splitcharacter); target=ref.substring(splitcharacter+1,1000).toLowerCase();}
else {loc=ref; target="_self";};
lowloc=loc.toLowerCase();
if (lowloc=="false") {return;}
if (target=="_self") {document.location=loc;}
else {if (target=="_top") {top.location=loc;}
else {if (target=="_blank") {window.open(loc);}
else{if (target=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}}
}

var value = 0;
function calc() {
value = 0;
var el=document.getElementById("contents")
c=el.getElementsByTagName("input");
for (var i=0;i<c.length;i++) {
if (c[i].checked==true&&c[i].type=="checkbox"&&c[i].name=="del[]")
value = Math.floor(Number(value)+Number(c[i].getAttribute("value")));
}
var t=document.getElementById("totalexp"),
el=document.createElement("span");
while (t.firstChild) t.removeChild(t.firstChild);
el.appendChild(document.createTextNode(addCommas(value)));
t.appendChild(el);
}


function checkAll(ref) {
  var chkAll = document.getElementById('checkAll');
  var checks = document.getElementsByName('del[]');
  var boxLength = checks.length;
  var allChecked = false;
  var totalChecked = 0;
  if ( ref == 1 ) {
    if ( chkAll.checked == true ) {
      for ( i=0; i < boxLength; i++ ) {
        checks[i].checked = true;
      }
    }
    else {
      for ( i=0; i < boxLength; i++ ) {
        checks[i].checked = false;
      }
    }
  }
  else {
    for ( i=0; i < boxLength; i++ ) {
      if ( checks[i].checked == true ) {
        allChecked = true;
        continue;
      }
      else {
        allChecked = false;
        break;
      }
    }
    if ( allChecked == true ) {
      chkAll.checked = true;
    }
    else {
      chkAll.checked = false;
    }
  }
  for ( j=0; j < boxLength; j++ ) {
    if ( checks[j].checked == true ) {
      totalChecked++;
	}
  }
}

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}