//wcat.js

var formatCount = new Array();
var ignoreFormat = new Array();
var formatPromptCount = 3;

//message for leaving the form;
var leaveFormMessage = "You are about to leave the WCAT form; this will result in the loss of all data you have entered.\n\nDo you wish to leave the form?"

//days in month
var daysIn = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

//validation Regexes
var re_empty = /^[\s]*$/;

var re_date = /^[\d]{4}(\/|\s)?[\d]{1,2}(\/|\s)?[\d]{1,2}$/;   // /^[\d]{4}(\/|\s)?[\d]{1,2}\/[\d]{1,2}$/;

//New: 8 digit only: var re_wcb             = /^[\d]{8}$/i;
var re_wcb = /^(?:(?:(?:[a-z]{2})?[\d]{8}))$/i;

var re_decnum = /^[\d]{7}$/i;
var re_carecard = /^[\d]{4}[\s]?[\d]{3}[\s]?[\d]{3}$/;
var re_SIN = /^[\d]{3}\-[\d]{3}\-[\d]{3}$/;
var re_postal = /^[a-zA-Z][\d][a-zA-Z][\s]?[\d][a-zA-Z][\d]$/i;
var re_areacode = /^[\d]{3}$/;
var re_phone = /^[\d]{3}[\-\s\.]?[\d]{4}$/;
var re_fullphone = /^\([\d]{3}\) [\d]{3}\-[\d]{4}$/;
var re_name = /^[^\s]+[\s][^\s]+(?:.*?)*$/;
var re_rfs = /^[\d]{4}[\d]+$/i;
var re_insp = /^([\d]{12}(,|,\s*)*)*$/;
var re_discrim = /^([\d]{4}\-?D\-?[\d]+(,|,\s*)*)*$/i;
//var re_discrim         = /^[\d]{4}\[\-\s\.]D\-[\d]+$/i;
var re_customercare = /^9[\d]{10}$/;
var re_wcatdec = /^[\d]{4}\-?[\d]{5}$/;
var re_wsbcfile = /^[\d]{6}$/;
var re_appeal = /^([\d]{6}-?[a-zA-Z],\s?)*([\d]{6}-?[a-zA-Z])?$/;



var tracker = new TooltipTracker("tracker");
tracker.setWidth("3in");
tracker.setBorder("none");
tracker.setBackground("#ffffff");

//tracker.setBorder("solid #990011 1px");
//tracker.setBackground("#dbf5a5");
//tracker.setBackground("#c8e192");
//tracker.setBackground("#f8fff0");
//tracker.setOpacity("0.9");

tracker.make("nohelp", "<p>Sorry, help is unavailable for this field</p>");

function showNotice() {
  document.getElementById("notice_bg").style.display = "block";
  document.getElementById("notice_txt").style.display = "block";

  var late_txt = document.getElementById("late_txt");
  if (late_txt != null) late_txt.style.display = "block";
}
function clearNotice() {
  document.getElementById("notice_bg").style.display = "none";
  document.getElementById("notice_txt").style.display = "none";
}
function clearNotice(focusEltID) {
  document.getElementById("notice_bg").style.display = "none";
  document.getElementById("notice_txt").style.display = "none";
  document.getElementById(focusEltID).focus();
}

function gotoNextIfChecked(curCheckBoxID, nextElementID) {
  if (curCheckBoxID == null) return;
  if (document.getElementById(curCheckBoxID).checked) document.getElementById(nextElementID).focus();
}

//remove spaces from begining and ending of string
function trim(str) {
  return str.replace(/^\s+|\s+$/g, "");
}

function stripLeadingZeroes(str) {
  if (null == str) return "";
  return str.replace(/^[0]*/, "");
}
function trim(str) {
  var rval = str.replace(/^[\s]*/, "");
  rval = rval.replace(/[\s]*$/, "");
  return rval;
}

var goingback = null;
function goback(elem, srcElem) {
  goingback = srcElem;
  elem.focus();
}



function confirmLeaveForm() {
  if (!event.keyCode == 13) {
    return confirm(leaveFormMessage);
  }
}

function addBlurEvents(frm) {
  for (var i = 0; i < frm.elements.length; i++) {
    var x = i;
    if (frm.elements[x] != null
     && frm.elements[x].type != null
     && frm.elements[x].className != "nofocus"
     // && frm.elements[x].className != "printButton" 
     && frm.elements[x].className.match("continueText") == null) {

      //checkboxes
      if (frm.elements[x].type == "checkbox" || frm.elements[x].type == "radio") {
        frm.elements[x].onfocus = function() {
          if (validate(this.form, this, false)) {
            tracker.closeAll();

            setCheckBoxGroupHighlight(frm, this, true);
          }
        }
        frm.elements[x].onchange = function() {
          if (validate(this.form, this, false)) {
            if (/\bexample\b/.test(this.className)) {
              this.className = this.className.replace(/\bexample\b/, " xmpl ");
              this.value = "";
            }
          }
        }
        frm.elements[x].onclick = function() {
          if (validate(this.form, this, true)) {
            if (/\bexample\b/.test(this.className)) {
              this.className = this.className.replace(/\bexample\b/, " xmpl ");
              this.value = "";
            }
          }
        }
        frm.elements[x].onblur = function() {
          setCheckBoxGroupHighlight(frm, this, false);
        }

        //all others
      } else {
        frm.elements[x].onfocus = function() {
          if (validate(this.form, this, false)) {
            tracker.closeAll();
            if (/\bexample\b/.test(this.className)) {
              this.className = this.className.replace(/\bexample\b/, " xmpl ");
              this.value = "";
            }
            this.className = this.className + " highlight";
          }
        }
        if (frm.elements[x].tagName.toLowerCase() != "textarea") {
          frm.elements[x].onblur = function() {
            if (/\bxmpl\b/.test(this.className) && this.value == "") {
              this.className = this.className.replace(/\bxmpl\b/, " example ");
              //addExampleText(this);   --DW: this change is so that the examples are not re-added after tabbing through a field (they may want this back)
            }
            this.className = this.className.replace(/\highlight\b/, " ");
          }
        }
      }
    }
  }
}




function isExample(elem) {
  if (elem != null && elem.className != null && /\bexample\b/.test(elem.className)) return true;
  return false;
}

function setupExamples(frm) {
  var classed = false;
  for (var i = 0; i < frm.elements.length; i++) {
    var x = i;
    if (frm.elements[x] != null && frm.elements[x].type != null) {
      var elem = frm.elements[x];
      if (elem.value == "" && elem.className != null) {
        if (!classed) {
          //alert(elem.className+" - "+isExample(elem));
          classed = true;
        }
        if (/\bexample\b/.test(elem.className)) {
          addExampleText(elem);
        }
      } else {
        if (elem.className != null) elem.className = elem.className.replace(/\bexample\b/, "");
      }
    }
  }
}

function addExampleText(elem) {
  if (/\bdate\b/.test(elem.className)) {
    elem.value = "yyyy/mm/dd";
  } else if (/\bwcbclaim\b/.test(elem.className)) {
    elem.value = "12345678 or UC12345678";
  } else if (/\bsin\b/.test(elem.className)) {
    elem.value = "123-456-789";
  } else if (/\bdecision\b/.test(elem.className)) {
    elem.value = "1234567";
  } else if (/\bareacode\b/.test(elem.className)) {
    elem.value = "250";
  } else if (/\bphone\b/.test(elem.className)) {
    elem.value = "123-4567";
  } else if (/\bfullphone\b/.test(elem.className)) {
    elem.value = "250 123-4567";
  } else if (/\bpostal\b/.test(elem.className)) {
    elem.value = "V6V 3B1";
  } else if (/\brfs\b/.test(elem.className)) {
    elem.value = "200012345";
  } else if (/\binsp\b/.test(elem.className)) {
    elem.value = "2000-12345678";
  } else if (/\bdiscrim\b/.test(elem.className)) {
    elem.value = "2000-D-987";
  } else if (/\bcustomercare\b/.test(elem.className)) {
    elem.value = "90000000000";
  } else if (/\bcarecard\b/.test(elem.className)) {
    elem.value = "1234 567 890";
  } else if (/\bwcatdec\b/.test(elem.className)) {
    elem.value = "2003-00000";
  } else if (/\bwsbcfile\b/.test(elem.className)) {
    elem.value = "999888";
  } else if (/\badministrative\b/.test(elem.className)) {
    elem.value = "200012345678";
  } else if (/\bappeal\b/.test(elem.className)) {
    elem.value = "123456-A";
  }
}

/* 
* parameters: 
* elem   - HTML textarea element
* length - maximum character count for the element, beyond 
*          which must be added to an additional page
*
* The method checks to see if the length of content in the 
* textarea is greater than the provided parameter. If so, 
* the appropriate overflow textarea is made visible, and 
* the input is split at the last space before the length
* limit.  
*/

var lineheight = 0.17;
var newpagemax = 54;
var linelength = 76;
var extrapages = new Array();

function stitch(elem) {
  if (extrapages[elem.name] != null && extrapages[elem.name] > 0) {
    for (var i = 0; i < 20 && i <= extrapages[elem.name]; i++) {
      var xpageCon = document.getElementById(elem.name + "_" + i);
      var xpage = document.getElementById(elem.name + "_in_" + i);
      if (xpage != null) {
        elem.value += xpage.value;
      }
      if (xpageCon != null) {
        //elem.form.removeChild(xpageCon);
        xpageCon.parentNode.removeChild(xpageCon);
      }
    }
  }
  extrapages[elem.name] = 0;

  elem.value = trim(elem.value);
}


//TODO: add styles to elements created below instead of hard coding styles -DW Dec 7, 2009
function truncate(elem, length, lbl) {
  if (elem == null || length <= 0) return;
  
  elem.className = elem.className.replace(/\bhighlight\b/, " ");

  if (extrapages[elem.name] == null) {
    extrapages[elem.name] = 0;
  }
  stitch(elem);
  elem.value = elem.value.replace(/\r/g, "");

  var lines = new Array();
  var chunks = elem.value.split("\n");
  var chlen = chunks.length;

  for (var i = 0; i < chlen; i++) {
    var cbreak = false;
    do {
      if (chunks[i] == "") {
        //lines.push("");
      } else if (chunks[i].length <= linelength) {
        lines.push(chunks[i]);
        chunks[i] = "";
      } else {
        var potentialline = chunks[i].substring(0, linelength);
        var tspace = potentialline.lastIndexOf(" ");

        if (tspace <= 0) {
          lines.push(chunks[i]);
          chunks[i] = "";
        } else {
          lines.push(chunks[i].substring(0, tspace));
          chunks[i] = chunks[i].substring(tspace);
        }
      }

      if (i > 0 && !cbreak) {
        cbreak = true;
        lines[lines.length - 1] = trimBreaks(lines[lines.length - 1]);

        lines[lines.length - 1] = "\n" + lines[lines.length - 1];
      }
    } while (chunks[i].length > 0);
    //if(i<chunks.length-1) lines[lines.length-1]+="\n";
  }

  var ii = 0;
  var elval = "";
  var numlines = lines.length;

  for (ii = 0; ii < numlines && ii < length; ii++) {
    elval = elval + lines[ii];
  }
  elem.value = elval;

  var pg = 0;

  var newpageprint = document.getElementById(elem.name + "_print");
  if (newpageprint != null) newpageprint.parentNode.removeChild(newpageprint);

  newpageprint = document.createElement("div");
  newpageprint.className = "printonly textarea";
  newpageprint.id = elem.name + "_print";

  var extratext = "";

  var morediv = document.getElementById(elem.name + "_morelink");
  if (morediv != null) morediv.parentNode.removeChild(morediv);

  if (ii < numlines) {
    /*while(ii<numlines) {
    var smallpage=false;
    if(numlines-ii<newpagemax) {
    smallpage=true;
    }
    
    if(pg==0) {*/

    morediv = document.createElement("DIV");
    morediv.style.textAlign = "right";
    morediv.id = elem.name + "_morelink";
    morediv.className = "";
    //document.insertBefore(morediv, document.getElementById(elem.name+"_placeholder"));
    elem.parentNode.insertBefore(morediv, elem.nextSibling);

    morelink = document.createElement("span");
    morelink.name = elem.name;
    morelink.onclick = function() {
      window.location.hash = this.name + "_more";
    }
    morelink.style.cursor = "pointer";
    morelink.className = "textarea";          // "textbox";
    morelink.appendChild(document.createTextNode("more..."));

    morediv.appendChild(morelink);

    var placeholder = document.getElementById(elem.name + "_placeholder");
    if (placeholder != null) {
      placeholder.parentNode.insertBefore(newpageprint, placeholder);
    } else {
      elem.form.appendChild(newpageprint);
    }
    //} 

    extrapages[elem.name]++;

    var newpagediv = document.createElement("DIV");
    newpagediv.className = "overflow";
    //if(smallpage) newpagediv.style.height=((lines.length-ii)*lineheight+0.5)+"in";
    newpagediv.id = elem.name + "_" + pg;

    //elem.form.appendChild(newpagediv);

    var placeholder = document.getElementById(elem.name + "_placeholder");
    if (placeholder != null) {
      placeholder.parentNode.insertBefore(newpagediv, placeholder);
    } else {
      elem.form.appendChild(newpagediv);
    }

    var newpagelabel = document.createElement("strong");
    newpagelabel.style.display = "block";
    newpagelabel.style.paddingTop = "0.1in";
    newpagelabel.id = elem.name + "_lbl_" + pg;
    newpagelabel.appendChild(document.createTextNode(lbl));
    newpagediv.appendChild(newpagelabel);

    //if(pg==0) {
    var moretarget = document.getElementById(elem.name + "_more");
    if (moretarget != null) moretarget.parentNode.removeChild(moretarget);

    moretarget = document.createElement("A");
    moretarget.name = elem.name + "_more";
    moretarget.id = moretarget.name;
    newpagelabel.appendChild(moretarget);
    //}

    var newpagetext = document.createElement("TEXTAREA");
    //newpagetext.className = "dontprint";
    newpagetext.className = "continueText";
    newpagetext.style.fontFamily = "verdana, arial, helvetica, sans-serif";
    
    //if(smallpage) newpagetext.style.height=((lines.length-ii+1)*lineheight)+"in";
    newpagetext.id = elem.name + "_in_" + pg;
    newpagediv.appendChild(newpagetext);
    //newpagetext.className = elem.name + "/" + length;

    newpagetext.onblur = function() {
      var id = this.id.substring(this.id.lastIndexOf("_") + 1);
      var info = this.className.split("/");
      if (document.getElementById(info[0] + "_lbl_" + id) == null) return;
      var lbl = document.getElementById(info[0] + "_lbl_" + id).firstChild.data;
      truncate(this.form.elements[info[0]], info[1], lbl);
    }

    elval = "";

    var linesAdded = 0;
    /*for(;ii<numlines&&linesAdded<newpagemax; ii++) {
    elval=elval+lines[ii];
    linesAdded++;
    }*/

    for (; ii < numlines; ii++) {
      elval = elval + lines[ii];
      linesAdded++;
    }

    newpagetext.value = elval;
    extratext += elval;
    
    //Add Text To New Page Element
    newpageprint.innerHTML = "<strong style=\"display:block;padding-top:0.1in;color:Black;font-size:13px;\">" + lbl + "</strong>\n" + extratext.replace(/\n/g, "<br>");
  }
}


var printTried = false;

function tryPrint(frm) {
  if (validate(frm, null, true)) {
    //FillPrintHeaderFooter(frm);
    print();
    //alert("Print complete form");
    printTried = true;
  } else if (confirm("Your form is incomplete, do you wish to print anyway?")) {
    //FillPrintHeaderFooter(frm);
    print();
    //alert("Print incomplete form");
    printTried = true;
  }

  return printTried;
}

function trimBreaks(str) {
  var rval = str.replace(/^[\r\n]/, "");
  rval = rval.replace(/[\r\n]$/, "");

  return rval;
}

var frmWnd;
function popup(url, w, h) {
  var wnd = window.open(url, "_blank", "width=" + w + ", height=" + h + ", toolbars=no, menubar=no, scrollbars=yes");
  return wnd;
}


document.onkeypress = function(event) {

  if (event == null) event = window.event;
  var srcElem = event.target;
  if (srcElem == null) srcElem = event.srcElement;
  var tagName = srcElem.tagName;
  if (tagName != null) tagName = tagName.toLowerCase();

  if (event != null && event.keyCode == 13 && srcElem != null) {
    if (tagName != null && tagName != "textarea" && tagName != "a") {
      return false;
    }
  }

  return true;
}

/* added by DW */
function enterTrap() {
  if (event != null && event.keyCode == 13) {
    //Get the button the user wants to have clicked
    var btn = document.getElementById("btnOK");
    if (btn != null) { //If we find the button click it
      btn.click();
      event.keyCode = 0
    }
  }
}


/* help bubbles */
tracker.make("workerLastName", "<p>Fill in the worker's last name, even if you are starting this appeal as a dependant of a deceased worker, or as an employer. </p>");
tracker.make("workerLastName3", "<p>Fill in the worker's last name, even if you are starting this appeal as an employer or a union. </p>");
tracker.make("workerFirstName", "<p>Fill in the worker's first name, even if you are starting this appeal as a dependant of a deceased worker, or as an employer. </p>");
tracker.make("workerFirstName3", "<p>Fill in the worker's first name, even if you are starting this appeal as an employer or a union. </p>");
tracker.make("WorkSafeBCClaim", "<p><strong>What is a WorkSafeBC claim number?</strong><br><br>When a claim is made with WorkSafeBC for a work related injury or disease, a claim number is assigned to the worker by WorkSafeBC that is unique to a claim.<br><br>It is an eight digit number OR two letters followed by an eight digit number. If you are listing more than one claim number, please separate the numbers with a comma (,). <br/>Example 12345678, UC12345678 </p><p><img width='375' height='193' src='images/examples/ClaimNumber.jpg'></p>"); // a duplicate of this value exists in the ~/Appeals/Appeal_status_inquiry/appeal_status.aspx
tracker.getByName("WorkSafeBCClaim").setWidth("430px"); // a duplicate of this value exists in the ~/Appeals/Appeal_status_inquiry/appeal_status.aspx
tracker.make("WorkSafeBCClaim5", "<p><strong>What is a WorkSafeBC claim number?</strong><br><br>When a claim is made with WorkSafeBC for a work related injury or disease, a claim number is assigned to the worker by WorkSafeBC that is unique to a claim.<br><br>It is an eight digit number (example 11234561) OR two letters followed by an eight digit number (example UC99012345). </p><p><img width='375' height='142' src='images/examples/wsbcClaimeNumber5.jpg'></p>"); 
tracker.getByName("WorkSafeBCClaim5").setWidth("430px"); // a duplicate of this value exists in the ~/Appeals/Appeal_status_inquiry/appeal_status.aspx



tracker.make("AppealNumber", "<p>Example:  123456-A. </p>"); // a duplicate of this value exists in the ~/Appeals/Appeal_status_inquiry/appeal_status.aspx

tracker.make("WorkSafeBCClaim15B", "<p><strong>What is a WorkSafeBC claim number?</strong><br><br>When a claim is made with WorkSafeBC for a work related injury or disease, a claim number is assigned to the worker by WorkSafeBC that is unique to a claim.<br><br>It is an eight digit number OR two letters followed by an eight digit number. If you are listing more than one claim number, please separate the numbers with a comma (,). <br/>Example 12345678, UC12345678 </p><p><img width='375' height='142' src='images/examples/ClaimNumber15B.jpg'></p>");
tracker.getByName("WorkSafeBCClaim15B").setWidth("430px");

tracker.make("CustomerCare", "<p><strong>What is a WorkSafeBC Customer Care Number?</strong><br><br>A WorkSafeBC Customer Care number is an 11 digit number that begins with a 9, which WorkSafeBC gives to a worker for life to identify the worker.  Example 90000000000.<br><br>A worker may have many claim numbers but only one Customer Care number.</p><p><img width='375' height='260' src='images/examples/CareNumber.jpg'> </p>");
tracker.getByName("CustomerCare").setWidth("430px");
tracker.make("CareCard", "<p>You will find the personal health care number on the worker's BC CareCard.<br/>Example: 1234 567 890.</p><p><img width='373' height='246' src='images/examples/CareCard.jpg'></p>");
tracker.getByName("CareCard").setWidth("430px");

tracker.make("MailingAddress", "<p>You must be sure that the address you give is correct because this is where our registry will send any further notices or information to you.  If your address changes at any time, notify us at WCAT immediately.  You should also notify WorkSafeBC if your address changes. </p>");
tracker.make("MailingAddressRep", "<p>You must be sure that the address you give is correct because this is where our registry will send any further notices or information to your representative.  If your representative's  address changes at any time, notify us at WCAT immediately.  You should also notify WorkSafeBC if your representative's address changes. </p>");
tracker.make("City", "<p>Example Victoria</p>");
tracker.make("Province", "<p>Example BC</p>");
tracker.make("PostalCode", "<p>Example V6V 3B1</p>");
tracker.make("DaytimePhone", "<p>Example 250 123-4567</p>");
tracker.make("OtherPhone", "<p>Example 250 123-4567</p>");
tracker.make("Fax", "<p>Example 250 123-4567</p>");

tracker.make("Date", "<p>You must identify the date of the Review Division decision that you are appealing. </p><p><strong>Where do I find the date of the Review Division decision?</strong></p><p>You will find this date on the first page of the Review Division decision.   Please fill out a separate notice of appeal form for each Review Division decision with a different date. Please enter the date in yyyy/mm/dd format.  For the example below you would enter 2001/01/15.</p><p><img width='375' height='143' src='images/examples/RDDate.jpg'></p>");
tracker.getByName("Date").setWidth("430px");

tracker.make("Date24", "<p>You must identify the date of the Review Division decision that you are appealing. </p><p><strong>Where do I find the date of the Review Division decision?</strong></p><p>You will find this date on the first page of the Review Division decision.   Please fill out a separate notice of appeal form for each Review Division decision with a different date. Please enter the date in yyyy/mm/dd format.  For the example below you would enter 2001/01/15.</p><p><img width='375' height='216' src='images/examples/RDDate24.jpg'></p>");
tracker.getByName("Date24").setWidth("430px");

tracker.make("Date3", "<p>Date of WorkSafeBC Decision you are appealing.  Format yyyy/dd/mm. </p><p><img width='375' height='140' src='images/examples/DiscrimDate.jpg'></p>");
tracker.getByName("Date3").setWidth("430px");

tracker.make("Date5", "<p>Date of WorkSafeBC Decision you are appealing.  Format yyyy/dd/mm. </p><p><img width='375' height='142' src='images/examples/worksafebcDecisionDate.jpg'></p>");
tracker.getByName("Date5").setWidth("430px");

tracker.make("RDNum", "<p>You must identify the reference number of the decision that you are appealing.</p><p><strong>Where do I find the Review Division reference number?</strong></p><p>You will find the reference number on the first page of the Review Division decision.  There may be more than one reference number listed on a Review Division decision.  Each reference number refers to one WorkSafeBC decision that is being reviewed.  List only the reference number(s) that you want to appeal.  Example: R1234567.</p><p>If the reference number you are entering has less than seven digits, add zeros (\"0\") to the beginning for a total of seven digits.</p><p><img width='375' height='143' src='images/examples/RDRefNum.jpg'></p>");
tracker.getByName("RDNum").setWidth("430px");

tracker.make("RDNum24", "<p>You must identify the reference number of the decision that you are appealing.</p><p><strong>Where do I find the Review Division reference number?</strong></p><p>You will find the reference number on the first page of the Review Division decision.  There may be more than one reference number listed on a Review Division decision.  Each reference number refers to one WorkSafeBC decision that is being reviewed.  List only the reference number(s) that you want to appeal.  Example: R1234567.</p><p>If the reference number you are entering has less than seven digits, add zeros (\"0\") to the beginning for a total of seven digits.</p><p><img width='375' height='216' src='images/examples/RDRefNum24.jpg'></p>");
tracker.getByName("RDNum24").setWidth("430px");

tracker.make("WhyIncorrect", "<p>This is where you provide a brief explanation about why you think the decision you are appealing is incorrect or should be changed. You only need to include the basic information on this form to start your appeal. We will give you the opportunity later to provide more information and evidence, either through written or verbal submissions.</p>");

tracker.make("Outcome", "<p>This is where you tell us what results or benefits you want from your appeal.  You should relate the results or benefits you are requesting to the issues raised by the decision you are appealing.  If you are appealing more than one decision, state what results or benefits you are requesting for each decision.</p>");

tracker.make("Disclosure", "<p>Disclosure is an updated copy of your claim file.  If you are a worker and your employer is participating in your appeal, WorkSafeBC will also send your employer disclosure.  You can choose whether you would like to receive disclosure of your claim file on a CD or in a paper format.  Please check which method of disclosure you prefer.  To make a check in the checkbox use the spacebar, or click your mouse over the box.</p>");

tracker.make("MethodWriting", "<p>This appeal method is often suitable for appeals that deal with medical, legal, or policy issues. </p>");
tracker.make("MethodOral", "<p>Normally, we use oral hearings for appeals involving significant issues of credibility, multiple appeals of a complex nature and where significant factual issues are in dispute.  Other compelling reasons for having an oral hearing include where an appellant or respondent has difficulty communicating in written English.</p>");
tracker.make("OralHearingLocation", "<p>WCAT holds oral hearings in the towns and cities throughout the province of British Columbia which are listed here.  If WCAT decides to hold an oral hearing, please choose the town or city where you would like the oral hearing to take place.</p>");
tracker.make("Interpreter", "<p>WCAT will provide an interpreter at no charge at the oral hearing if you need one.  You cannot use a friend or relative as an interpreter.  Your hearing may be rescheduled if your vice chair believes an interpreter is necessary. <br/><br/>If you need an interpreter please check YES.  If you do not need an interpreter please check NO.  To make a check in the checkbox use the spacebar, or click your mouse over the box.</p>");
tracker.make("Witnesses", "<p>Both you and the respondent may bring witnesses to give evidence at the hearing.  Please send us the names and addresses of the witnesses you will be bringing at least 21 days before your hearing.</p>");
tracker.make("Language", "<p>Example Chinese</p>");
tracker.make("Dialect", "<p>Example Mandarin</p>");

tracker.make("SelfRep", "<p>You may appeal on your own, or you may want to ask for assistance from someone familiar with the workers' compensation system, such as a compensation consultant, a lawyer, an employers' association or a union representative. You can get free help with your appeal from a workers' adviser if you are a worker, or an employers' adviser if you are an employer. </p>");

tracker.make("WSBCFile", "<p>If this is a matter involving an Assessment, Occupational Health and Safety or other Non-Compensation matter you must identify the Employer's WorkSafeBC Number (also referred to as File, Firm or Account number).  This number has six digits (example 999888) and can be found on the cover page attached to the Review Division decision. If your number has less than six digits, add zeros (\"0\") to the beginning for a total of six digits (example 009888).</p><p><img width='400' height='222' src='images/examples/EmployerNumber.jpg'></p>"); 
tracker.getByName("WSBCFile").setWidth("430px");
tracker.make("RFS", "<p>If this is an Occupational Health and Safety matter you will find a RFS (Recommendation for Sanction) number at the top of the Board's decision that was the subject of the review by the Review Division.  This number begins with RFS, is followed by a number sign and concludes with a year and a series of digits (example 200012345). If you are listing more than one RFS number, please separate the numbers with a comma (,).</p><p><img width='375' height='211' src='images/examples/rfs.jpg'></p>");
tracker.getByName("RFS").setWidth("430px");
tracker.make("administrative", "<p>If this is an Occupational Health and Safety matter you may find an Administrative Penalty Order Inspection Report (IR) number in the body of the Board's decision that was the subject of the review by the Review Division.  This number begins with a year and is followed by a series of eight digits (example Inspection Report 200012345678). If you are listing more than one IR number, please separate the numbers with a comma (,).</p><p><img width='375' height='211' src='images/examples/AdminPenalty.jpg'></p>");
tracker.getByName("administrative").setWidth("430px");
tracker.make("administrative24", "<p>If this is an Occupational Health and Safety matter you may find an Administrative Penalty Order Inspection Report (IR) number in the body of the Board's decision that was the subject of the review by the Review Division.  This number begins with a year and is followed by a series of eight digits (example Inspection Report 200012345678). If you are listing more than one IR number, please separate the numbers with a comma (,).</p><p><img width='375' height='211' src='images/examples/AdminPenalty.jpg'></p>");
tracker.getByName("administrative24").setWidth("430px");
tracker.make("wcat1iam", "<p>It is mandatory to indicate that you are the worker, a dependant of a deceased worker, or the employer.</p>");
tracker.make("wcat24iam", "<p>It is mandatory to indicate that you are the worker, employer, owner, dependant of a deceased worker, union, supplier or other</p>");
tracker.make("wcat3iam", "<p>It is mandatory to indicate that you are the worker, union, or the employer.</p>");
tracker.make("wcat5iam", "<p>It is mandatory to indicate that you are the worker, the employer, or the dependant of a deceased worker.</p>");
tracker.make("wcat15aiam", "<p>It is mandatory to indicate that you are the worker, employer, owner, dependant of a deceased worker, union, supplier or other.</p>");
tracker.make("wcat15biam", "<p>It is mandatory to indicate that you are the worker, union, a dependant of a deceased worker, or the employer.</p>");
tracker.make("wcat65iam", "<p>It is mandatory to indicate that you are the worker, employer, owner, dependant of a deceased worker, union, supplier or other.</p>");

tracker.make("WorkSafeBCDA", "<p>For your appeal of this WorkSafeBC Discriminatory Action Decision you must identify the Discriminatory Action Reference Number that you are appealing.  This number begins with a year, is followed by a 'D' and concludes with a series of numbers.<br />Example 2000-D-987.</p><p><img width='375' height='140' src='images/examples/discrim.jpg'></p>");
tracker.getByName("WorkSafeBCDA").setWidth("430px");
tracker.make("WCATDate", "<p>You will find the date on the first page of the WCAT decision.</p><p><img width='400' height='288' src='images/examples/WCATDate.jpg'></p>");
tracker.getByName("WCATDate").setWidth("430px");
tracker.make("WCATDate15B", "<p>The date of the WorkSafeBC decision is found on the cover letter enclosed with the WorkSafeBC decision. Please enter the date in yyyy/mm/dd format.  For the example below you would enter 2001/01/15.</p><p><img width='375' height='140' src='images/examples/WCATDate15B.jpg'></p>");
tracker.getByName("WCATDate15B").setWidth("430px");
tracker.make("WCATDate65", "<p>You will find the date on the first page of the WCAT decision. Please enter the date in yyyy/mm/dd format.  For the example below you would enter 2003/01/15.</p><p><img width='400' height='288' src='images/examples/WCATDate.jpg'></p>");
tracker.getByName("WCATDate65").setWidth("430px");

tracker.make("WCATDecision", "<p>You will find the WCAT decision number on the first page of the WCAT decision.</p><p><img  width='400' heigth='288' src='images/examples/wcatdecision.jpg'></p>");
tracker.getByName("WCATDecision").setWidth("430px");

tracker.make("WCATDecision65", "<p>You will find the WCAT decision number on the first page of the WCAT decision. Example: 2003-00000.</p><p><img width='400' heigth='288' src='images/examples/wcatdecision.jpg'></p>");
tracker.getByName("WCATDecision65").setWidth("430px");

tracker.make("reconreasons", "<p>To qualify for a reconsideration, you must show:</p><ol><li>That we made a jurisdictional error; and/or</li><li>That there is new evidence that was not available when the vice chair was making the decision.</li></ul>");
tracker.make("jurisdictional", "<p>What is jurisdictional error?</p><p>A jurisdictional error occurs if we did something we had no power to do, or if we did not do something that we were required to do. The Post-Decision Guide gives more information and examples of jurisdictional errors and new evidence.</p>");
tracker.make("newevidence", "<p>What is new evidence?</p><p>For evidence to be \"new\" it must not have existed at the time your appeal was being decided or, if it did exist, you did not know about it and you would not have been able to find it if you had tried.  This is called \"reasonable diligence\".</p><p>New evidence must be \"substantial,\" that is, have weight and support a different conclusion.  It must also be \"material,\" that is, it must be relevant to the decision.  For example, a new medical opinion based on a newly introduced medical test might be \"new\" evidence, while the opinion of a new specialist confirming a medical opinion already on your file might not.</p><p>The Post-Decision Guide gives more information and examples of jurisdictional errors and new evidence.</p>");

tracker.make("formCheckList", "<p>Make sure you remember to sign the form after you print it.</p>");
