﻿
function editWin(o)
{
  window.location.href="UpdateNews.aspx?nid="+o;    
}

function changepage(tid)
{
    window.location.href='List.aspx?TypeID='+tid;
}

var whichPic=1;
var t;

//页面加载，切换播放
function shadowChange()
{
    t=setTimeout("changepicture()",0);
}

//手动切换
function changepic(picPath,type,which)
{
    clearTimeout(t);
    
    if(type=="pic")
    {
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><img align='absmiddle' src='"+picPath+"' width='300' height='204' /></div>";
        whichPic=which;
    }
    else
    {
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><EMBED src='"+picPath+"' style=\"HEIGHT:204px ; WIDTH: 300px\" type=audio/mpeg AUTOSTART=\"1\" loop=\"0\"></EMBED></div>";
        whichPic=which;
    }
}

//自行切换
function changepicture()
{
    switch(whichPic)
    {
        case 1:
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><img align='absmiddle' src='"+document.getElementById("pic1").src+"' width='300' height='205' /></div>";
        whichPic++;
        setTimeout("changepicture()",5000);
        return;
        case 2:
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><img align='absmiddle' src='"+document.getElementById("pic2").src+"' width='300' height='205' /></div>";
        whichPic++;
        setTimeout("changepicture()",5000);
        return;
        case 3:
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><img align='absmiddle' src='"+document.getElementById("pic3").src+"' width='300' height='205' /></div>";
        whichPic++;
        setTimeout("changepicture()",5000);
        return;
        case 4:
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><img align='absmiddle' src='"+document.getElementById("pic4").src+"' width='300' height='205' /></div>";
        whichPic++;
        setTimeout("changepicture()",5000);
        return;
        case 5:
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><img align='absmiddle' src='"+document.getElementById("video1").src+"' width='300' height='205' /></div>";
        whichPic++;
        setTimeout("changepicture()",5000);
        return;
        case 6:
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><img align='absmiddle' src='"+document.getElementById("video2").src+"' width='300' height='205' /></div>";
        whichPic++;
        setTimeout("changepicture()",5000);
        return;
        case 7:
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><img align='absmiddle' src='"+document.getElementById("video3").src+"' width='300' height='205' /></div>";
        whichPic++;
        setTimeout("changepicture()",5000);
        return;
        case 8:
        document.getElementById("DivShow").innerHTML="<div style='height: 236px; line-height:236px;'><img align='absmiddle' src='"+document.getElementById("video4").src+"' width='290' height='205' /></div>";
        whichPic++;
        setTimeout("changepicture()",5000);
        whichPic=1;
        return;
    }
}

//切换div
var state1=false;
function switchDiv(str)
{
    if(str=="first")
    {
        document.getElementById("first").style.display="block";
        document.getElementById("second").style.display="none";
        state1=true;
        return;
    }
    
    if(str=="second")
    {
        document.getElementById("second").style.display="block";
        document.getElementById("first").style.display="none";
        state1=false;
    }
}

var state=false;
function hideorshow(id)
{
    if(state==false)
    {
        document.getElementById(id).style.display="none";
        state=true;
        return;
    }
    document.getElementById(id).style.display="block";    
    state=false;
}


