//旧300广告代码.2008-1-25重写,旧300使用文件名统一为ad.js


//广告
function Advertise(){
	this.sAdNo = new Array();
	this.sAdver = new Array();
	this.sAdType = new Array();
	this.sWidth = new Array();
	this.sHeight = new Array();
	this.sUrl = new Array();
	
	this.id = 0;
	this.sAdN = '';
	this.sStyle = '';
	
	this.sAdNo[0] = 'I-B-02';
	this.sAdver[0] = 'ib02.swf';
	this.sAdType[0] = 'swf';
	this.sWidth[0] = '408';
	this.sHeight[0] = '60';
	this.sUrl[0] = '';
		          
	this.sAdNo[1] = 'I-B-03';
	this.sAdver[1] = 'ib03.swf';
	this.sAdType[1] = 'swf';
	this.sWidth[1] = '408';
	this.sHeight[1] = '60';
	this.sUrl[1] = '';
	
	this.sAdNo[2] = 'I-T-01';
	this.sAdver[2] = 'it01.swf';
	this.sAdType[2] = 'swf';
	this.sWidth[2] = '780';
	this.sHeight[2] = '90';
	this.sUrl[2] = '<a href=\"http://www.chanet.com.cn/click.cgi?a=61161&d=9731&u=&e=\" target=\"_blank\"><IMG SRC=\"http://file.chanet.com.cn/image.cgi?a=61161&d=9731&u=&e=\" width=\"780\" height=\"90\"  border=\"0\"></a>';

	this.sAdNo[3] = 'I-T-02';
	this.sAdver[3] = 'dt01.gif'
	this.sAdType[3] = 'pic';
	this.sWidth[3] = '780';
	this.sHeight[3] = '90';
	this.sUrl[3] = '<a href=\"http://www.chanet.com.cn/click.cgi?a=61161&d=7472&u=&e=\" target=\"_blank\"><IMG SRC=\"http://file.chanet.com.cn/image.cgi?a=61161&d=7472&u=&e=\" width=\"780\" height=\"90\"  border=\"0\"></a>';

	this.sAdNo[4] = 'I-S-01';
	this.sAdver[4] = 'is01.gif';
	this.sAdType[4] = 'pic';
	this.sWidth[4] = '180';
	this.sHeight[4] = '60';
	this.sUrl[4] = '';

	this.sAdNo[5] = 'I-S-02';
	this.sAdver[5] = 'is02.gif';
	this.sAdType[5] = 'pic';
	this.sWidth[5] = '180';
	this.sHeight[5] = '60';
	this.sUrl[5] = '';

	this.sAdNo[6] = 'I-S-03';
	this.sAdver[6] = 'is03.gif';
	this.sAdType[6] = 'pic';
	this.sWidth[6] = '180';
	this.sHeight[6] = '60';
	this.sUrl[6] = '';

	this.sAdNo[7] = 'I-L-01';
	this.sAdver[7] = 'il01.gif';
	this.sAdType[7] = 'pic';
	this.sWidth[7] = '200';
	this.sHeight[7] = '60';
	this.sUrl[7] = '';

	this.sAdNo[8] = 'I-L-02';
	this.sAdver[8] = 'il02.gif';
	this.sAdType[8] = 'pic';
	this.sWidth[8] = '200';
	this.sHeight[8] = '60';
	this.sUrl[8] = '';

	this.sAdNo[9] = 'L-T-01';
	this.sAdver[9] = 'lt01.swf';
	this.sAdType[9] = 'swf';
	this.sWidth[9] = '780';
	this.sHeight[9] = '90';
	this.sUrl[9] = '';

	this.sAdNo[10] = 'L-S-01';
	this.sAdver[10] = 'ls01.gif';
	this.sAdType[10] = 'pic';
	this.sWidth[10] = '180';
	this.sHeight[10] = '60';
	this.sUrl[10] = '';

	this.sAdNo[11] = 'L-S-02';
	this.sAdver[11] = 'ls02.gif';
	this.sAdType[11] = 'pic';
	this.sWidth[11] = '180';
	this.sHeight[11] = '60';
	this.sUrl[11] = '';

	this.sAdNo[12] = 'D-T-01';
	this.sAdver[12] = 'dt01.gif';
	this.sAdType[12] = 'union';
	this.sWidth[12] = '780';
	this.sHeight[12] = '90';
	this.sUrl[12] = '<a href=\"http://www.chanet.com.cn/click.cgi?a=61161&d=7472&u=&e=\" target=\"_blank\"><IMG SRC=\"http://file.chanet.com.cn/image.cgi?a=61161&d=7472&u=&e=\" width=\"780\" height=\"90\"  border=\"0\"></a>';

	this.sAdNo[13] = 'D-P-01';
	this.sAdver[13] = 'dp01.swf';
	this.sAdType[13] = 'swf';
	this.sWidth[13] = '780';
	this.sHeight[13] = '90';
	this.sUrl[13] = '';

	this.sAdNo[14] = 'D-W-01';
	this.sAdver[14] = '想要一览众山小吗?<br><a href=http://ruchina.com/scene><font color=red>世界景点大全</font></a>,文字链接2,文字链接3,文字链接4,文字链接5';
	this.sAdType[14] = 'txt';
	this.sWidth[14] = '';
	this.sHeight[14] = '';
	this.sUrl[14] = '';

	this.sAdNo[15] = 'L-S-03';
	this.sAdver[15] = 'ls03.gif';
	this.sAdType[15] = 'pic';
	this.sWidth[15] = '180';
	this.sHeight[15] = '60';
	this.sUrl[15] = '';

	this.sAdNo[16] = 'L-S-04';
	this.sAdver[16] = 'ls04.gif';
	this.sAdType[16] = 'pic';
	this.sWidth[16] = '180';
	this.sHeight[16] = '60';
	this.sUrl[16] = '';

	this.sAdNo[17] = 'L-S-05';
	this.sAdver[17] = 'ls05.gif';
	this.sAdType[17] = 'pic';
	this.sWidth[17] = '180';
	this.sHeight[17] = '60';
	this.sUrl[17] = '';


	this.setAdNo = function(str){
		this.sAdN = str;
	}
	
	this.setStyle = function(str){
		this.sStyle = str;
	}

	this.ShowAd = function(){
		for(i=0;this.sAdNo[i];i++) if(this.sAdN == this.sAdNo[i]) this.id = i;
		
		if(this.sAdType[this.id] == 'swf'){
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + this.sWidth[this.id] + '" height="' + this.sHeight[this.id] + '">\n');
              document.write('  <param name="movie" value="http://ad.d1trip.com/swf/' + this.sAdver[this.id] + '">\n');
              document.write('  <param name="quality" value="high">\n');
			  //document.write('<param value="false" name="menu">\n');
			  //document.write('<param value="opaque" name="wmode">\n');
              document.write('  <embed src="http://ad.d1trip.com/swf/' + this.sAdver[this.id] + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + this.sWidth[this.id] + '" height="' + this.sHeight[this.id] + '"></embed>\n');
              document.write('</object>\n');
		}
		else if(this.sAdType[this.id] == 'pic'){
			document.write('<a href=http://ad.d1trip.com/adclick.asp?ad=' + this.sAdNo[this.id] + ' target=_blank><img border=0 src=http://ad.d1trip.com/pic/' + this.sAdver[this.id] + ' width="' + this.sWidth[this.id] + '" height="' + this.sHeight[this.id] + '"></a>');
		}
		else if(this.sAdType[this.id] == 'txt'){
			this.ss = new Array();
			this.ss = this.sAdver[this.id].split(",");
			for(i=0;this.ss[i];i++){
				 document.write('<a href=http://ad.d1trip.com/adclick.asp?ad=' + this.sAdNo[this.id] + '&no=' + i + ' class="' + this.sStyle + '" target=_blank>' + this.ss[i] + '</a><br>');
			}
		}

				//第三方代码
		else if(this.sAdType[this.id] == 'union'){
			document.write(this.sUrl[this.id]);
		}

		
	}
}


