﻿/********************************************************************
*                                                                   *
*               With all best wishes for HanJuan                    *
*                                                                   *
*               Main Cascading Style Sheet                          *
*               main.js, 2010/01/30, NetFeng                        *
*                                                                   *
********************************************************************/

function GE(T, W) {return ( W || window ).document.getElementById(T);}
function GT(T, D) {return ( D || document).getElementsByTagName(T);}

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.jglz.gov.cn', '井冈廉政网')
}


function navMouse(action, n, i)
{
	n = (n < 10) ? "0" + n.toString() : n.toString();
	var webroot = "http://" + document.domain + "/";
	GE("nav" + n).src = (action) ? webroot + "images/nav/btn_nav_" + n + ".jpg" : webroot + "images/nav/btn_nav_a_" + n + ".jpg";
	if (i)
	{
		i = (i < 10) ? "0" + i.toString() : i.toString();
		if (!action)
		{
			if (n != i) GE("nav" + i).src = webroot + "images/nav/btn_nav_" + i + ".jpg";		
		}
		else
		{
			GE("nav" + i).src = webroot + "images/nav/btn_nav_a_" + i + ".jpg";
		}
	}
}

function gotoURL(selObj, Restore)
{
  if (selObj.options[selObj.selectedIndex].value != "#" )
  	location.href = selObj.options[selObj.selectedIndex].value;
  if (Restore) selObj.selectedIndex=0;
}

var newWindow = null
function showVote(target)
{       
  if (! newWindow || newWindow.closed)
  {
    newWindow = window.open(target, "nf_vote","toolbar=no, resizable=no, status=no, menuba=no, scrollbars=yes, dependent, width=512, height=248");
  }
  else
  {
     newWindow.focus();
   }
}
