// Check the browser is Microsoft Internet Explorer or not. If match, print out a button for print friendly.
var strPath = window.location.pathname.toString();
var intEnd = strPath.indexOf("chs");
//var strPicPath = strPath.substr(0, intEnd) + "images/print.jpg";
var strPicPath = strPath.substr(0, intEnd) + "images/print_icon.jpg";
if (strPicPath.indexOf("\\Dev") > -1)
 strPicPath = strPicPath.substr(1, strPicPath.length);

if (navigator.appName == "Microsoft Internet Explorer")
 document.write("<a href = \"javascript:printVer()\" id = \"m5\"><img src = \"" + strPicPath + "\" alt = \"友善打印\" border = \"0\" width = \"19\" height = \"21\" style = \"vertical-align: baseline\"><font size = \"1\" style = \"color: #336699\">友善打印</font></a>");

// Get the hash variable from the url. If got the value, disable the area for printing.
if (window.location.hash == "#print")
{
 m1.style.display = "none";
 m2.style.display = "none";
 m3.style.display = "none";
 m4.style.width = "600";
// m5.style.display = "none";
 m6.style.display = "";
 // Print out the popup window.
 window.print();
}

// Function for prepare printing.
function printVer()
{
 var intStart = window.location.pathname.toString().lastIndexOf("\\"); // Get the start point of filename at the URL.
 var intEnd = window.location.pathname.toString().length; // Get the end point of filename at the URL.
 var strPath = window.location.pathname.toString() + "#print"; // Create a URL for passing varable to priting.
 // Popup a new window for printing.
 printWin = window.open(strPath, "PrintWindow", "toolbar=no, width=640, scrollbars=yes, location=yes");
}

