﻿var helps = new Array(); 
helps[0]="Filter name – The name of the filter. Required field. <br>If you want your filter results page to play <i>DX DX</i> as morse code (midi -file) check <i>Play sound</i>.";
helps[1]="Link list containing country signs divided alphabetically. <br/>For example choosing OE - P2 will show you countries from Austria to Papua New Guinea.";
helps[2]="Countries and modes are on the horizontal axis.<br />All frequencies from HF to 47GHz are at vertical axis.<br/>If you check <i>All</i> -checkbox all checkboxes from the country raster under the corresponding country will be automatically selected from all modes CW, SSB and DIGI and frequencies.<br> If you click frequency name all checkboxes from horizontal axis are automatically checked. <br>If you click mode name all checkboxes under the mode are automatically checked.";
helps[3]="In case You want to receive emails when filter fires configure email options. <br/>Choose <i>Yes</i>, select <i>Start</i> and <i>End</i> for the time interval and check days when emails are sent. <br/>If you choose for example 1000 – 1200 and select Monday from the day of week –checkboxes the system will send you emails if the filter is fired during 1000 – 1200 on Mondays. <br/>If you choose 2200 – 0600 and select Monday from the day of week –checkboxes the system will send you emails if the filter is fired during Monday 2200 – Tuesday 0600.";
helps[4]="With these options You can filter certain dx calls, spotters, infos and frequencies out/in from your filter. <br/>Choose <i>Exactly</i> to search exact values. <br/> Choose <i>Begins with</i> to search values that start with inserted phrase. <br>Choose <i>Contains</i> to search values that contain inserted phrase.<br>Choose <i>Show or Don`t Show</i> to include/not include spots of corresponding rule to the results.<br/> Frequency can contain '.' and ',' marks. Example frequecies: 2000.2, 28.440.4, 1,345,1, 1000 <br/> If You want your filter to show all spots that include dx call phrase 'OH' write 'OH' to <i>DX call</i> textfied, choose exactly and show from the pulldown menus and push <i>Add</i> button. <br/>The rule will appear below the options. You can then delete the rule by hitting <i>Delete</i> button. ";
helps[5]="With these options You can include/not include IOTA, Mobile, QRP, Satellite, Beacon and Digital spots in your filter. <br/>If You want your filter to include IOTA spots choose <i>Yes</i> from the <i>Show IOTA</i> pulldown menu and the results will include all IOTA spots.";

function move_box(an, box, offset) {
  var cleft = 0;
  var ctop = 0;
  var obj = an;
  while (obj.offsetParent) {
    cleft += obj.offsetLeft;
    ctop += obj.offsetTop;
    obj = obj.offsetParent;
  }
  box.style.left = cleft + 'px';  
  ctop += an.offsetHeight + 8;
  ctop -= offset;
  if (document.body.currentStyle &&
    document.body.currentStyle['marginTop']) {
    ctop += parseInt(
      document.body.currentStyle['marginTop']);
  }
  box.style.top = ctop + 'px';
}

function show_hide_box(an, width, height, borderStyle, help, offset) {
  var href = an.href;
  var boxdiv = document.getElementById(href);

  if (boxdiv != null) {
    if (boxdiv.style.display=='none') {
      move_box(an, boxdiv, offset);
      boxdiv.style.display='block';
    } else
      boxdiv.style.display='none';
    return false;
  }

  boxdiv = document.createElement('div');
  boxdiv.setAttribute('id', href);
  boxdiv.style.display = 'block';
  boxdiv.style.position = 'absolute';
  boxdiv.style.width = width + 'px';  
  boxdiv.style.height = height + 'px';  
  boxdiv.style.border = borderStyle;
  boxdiv.style.backgroundColor = '#cccccc';
  boxdiv.style.padding = '5px';  
  boxdiv.style.color = '#000';
 
  boxdiv.innerHTML = helps[help] +"<br><br><a href=\"#\" onclick=\"closeDiv('"+href+"')\">Close</a>";
  document.body.appendChild(boxdiv);
  move_box(an, boxdiv, offset);

  return false;
}

function closeDiv(divid)
{
    var divi = document.getElementById(divid);
    if (divi)
    {
        divi.style.display = 'none';
    }
}