﻿//屏蔽右键
/*
function click() 
{ 
    if(event.button == 2) 
    { 
       document.body.oncontextmenu=function(){return false;}
    } 
    return false;
} 

document.onmousedown = click; 
*/

//时间显示函数
function timeview()
{
  timestr=LOCAL_TIME.toLocaleString();
  //timestr=timestr.substr(timestr.indexOf(" "));t

  if (OperId==0)
  {window.document.all.time_span.innerHTML = USERINFO+'&nbsp;'+getTimeSect()+"好！ " + "当前日期："+timestr;}
  else 
  {
   window.document.all.time_span.innerHTML = USERINFO+'&nbsp;'+ "<span class=\"ChangePWD\">[<a onclick=\"document.all.indexFrame.src='ChangePwd.aspx?Id=OperId'\" href=\"#\">个人设置</a>]</span>" +'&nbsp'+  getTimeSect()+"好！ " + "当前日期："+timestr;
  }
  LOCAL_TIME.setSeconds(LOCAL_TIME.getSeconds()+1);
  window.setTimeout( "timeview()", 1000 );
}


function getTimeSect()
{
  var tag="晚上";
  var time=LOCAL_TIME.getHours()+LOCAL_TIME.getMinutes()/60;
  
	if(time<6.5)
	{
		tag="晚上";
		return tag;
	}
	if(time<8)
	{
		tag="早上";
		return tag;
	}
	if(time<12)
	{
		tag="上午";
		return tag;
	}
	if(time<14)
	{
		tag="中午";
		return tag;
	}
	if(time<19)
	{
		tag="下午";
		return tag;
	}
  
  return tag;
}

function chk()
{
	if(""==document.all.edUser.value)
	{
		showmsg(document.all.edUser," 请输入您要登陆的帐号！",true);
		document.all.edUser.focus();
	}
	else
		LoginFrm.submit();
}


var MENU_VIEW=true;
var HTM_MENU=null;
var MENU_W=null;
function initMainView()
{
	//self.moveTo(0,0);
	//self.resizeTo(screen.availWidth,screen.availHeight);	
	self.focus();
	timeview();
	
}
function MouseOverStyle(obj)
{	obj.className="IconStyleOn";
}
function MouseOutStyle(obj)
{
	obj.className="IconStyle";
}
function DoTran(obj)
{
	obj.style.filter='alpha(opacity=66);'
}
function ClearTran(obj)
{
	obj.style.filter='alpha(opacity=100);'
}
function menu_ctrl()
{
	if(!MENU_VIEW)
	{
		leftMenu.width=MENU_W;
		leftMenu.bgColor='white';
		MENU_VIEW=true;
		//leftMenu.innerHTML=HTM_MENU;
		leftMenu.style.display="";
		MainFrm.splitImg.src="../Images/splitArrow.gif";
	}
	else
	{
		leftMenu.style.display="none";
		MENU_W=leftMenu.width;
		leftMenu.width=1;
		leftMenu.bgColor='#B6C5E7';
		//HTM_MENU=leftMenu.innerHTML;
		//leftMenu.innerHTML='';
		MENU_VIEW=false;
		MainFrm.splitImg.src="../Images/_splitArrow.gif";
	}
	
}

function menuctrl()
{
	if(!MENU_VIEW)
	{
		leftMenu.width=MENU_W;
		leftMenu.bgColor='white';
		MENU_VIEW=true;
		//leftMenu.innerHTML=HTM_MENU;
		leftMenu.style.display="";
		MainFrm.splitImg.src="Images/splitArrow.gif";
	}
	else
	{
		leftMenu.style.display="none";
		MENU_W=leftMenu.width;
		leftMenu.width=1;
		leftMenu.bgColor='#B6C5E7';
		//HTM_MENU=leftMenu.innerHTML;
		//leftMenu.innerHTML='';
		MENU_VIEW=false;
		MainFrm.splitImg.src="Images/_splitArrow.gif";
	}
	
}



//当向加收缩时
function Right_menu_ctrl()
{
	if(!MENU_VIEW)
	{
		leftMenu.width=MENU_W;
		leftMenu.bgColor='white';
		MENU_VIEW=true;
		//leftMenu.innerHTML=HTM_MENU;
		leftMenu.style.display="";
		MainFrm.splitImg.src="../Images/_splitArrow.gif";
	}
	else
	{
		leftMenu.style.display="none";
		MENU_W=leftMenu.width;
		leftMenu.width=1;
		leftMenu.bgColor='#B6C5E7';
		//HTM_MENU=leftMenu.innerHTML;
		//leftMenu.innerHTML='';
		MENU_VIEW=false;		
		MainFrm.splitImg.src="../Images/splitArrow.gif";
	}
	
}

function Go2Url(url)
{
	document.all.indexFrame.src=url;
}
function goback()
{
	indexFrame.history.back(-1);
}
function goforward()
{
	indexFrame.history.go(1);
}
function refresh()
{
	indexFrame.location.reload();
}

function exit()
{
	if(confirm("确定退出系统吗？"))
		window.close();
}


function showmsg(ctl,text,ImagePath)
{
    
	var oPopup = window.createPopup();
	var _width=text.length*14+32;
	var _height=-36;
	if(ImagePath==null)
		text='<DIV NOWRAP align=center STYLE="height:28px; background:#FFFFdd; border:1px solid #575757; padding:4px;"><IMG vspace=1 align=absmiddle src="../../../Images/icon_err.gif"><font size=2 color=#DC0C0C>&nbsp;'+text+'</font></DIV>'
    else
        	text='<DIV NOWRAP align=center STYLE="height:28px; background:#FFFFdd; border:1px solid #575757; padding:4px;"><IMG vspace=1 align=absmiddle src="Images/icon_err.gif"><font size=2 color=#DC0C0C>&nbsp;'+text+'</font></DIV>'
	oPopup.document.body.innerHTML=text;
	//oPopup.show(0, _height, _width, 28,ctl);
	if (ctl.tagName !="SELECT") 
	{
	   oPopup.show(0, _height, _width, 28,ctl);
	}
	else
	{
	   var top = ctl.parentElement.offsetParent.offsetTop + ctl.parentElement.offsetTop+220;
	   var left = ctl.parentElement.offsetParent.offsetLeft + ctl.parentElement.offsetLeft+180;
	   oPopup.show(left,top,_width, 28);      
	}
	
}
	



