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

  // set defualt value ...
  var Manual_file = "http://www.mydlink.com/content/download";
  var QIG_file = "http://www.mydlink.com/content/download";
  var DVC_file = "http://tsd.dlink.com.tw/";
  var DVC_UM = "http://ipsurveillance.dlink.com.tw/product_detail.asp?CategorySno=IJ&sno=HLNJ";
  var ADOBE_READER = "http://www.adobe.com/go/EN_US-H-GET-READER";
  var reallang = wd.getGlobalVar("Language").toLowerCase();
   
  try
  {
    footer = document.createElement("div");
    footer.id = "footer";
    ul = document.createElement("ul");
    ul.id = "ft-nav";

    var footer_item = [
      // Troubleshooting
      {
        "id"      :   "footer_a_trouble_shooting",
        "text"    :   ml.get_word("footer_1"),
        "title"    :   ml.get_word("footer_11"),
        "href"    :   "../Troubleshooting/ts.html",
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // Support
      {
        "id"      :   "footer_a_tech_support",
        "text"    :   ml.get_word("footer_2"),
        "title"    :   ml.get_word("footer_12"),
        "href"    :   "http://www.dlink.com/corporate/worldwideoffices/",
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // D-View Cam
      {
        "id"      :   "footer_a_dvc",
        "text"    :   ml.get_word("footer_3"),
        "title"    :   ml.get_word("footer_13"),
        "href"    :   "#",
        "onclick" :   function(){show_EULA(DVC_file);},
        "target"  :   "_self"
      },
/*     // ffdshow
      {
//       "id"      :   "footer_a_ffdshow",
        "text"    :   ml.get_word("footer_10"),
        "title"    :   ml.get_word("footer_14"),
        "href"    :   "../FFDShow/Launcher.exe",
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
*/      // Manual
      {
        "id"      :   "footer_a_manual",
        "text"    :   ml.get_word("footer_4"),
        "title"    :   ml.get_word("footer_15"),
        "href"    :   Manual_file,
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // Quick Guide
      {
        "id"      :   "footer_a_qig",
        "text"    :   ml.get_word("footer_5"),
        "title"    :   ml.get_word("footer_16"),
        "href"    :   QIG_file,
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // Acrobat Reader
      {
        "id"      :   "footer_a_acrobat_reader",
        "text"    :   ml.get_word("footer_6"),
        "title"    :   ml.get_word("footer_17"),
        "href"    :   ADOBE_READER,
        "onclick" :   function(){},
        "target"  :   "wizard_new"
      },
      // About
      {
        "id"      :   "footer_a_about",
        "text"    :   ml.get_word("footer_7"),
        "title"    :   ml.get_word("footer_18"),
        "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";
      a.title = footer_item[f]["title"];
	  var vid = footer_item[f]["id"]+ "-" + reallang;
	  a.id = vid;	
      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";
    a.title = ml.get_word("footer_19");
    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";

    // Agree button ...
    var div_btnA_inner = document.createElement("div");
      div_btnA_inner.innerHTML = "Agree";
    var div_btnA_outer = document.createElement("div");
      div_btnA_outer.onclick = "hide_lightbox();";
      div_btnA_outer.className = "btn floatl";
      div_btnA_outer.appendChild(div_btnA_inner);
    var 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_link.appendChild(div_btnA_outer);
    div_btnbar.appendChild(div_btnA_link);

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

    // DVC Manual button ...
    var div_btnC_inner = document.createElement("div");
      div_btnC_inner.innerHTML = "D-ViewCam Manual";
    var div_btnC_outer = document.createElement("div");
      div_btnC_outer.className = "btnw floatr";
      div_btnC_outer.appendChild(div_btnC_inner);
    var div_btnC_link = document.createElement("a");
	  div_btnC_link.id = "footer_a_dvcmanual";
      div_btnC_link.href = DVC_UM;
      div_btnC_link.target = "wizard_new";
      div_btnC_link.style.textDecoration = "none";
      div_btnC_link.title = "Open the User Manual (PDF) \n If you do not have a PDF reader installed, you can click on the Acrobat Reader link at the bottom of the screen to install it before opening this document.";
      div_btnC_link.appendChild(div_btnC_outer);
    div_btnbar.appendChild(div_btnC_link);

    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();



