//<![CDATA[

// setup DOM choice

var DOM = (document.getElementById) ? 1 : 0;

var IE = DOM ? 0 : 1;





function showPage(form) {

   var formindex=form.navjump.selectedIndex;

   parent.self.location=form.navjump.options[formindex].value;

}


// Multi textarea character count

function show_text(htm_id, str_val) {

   // Detect browser
   if (DOM) {

      var divarea=document.getElementById(htm_id);

      divarea.innerHTML=str_val;

   } else if (IE) {

      document.all[htm_id].innerHTML=str_val;

   }

}


function get_text(htm_id) {

   var str_val = "";

   // Detect browser

   if (DOM) {

      var textarea=document.getElementById(htm_id);

      str_val=textarea.value;

   } else if (IE) {

      str_val = document.all[htm_id].value;

   }

   return str_val;

}


function count_chars(textarea,htm_id,max_keys) {

   var str_val = new String(get_text(textarea));

   var str_len = str_val.length;

   var str_result = "Characters remaining: " + (max_keys - str_len) + ".";

   if (str_len >= max_keys) str_result = "Max chars reached, please review.";

   show_text(htm_id, str_result);

}


function openWin(ifilename,iwidth,iheight) {

   var win;

   win = window.open(ifilename, 'win', 'scrollbars=none,width='+iwidth+',height='+iheight+',alwaysRaised=yes');

   // a crude but effective method of forcing the window to resize if neccessary and keep focus

   win.close()

   win = window.open(ifilename, 'win', 'scrollbars=none,width='+iwidth+',height='+iheight+',alwaysRaised=yes');


   return win;

}


function openWin220(ifilename) {

   openWin(ifilename, 200, 200);

}


//]]>