function changePage(newLoc) {
   	newPage = newLoc.options[newLoc.selectedIndex].value

   	if (newPage != "") {
   	    window.location.href = newPage
   	}
}

function addFormParameter ( form, paramType, paramName, paramValue ) {
  if ( document.getElementById) {
    var input = document.createElement('INPUT');

    if ( document.all ) { // doesnt work for all browsers!!!
      input.type = paramType; // 'HIDDEN'
      input.name = paramName; // 'some name'
      input.value = paramValue;
    }
    else if (document.getElementById) {
      input.setAttribute('type', attributeType);
      input.setAttribute('name', attributeName);
      input.setAttribute('value', attributeValue);
    }
    removeFormField(form, paramName) //just in case it has been set previously
    form.appendChild( input );
  }
}

function getFormField(form, fieldName) {
  if (!document.all)
    return form[fieldName];
  else // IE bug!!!
    for (var e=0; e<form.elements.length;e++)
     if (form.elements[e].name==fieldName)
       return form.elements[e];
  return null;
}

function removeFormField(form, fieldName) {
  var field = getFormField(form,fieldName);
  if (field && !field.length)
    field.parentNode.removeChild(field);
}

function gotoEnd() {
  //if ( document.anchors.length > 0 ) {
    //req = location.hash.substring(1)
    window.location.hash=1
  //}
}

function expandingLabelClick( id ) {
    var theDivExpLabelHeader = document.getElementById("divExpandingLabelHeader"+id);
    var theDivExpLabelInside = document.getElementById("divExpandingLabelInside"+id);

    if (theDivExpLabelInside.style.display != "none") {
      theDivExpLabelInside.style.display="none";
      theDivExpLabelHeader.style.display="";
    }
    else {
      theDivExpLabelInside.style.display="";
      theDivExpLabelHeader.style.display="none";
    }
}

function expandingDropDownClick( id ) {
    expandingLabelClick( id );
    expandingLabelClick( id + "_dropdown" );
}


