﻿document.write("<script type='text/javascript' src='js/jquery-1.4.2.min.js'></script>");
document.write("<script type='text/javascript' src='js/lhgcore.min.js'></script>");
document.write("<script type='text/javascript' src='js/lhgdialog.js'></script>");

(document.body||window).attachEvent("onload",init_Data);
function init_Data()
{
    var vDtbl=sdgongan_gaindexsdga.get_Data('select * from COLUMN_FLAG where C_ID=0 and WS_ID=\'002\'').value;
    if(vDtbl != null && vDtbl.Rows.length > 0) document.title=vDtbl.Rows[0]["TYPE"];
    else document.title="佛山市顺德区公安局政务网";
    
    vDtbl = null;
    vDtbl=sdgongan_gaindexsdga.get_Data('select * from COLUMN_FLAG where C_ID=1 and WS_ID=\'002\'').value;
    if(vDtbl != null && vDtbl.Rows.length > 0) document.getElementById("divRight1").innerHTML=vDtbl.Rows[0]["TYPE"];
    else document.getElementById("divRight1").innerHTML="粤ICP备05077616 公安备案编号200403D0068";
    
    vDtbl = null;
    vDtbl=sdgongan_gaindexsdga.get_Data('select * from COLUMN_FLAG where C_ID=2 and WS_ID=\'002\'').value;
    if(vDtbl != null && vDtbl.Rows.length > 0) document.getElementById("divRight2").innerHTML=vDtbl.Rows[0]["TYPE"];
    else document.getElementById("divRight2").innerHTML="佛山市顺德区公安局 版权所有";
    
	if(confirm("您好！\n\n    佛山市顺德区公安局政务网网址gongan.shunde.cn变更为gongan.shunde.gov.cn。\n\n    为了避免影响您网站的访问，请直接访问新网址http://gongan.shunde.gov.cn。\n\n    由此给您带来的不便，我们深表歉意！\n\n    按“确定”自动跳转到新网站")){
		top.location.href = "http://gongan.shunde.gov.cn";
	};
	
	
    set_color();
}
function set_color()
{
    var vSql = "select * from colorFill where Color_type = '0' and C_ID = '0'";
    var vdtbl = sdgongan_gaindexsdga.get_Data(vSql).value;
    if(vdtbl != null && vdtbl.Rows.length > 0 && vdtbl.Rows[0]["Color_background"] != "") document.body.style.backgroundColor=vdtbl.Rows[0]["Color_background"];
    else document.body.style.backgroundColor="#9fbbdf";
    
    vSql = "select type from COLUMN_FLAG where c_id=-1 and ws_id='002'";
    vdtbl = sdgongan_gaindexsdga.get_Data(vSql).value;
    if(vdtbl != null && vdtbl.Rows.length > 0 && vdtbl.Rows[0]["type"] == "true") document.body.style.filter="gray";
}
function get_time()
{
    var date=new Date();
    var year="",month="",day="",week="",hour="",minute="",second="";
    year=date.getYear();
    month=add_zero(date.getMonth()+1);
    day=add_zero(date.getDate());
    week=date.getDay();
    switch (date.getDay()) 
    {
        case 0:val="星期天";break
        case 1:val="星期一";break
        case 2:val="星期二";break
        case 3:val="星期三";break
        case 4:val="星期四";break
        case 5:val="星期五";break
        case 6:val="星期六";break
    }
    hour=add_zero(date.getHours());
    minute=add_zero(date.getMinutes());
    second=add_zero(date.getSeconds());
    document.getElementById("timetable").innerText=" "+year+"."+month+"."+day+" "+hour+":"+minute+":"+second+" "+val;
}

function add_zero(temp)
{
    if(temp<10) return "0"+temp;
    else return temp;
}
setInterval("get_time()",1000);

function onMouseOver(imgIndex, mType)
{
    switch(imgIndex)
    {
        case 2:
            document.getElementById("img2").src = "images/gaindex_02" + mType;
            break;
        case 3:
            document.getElementById("img3").src = "images/gaindex_03" + mType;
            break;
        case 4:
            document.getElementById("img4").src = "images/gaindex_04" + mType;
            break;
        case 5:
            document.getElementById("img5").src = "images/gaindex_05" + mType;
            break;
        case 6:
            document.getElementById("img6").src = "images/gaindex_06" + mType;
            break;
        case 7:
            document.getElementById("img7").src = "images/gaindex_07" + mType;
            break; 
        case 8:
            document.getElementById("img8").src = "images/gaindex_08" + mType;
            break;        
    }
}
