<!--

 //菜单的结构
function menu(name) 
{
	this.name = name;      //名称
	this.bar = new Array();   //所包含的菜单条数组
}

/**
* 生成菜单栏
* objMnu.bar Object 一个菜单栏对象数组
*{菜单栏名字, 菜单了栏显示文本}
*/
function createMainMenu(objMnu)
{
	var strHTML, i;
	strHTML = "<div class='menuBar' style='left:0; top:37; width:100%; height:27'>";
	//document.write (strHTML);
	for (i = 0; i < objMnu.bar.length; i++) 
	{   
	    var menuitem=objMnu.bar[i][0];
         if(menuitem=='Logout')
	    {
	      strHTML += "<a class='menuButton' href='javascript:if(confirm(\"确认退出系统?\")){location.href=\"../Admin/Writeoff.Asp\";top.window.close();}'>" + objMnu.bar[i][1] + "</a>";
	    }else{
		 strHTML += "<a class='menuButton' href='' " + 
		 "onclick='return buttonClick(event, \"" + objMnu.bar[i][0] + "\");' " +
		 "onmouseover='buttonMouseover(event, \"" + objMnu.bar[i][0] + "\");'>" + objMnu.bar[i][1] + "</a>";}
		if (i != objMnu.bar.length -1 )
		{
			strHTML += "<a class='compart'>|</a>";
		}
		//document.write (strHTML);
	}

	strHTML += "</div>";  
	document.write (strHTML);
}

/**
* 生成菜单
* objMnu Object 一个菜单对象数组
*{菜单了栏显示文本, 链接, 子菜单名称}
*/
function createMenu(objMnu)
{
	var strHTML, i;
	strHTML = "<div id='" + objMnu.name + "' class='menu' onmouseover='menuMouseover(event)'>";
	//document.write (strHTML);

	for (i = 0; i < objMnu.bar.length; i++) 
	{
		if (objMnu.bar[i][0] == "-")
		{
			strHTML += "<div class='menuItemSep'></div>";
		}
		else
		{
			if (objMnu.bar[i][2] == "")
			{
				strHTML += "<a class='menuItem' href='javascript:chgWorkPage(\"" + objMnu.bar[i][1] + "\");void(0)'>" + objMnu.bar[i][0] + "</a>";
				//document.write (strHTML);
			}
			else
			{
				strHTML += "<a class='menuItem' href='' " +  "onclick='return false;' " +
				"onmouseover=\"menuItemMouseover(event, '" + objMnu.bar[i][2] + "');\"><span class='menuItemText'>" + objMnu.bar[i][0] + 
				"</span><span class='menuItemArrow'>&#9654;</span></a>";
				//document.write (strHTML);
			}
		}
	}

	strHTML += "</div>";  
	document.write (strHTML);
}


function chgWorkPage(strUrl) 
{
	closeMenu();
	if (strUrl.indexOf("javascript") != -1)
	{
		//弹出窗口
		var tmp = strUrl.split(':'); 
		var w = tmp[1];

		if (tmp[2] == '0')
		{
			if (confirm("确认退出系统?"))
			{
				top.window.location.href='../Admin/Writeoff.Asp';
				top.window.close();
			}
		}
		else if (tmp[2] == 'logout')
		{
			if (confirm("确认注销当前用户?"))
			{
				top.window.location.href='../Admin/Writeoff.Asp';
				top.window.location.href='../Admin/Writeoff.Asp';
			}
		}
		else if (tmp[3] == 'OpenFile')
		{
			OpenFile();
		}
		else if (tmp[3] == 'Tool_T')
		{
			Tool_T();
		}
		else if (tmp[3] == 'Tool_S')
		{
			Tool_S();
		}
		else if (tmp[3] == 'Tool_D')
		{
			Tool_D();
		}
		else if (tmp[3] == 'Tool_I')
		{
			Tool_I();
		}
		else if (tmp[3] == 'Tool_N')
		{
			Tool_N();
		}
		else if (tmp[3] == 'Tool_P')
		{
			Tool_P();
		}
		else if (tmp[3] == 'Tool_LLLLL')
		{
			Tool_LLLLL();
		}

		else if (tmp[3] == 'JFCmsSite')
		{
			opJFcmsSite();
		}
		else if (tmp[3] == 'JFCmsUpdateSite')
		{
			opJFCmsUpdateSite();
		}
		else if (tmp[3] == 'JFCmsHelpSite')
		{
			opJFcmsHelpSite();
		}
		else if (tmp[3] == 'JFCmsBbsSite')
		{
			opJFcmsBbsSite();
		}
		else if (tmp[3] == 'AboutJFCms')
		{
			about();
		}
		else if (tmp[3] == 'fullwindow')
		{
			fullwindow("../Admin/Admin.Asp",tmp[2]);
		}
		else if (tmp[3] == 'PreservationFile')
		{
			PreservationFile();
		}
		else
		{
			opWindow(tmp[1],tmp[2],tmp[3]);
		}
	}
	else
	{
		document.all("workIfame").src = strUrl;
	}
}

function PreservationFile(){
	document.workIfame.form1.submit();
	}
function opWindow(wW,wH,wHref) {
	var xMax = screen.width, yMax = screen.height;
	var xOffset = (xMax - wW)/2, yOffset = (yMax - wH)/2;
	win = window.open(wHref,'ow', 'width=' + wW + ',height=' + wH + ',top='+yOffset+',left='+xOffset+',toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
}

function opJFcmsSite() {
	win = window.open('http://www.uzgg.com/');
}

function opJFCmsUpdateSite() {
	win = window.open('http://www.uzgg.com/News/');
}

function opJFcmsHelpSite() {
	win = window.open('http://help.uzgg.com/');
}

function opJFcmsBbsSite() {
	win = document.workIfame.location="OpenFile.Asp"
}

function about()
{
window.showModalDialog("../Admin/About.Asp","ABOUT","dialogwidth:500px;dialogheight:350px;center:yes;status:no;scroll:no;help:no");
}


function fullwindow(pagename,type){
  setEvents(type);
  //top.window.close();
  top.window.opener=null;
  top.window.close();
  //shutwin();
}

function shutwin(){top.window=null;top.window.close();}

function setEvents(type) {
 var objChild;                           // Window
 var reWork = new RegExp('object','gi'); // Regular expression

 try {
  objChild = window.open('','child','width=50,height=50,status=no,resizable=yes'); 

  objChild.close();
 }
 catch(e) { }

 if(!reWork.test(String(objChild)))
 {
   alert('弹出窗口被拦截!\n如果您正在使用非IE浏览器请使用IE打开.\n如果您使用IE并安装弹出窗口拦截插件,请设置允许本窗口打开.');
 }
 else
 {
 openMain(type);
 } 
}

var number = Math.random();
var foot = Math.round(number * (10000-1))+1;
function openMain(type){
        if(window.name!='miswin'){
				url = '../Admin/Admin.Asp';
				if (type==1)
					{
						s=window.open(url,foot,'resizable=yes');//
					}
					else
					{
						s=window.open(url,foot,'resizable=yes,scrollbars=yes,resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes');
					}
				
                try{
                s.moveTo(0,0);
                s.resizeTo(screen.availWidth,screen.availHeight);
                self.opener=null;
                self.close();
                s.focus();
                }catch(e){}
        }
}

function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isOP    = false;  // Opera
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;


  s = "MSIE";
  if ((i = ua.indexOf(s))) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }
}



//----------------------------------------------------------------------------
// Code for handling the menu bar and active button.
//----------------------------------------------------------------------------

var activeButton = null;

// Capture mouse clicks on the page so any active button can be
// deactivated.

document.onmousedown = pageMousedown;


function pageMousedown(event) {

  var el;

  // If there is no active button, exit.

  if (activeButton == null)
{
	 // alert (activeButton)
	return;
}

  // Find the element that was clicked on.

  el = window.event.srcElement;

  // If the active button was clicked on, exit.

  if (el == activeButton)
    return;

  // If the element is not part of a menu, reset and clear the active
  // button.

	if (getContainerWith(el, "DIV", "menu") == null) 
	{
		resetButton(activeButton);
		activeButton = null;
	}
}

function buttonClick(event, menuId) {

  var button;

  // Get the target button element.
   button = window.event.srcElement;

  // Blur focus from the link to remove that annoying outline.
  button.blur();

  // Associate the named menu to this button if not already done.
  // Additionally, initialize menu display.
  //alert (button.menu);
  if (button.menu == null) 
  {
    button.menu = document.getElementById(menuId);
    if (button.menu.isInitialized == null)
      menuInit(button.menu);
  }

  // Reset the currently active button, if any.

//alert (activeButton)
	//alert (button);
  if (activeButton != null)
    resetButton(activeButton);

  // Activate this button, unless it was the currently active one.

  if (button != activeButton) {
    depressButton(button);
    activeButton = button;
  }
  else
    activeButton = null;

  return false;
}

function buttonMouseover(event, menuId) {

  var button;

  // Find the target button element.

    button = window.event.srcElement;


  // If any other button menu is active, make this one active instead.

  if (activeButton != null && activeButton != button)
    buttonClick(event, menuId);
}

function depressButton(button) {

  var x, y;

  // Update the button's style class to make it look like it's
  // depressed.

  button.className += " menuButtonActive";

  // Position the associated drop down menu under the button and
  // show it.

  x = getPageOffsetLeft(button);
  y = getPageOffsetTop(button) + button.offsetHeight;

  // For IE, adjust position.

    x += button.offsetParent.clientLeft;
    y += button.offsetParent.clientTop;

  button.menu.style.left = x + "px";
  button.menu.style.top  = y + "px";
  button.menu.style.visibility = "visible";

  // For IE; size, position and show the menu's IFRAME as well.

  if (button.menu.iframeEl != null)
  {
    button.menu.iframeEl.style.left = button.menu.style.left;
    button.menu.iframeEl.style.top  = button.menu.style.top;
    button.menu.iframeEl.style.width  = button.menu.offsetWidth + "px";
    button.menu.iframeEl.style.height = button.menu.offsetHeight + "px";
    button.menu.iframeEl.style.display = "";
  }
}

function resetButton(button) {
	if (button == null)
	{
		button = this.activeButton;
	}
	if (button == null)
	{
		return;
		activeButton = null;
	}

  // Restore the button's style class.

  removeClassName(button, "menuButtonActive");

  // Hide the button's menu, first closing any sub menus.

  if (button.menu != null) {
    closeSubMenu(button.menu);
    button.menu.style.visibility = "hidden";

    // For IE, hide menu's IFRAME as well.

    if (button.menu.iframeEl != null)
      button.menu.iframeEl.style.display = "none";
  }
}

//----------------------------------------------------------------------------
// Code to handle the menus and sub menus.
//----------------------------------------------------------------------------

function closeMenu() {
	/*if (button == null)
	{
		button = this.activeButton;
	}
	if (button == null)
	{
		return;
		activeButton = null;
	}*/

	var button = this.activeButton;
	if (button == null)
	{
		return;
	}

  // Restore the button's style class.

  removeClassName(button, "menuButtonActive");

  // Hide the button's menu, first closing any sub menus.

  if (button.menu != null) {
    closeSubMenu(button.menu);
    button.menu.style.visibility = "hidden";

    // For IE, hide menu's IFRAME as well.

    if (button.menu.iframeEl != null)
      button.menu.iframeEl.style.display = "none";
  }
	button.menu = null;
	activeButton = null;
}


function menuMouseover(event) {

  var menu;

  // Find the target menu element.


    menu = getContainerWith(window.event.srcElement, "DIV", "menu");


  // Close any active sub menu.

  if (menu.activeItem != null)
    closeSubMenu(menu);
}

function menuItemMouseover(event, menuId) {

  var item, menu, x, y;

  // Find the target item element and its parent menu element.

    item = getContainerWith(window.event.srcElement, "A", "menuItem");

  menu = getContainerWith(item, "DIV", "menu");

  // Close any active sub menu and mark this one as active.

  if (menu.activeItem != null)
    closeSubMenu(menu);
  menu.activeItem = item;

  // Highlight the item element.

  item.className += " menuItemHighlight";

  // Initialize the sub menu, if not already done.

  if (item.subMenu == null) {
    item.subMenu = document.getElementById(menuId);
    if (item.subMenu.isInitialized == null)
      menuInit(item.subMenu);
  }

  // Get position for submenu based on the menu item.

  x = getPageOffsetLeft(item) + item.offsetWidth;
  y = getPageOffsetTop(item);

  // Adjust position to fit in view.

  var maxX, maxY;


    maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) +
      (document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth);
    maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) +
      (document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight);

  maxX -= item.subMenu.offsetWidth;
  maxY -= item.subMenu.offsetHeight;

  if (x > maxX)
    x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
      + (menu.offsetWidth - item.offsetWidth));
  y = Math.max(0, Math.min(y, maxY));

  // Position and show it.

  item.subMenu.style.left       = x + "px";
  item.subMenu.style.top        = y + "px";
  item.subMenu.style.visibility = "visible";

  // For IE; size, position and show the menu's IFRAME as well.

  if (item.subMenu.iframeEl != null)
  {
    item.subMenu.iframeEl.style.left    = item.subMenu.style.left;
    item.subMenu.iframeEl.style.top     = item.subMenu.style.top;
    item.subMenu.iframeEl.style.width   = item.subMenu.offsetWidth + "px";
    item.subMenu.iframeEl.style.height  = item.subMenu.offsetHeight + "px";
    item.subMenu.iframeEl.style.display = "";
  }

  // Stop the event from bubbling.


    window.event.cancelBubble = true;

}

function closeSubMenu(menu) {

  if (menu == null || menu.activeItem == null)
    return;

  // Recursively close any sub menus.

  if (menu.activeItem.subMenu != null) {
    closeSubMenu(menu.activeItem.subMenu);


    // Hide the sub menu.
    menu.activeItem.subMenu.style.visibility = "hidden";

    // For IE, hide the sub menu's IFRAME as well.

    if (menu.activeItem.subMenu.iframeEl != null)
      menu.activeItem.subMenu.iframeEl.style.display = "none";

    menu.activeItem.subMenu = null;
  }

  // Deactivate the active menu item.

  removeClassName(menu.activeItem, "menuItemHighlight");
  menu.activeItem = null;
}

//----------------------------------------------------------------------------
// Code to initialize menus.
//----------------------------------------------------------------------------

function menuInit(menu) {

  var itemList, spanList;
  var textEl, arrowEl;
  var itemWidth;
  var w, dw;
  var i, j;

  // For IE, replace arrow characters.


    menu.style.lineHeight = "2.5ex";
    spanList = menu.getElementsByTagName("SPAN");
    for (i = 0; i < spanList.length; i++)
      if (hasClassName(spanList[i], "menuItemArrow")) {
        spanList[i].style.fontFamily = "Webdings";
        spanList[i].firstChild.nodeValue = "4";
      }


  // Find the width of a menu item.

  itemList = menu.getElementsByTagName("A");
  if (itemList.length > 0)
    itemWidth = itemList[0].offsetWidth;
  else
    return;

  // For items with arrows, add padding to item text to make the
  // arrows flush right.

  for (i = 0; i < itemList.length; i++) {
    spanList = itemList[i].getElementsByTagName("SPAN");
    textEl  = null;
    arrowEl = null;
    for (j = 0; j < spanList.length; j++) {
      if (hasClassName(spanList[j], "menuItemText"))
        textEl = spanList[j];
      if (hasClassName(spanList[j], "menuItemArrow")) {
        arrowEl = spanList[j];
      }
    }
    if (textEl != null && arrowEl != null) {
      textEl.style.paddingRight = (itemWidth 
        - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";

      // For Opera, remove the negative right margin to fix a display bug.


    }
  }

  // Fix IE hover problem by setting an explicit width on first item of
  // the menu.


    w = itemList[0].offsetWidth;
    itemList[0].style.width = w + "px";
    dw = itemList[0].offsetWidth - w;
    w -= dw;
    itemList[0].style.width = w + "px";


  // Fix the IE display problem (SELECT elements and other windowed controls
  // overlaying the menu) by adding an IFRAME under the menu.


    var iframeEl = document.createElement("IFRAME");
    iframeEl.frameBorder = 0;
    iframeEl.src = "javascript:;";
    iframeEl.style.display = "none";
    iframeEl.style.position = "absolute";
    iframeEl.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
    menu.iframeEl = menu.parentNode.insertBefore(iframeEl, menu);

  // Mark menu as initialized.

  menu.isInitialized = true;
}

//----------------------------------------------------------------------------
// General utility functions.
//----------------------------------------------------------------------------

function getContainerWith(node, tagName, className) {

  // Starting with the given node, find the nearest containing element
  // with the specified tag name and style class.

  while (node != null) {
    if (node.tagName != null && node.tagName == tagName &&
        hasClassName(node, className))
      return node;
    node = node.parentNode;
  }

  return node;
}

function hasClassName(el, name) {

  var i, list;

  // Return true if the given element currently has the given class
  // name.

  list = el.className.split(" ");
  for (i = 0; i < list.length; i++)
    if (list[i] == name)
      return true;

  return false;
}

function removeClassName(el, name) {

  var i, curList, newList;

  if (el.className == null)
    return;

  // Remove the given class name from the element's className property.

  newList = new Array();
  curList = el.className.split(" ");
  for (i = 0; i < curList.length; i++)
    if (curList[i] != name)
      newList.push(curList[i]);
  el.className = newList.join(" ");
}

function getPageOffsetLeft(el) {

  var x;

  // Return the x coordinate of an element relative to the page.

  x = el.offsetLeft;
  if (el.offsetParent != null)
    x += getPageOffsetLeft(el.offsetParent);

  return x;
}

function getPageOffsetTop(el) {

  var y;

  // Return the x coordinate of an element relative to the page.

  y = el.offsetTop;
  if (el.offsetParent != null)
    y += getPageOffsetTop(el.offsetParent);

  return y;
}
//-->