﻿/* 
Correctly handle PNG transparency in Win IE 5.5 & 6.
Copyright 2007 Ignia, LLC
Based in part on code from from http://homepage.ntlworld.com/bobosola.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/

function fixPng() {
  var arVersion = navigator.appVersion.split("MSIE")
  var version = parseFloat(arVersion[1])

  if ((version >= 5.5 && version < 7.0) && (document.body.filters)) {
    for(var i=0; i<document.images.length; i++) {
      var img = document.images[i];
      var imgName = img.src.toUpperCase();
      if (imgName.indexOf(".PNG") > 0) {
        var width = img.width;
        var height = img.height;
        var sizingMethod = (img.className.toLowerCase().indexOf("scale") >= 0)? "scale" : "image"; 
        img.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src.replace('%23', '%2523').replace("'", "%27") + "', sizingMethod='" + sizingMethod + "')";
        img.src = "images/blank.gif";
        img.width = width;
        img.height = height;
        }
      }
    }
  }

fixPng();


function Open_FeedBacks()
{
    var language = document.getElementById("txtMessage").value;//語言    
    var EmployeeId=document.getElementById("txtUser").value;//员工编号
    window.open("FeedBacks.aspx?CULTURE="+language+"&EmployeeId="+EmployeeId,"newwindow","height=600,width=700,toolbar= no,menubar=no,scrollbars=no,resizable=no,location=no,status=no,top="+(window.screen.height-600)/2+",left="+(window.screen.width-700)/2);
    return false;
}
function Open_Login(falg)
{
    var language = document.getElementById("txtMessage").value;//語言    
    var EmployeeId=document.getElementById("txtUser").value;//员工编号
    window.open("Login1.aspx?CULTURE="+language+"&EmployeeId="+EmployeeId+"&s_Sel="+falg,"newwindow","height=660,width=1000,toolbar= no,menubar=no,scrollbars=no,resizable=yes,location=no,status=no,top="+0+",left="+0);
    return false;
}
function Open_Faqs()
{
    var language = document.getElementById("txtMessage").value;//語言
    if(language=='en-us')
    {
       window.showModalDialog('../Files/Faqs.htm','Faqs','dialogWidth:1024px;dialogHeight:768px;help:no;resizable:no;status:no;scroll:yes')
    }
    if(language=='zh-tw')
    {
       window.showModalDialog('../Files/FAQSTw.htm','Faqs','dialogWidth:1024px;dialogHeight:768px;help:no;resizable:no;status:no;scroll:yes')
    }
    if(language=='zh-cn')
    {
       window.showModalDialog('../Files/FAQScn.htm','Faqs','dialogWidth:1024px;dialogHeight:768px;help:no;resizable:no;status:no;scroll:yes')
	}
    return false;
}
