document.write(
          '<div id="slide">'+
            '<div id="showImg">'+
              '<a id="imglink" href="" target="_blank"><img width="200px" height="150px" id="showImgPic" src="" border="0" style="display:none;" alt="" /></a>'+
            '</div>'+
            '<div id="switcher" align="right">'+
              '<ul>'
);

for(i=0;i<sPicArr.length;i++)
{
    t=i+1;
    document.write(
                '<li id="switch_' + i + '" class="dblack" onmouseover="this.className=\'gray\';"  onmouseout="this.className=\'dblack\';">' +
                  '<a href="javascript:slidePic(\'' + i + '\');" target=_self>' + t + '</a>' +
                '</li>'
    );
}

document.write(
              '</ul>'+
            '</div>'+
            '<div id="slideSwitch" style="margin-top: 120px;margin-left: 90px;position:absolute;z-index:99;display:none"></div>'+
          '</div>'+
            '<div id="picTitle" style="width:218px;display:none;text-align:center;"></div>'
);

showImg(index);

function showImg(index)
{
    if (index>=sPicArr.length)
    {
        index=0;
    }
    
    slidePic(index);
    index++;
    setTimeout('showImg('+index+')',6*1000);//ms
}

function slidePic(index)
{
    if(sPicArr[index][0])
    {
        if ('Microsoft Internet Explorer' == navigator.appName)
        {
            document.all.slide.style.filter="progid:DXImageTransform.Microsoft.RandomDissolve()";
            document.all.slide.filters[0].Apply();            
        }

        $("showImg").style.display='block';
        $("showImgPic").style.display='';
        $("showImgPic").src=sPicArr[index][0];
        $("imglink").href=sPicArr[index][2];
        
        if (sPicArr[index][2])
        {
            $("picTitle").innerHTML='<a href="' + sPicArr[index][2] + '" target="_blank">' + sPicArr[index][1] + '</a>';
            $("picTitle").style.display = "";
        }
        else
        {
            $("picTitle").style.display = "none";
        }
        
        for (i=0; i<sPicArr.length; i++)
        {
            if( i==index)
            {
                $("switch_"+i).className='gray';
            }
            else
            {
                $("switch_"+i).className='dblack';
            }
        }

        if ('Microsoft Internet Explorer' == navigator.appName)
        {            
            document.all.slide.filters[0].Play();        
        }
    }
}