﻿
        function $(id) {
            return document.getElementById(id);
        }

        function setTransition() {
            if (document.all) {
                $('imgAd').filters.revealTrans.Transition = Math.floor(Math.random() * 23); //设置图片切换
                $('imgAd').filters.revealTrans.apply(); //应用图片切换
            }
        }
        function playTransition() {
            if (document.all)
                $('imgAd').filters.revealTrans.play() //播放图片
        }
        function changeImg() {
            if (curIndex == arr.length - 1) {
                curIndex = 0;
            }
            else {
                curIndex += 1;
            }
            setTransition();
            $('imgAd').src = arr[curIndex];
            $('imgAd').alt = altAry[curIndex];
            //$('spTitle').innerText = parseInt(curIndex) + 1 + '、' + altAry[curIndex]; //图片的alt
            $('url').href = urlAry[curIndex]; //图片的src
            if(curIndex ==0)
                title="<font  style='background-color:Red;'>&nbsp;1&nbsp;</font> "+"&nbsp;2&nbsp;3&nbsp;";
            else if(curIndex == 1)
                title="&nbsp;1&nbsp;"+"<font  style='background-color:Red;'>&nbsp;2&nbsp;</font> "+"&nbsp;3&nbsp;";
            else 
                title="&nbsp;1&nbsp;2&nbsp;"+"<font  style='background-color:Red;'>&nbsp;3&nbsp;</font> ";
            $('spTitle').innerHTML =altAry[curIndex] + title;
            playTransition();
        }
        
