function HtmlDecode(text){
return text.replace(/&amp;/g,'&').replace(/&quot;/g,'\"').replace(/&lt;/g,'<').replace(/&gt;/g,'>');}
function XTopMap(w, h, strTopMap){
	var m_TopImgs = new Array();
	var m_w = w;
	var m_h = h;
	var addW = 2;
	var m_nowPic = 0;
	var m_hTimer;
	var m_strTopMap = strTopMap;
										    
	this.TopImgItem = function (imgUrl, strUrl, strText){
		this.img = new Image();
		this.img.src = imgUrl;
		this.strUrl = strUrl;
		this.strText = HtmlDecode(strText);
	}
										    
	this.AddImgItem = function (strUrl, imgUrl, strText){
		m_TopImgs[m_TopImgs.length] = new this.TopImgItem(imgUrl, strUrl, strText);
	}
										    
	this.Length = function(){
		return m_TopImgs.length;
	}
										    
	this.GetTopImgItem = function(l){
		return m_TopImgs[l];
	}
										    
	this.change_img = function(){
		if(!m_nowPic){
			m_nowPic = 1;
		}else if(document.all){
			document.getElementById(m_strTopMap + "_pic").filters[0].Apply();
			document.getElementById(m_strTopMap + "_pic").filters[0].Play(duration=0);
			document.getElementById(m_strTopMap + "_pic").filters[0].Transition=23;
		}
		document.getElementById(m_strTopMap + "_pic").src = m_TopImgs[m_nowPic-1].img.src;
		document.getElementById(m_strTopMap + "_url").href = m_TopImgs[m_nowPic-1].strUrl;
		//document.getElementById(m_strTopMap + "_title").value = m_TopImgs[m_nowPic-1].strText.replace("&#39;","'");
										
	for (var i=1;i<=m_TopImgs.length;i++){
		document.getElementById(m_strTopMap + "_xxjdjj"+i).className='axx';
	}
		document.getElementById(m_strTopMap + "_xxjdjj"+m_nowPic).className='bxx';
		m_nowPic++;
		if( m_nowPic > m_TopImgs.length ){m_nowPic = 1;}
			hTimer = setTimeout('eval("'+m_strTopMap+'.change_img()")', 5000);
		}
										    
		this.imgClick = function(n){
		m_nowPic = n;
			window.clearInterval(hTimer);
			this.change_img();
		}
										    
		this.show = function(){
		    //document.write('<div style="width:'+(m_w + addW)+'px;height:'+m_h+'px;overflow:hidden;text-overflow:clip;float:left;">');
			document.write('<div><a id="' + m_strTopMap + '_url" target="_blank"><img id="'+m_strTopMap + '_pic" style="border:none;FILTER: progid:DXImageTransform.Microsoft.RevealTrans (duration=0,transition=23)" width='+m_w+' height='+m_h+' /></a></div>');
			document.write('<div style="width:100%;text-align:right;margin-top: -18px;height:14px;padding-top:1px;z-index:4000;"><div>');
		for(var i=1;i<m_TopImgs.length+1;i++){
			document.write('<a href="javascript:'+m_strTopMap+'.imgClick('+i+');" id="'+m_strTopMap+'_xxjdjj'+i+'" class="axx" target="_self">'+i+'</a>');
			}
		document.write('</div></div>');
		}								
	}
	
