function ShowAd(adNum,strLineData,divID,fwidth,fheight)
{
	this.iWritedCount= 0;
	this.TempCode = "";
	this.inum = 0;
	this.tranId = 0;	
	this.fnum = adNum;
	//this.tnum = timeNum;
	this.urlData = strLineData;
	this.insertID = divID;
	this.flashw   = fwidth;
	this.flashh   = fheight;
	this.aDoc = this.urlData.split("|*|");
	this.aWritedImg = new Array(this.aDoc.length);
	for(i=0; i<this.aWritedImg.length; i++ ){
		this.aWritedImg[i]=0;	
	}
	this.ShowAdTran = function(){
		if (this.tranId<this.fnum){
				document.getElementById(this.insertID).innerHTML = this.WriteImg_Default_A();
				this.tranId ++;		
		}else{
			var cmd = "this.ShowAdTran()";
			this.tranId = 0;
			this.inum = 0;
			eval(cmd);
		}
	}
	this.WriteImg_Default_A = function(){
	 var i,z;
	 i =this.inum;
	 this.aWritedImg[ i ] ++;
	 this.iWritedCount ++;
	 switch( this.GetFileExt( this.aDoc[i] ) )
	 {
	  case ".swf":
	   
	   this.TempCode = '<div id="ad'+this.iWritedCount+'" style="width:'+this.flashw+';height:'+this.flashh+'"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width='+this.flashw+' height='+this.flashh+'>';
	   this.TempCode = this.TempCode + '<PARAM NAME=movie VALUE="' + this.GetFileSrc(this.aDoc[i]) +'"><PARAM NAME=quality VALUE=high>'+'<param name=wmode value=transparent>';
	   this.TempCode = this.TempCode + '<EMBED src="' + this.GetFileSrc(this.aDoc[i]) + '" quality=high TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width='+this.flashw+' height='+this.flashh+'></EMBED></OBJECT></div>';
	   this.inum ++;
	   return this.TempCode; //·µ»Øflash´úÂëÆ¬¶Ï
	   break;
	  case ".gif":
	  case ".jpg":
	   thisTempCode ="";
	   thisTempCode = '<div id="ad'+iWritedCount+'"><a href="'+this.GetFileUrl(this.aDoc[i])+'"target="_blank"><img src="' + this.GetFileSrc(this.aDoc[i]) + '" border=0></a></div>';
	   this.inum ++;
	   return this.TempCode; //·µ»Øimage´úÂëÆ¬¶Ï
	   break;  
	  default:
	   break;
	 }
	 
	 this.inum ++;
	}

	this.GetFileExt = function ( str ){
		var i = str.lastIndexOf(".");
		if( i != -1 )
			return str.substr(i).toLowerCase( );
		else
			return "";

	}

	this.GetFileUrl = function ( str ){
		 var s = str.indexOf("|@|");
		 if( s != -1 )
		  return str.substr(0,s);
		 else
		  return "";
	}

	this.GetFileSrc = function ( str ){
		 var g = str.lastIndexOf("|@|");
		 if( g != -1 )
		  return str.substr(g+3);
		 else
		  return "";
	}
}