defaultStatus = new Date().toLocaleString();
var u = "";
var p = 1;
var s;
var isT = true;
var isIE4 = false;
var isNav4 = false;
var isNav6 = false;
var menuOffX = 0;
var menuOffY = 0;
var fo_shadows = new Array();
function setBrowser(){
	if (document.all) isIE4 = true;
	else if (document.layers) isNav4 = true;
	else if (document.getElementById) isNav6 = true;
}

function $(_sId){
	return document.getElementById(_sId);
}
function plts(pltsPop){
    var newSpan = document.createElement("span");newSpan.id = "pltsTipLayer";newSpan.style.position = "absolute";
    document.body.appendChild(newSpan);pltsTipLayer.innerHTML = pltsPop;
	var popHeight = pltsTipLayer.clientHeight;
	var popWidth = pltsTipLayer.clientWidth;
	var items = pltsTipLayer.getElementsByTagName("img");
	if(items.length>0 && (popHeight>420 || popWidth>560)) {items[0].height = popHeight/2;popHeight/=2;items[0].width = popWidth/2;popWidth/=2;};
	var MouseX = event.clientX + document.body.scrollLeft;
	var MouseY = event.clientY + document.body.scrollTop;
	var popTopAdjust;
	var popLeftAdjust;
	if(MouseY+10+popHeight > document.body.clientHeight-document.documentElement.scrollTop) popTopAdjust = -popHeight-20;
	else popTopAdjust = 0;
	if(MouseX+5+popWidth > document.body.clientWidth-document.documentElement.scrollLeft) popLeftAdjust = -popWidth-10;
	else popLeftAdjust = 0;
	pltsTipLayer.style.left = MouseX + 5 + document.documentElement.scrollLeft + popLeftAdjust + "px";pltsTipLayer.style.top = MouseY + 10 + document.documentElement.scrollTop + popTopAdjust + "px";
}
function pltsC(){
    var snode = $("pltsTipLayer");
    if(snode!=null) snode.parentNode.removeChild(snode);
}

function CopyRight(unit){
    document.write("Copyright &copy; 2008-" + new Date().getYear() + " Copyright &copy; 2008-" + new Date().getYear() + " 黑龙江省公安厅&#8482; All Rights Reserved.<br />主办：黑龙江省公安厅政治部 电话：0451-82897211,0451-82897212<br/>技术支持：黑龙江省公安厅科技（信通）处 电话：0451-82897111<br/>地址：哈尔滨市中山路145号 邮编：150001<br/><a href='http://www.miibeian.gov.cn/'>黑ICP备05006531号</a>");
}

var docEle = function(){
    return $(arguments[0]) || false;
}
function openMask(){
    document.documentElement.style.overflowX = "hidden";document.body.style.overflowX = "hidden";document.documentElement.style.overflowY = "hidden";document.body.style.overflowY = "hidden";
    var newMask = document.createElement("div");newMask.id = "mask";newMask.style.left = 0;newMask.style.top = document.documentElement.scrollTop;newMask.style.width = screen.availWidth;newMask.style.height = screen.availHeight;document.body.appendChild(newMask);
}
function closeMask(){
    document.body.removeChild(docEle("mask"));document.documentElement.style.overflowX = "hidden";document.body.style.overflowX = "hidden";document.documentElement.style.overflowY = "auto";document.body.style.overflowY = "auto";
}
function closeMask2(){
    document.body.removeChild(docEle("mask"));document.documentElement.style.overflowX = "auto";document.body.style.overflowX = "auto";document.documentElement.style.overflowY = "auto";document.body.style.overflowY = "auto";
}

function submitSearch(){
    if(document.Search.keyword.value.length<1 || document.Search.keyword.value.search(/ /i)!=-1){
        alert("请您录入要搜索的内容！");document.Search.keyword.focus();return false;
    }else{
        document.Search.submit();return true;
    }
}

function getStyleP(strId, strProperty){
    if (isNav6){
        var styleObject = $(strId);
        if (styleObject != null){
            styleObject = styleObject.style;
            if (styleObject[strProperty]) return styleObject[ strProperty ];
        }
        styleObject = getStyleBySelector( "#" + strId );
        return (styleObject != null) ? styleObject[strProperty] : null;
    }else if (isIE4) return document.all[strId].style[strProperty];
    else return "";
}
function setStyleP(strId, strProperty, strValue){
    if (isNav6){
        var styleObject = $( strId );
        if (styleObject != null) {styleObject = styleObject.style;styleObject[ strProperty ] = strValue;}
    }else if (isIE4 && document.all[strId] != null) document.all[strId].style[strProperty] = strValue;
}
function setDisplay(element, strStyle){
	var strID;	
	if (typeof element == "object") strID = element.id;
	else if (typeof element == "string") strID = element;
	if (strID != "" && strID != null && (isIE4 || isNav6)){
		if (getStyleP(strID,'display')=='none') setStyleP(strID, 'display', strStyle);
		else setStyleP(strID, 'display', 'none');
	}
}

function login(){
    if(document.Login.userid.value.length<2||document.Login.user_password.value.length<1){
        alert("请输入用户名及密码！");return false;
    }else{
        if(document.Login.l[0].checked==true) document.Login.action="http://10.112.1.18/login.do";
        else document.Login.action="http://10.112.1.35/login.do";
    }
}

function Radio(obj){
    var RadioV;
    for(var i=0;i< obj.length;i++){
        if(obj[i].checked) RadioV = obj[i].value;
    }
    return RadioV;
}

function ShowWin(url,w,h,type){
    var loc_x = (screen.availWidth - w)/2;
    var loc_y = (screen.availHeight - h)/2;
    if(type==null) window.showModalDialog(url,self,"edge:raised;scroll:1;status:0;help:0;location:0;dialogWidth:" + w + "px;dialogHeight:" + h + "px;dialogTop:" + loc_y + "px;dialogLeft:" + loc_x + "px");
    else window.open(url,"_blank","width=" + w + ",height=" + h + ",top=" + loc_y + ",left=" + loc_x);
}

function WorkTime(){
    var d = new Date();var w = d.getDay();var h = d.getHours();
    if (w<6 && w>0 && ((h>7 && h<11) || (h>13 && h <17)) ) top.location="http://www.hl/Music/Error.htm";
    setTimeout("WorkTime()",1000);
}

function On(d){
    if(old == null) O(d);else if(old==d){if (getStyleP('div' + d,'display')=='none') O(d);else C(d);}
    else{C(old);O(d);}    
    old = d;
}
function O(id){
    setStyleP('div' + id, 'display', 'inline');$('img' + id).src = '/images/sanjiao2.gif';
}
function C(id){
    setStyleP('div' + id, 'display', 'none');$('img' + id).src = '/images/sanjiao.gif';
}

function P(url,page){
    var jp = $('jump');
    if (jp != null){
        var ep = parseInt($('epi').value);        
        if (page > ep) page = ep;
    }
    if (!parseInt(page)) page = 1;
    else if (s != null){
        var t = 5 - Math.round((new Date().getTime()-s.getTime())/1000);
        if (t > 0){
            isT = false;alert("请求过于频繁，请在【" + t + "】秒后重试！");
            if (jp != null) jp.value = p;
        }else isT = true;
    }
    if (isT) L(url,page);
}
function onkeydown(){
    var ep = $('epi');
    if (ep != null){
        if (window.event.keyCode==37 && p>1) P(u,p-1);
        if (window.event.keyCode==39 && p<ep.value) P(u,p+1);
    }
}

function showmenu(e,vmenu,vmenuobj,mod){
	if (!document.all&&!$&&!document.layers) return;
	var which=vmenu;
	if (vmenuobj){
		var MenuObj = fetch_object(vmenuobj);
		if (MenuObj) which = MenuObj.innerHTML;
	}
	if (!which)	return;
	clearhidemenu();ie_clearshadow();
	menuobj=isIE4? document.all.popmenu : isNav6? $("popmenu") : isNav4? document.popmenu : "";
	menuobj.thestyle=(isIE4||isNav6)? menuobj.style : menuobj;
	if (isIE4||isNav6) menuobj.innerHTML = which;
	else{
		menuobj.document.write('<layer name=gui bgcolor="#ffffff" width="200" onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>');menuobj.document.close();
	}
	menuobj.contentwidth=(isIE4||isNav6)? menuobj.offsetWidth : menuobj.document.gui.document.width;
	menuobj.contentheight=(isIE4||isNav6)? menuobj.offsetHeight : menuobj.document.gui.document.height;
	eventX=isIE4? event.clientX : isNav6? e.clientX : e.x;
	eventY=isIE4? event.clientY : isNav6? e.clientY : e.y;
	var rightedge=isIE4? document.body.clientWidth-eventX : window.innerWidth-eventX;
	var bottomedge=isIE4? document.body.clientHeight-eventY : window.innerHeight-eventY;
	var getlength;
	if (rightedge<menuobj.contentwidth){
		getlength=isIE4? document.body.scrollLeft+eventX-menuobj.contentwidth+menuOffX : isNav6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
	}else{
		getlength=isIE4? ie_x(event.srcElement)+menuOffX : isNav6? window.pageXOffset+eventX : eventX
	}
	menuobj.thestyle.left=getlength+'px'
	if (bottomedge<menuobj.contentheight&&mod!=0){
		getlength=isIE4? document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY-23 : isNav6? window.pageYOffset+eventY-menuobj.contentheight-10 : eventY-menuobj.contentheight
	}else{
		getlength=isIE4? ie_y(event.srcElement)+menuOffY : isNav6? window.pageYOffset+eventY+10 : eventY
	}
	menuobj.thestyle.top=getlength+'px';menuobj.thestyle.visibility="visible";ie_dropshadow(menuobj,"#ffffff",3);
	return false;
}
function ie_y(e){  
	var t=e.offsetTop;  
	while(e=e.offsetParent)
		t+=e.offsetTop;
	return t;  
}  
function ie_x(e){  
	var l=e.offsetLeft;  
	while(e=e.offsetParent)
		l+=e.offsetLeft;
	return l;  
}  
function ie_dropshadow(el, color, size)
{
	var i;
	for (i=size; i>0; i--)
	{
		var rect = document.createElement('div');
		var rs = rect.style
		rs.position = 'absolute';rs.left = (el.style.posLeft + i) + 'px';rs.top = (el.style.posTop + i) + 'px';rs.width = el.offsetWidth + 'px';rs.height = el.offsetHeight + 'px';rs.zIndex = el.style.zIndex - i;rs.backgroundColor = color;
		var opacity = 1 - i / (i + 1);
		rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';fo_shadows[fo_shadows.length] = rect;
	}
}
function ie_clearshadow()
{
	for(var i=0;i<fo_shadows.length;i++)
	{
		if (fo_shadows[i]) fo_shadows[i].style.display="none";
	}
	fo_shadows=new Array();
}
function contains_isNav6(a, b) {
	while (b.parentNode)
		if ((b = b.parentNode) == a) return true;
	return false;
}
function hidemenu(){
	if (window.menuobj) menuobj.thestyle.visibility=(isIE4||isNav6)? "hidden" : "hide";
	ie_clearshadow()
}
function dynamichide(e){
	if (isIE4&&!menuobj.contains(e.toElement)) hidemenu();
	else if (isNav6&&e.currentTarget!= e.relatedTarget&& !contains_isNav6(e.currentTarget, e.relatedTarget)) hidemenu();
}
function delayhidemenu(){
	if (isIE4||isNav6||isNav4) delayhide=setTimeout("hidemenu()",500);
}
function clearhidemenu(){
	if (window.delayhide) clearTimeout(delayhide);
}
function highlightmenu(e,state){
	if (document.all) source_el=event.srcElement;
	else if (document.getElementById) source_el=e.target;
	if (source_el.className=="menuitems") source_el.id=(state=="on")? "mouseoverstyle" : ""
	else{
		while(source_el.id!="popmenu"){
			source_el=document.getElementById? source_el.parentNode : source_el.parentElement;
			if (source_el.className=="menuitems") source_el.id=(state=="on")? "mouseoverstyle" : "";
		}
	}
}
