
function appendFooter()
{
  var ul, li, a, t;
  // object for multi-language
  if(ml==undefined)
  {
      var ml = new mLang(wd.getGlobalVar("Language"));
  }

  var Manual_file, QIG_file;
  // set defualt value ...
  Manual_file = "../Manual/Others/DCS-5230_A1_Manual_v1.00(I).pdf";
  QIG_file = "../QIG/Others/DCS-5230_A1_QIG_v1.00(I).pdf";
  
  // change UM & QIG path if necessary ...
  var tmWinter = new Date(Date.UTC(2005, 12, 30, 0, 0, 0, 0));
  var timeW = (-1)*tmWinter.getTimezoneOffset() / 60;
  switch(wd.getGlobalVar("Language").toLowerCase())
  {
    case "english":
      if(
        timeW == -5 ||
        timeW == -6 ||
        timeW == -7 ||
        timeW == -8 ||
        timeW == -9
      )
      {
        Manual_file = "../Manual/USA/DCS-5230_A1_Manual_v1.00(US).pdf";
        QIG_file = "../QIG/USA/DCS-5230_A1_QIG_v1.00(US).pdf";
      }
      break;

    case "french":
      if(
        timeW == -4 ||
        timeW == -5 ||
        timeW == -6 ||
        timeW == -7 ||
        timeW == -8
      )
      {
        Manual_file = "../Manual/Canada/DCS-5230_A1_Manual_v1.00(CA).pdf";
        QIG_file = "../QIG/Canada/DCS-5230_A1_QIG_v1.00(CA).pdf";
      }
      break;
  }
  
  try
  {
    footer = document.createElement("div");
    footer.id = "footer";
    ul = document.createElement("ul");
    ul.id = "ft-nav";

    var footer_item = [
      // Troubleshooting
      {
        "text"    :   ml.get_word("footer_1"),
        "href"    :   "../Troubleshooting/ts.html",
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // Support
      {
        "text"    :   ml.get_word("footer_2"),
        "href"    :   "http://support.dlink.com.tw",
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // D-View Cam
      {
        "text"    :   ml.get_word("footer_3"),
        "href"    :   "#",
        "onclick" :   function(){show_EULA("../D-View Cam/setup.exe");},
        "target"  :   "_self"
      },
      // ffdshow
      {
        "text"    :   ml.get_word("footer_10"),
        "href"    :   "../FFDShow/Launcher.exe",
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // Manual
      {
        "text"    :   ml.get_word("footer_4"),
        "href"    :   Manual_file,
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // Quick Guide
      {
        "text"    :   ml.get_word("footer_5"),
        "href"    :   QIG_file,
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // Acrobat Reader
      {
        "text"    :   ml.get_word("footer_6"),
        "href"    :   "../Acrobat/AdbeRdr810_en_US.exe",
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // About
      {
        "text"    :   ml.get_word("footer_7"),
        "href"    :   "../home/about.html",
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      }
      
    ];

    


    for(f in footer_item)
    {


      li = document.createElement("li");
      a = document.createElement("a");
      a.href = footer_item[f]["href"];
      a.onclick = footer_item[f]["onclick"];
      a.target = footer_item[f]["target"];
      a.style.whiteSpace = "nowrap";

      div = document.createElement("div");
      div.innerHTML = footer_item[f]["text"];
      //a.appendChild(document.createTextNode(footer_item[f]["text"]));
      a.appendChild(div);
      //a.href = "#";
      //a.target = "wizard_new";
      li.appendChild(a);
      li.style.paddingRight = "2px";
      li.style.paddingLeft = "2px";
      ul.appendChild(li);

      //sep===============================================================
      li = document.createElement("li");
      li.className = "sep";
      li.appendChild(document.createTextNode("\u00a0"));
      ul.appendChild(li);


    }





    //Exit

    li = document.createElement("li");
    li.style.styleFloat = "right";
    a = document.createElement("a");
    a.href = "javascript:top.close()";
    a.style.whiteSpace = "nowrap";
    div = document.createElement("div");
    div.innerHTML = ml.get_word("footer_8");
    //a.appendChild(document.createTextNode(ml.get_word("footer_8")));
    a.appendChild(div);
    li.appendChild(a);
    ul.appendChild(li);


    footer.appendChild(ul);
    document.body.appendChild(footer);

    //sep===============================================================
//     li = document.createElement("li");
//     li.style.styleFloat = "right";
//     li.className = "sep";
//     li.appendChild(document.createTextNode("\u00a0"));
//     ul.appendChild(li);

    //Copy Rights
    div = document.createElement("div");
    div.className = "copyright";
    str = document.createTextNode(ml.get_word("footer_9"));
    div.appendChild(str);
    document.body.appendChild(div);



    // create elements for EULA
    var div = document.createElement("div");
    div.id = "LB_EULA";
    div.style.display = "none";
    var p = document.createElement("p");
    p.className = "w_blueb17";
    p.innerHTML = "End User License Agreement";
    div.appendChild(p);
    p = document.createElement("p");
    p.style.fontWeight = "bold";
    p.innerHTML = "IMPORTANT - READ BEFORE COPYING, INSTALLING OR USING";
    div.appendChild(p);
    var iframe = document.createElement("iframe");
    iframe.border = "0";
    iframe.frameborder = "0";
    iframe.src = "../home/eula.html";
    iframe.style.width = "500px";
    iframe.style.height = "300px";
    iframe.style.border = "#fff 0px solid";
    div.appendChild(iframe);
    var div_btnbar = document.createElement("div");
    div_btnbar.className = "btnbar";
    var div_btnA_outer = document.createElement("div");
    div_btnA_outer.onclick = "hide_lightbox();";
    div_btnA_outer.className = "btn floatl";
    div_btnA_link = document.createElement("a");
    div_btnA_link.id = "EULA_Setup_Path";
    div_btnA_link.target = "wizard_new";
    div_btnA_link.style.color = "white";
    div_btnA_link.style.textDecoration = "none";
    div_btnA_inner = document.createElement("div");
    div_btnA_inner.innerHTML = "Agree";
    div_btnA_link.appendChild(div_btnA_inner);
    div_btnA_outer.appendChild(div_btnA_link);
    div_btnbar.appendChild(div_btnA_outer);

    var div_btnB_outer = document.createElement("div");
    div_btnB_outer.onclick = "hide_lightbox();";
    div_btnB_outer.className = "btn floatl";
    div_btnB_inner = document.createElement("div");
    div_btnB_inner.innerHTML = "Disagree";
    div_btnB_outer.appendChild(div_btnB_inner);
    div_btnbar.appendChild(div_btnB_outer);

    div.appendChild(div_btnbar);    
    document.body.appendChild(div);
    
  }catch(e)
  {
    //alert(e.desc);
  }
}

dhtmlLoadScript("../script/lightbox.js"); // for EULA
function show_EULA(setup_path)
{
  document.getElementById("EULA_Setup_Path").href = setup_path;
  show_lightbox("LB_EULA");
}

appendFooter();



