﻿/********************************************************************
*                                                                   *
*               With all best wishes for HanJuan                    *
*                                                                   *
*               Main Cascading Style Sheet                          *
*               main.js, 2008/05/06, NetFeng                        *
*                                                                   *
********************************************************************/

function showDate()
{
	var today = new Date();
	var day = today.getDate(), month = today.getMonth()+1, year = today.getFullYear(), weekday = "星期"+"日一二三四五六".charAt(today.getDay());
	document.write(year+"年"+month+"月"+day+"日 "+weekday);
}


function addFavorite()
{
	window.external.AddFavorite('http://www.jxdczx.com/','江西东昌咨询公司网站')
}


function navMouse(obj, n, action)
{
	var webroot = "http://" + document.domain + "/";
	obj.src = (action == 1) ? webroot + "\images/btn_nav_0" + n + ".png":webroot + "\images/btn_nav_0" + n + "_a.png";
}

function gotoURL(selObj, Restore)
{
  if (selObj.options[selObj.selectedIndex].value != "#" )
  	location.href =selObj.options[selObj.selectedIndex].value;
  if (Restore) selObj.selectedIndex=0;
}

function fixPng()
{
    var arVersion = navigator.appVersion.split("MSIE");
    var Version = parseFloat(arVersion[1]);
    if ((Version >= 5.5) && (Version < 7))
    {
       for(var j=0; j<document.images.length; j++)
       {
          var img = document.images[j];
          var imgName = img.src.toUpperCase();
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
          {
             var imgID = (img.id) ? "id='" + img.id + "' " : "";
             var imgClass = (img.className) ? "class='" + img.className + "' " : "";
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
             var imgStyle = "display:inline-block;" + img.style.cssText;
             if (img.align == "left") imgStyle = "float:left;" + imgStyle
             if (img.align == "right") imgStyle = "float:right;" + imgStyle
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
             var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
             img.outerHTML = strNewHTML;
             j = j-1;
          }
       }
    } 
}

window.attachEvent("onload", fixPng); 
