function writeFlash(id, src, height, width, param, param_val){

  output = ("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"" + width + "\" height=\"" + height + "\" id=\"" + id + "\" align=\"top\">");
  var scale = "";
  var wmode = "";
  var allowScriptAccess = "";

  for(i=0; i<param.length; i++){

    output += ("<param name=\"" + param[i] + "\" value=\"" + param_val[i] + "\" />\n");

    if(param[i] == "scale"){

      scale = "scale=\"" + param_val[i] + "\"";

    }

    if(param[i] == "wmode"){

      wmode = "wmode=\"" + param_val[i] + "\"";

    }

    if(param[i] == "allowScriptAccess"){

      allowScriptAccess = "allowScriptAccess=\"" + param_val[i] + "\"";

    }
 
  }

  output += ("<embed src=\"" + src + "\" quality=\"high\" bgcolor=\"#ff0000\" width=\"" + width + "\" height=\"" + height + "\" name=\"" + id + "\" salign=\"t\" align=\"top\" " + allowScriptAccess + " " + wmode + " type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"  border=\"0\" " + scale + " />");
  output += ("</object>");

  document.write(output);

}

function charCount(trig_id, targ_id, max, critlim, normclass, critclass){

  var trig_obj = document.getElementById(trig_id);
  var targ_obj = document.getElementById(targ_id);

  charcount = max - trig_obj.value.length;

  if(charcount < 0){

    trig_obj.value = trig_obj.value.substring(0, max);
    charcount = 0;

  }

  targ_obj.value = charcount + " characters remaining";

  targ_obj.className = normclass;

  if(charcount <= critlim){

    targ_obj.className = critclass;

  }

} 

function qn_select_item(id_root, target_id, selectclass, input_id, view_url){

  var item_num = 1;

  while(obj = document.getElementById(id_root + item_num)){

    var re = new RegExp(selectclass);
    obj.className = obj.className.replace(re, '');
    item_num++;

  }

  obj = document.getElementById(target_id);
  obj.className += ' ' + selectclass;

  obj = document.getElementById(input_id);
  obj.value = view_url;

}

function ls_show_form(){

  var obj = document.getElementById('change_loc_table');
  obj.style.display = 'none';

  var obj = document.getElementById('loc_sub_form');
  obj.style.display = 'block';

}

function showHelp(SITE_ROOT, hid){

  var loc = SITE_ROOT + "help/helpwin.php?hid=" + hid;
  window.open(loc, 'helpwin', 'width=300,height=230');

}
