
<%
'##################################################################                                                                 
'★         web08.net - 威博购物系统                                              
'★  版权所有: web08.net                                                                                                       
'★  程序制作: 威博网络技术公司                                     
'★           email:web08net@hotmail.com                           
'★            Q Q :645095280,475980829
'★	       电话:021-55520018                                                                                                         
'★  相关网址: [产品介绍] http://www.021web.com.cn/gwxt.html
'★            [支持论坛] http://bbs.web08.net/                                                                                     
'★  主页地址: http://www.web08.net/  
'★		http://www.021web.com.cn/			                                                                 
'###################################################################
%><% 	Dim MyFile,CrHNJS,TempStateFlag,DnsPath,GetUrl,LDnsPath,AdsJSStr,AdsTempStr,JsFileName,objStream,AdsTempStrRight
	dim rootpath,rootpath2,Web_ad_path,c_filepath,web_sql,web_ad_path2
	 rootpath=replace(Web_Get_RootDir(Web_C_setupfolder),"/","\")
	 rootpath2=Web_Get_RootDir(Web_C_setupfolder)

		Web_ad_path=""&rootpath2&"systemad/"
		Web_ad_path2=""&rootpath2&"systemad/"
		web_sql=""
	function AdsTempPicStr(Location)
	    dim FunLocation,FunAdsObj
		FunLocation = clng(Location)
		sql="select * from Web_AD where "&web_sql&" AdID="&FunLocation&""
		Set FunAdsObj = Conn.Execute(sql)
		if InStr(1,LCase(FunAdsObj("AdPicPath")),".swf",1)<>0 Then
			If InStr(1,LCase(FunAdsObj("AdPicPath")),"http://")<>0 then
				AdsTempStr="<EMBED src="""& FunAdsObj("AdPicPath") &""" quality=high WIDTH="""& FunAdsObj("AdPicWidth") &""" HEIGHT="""& FunAdsObj("AdPicHeight") &""" TYPE=""application/x-shockwave-flash"" PLUGINSPAGE=""http://www.macromedia.com/go/getflashplayer""></EMBED>"
			Else
				AdsTempStr="<EMBED src="""& rootpath2&""& FunAdsObj("AdPicPath") &""" quality=high WIDTH="""& FunAdsObj("AdPicWidth") &""" HEIGHT="""& FunAdsObj("AdPicHeight") &""" TYPE=""application/x-shockwave-flash"" PLUGINSPAGE=""http://www.macromedia.com/go/getflashplayer""></EMBED>"
			End If
		Else
			If InStr(1,LCase(FunAdsObj("AdPicPath")),"http://")<>0 then
				AdsTempStr="<a href="""&Web_ad_path2&"AdsClick.asp?Location="& FunLocation &""" target=_blank><img src="""& FunAdsObj("AdPicPath") &""" border=0 width="""& FunAdsObj("AdPicWidth") &""" height="""& FunAdsObj("AdPicHeight") &""" alt="""& FunAdsObj("AdCaptionTxt") &""" align=top></a>"
			Else
				AdsTempStr="<a href="""&Web_ad_path2&"AdsClick.asp?Location="& FunLocation &""" target=_blank><img src="""&rootpath2&""& FunAdsObj("AdPicPath") &""" border=0 width="""& FunAdsObj("AdPicWidth") &""" height="""& FunAdsObj("AdPicHeight") &""" alt="""& FunAdsObj("AdCaptionTxt") &""" align=top></a>"
			End If
		End If
		if InStr(1,LCase(FunAdsObj("AdRightPicPath")),".swf",1)<>0 Then
			If InStr(1,LCase(FunAdsObj("AdRightPicPath")),"http://")<>0 then
				AdsTempStrRight="<EMBED src="""& FunAdsObj("AdRightPicPath") &""" quality=high WIDTH="""& FunAdsObj("AdPicWidth") &""" HEIGHT="""& FunAdsObj("AdPicHeight") &""" TYPE=""application/x-shockwave-flash"" PLUGINSPAGE=""http://www.macromedia.com/go/getflashplayer""></EMBED>"
			Else
				AdsTempStrRight="<EMBED src="""& rootpath2&""& FunAdsObj("AdRightPicPath") &""" quality=high WIDTH="""& FunAdsObj("AdPicWidth") &""" HEIGHT="""& FunAdsObj("AdPicHeight") &""" TYPE=""application/x-shockwave-flash"" PLUGINSPAGE=""http://www.macromedia.com/go/getflashplayer""></EMBED>"
			End If
		Else
			If InStr(1,LCase(FunAdsObj("AdRightPicPath")),"http://")<>0 then
				AdsTempStrRight="<a href="""&Web_ad_path2&"AdsClick.asp?Location="& FunLocation &""" target=_blank><img src="""& rootpath2&FunAdsObj("AdRightPicPath") &""" border=0 width="""& FunAdsObj("AdPicWidth") &""" height="""& FunAdsObj("AdPicHeight") &""" alt="""& FunAdsObj("AdCaptionTxt") &""" align=top></a>"
			Else
				AdsTempStrRight="<a href="""&Web_ad_path2&"AdsClick.asp?Location="& FunLocation &""" target=_blank><img src="""& rootpath2 & FunAdsObj("AdRightPicPath") &""" border=0 width="""& FunAdsObj("AdPicWidth") &""" height="""& FunAdsObj("AdPicHeight") &""" alt="""& FunAdsObj("AdCaptionTxt") &""" align=top></a>"
			End If
		End If
		FunAdsObj.close
		set FunAdsObj = nothing
	end function
  	        Sub rightflash(TempLocation)
			conndb
			Randomize
			Randomize_i_Str =  CStr(Int((999 * Rnd) + 1))
			ShowAdsLocation = clng(TempLocation)
			Set right_flash= Conn.Execute("select * from Web_AD where "&web_sql&" AdID="&TempLocation&"")
			pwidth=right_flash("AdPicWidth")
			pheight= right_flash("AdPicHeight")
			paddress=right_flash("AdPicPath")
			if CheckAd(right_flash)=False  then
				AdsJSStr = "document.write('');"
			else
				web_filepath=rootpath2&"systemad/Createjs/rightflash.js"
				AdsJSStr=AdsJSStr&GetFileContent(web_filepath)
				AdsJSStr =AdsJSStr&"document.write('<div id=""Layer"&Randomize_i_Str&""" style=""position:absolute; right:0px; top:0px; width:"""&pwidth&"""px; height:"""&pheight&"""px; z-index:99"">');"&vbCrLf
				AdsJSStr =AdsJSStr&"document.write('<embed src="""&rootpath2&paddress&""" width="""&pwidth&""" height="""&pheight&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" wmode=""transparent""></embed>');"&vbCrLf
				AdsJSStr =AdsJSStr&"document.write('</div>');"&vbCrLf      
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			ShowAdsLocation=Returnflag(TempLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& ShowAdsLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& ShowAdsLocation &".js")
			 end if
			c_filepath=rootpath2&"systemad/"& ShowAdsLocation &".js"
			call save_file( AdsJSStr,c_filepath)
			set MyFile=nothing
			right_flash.close
			Set right_flash = Nothing
		 End Sub
        Sub ShowAds(TempLocation)
		    dim ShowAdsStr,ShowAdsLocation,ShowAdsObj
			ShowAdsLocation = clng(TempLocation)
			AdsTempPicStr(ShowAdsLocation)
			ShowAdsStr = AdsTempStr
			Set ShowAdsObj = Conn.Execute("select * from Web_AD where "&web_sql&" AdID="&ShowAdsLocation&"")
			if CheckAd(ShowAdsObj)=False  then
				AdsJSStr = "document.write('');"
			else
				AdsJSStr = "document.write('"& ShowAdsStr &"');" & vbCrLf & _
				           "document.write('<script src="&rootpath2&"systemad/show.asp?Location="&ShowAdsLocation&"></script>');"
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			'response.write Server.MapPath(Web_ad_path)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			ShowAdsLocation=Returnflag(ShowAdsLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& ShowAdsLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& ShowAdsLocation &".js")
			 end if
			c_filepath=rootpath2&"systemad/"& ShowAdsLocation &".js"
			call save_file( AdsJSStr,c_filepath)
				set MyFile=nothing
			ShowAdsObj.close
			Set ShowAdsObj = Nothing
		 End Sub
		 
		 Sub NewWindow(TempLocation)
		    dim NewWindowObj,NewWindowLocation,dialogConent,dialogConent1 ,sUrl
			NewWindowLocation = clng(TempLocation)
			Set NewWindowObj = Conn.Execute("select * from Web_AD where "&web_sql&" AdID="&NewWindowLocation&"")
			If CheckAd(NewWindowObj)=True Then
				If Instr(1,LCase(NewWindowObj("AdPicPath")),"http://") <> 0 then
					AdsJSStr = "window.open('"&rootpath2&"systemad/showphoto.asp?pic="&NewWindowLocation&"','','width="& NewWindowObj("AdPicWidth") &",height="& NewWindowObj("AdPicHeight") &",scrollbars=1');"
				Else
					AdsJSStr = "window.open('"&rootpath2&"systemad/showphoto.asp?pic="&NewWindowLocation&"','','width="& NewWindowObj("AdPicWidth") &",height="& NewWindowObj("AdPicHeight") &",scrollbars=1');" & vbCrLf & _
					"document.write('<script src="&rootpath2&"systemad/show.asp?Location="&NewWindowLocation&"></script>');"
				End If
			Else
				AdsJSStr="document.write('');"
			End If
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			NewWindowLocation=Returnflag(NewWindowLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& NewWindowLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& NewWindowLocation &".js")
			 end if
			
				c_filepath=rootpath2&"systemad/"&NewWindowLocation&".js"
			
		
			call save_file( AdsJSStr,c_filepath)
				set MyFile=Nothing
			NewWindowObj.close
			Set NewWindowObj = Nothing
		 End Sub
		 
		 Sub OpenWindow(TempLocation)
		    dim OpenWindowObj,OpenWindowLocation
			OpenWindowLocation = clng(TempLocation)
			Set OpenWindowObj = Conn.Execute("select * from Web_AD where "&web_sql&" AdID="&OpenWindowLocation&"")
			If 	CheckAd(OpenWindowObj)=True Then
				AdsJSStr = "window.open('"&rootpath2&"systemad/showphoto.asp?pic="&OpenWindowLocation&"','_blank');"
			Else
				AdsJSStr="document.write('');"
			End If
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				response.write Server.MapPath(Web_ad_path)
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			OpenWindowLocation=Returnflag(OpenWindowLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& OpenWindowLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& OpenWindowLocation &".js")
			 end if
				c_filepath=rootpath2&"systemad/"&OpenWindowLocation&".js"
			call save_file( AdsJSStr,c_filepath)
				set MyFile=nothing
			OpenWindowObj.close
			Set OpenWindowObj = Nothing
		 End Sub
		 
		 Sub FilterAway(TempLocation)
		    dim FilterAwayStr,FilterAwayLocation,FilterAwayObj
			FilterAwayLocation = clng(TempLocation)
			AdsTempPicStr(FilterAwayLocation)
			FilterAwayStr = AdsTempStr
			Set FilterAwayObj = Conn.Execute("select * from Web_AD where  "&web_sql&" AdID="&FilterAwayLocation&"")
			if CheckAd(FilterAwayObj)=False then
				AdsJSStr = "document.write('');"
			else
				AdsJSStr = "FilterAwayStr=(document.layers)?true:false;" & vbCrLf & _
						   "if(FilterAwayStr){document.write('<layer id=FilterAwayT onLoad=""moveToAbsolute(layer1.pageX-160,layer1.pageY);clip.height="& FilterAwayObj("AdPicHeight") &";clip.width="& FilterAwayObj("AdPicWidth") &"; visibility=show;""><layer id=FilterAwayF position:absolute; bottom:20; center:1>"& FilterAwayStr &"</layer></layer>');}" & vbCrLf & _
						   "else{document.write('<div style=""position:absolute;bottom:"& cint(FilterAwayObj("AdPicHeight")+20) &"; center:1;""><div id=FilterAwayT style=""position:absolute; width:"& FilterAwayObj("AdPicWidth") &"; height:"& FilterAwayObj("AdPicHeight") &";clip:rect(0,"& FilterAwayObj("AdPicWidth") &","& FilterAwayObj("AdPicHeight") &",0)""><div id=FilterAwayF style=""position:absolute;bottom:20; center:1"">"& FilterAwayStr &"</div></div></div>');} " & vbCrLf & _
						   "document.write('<script language=javascript src="&rootpath2&"systemad/CreateJs/FilterAway.js></script>');" & vbCrLf & _
				           "document.write('<script src="&Wrootpath2&"systemad/show.asp?Location="&FilterAwayLocation&"></script>');"
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			FilterAwayLocation=Returnflag(FilterAwayLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& FilterAwayLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& FilterAwayLocation &".js")
			 end if

				c_filepath=rootpath2&"systemad/"&FilterAwayLocation&".js"

			call save_file( AdsJSStr,c_filepath)
				set MyFile=nothing
			FilterAwayObj.close
			Set FilterAwayObj = Nothing
		 End Sub
		 
		 Sub DialogBox(TempLocation)
		    dim DialogBoxObj,DialogBoxLocation
			DialogBoxLocation = clng(TempLocation)
			Set DialogBoxObj = Conn.Execute("select * from Web_AD where "&web_sql&" AdID="&DialogBoxLocation&"")
			if CheckAd(DialogBoxObj)=False then
				AdsJSStr = "document.write('');"
			else
				AdsJSStr = "window.showModalDialog('"&rootpath2&"systemad/showphoto.asp?pic="&DialogBoxLocation&"','','dialogWidth:"& DialogBoxObj("AdPicWidth")+10 &"px;dialogHeight:"& DialogBoxObj("AdPicHeight")+30 &"px;center:0;status:no');"
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			DialogBoxLocation=Returnflag(DialogBoxLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& DialogBoxLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& DialogBoxLocation &".js")
			 end if
		
				c_filepath=rootpath2&"systemad/"&DialogBoxLocation&".js"
			
			
			call save_file( AdsJSStr,c_filepath)
				set MyFile=nothing
		 	DialogBoxObj.Close
			Set DialogBoxObj = Nothing
		 End Sub
		 
		 Sub ClarityBox(TempLocation)
		    dim ClarityBoxObj,ClarityBoxLocation,ClarityBoxStr
			ClarityBoxLocation = clng(TempLocation)
			AdsTempPicStr(ClarityBoxLocation)
			ClarityBoxStr = AdsTempStr
			Set ClarityBoxObj = Conn.Execute("select * from Web_AD where  "&web_sql&" AdID="&ClarityBoxLocation&"")
			if CheckAd(ClarityBoxObj)=False then
				AdsJSStr = "document.write('');"
			else
				AdsJSStr = "document.write('<script language=javascript src="&rootpath2&"systemad/CreateJs/ClarityBox.js></script>'); " & vbCrLf & _
						   "document.write('<div style=""position:absolute;left:300px;top:150px;width:"& ClarityBoxObj("AdPicWidth") &"; height:"& ClarityBoxObj("AdPicHeight") &";z-index:1;solid;filter:alpha(opacity=90)"" id=ClarityBoxID onmousedown=""ClarityBox(this)"" onmousemove=""ClarityBoxMove(this)"" onMouseOut=""down=false"" onmouseup=""down=false""><table cellpadding=0 border=0 cellspacing=1 width="& ClarityBoxObj("AdPicWidth") &" height="& cint(ClarityBoxObj("AdPicHeight")+20) &" bgcolor=#000000><tr><td height=20 align=right style=""cursor:move;""><a href=# style=""font-size: 9pt; color: white; text-decoration: none"" onClick=ClarityBoxclose(""ClarityBoxID"") >>>关闭>></a></td></tr><tr><td>"&ClarityBoxStr&"</td></tr></table></div>');" & vbCrLf & _
				           "document.write('<script src="&rootpath2&"systemad/show.asp?Location="&ClarityBoxLocation&"></script>');"
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			ClarityBoxLocation=Returnflag(ClarityBoxLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& ClarityBoxLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& ClarityBoxLocation &".js")
			 end if

				c_filepath=rootpath2&"systemad/"&ClarityBoxLocation&".js"


			call save_file( AdsJSStr,c_filepath)
				set MyFile=nothing
			ClarityBoxObj.close
			Set ClarityBoxObj = Nothing
		 End Sub
		 
		 Sub RightBottom(TempLocation)
		    dim RightBottomStr,RightBottomLocation,RightBottomObj
			RightBottomLocation = clng(TempLocation)
			AdsTempPicStr(RightBottomLocation)
			RightBottomStr = AdsTempStr
			Set RightBottomObj = Conn.Execute("select * from Web_AD where  "&web_sql&" AdID="&RightBottomLocation&"")
			if CheckAd(RightBottomObj)=False then
				AdsJSStr = "document.write('');"
			else
				AdsJSStr = "if (navigator.appName == 'Netscape')" & vbCrLf & _
						   "{document.write('<layer id=RightBottom top=150 width="& RightBottomObj("AdPicWidth") &" height="& RightBottomObj("AdPicHeight") &">"& RightBottomStr &"</layer>');}" & vbCrLf & _
						   "else{document.write('<div id=RightBottom style=""position: absolute;width:"& RightBottomObj("AdPicWidth") &";height:"& RightBottomObj("AdPicHeight") &";visibility: visible;z-index: 1"">"& RightBottomStr &"</div>');}" & vbCrLf & _
						   "document.write('<script language=javascript src="&rootpath2&"systemad/CreateJs/RightBottom.js></script>');" & vbCrLf & _
				           "document.write('<script src="&rootpath2&"systemad/show.asp?Location="&RightBottomLocation&"></script>');"
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			RightBottomLocation=Returnflag(RightBottomLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& RightBottomLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& RightBottomLocation &".js")
			 end if

				c_filepath=rootpath2&"systemad/"&RightBottomLocation& ".js"
			
				
 				call  save_file(AdsJSStr,c_filepath)
				set MyFile=nothing
			RightBottomObj.close
			Set RightBottomObj = Nothing
		 End Sub
		 
		 Sub DriftBox(TempLocation)
		    dim DriftBoxStr,DriftBoxLocation,DriftBoxObj
			DriftBoxLocation = clng(TempLocation)
			AdsTempPicStr(DriftBoxLocation)
			DriftBoxStr = AdsTempStr
			Set DriftBoxObj = Conn.Execute("select * from Web_AD where "&web_sql&" AdID="&DriftBoxLocation&"")
			if CheckAd(DriftBoxObj)=False then
				AdsJSStr = "document.write('');"
			else
				AdsJSStr = "DriftBoxStr=(document.layers)?true:false;" & vbCrLf & _
						   "if(DriftBoxStr){document.write('<layer id=DriftBox width="& DriftBoxObj("AdPicWidth") &" height="& DriftBoxObj("AdPicHeight") &" onmouseover=DriftBoxSM(""DriftBox"") onmouseout=movechip(""DriftBox"")>"& DriftBoxStr &"</layer>');}" & vbCrLf & _
						   "else{document.write('<div id=DriftBox style=""position:absolute; width:"& DriftBoxObj("AdPicWidth") &"px; height:"& DriftBoxObj("AdPicHeight") &"px; z-index:9; filter: Alpha(Opacity=90)"" onmouseover=DriftBoxSM(""DriftBox"") onmouseout=movechip(""DriftBox"")>"& DriftBoxStr &"</div>');}" & vbCrLf & _
						   "document.write('<script language=javascript src="&rootpath2&"systemad/CreateJs/DriftBox.js></script>');" & vbCrLf & _
				           "document.write('<script src="&rootpath2&"systemad/show.asp?Location="&DriftBoxLocation&"></script>');"
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			DriftBoxLocation=Returnflag(DriftBoxLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& DriftBoxLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& DriftBoxLocation &".js")
			 end if
		
				c_filepath=rootpath2&"systemad/"&DriftBoxLocation&".js"
			
			
 				call  save_file(AdsJSStr,c_filepath)
				set MyFile=nothing
			DriftBoxObj.close
			Set DriftBoxObj = Nothing
		 End Sub
		 
		 Sub LeftBottom(TempLocation)
		    dim LeftBottomStr,LeftBottomLocation,LeftBottomObj
			LeftBottomLocation = clng(TempLocation)
			AdsTempPicStr(LeftBottomLocation)
			LeftBottomStr = AdsTempStr
			Set LeftBottomObj = Conn.Execute("select * from Web_AD where  "&web_sql&" AdID="&LeftBottomLocation&"")
			if CheckAd(LeftBottomObj)=False then
				AdsJSStr = "document.write('');"
			else
				AdsJSStr = "if (navigator.appName == 'Netscape')" & vbCrLf & _
						   "{document.write('<layer id=LeftBottom top=150 width="& LeftBottomObj("AdPicWidth") &" height="& LeftBottomObj("AdPicHeight") &">"& LeftBottomStr &"</layer>');}" & vbCrLf & _
						   "else{document.write('<div id=LeftBottom style=""position: absolute;width:"& LeftBottomObj("AdPicWidth") &";height:"& LeftBottomObj("AdPicHeight") &";visibility: visible;z-index: 1"">"& LeftBottomStr &"</div>');}" & vbCrLf & _
						   "document.write('<script language=javascript src="&rootpath2&"systemad/CreateJs/LeftBottom.js></script>');" & vbCrLf & _
				           "document.write('<script src="&rootpath2&"systemad/show.asp?Location="&LeftBottomLocation&"></script>');"
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			LeftBottomLocation=Returnflag(LeftBottomLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& LeftBottomLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& LeftBottomLocation &".js")
			 end if
			
				c_filepath=rootpath2&"systemad/"&LeftBottomLocation&".js"
			
			
 				call  save_file(AdsJSStr,c_filepath)
				set MyFile=nothing
			LeftBottomObj.close
			Set LeftBottomObj = Nothing
		 End Sub
		 
		 Sub Couplet(TempLocation)
		    dim CoupletLeftStr,CoupletLocation,CoupletRightStr,CoupletObj
			CoupletLocation = clng(TempLocation)
			AdsTempPicStr(CoupletLocation)
			CoupletLeftStr = AdsTempStr
			CoupletRightStr = AdsTempStrRight
			Set CoupletObj = Conn.Execute("select * from Web_AD where "&web_sql&" AdID="&CoupletLocation&"")
			if CheckAd(CoupletObj)=False then
				AdsJSStr = "document.write('');"
			else
				AdsJSStr =  "function winload()" & vbCrLf & _
							"{" & vbCrLf & _
							"AdsLayerLeft.style.top=20;" & vbCrLf & _
							"AdsLayerLeft.style.left=5;" & vbCrLf & _
							"AdsLayerRight.style.top=20;" & vbCrLf & _
							"AdsLayerRight.style.right=5;" & vbCrLf & _
							"}" & vbCrLf & _
							"if(screen.availWidth>800){" & vbCrLf & _
							"{" & vbCrLf & _
							"document.write('<div id=AdsLayerLeft style=""position: absolute;visibility:visible;z-index:1""><table width=100  border=0 cellspacing=0 cellpadding=0><tr><td>" & CoupletLeftStr & "</td></tr></table></div>'" & vbCrLf & _
							"+'<div id=AdsLayerRight style=""position: absolute;visibility:visible;z-index:1""><table width=100  border=0 cellspacing=0 cellpadding=0><tr><td>" & CoupletRightStr & "</td></tr></table></div>');" & vbCrLf & _
							"}" & vbCrLf & _
							"document.write('<script language=javascript src="&rootpath2&"systemad/CreateJs/Couplet.js></script>');" & vbCrLf & _
							"winload()" & vbCrLf & _
							"}" & vbCrLf & _
				           "document.write('<script src="&rootpath2&"systemad/show.asp?Location="&CoupletLocation&"></script>');"
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			CoupletLocation =Returnflag(CoupletLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& CoupletLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& CoupletLocation &".js")
			 end if
		
				c_filepath=rootpath2&"systemad/"&CoupletLocation&".js"
			
				'response.write c_filepath
				'response.end
 				call  save_file(AdsJSStr,c_filepath)
				set MyFile=nothing
			CoupletObj.close
			Set CoupletObj = Nothing
		 End Sub
		 Sub floatdouble(TempLocation)
		    dim CoupletLeftStr,CoupletLocation,CoupletRightStr,CoupletObj
			CoupletLocation = clng(TempLocation)
			AdsTempPicStr(CoupletLocation)
			CoupletLeftStr = AdsTempStr
			CoupletRightStr = AdsTempStrRight
			Set CoupletObj = Conn.Execute("select * from Web_AD where "&web_sql&" AdID="&CoupletLocation&"")
			if CheckAd(CoupletObj)=False then
				AdsJSStr = "document.write('');"
			else
				AdsJSStr =  "var lpic='"&rootpath2&""&CoupletObj("AdPicPath")&"';"& vbCrLf & _
					    "var lurl='"&CoupletObj("AdLinkAdress")&"';"& vbCrLf & _
					    "var rpic='"&rootpath2&""&CoupletObj("AdRightPicPath")&"';"& vbCrLf & _
					    "var rurl='"&CoupletObj("AdLinkAdress")&"';" & vbCrLf & _
					    "document.write('<script language=javascript src="&rootpath2&"systemad/CreateJs/doublefloat.js></script>');" & vbCrLf & _
				           "document.write('<script src="&rootpath2&"systemad/show.asp?Location="&CoupletLocation&"></script>');"
			end if
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			CoupletLocation =Returnflag(CoupletLocation)
			 if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& CoupletLocation &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& CoupletLocation &".js")
			 end if
		
				c_filepath=rootpath2&"systemad/"&CoupletLocation &".js"
			

 				call  save_file(AdsJSStr,c_filepath)
				set MyFile=nothing
			CoupletObj.close
			Set CoupletObj = Nothing
		 End Sub
		 
		

'############################################################################################################
'随即变换广告
'############################################################################################################
Sub CreateRandomize(adid)
		
	 		Conndb
			set rshdp=Server.CreateObject("adodb.recordset")
			sql="select * from web_ad where  adid="&adid&""
			rshdp.open sql,conn,1,3
			pwidth=rshdp("AdPicWidth")
			pheight=rshdp("AdPicHeight")
			picname=split(rshdp("adhdpdetail"),"$$")(0)
			picUrl=split(rshdp("adhdpdetail"),"$$")(1)
			picAddress=split(rshdp("adhdpdetail"),"$$")(2)
			vnum=split(picname,"|")
			tcount=UBound(vnum)+1
			AdsJSStr =AdsJSStr&"var how_many_ads = "&tcount-1&" ;" & vbCrLf 
			AdsJSStr =AdsJSStr&"var now = new Date() ;" & vbCrLf 
			AdsJSStr =AdsJSStr&"var sec = now.getSeconds() ;" & vbCrLf 
			AdsJSStr =AdsJSStr&"var ad = sec % how_many_ads; ;" & vbCrLf 
			AdsJSStr =AdsJSStr&"ad +=1; ;" & vbCrLf 
 

			for ii=1 to UBound(vnum)
				AdsJSStr =AdsJSStr&"if (ad=="&ii&"){ " & vbCrLf
				AdsJSStr =AdsJSStr&"url="""&split(picUrl,"|")(ii)&"""; " & vbCrLf
				AdsJSStr =AdsJSStr&"alt="""&split(picname,"|")(ii)&""";  " & vbCrLf
				AdsJSStr =AdsJSStr&"banner="""&rootpath2&split(picAddress,"|")(ii)&"""; " & vbCrLf
				AdsJSStr =AdsJSStr&"width="""&pwidth&"""; " & vbCrLf
				AdsJSStr =AdsJSStr&"height="""&pheight&"""; " & vbCrLf
				AdsJSStr =AdsJSStr&"} " & vbCrLf
			next

			AdsJSStr =AdsJSStr&"document.write('<center>'); " & vbCrLf 
			AdsJSStr =AdsJSStr&"document.write('<a href=\""' + url + '\"" target=\""_blank\"">');"& vbCrLf 
			AdsJSStr =AdsJSStr&"document.write('<img src=\""' + banner + '\"" width='); "& vbCrLf 
			AdsJSStr =AdsJSStr&"document.write(width + ' height=' + height + ' '); "& vbCrLf 
			AdsJSStr =AdsJSStr&"document.write('alt=\""' + alt + '\"" border=0><br>'); "
			AdsJSStr =AdsJSStr&"document.write('</center>'); "

			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(AdsJSStr,c_filepath)
			set MyFile=nothing
		 End Sub
'############################################################################################################
'固定文字广告
'############################################################################################################
 Sub CreateText (adid)
	     	Conndb
		Randomize
		Randomize_i_Str =  CStr(Int((999 * Rnd) + 1))
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
			pwidth=rshdp("AdPicWidth")
			pheight=rshdp("AdPicHeight")
			lineheight=rshdp("adhdptxth")
			picname=split(rshdp("adhdpdetail"),"$$")(0)
			picUrl=split(rshdp("adhdpdetail"),"$$")(1)
			picAddress=split(rshdp("adhdpdetail"),"$$")(2)
			vnum=split(picname,"|")
			tcount=UBound(vnum)+1
			tmp=split(rshdp("adhdpdetail"),"$$")
			for i=0 to ubound(tmp)
				picname=tmp(0)
				picAddress=tmp(2)
				picUrl=tmp(1)
			next
				FlashStr=FlashStr&"document.write('<div style=""height:"&pheight&"px; width:"&pwidth&"px;overflow:hidden""> ');"&vbCrLf 
				FlashStr=FlashStr&"document.write('<table width=""100%"" border=""0"" cellspacing=""0"" cellSpacing=""0"" cellPadding=""0"">');"&vbCrLf 
				for ii=0 to UBound(vnum)
					FlashStr=FlashStr&"document.write('<tr><td height="""&lineheight&""" align=""center""><a href="""&split(picUrl,"|")(ii)&""" target=""_blank"">"&split(picname,"|")(ii)&"</a></td></tr>');"&vbCrLf 
				next
				FlashStr=FlashStr&"document.write('</table>');"&vbCrLf 
				FlashStr=FlashStr&"document.write('</div>');"&vbCrLf 

			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
		 End Sub
'############################################################################################################
 'xml幻灯广告
'############################################################################################################
Sub Createhdpxml (adid)
		web_adid=adid
	     	Conndb
		Randomize
		Randomize_i_Str =  CStr(Int((999 * Rnd) + 1))
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
				onlyid=rshdp("adonlyid")
				pwidth=rshdp("AdPicWidth")
				pheight=rshdp("AdPicHeight")
				lineheight=rshdp("adhdptxth")
				FlashStr="var swf_width="&pwidth&";"&vbCrLf
				FlashStr=FlashStr&"var swf_height="&pheight&";"&vbCrLf
				FlashStr=FlashStr&"var swf_config=""|4|||0xFFFFFF|0xFF6600||4|3|1|_blank"";"&vbCrLf
				FlashStr=FlashStr&"document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width=""'+ swf_width +'"" height=""'+ swf_height +'"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<param name=""movie"" value="""&rootpath2&"systemad/flash/bcastr.swf?bcastr_xml_url="&onlyid&".xml "">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<param name=""quality"" value=""high"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<param name=""menu"" value=""false"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<param name=""FlashVars"" value=""bcastr_config='+swf_config+'"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<embed src="""&rootpath2&"systemad/flash/bcastr.swf?bcastr_xml_url="&onlyid&".xml""   FlashVars=""bcastr_config='+swf_config+'""  wmode=""opaque"" FlashVars=""bcastr_config='+swf_config+'""  menu=""false"" quality=""high"" width=""'+ swf_width +'"" height=""'+ swf_height +'"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" />');"&vbCrLf 
				FlashStr=FlashStr&"document.write('</object>');"&vbCrLf 

			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
			call createxml(web_adid)
 End Sub

 sub createxml(adid)
	conndb
	set rshdp=Server.CreateObject("adodb.recordset")
	sql="select * from web_ad where  adid="&adid&""
	rshdp.open sql,conn,1,3
	onlyid=rshdp("adonlyid")
	picname=split(rshdp("adhdpdetail"),"$$")(0)
	picUrl=split(rshdp("adhdpdetail"),"$$")(1)
	picAddress=split(rshdp("adhdpdetail"),"$$")(2)
	vnum=split(picname,"|")
	tcount=UBound(vnum)+1
	FlashStr="<?xml version=""1.0"" encoding=""utf-8""?>"& vbCrLf 
 	FlashStr=FlashStr&"<bcaster>"& vbCrLf 
	for ii=0 to UBound(vnum)
		FlashStr2=FlashStr2&"<item item_url="""&rootpath2&split(picAddress,"|")(ii)&""" link="""&split(picUrl,"|")(ii)&""" />"& vbCrLf 
	next
	FlashStr=FlashStr&FlashStr2&"</bcaster>"& vbCrLf 
	Set MyFile=Server.CreateObject(C_Web_FSO)
	if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& onlyid &".xml")
	end if
	c_filepath=rootpath2&onlyid &".xml"
	call save_file(FlashStr,c_filepath)
	set MyFile=nothing
 end sub
'############################################################################################################
 '循环滚动图片广告
'############################################################################################################
 Sub CreatepicText (adid)
	     	Conndb
		Randomize
		Randomize_i_Str =  CStr(Int((999 * Rnd) + 1))
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
			pwidth=rshdp("AdPicWidth")
			pheight=rshdp("AdPicHeight")
			lineheight=rshdp("adhdptxth")
			picname=split(rshdp("adhdpdetail"),"$$")(0)
			picUrl=split(rshdp("adhdpdetail"),"$$")(1)
			picAddress=split(rshdp("adhdpdetail"),"$$")(2)
			vnum=split(picname,"|")
			tcount=UBound(vnum)+1
			tmp=split(rshdp("adhdpdetail"),"$$")
			for i=0 to ubound(tmp)
				picname=tmp(0)
				picAddress=tmp(2)
				picUrl=tmp(1)
			next
				web_filepath=rootpath2&"systemad/Createjs/scroll_word_pic.js"
				FlashStr=FlashStr&GetFileContent(web_filepath)
				FlashStr=FlashStr&"document.write('<div id=""scroollBox"&Randomize_i_Str&""" >');" & vbCrLf
				FlashStr=FlashStr&"document.write('<div id=""scroollBody"&Randomize_i_Str&""">');" & vbCrLf 
				
				FlashStr=FlashStr&"document.write('<span id=""infozone"&Randomize_i_Str&""">');"&vbCrLf 
				for ii=0 to UBound(vnum)
					web_webstring=""
					FlashStr=FlashStr&"document.write('<div><a href="""&split(picUrl,"|")(ii)&""" target=""_blank""><img src="""&rootpath2&""&split(picAddress,"|")(ii)&"""></a></div>');"&vbCrLf 
				next
				FlashStr=FlashStr&"document.write('</div></div>');"&vbCrLf 
				FlashStr=FlashStr&"var sample"&Randomize_i_Str&" = new ScrollObj(""scroollBody"&Randomize_i_Str&""",""scroollBox"&Randomize_i_Str&""","&pheight&","&pwidth&","&lineheight&",50,50);"&vbCrLf 

			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
		 End Sub
'############################################################################################################
 '循环滚动文字广告
'############################################################################################################
 	Sub CreatewordText (adid)
	     	Conndb
		Randomize
		Randomize_i_Str =  CStr(Int((999 * Rnd) + 1))
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
			pwidth=rshdp("AdPicWidth")
			pheight=rshdp("AdPicHeight")
			lineheight=rshdp("adhdptxth")
			picname=split(rshdp("adhdpdetail"),"$$")(0)
			picUrl=split(rshdp("adhdpdetail"),"$$")(1)
			picAddress=split(rshdp("adhdpdetail"),"$$")(2)
			vnum=split(picname,"|")
			tcount=UBound(vnum)+1
			tmp=split(rshdp("adhdpdetail"),"$$")
			for i=0 to ubound(tmp)
				picname=tmp(0)
				picAddress=tmp(2)
				picUrl=tmp(1)
			next
				web_filepath=rootpath2&"systemad/Createjs/scroll_word_pic.js"
				FlashStr=FlashStr&GetFileContent(web_filepath)
				FlashStr=FlashStr&"document.write('<div id=""scroollBox"&Randomize_i_Str&""" >');" & vbCrLf
				FlashStr=FlashStr&"document.write('<div id=""scroollBody"&Randomize_i_Str&""">');" & vbCrLf 
				for ii=0 to UBound(vnum)
					web_webstring=""
					FlashStr=FlashStr&"document.write('<a href="""&split(picUrl,"|")(ii)&""" target=""_blank"">"&split(picname,"|")(ii)&"</a><br>');"&vbCrLf 
				next
				FlashStr=FlashStr&"document.write('</div></div>');"&vbCrLf 
				FlashStr=FlashStr&"var sample"&Randomize_i_Str&" = new ScrollObj(""scroollBody"&Randomize_i_Str&""",""scroollBox"&Randomize_i_Str&""","&pheight&","&pwidth&","&lineheight&",50,50);"&vbCrLf 

			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
		 End Sub
'############################################################################################################
 'flash视频播放
'############################################################################################################
	 Sub Createflashvideo (adid)
	     	Conndb
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
			pwidth=rshdp("AdPicWidth")
			pheight=rshdp("AdPicHeight")
			picname=split(rshdp("adhdpdetail"),"$$")(0)
			picUrl=split(rshdp("adhdpdetail"),"$$")(1)
			picAddress=split(rshdp("adhdpdetail"),"$$")(2)
			vnum=split(picname,"|")
			tcount=UBound(vnum)+1
			tmp=split(rshdp("adhdpdetail"),"$$")
			for i=0 to ubound(tmp)
				picname=tmp(0)
				picAddress=tmp(2)
				picUrl=tmp(1)
			next
			picAddress1=split(picAddress,"|")
			for ii=0 to ubound(picAddress1)
				picadd=picadd&"|"&picAddress1(ii)
			next
			PicAdd1=replace(picadd,"|","",1,1)
			picname1=split(picname,"|")
			for iii=0 to ubound(picname1)
				picname_1=picname_1&"|"&picname1(iii)
			next
			Picname_11=replace(picname_1,"|","",1,1)
				FlashStr="var swf_width="&pwidth&";"&vbCrLf
				FlashStr=FlashStr&"var swf_height="&pheight&";"&vbCrLf
				FlashStr=FlashStr&"var texts='"&Picname_11&"';"&vbCrLf
				FlashStr=FlashStr&"var files='"&PicAdd1&"';"&vbCrLf
				FlashStr=FlashStr&"document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width=""'+ swf_width +'"" height=""'+ swf_height +'"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<param name=""movie"" value="""&rootpath2&"systemad/flash/vcastr.swf"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<<param name=""quality"" value=""high"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<param name=""menu"" value=""false"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<param name=wmode value=""opaque"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<param name=""FlashVars"" value=""vcastr_file='+files+'&vcastr_title='+texts+'"">');"&vbCrLf
				FlashStr=FlashStr&"document.write('<embed src="""&rootpath2&"systemad/flash/vcastr.swf"" wmode=""opaque"" FlashVars=""vcastr_file='+files+'&vcastr_title='+texts+'& menu=""false"" quality=""high"" width=""'+ swf_width +'"" height=""'+ swf_height +'"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" />');"&vbCrLf 
				FlashStr=FlashStr&"document.write('</object>');"&vbCrLf 

			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
		 End Sub

'############################################################################################################
 'flash幻灯片
'############################################################################################################
	sub Createflashhdp(adid)
	     	 Conndb
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
			pwidth=rshdp("AdPicWidth")
			pheight=rshdp("AdPicHeight")
			picname=split(rshdp("adhdpdetail"),"$$")(0)
			picUrl=split(rshdp("adhdpdetail"),"$$")(1)
			picAddress=split(rshdp("adhdpdetail"),"$$")(2)
			vnum=split(picname,"|")
			tcount=UBound(vnum)+1
			tmp=split(rshdp("adhdpdetail"),"$$")
			for i=0 to ubound(tmp)
				picname=tmp(0)
				picAddress=tmp(2)
				picUrl=tmp(1)
			next
			picAddress1=split(picAddress,"|")
			for ii=0 to ubound(picAddress1)
				picadd=picadd&"|"&rootpath2&picAddress1(ii)
			next
			PicAdd1=replace(picadd,"|","",1,1)
			FlashStr=FlashStr&"document.write('<script language=javascript src="&rootpath2&"systemad/CreateJs/flashobject.js></script>');" & vbCrLf
			FlashStr=FlashStr&"document.write('<div id=flashcontent><a href=""http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;promoid=BIOW"">');" & vbCrLf
 			FlashStr=FlashStr&"document.write('<img src=""tab1.files/getflash.gif"" border=0 /></a>');" & vbCrLf
 			FlashStr=FlashStr&"document.write('<object codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 height="&pheight&" width="&pwidth&" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>');" & vbCrLf
  			FlashStr=FlashStr&"document.write('<param name=""quality"" value=""high"" />');" & vbCrLf
   			FlashStr=FlashStr&"document.write('<param name=""movie"" value="""&rootpath2&"systemad/flash/focus_1.swf"" />');" & vbCrLf
    			FlashStr=FlashStr&"document.write('<embed src="""&rootpath2&"systemad/flash/focus_1.swf"" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width=""40"" height=""100""></embed>');" & vbCrLf
   			FlashStr=FlashStr&"document.write('</object>');" & vbCrLf
			FlashStr=FlashStr&"document.write('</div>');" & vbCrLf
			FlashStr=FlashStr&"var fo = new FlashObject("""&rootpath2&"systemad/flash/focus_1.swf"", ""focus"", """&pwidth&""", """&pheight&""", ""7"", ""#ff0000"");" & vbCrLf
    			FlashStr=FlashStr&"fo.addParam(""quality"", ""high"");" & vbCrLf
   			FlashStr=FlashStr&"fo.addParam(""menu"",""false"");" & vbCrLf
    			FlashStr=FlashStr&"fo.addParam(""wmode"", ""transparent"");" & vbCrLf
    			FlashStr=FlashStr&"fo.addVariable(""pics"", '"&PicAdd1&"');" & vbCrLf
    			FlashStr=FlashStr&"fo.addVariable(""links"", '"&picUrl&"');" & vbCrLf
    			FlashStr=FlashStr&"fo.addVariable(""texts"", '"&picname&"');" & vbCrLf
    			FlashStr=FlashStr&"fo.write(""flashcontent"");" & vbCrLf


			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
		 End Sub
  	Sub Createjshdp(adid)
		
	 		Conndb
			set rshdp=Server.CreateObject("adodb.recordset")
			sql="select * from web_ad where  adid="&adid&""
			rshdp.open sql,conn,1,3
			pwidth=rshdp("AdPicWidth")
			pheight=rshdp("AdPicHeight")
			picname=split(rshdp("adhdpdetail"),"$$")(0)
			picUrl=split(rshdp("adhdpdetail"),"$$")(1)
			picAddress=split(rshdp("adhdpdetail"),"$$")(2)
			vnum=split(picname,"|")
			tcount=UBound(vnum)+1
			
				AdsJSStr =AdsJSStr&"var roll_image = new Array;" & vbCrLf 
				AdsJSStr =AdsJSStr&"var image_link = new Array;" & vbCrLf 
				AdsJSStr =AdsJSStr&"var small_img = new Array;" & vbCrLf 
			for ii=0 to UBound(vnum)
				AdsJSStr =AdsJSStr&"roll_image["&ii&"] = '"&rootpath2&""&split(picAddress,"|")(ii)&"';" & vbCrLf 
				AdsJSStr =AdsJSStr&"image_link["&ii&"] = '"&split(picUrl,"|")(ii)&"';" & vbCrLf 
				AdsJSStr =AdsJSStr&"small_img["&ii&"] = '"&rootpath2&"systemad/images/main_flash_button"&ii+1&"_on.gif';" & vbCrLf 
			next
			AdsJSStr =AdsJSStr&"var cliImg = '';"& vbCrLf 
			AdsJSStr =AdsJSStr&"var cliImgSrc = '';"& vbCrLf 
			AdsJSStr =AdsJSStr&"var imgNo = Math.round(Math.random() * "&tcount&");"& vbCrLf 

			AdsJSStr =AdsJSStr&"var interval = 3000;"& vbCrLf 
			AdsJSStr =AdsJSStr&"var setTime = '';"& vbCrLf 
			AdsJSStr =AdsJSStr&"function click_simg(ci, no){"& vbCrLf 
			AdsJSStr =AdsJSStr&" var pImg = document.all.bigimg;"& vbCrLf 
			AdsJSStr =AdsJSStr&"var pLink = document.all.imglink;"& vbCrLf 

			AdsJSStr =AdsJSStr&"if(cliImg == '') {"& vbCrLf 
			AdsJSStr =AdsJSStr&"  cliImg = ci;"& vbCrLf 
			AdsJSStr =AdsJSStr&" cliImgSrc = ci.src;"& vbCrLf 
			AdsJSStr =AdsJSStr&" ci.src = small_img[no];"& vbCrLf 
			AdsJSStr =AdsJSStr&" imgNo=no;"& vbCrLf 
			AdsJSStr =AdsJSStr&" pImg.src =roll_image[no];"& vbCrLf 
			AdsJSStr =AdsJSStr&" pLink.href = image_link[no];"& vbCrLf 
			AdsJSStr =AdsJSStr&"} else if(cliImg != ci) {"& vbCrLf 
			AdsJSStr =AdsJSStr&" cliImg.src = cliImgSrc;"& vbCrLf 
			AdsJSStr =AdsJSStr&" cliImg = ci;"& vbCrLf 
			AdsJSStr =AdsJSStr&" cliImgSrc = ci.src;"& vbCrLf 
			AdsJSStr =AdsJSStr&" ci.src = small_img[no];"& vbCrLf 
			AdsJSStr =AdsJSStr&" imgNo=no;"& vbCrLf 
			AdsJSStr =AdsJSStr&" pImg.src =roll_image[no];"& vbCrLf 
			AdsJSStr =AdsJSStr&" pLink.href = image_link[no];"& vbCrLf 
			AdsJSStr =AdsJSStr&"}"& vbCrLf 
			AdsJSStr =AdsJSStr&" clearTimeout(setTime);"& vbCrLf 
			AdsJSStr =AdsJSStr&"setTime=setTimeout(""rotate()"",interval);"& vbCrLf 
			AdsJSStr =AdsJSStr&"}"& vbCrLf 

			AdsJSStr =AdsJSStr&"function rotate(){"& vbCrLf 
			AdsJSStr =AdsJSStr&"imgNo = (imgNo >= "&UBound(vnum)&") ? 0 : imgNo+1;"& vbCrLf 
			AdsJSStr =AdsJSStr&"var ci = eval('document.all.num_img'+imgNo);"& vbCrLf 

			AdsJSStr =AdsJSStr&"document.all.bigimg.filters.blendTrans.apply();"& vbCrLf 
			AdsJSStr =AdsJSStr&"document.all.imglink.href=image_link[imgNo];"& vbCrLf 
			AdsJSStr =AdsJSStr&"document.all.bigimg.src=roll_image[imgNo];"& vbCrLf 
			AdsJSStr =AdsJSStr&"document.all.bigimg.filters.blendTrans.play();"& vbCrLf 

			AdsJSStr =AdsJSStr&" if(cliImg == '') {"& vbCrLf 
			AdsJSStr =AdsJSStr&"cliImg = ci;"& vbCrLf 
			AdsJSStr =AdsJSStr&"cliImgSrc = ci.src;"& vbCrLf 
			AdsJSStr =AdsJSStr&"ci.src = small_img[imgNo];"& vbCrLf 
			AdsJSStr =AdsJSStr&"} else if(cliImg != ci) {"& vbCrLf 
			adsJSStr =AdsJSStr&" cliImg.src = cliImgSrc;"& vbCrLf 
			AdsJSStr =AdsJSStr&" cliImg = ci;"& vbCrLf 
			AdsJSStr =AdsJSStr&" cliImgSrc = ci.src;"& vbCrLf 
			AdsJSStr =AdsJSStr&"ci.src = small_img[imgNo];"& vbCrLf 
			AdsJSStr =AdsJSStr&" }"& vbCrLf 
 			AdsJSStr =AdsJSStr&"setTime=setTimeout(""rotate()"",interval);"& vbCrLf 
			AdsJSStr =AdsJSStr&"}"& vbCrLf 
			AdsJSStr=AdsJSStr&"document.write('<TABLE cellSpacing=0 cellPadding=0 width="&pwidth&" border=0>');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write('<TBODY><TR>');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write('<TD height="&pheight&">');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write('<A onfocus=this.blur() href=""#"" name=imglink><IMG style=""FILTER: blendTrans(duration=1)"" height="&pheight&" src="""&rootpath2&""&split(picAddress,"|")(0)&""" width="&pwidth&" border=0 name=bigimg></A>');" & vbCrLf
    			AdsJSStr=AdsJSStr&"document.write(' </TD>');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write('</TR>');" & vbCrLf
    			AdsJSStr=AdsJSStr&"document.write(' <TR>');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write('<TD height=27>');" & vbCrLf
    			AdsJSStr=AdsJSStr&"document.write(' <TABLE cellSpacing=0 cellPadding=0 width=""100%"" border=0>');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write('<TBODY>');" & vbCrLf
    			AdsJSStr=AdsJSStr&"document.write(' <TR>');" & vbCrLf
			for iii=0 to UBound(vnum)
				AdsJSStr=AdsJSStr&"document.write('<TD width=3></TD>');" & vbCrLf
    				AdsJSStr=AdsJSStr&"document.write('  <TD width=61><IMG style=""CURSOR: hand"" onclick=""click_simg(this, "&iii&");"" height=15 src="""&rootpath2&"systemad/images/main_flash_button"&iii+1&".gif"" width=61  border=0 name=num_img"&iii&"></TD>');" & vbCrLf
				AdsJSStr=AdsJSStr&"document.write(' <TD width=72></TD>');" & vbCrLf
			next
			AdsJSStr=AdsJSStr&"document.write('  </TR>');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write(' </TBODY>');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write('</TABLE></TD>');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write(' </TR>');" & vbCrLf
			AdsJSStr=AdsJSStr&"document.write('  </TBODY></TABLE>');" & vbCrLf
			AdsJSStr=AdsJSStr&"rotate();" & vbCrLf
			

			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(AdsJSStr,c_filepath)
			set MyFile=nothing
		 End Sub
sub  Createwucaibinfen(adid)
	 	Conndb
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
		pwidth=rshdp("AdPicWidth")
		pheight=rshdp("AdPicHeight")
		picname=split(rshdp("adhdpdetail"),"$$")(0)
		picUrl=split(rshdp("adhdpdetail"),"$$")(1)
		picAddress=split(rshdp("adhdpdetail"),"$$")(2)
		vnum=split(picname,"|")
		tcount=UBound(vnum)+1
			web_filepath=rootpath2&"systemad/Createjs/scroll.js"
			FlashStr=FlashStr&"document.write('<style>{');" & vbCrLf
			FlashStr=FlashStr&"document.write('BODY {FONT-SIZE: 8pt;  MARGIN: 0px; COLOR: #cb6080; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: Tahoma, ""新宋体"", ""宋体""; BACKGROUND-COLOR: #fff;}');" & vbCrLf
			FlashStr=FlashStr&"document.write('.li_dot {FONT-SIZE: 12px; COLOR: #ed1264; FONT-FAMILY: Webdings;FLOAT: left}');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_show_out {MARGIN-TOP: 5px; FLOAT: left; WIDTH: "&pwidth&"px;}');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_show {BORDER-TOP-WIDTH: 4px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BORDER-LEFT-WIDTH: 4px; BORDER-BOTTOM-WIDTH: 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; POSITION: relative; HEIGHT: "&pheight&"px; TEXT-ALIGN: center; BORDER-RIGHT-WIDTH: 4px}');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_img {BORDER-RIGHT: #f27e96 1px solid; BORDER-TOP: #f27e96 1px solid; FILTER: progid:DXImageTransform.Microsoft.Fade(Overlap=1.00); OVERFLOW: hidden; BORDER-LEFT: #f27e96 1px solid; WIDTH: "&pwidth&"px; BORDER-BOTTOM: #f27e96 1px solid; HEIGHT: "&pheight&"px}');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_btn {LEFT: 4px; POSITION: absolute; TOP: 9px}');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_btn DIV {MARGIN: 5px};');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_show_ctl {PADDING-RIGHT: 0px; MARGIN-TOP: 2px; PADDING-LEFT: 0px; PADDING-BOTTOM: 3px; COLOR: #434343; PADDING-TOP: 3px; HEIGHT: 16px}');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_show_ctl A {COLOR: #434343};');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_show_ctl_msg {FILTER: progid:DXImageTransform.Microsoft.Fade(Overlap=1.00); FLOAT: left; OVERFLOW: hidden; "&pwidth&"px};');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_show_ctl_tuber {Z-INDEX: 100; LEFT: 305px; POSITION: relative; TOP: -17px};');" & vbCrLf
			FlashStr=FlashStr&"document.write('#flash_show_ctl_arrow {MARGIN-RIGHT: 5px};');" & vbCrLf
			FlashStr=FlashStr&"document.write('}</style>');" & vbCrLf
			FlashStr=FlashStr&GetFileContent(web_filepath)
			FlashStr=FlashStr&"document.write('<div id=flash_show_out>');" & vbCrLf
			FlashStr=FlashStr&"document.write('<div id=flash_show>');" & vbCrLf
			FlashStr=FlashStr&"document.write('<div id=flash_img width="&pwidth&" height="&pheight&"></div>');" & vbCrLf
			FlashStr=FlashStr&"document.write('<div id=flash_btn>');" & vbCrLf
			for ii=0 to UBound(vnum)
				FlashStr=FlashStr&"document.write('<div>');" & vbCrLf
				FlashStr=FlashStr&"document.write(' <a onClick=""javascript:showImage("&ii&");return false;""  target=_self><img height=13 alt=第"&ii+1&"幅 src="""&rootpath2&"systemad/images/flash_btn_"&ii+1&".gif"" width=13 border=0></a>');" & vbCrLf
				FlashStr=FlashStr&"document.write('</div>');" & vbCrLf
    			next
      			FlashStr=FlashStr&"document.write('</div>');" & vbCrLf
      			FlashStr=FlashStr&"document.write('</div>');" & vbCrLf
      			FlashStr=FlashStr&"document.write('<div id=flash_show_ctl>');" & vbCrLf
       			FlashStr=FlashStr&"document.write('<div id=flash_show_ctl_msg><span class=li_dot>4</span> <a id=flash_title ></a></div>');" & vbCrLf
 			FlashStr=FlashStr&"document.write('<div style=""PADDING-TOP: 2px"">');" & vbCrLf
			FlashStr=FlashStr&"document.write('<a id=img_prev_btn onClick=""showPrevImage();return false;"" >');" & vbCrLf
			FlashStr=FlashStr&"document.write('<img height=12 alt=上一页 src="""&rootpath2&"systemad/images/flash_back.gif"" width=11 border=0>');"& vbCrLf
			FlashStr=FlashStr&"document.write('</a> ');" & vbCrLf
 			FlashStr=FlashStr&"document.write('<a id=img_next_btn onClick=""showNextImage();return false;"">');"& vbCrLf
			FlashStr=FlashStr&"document.write('<img height=12 alt=下一页 src="""&rootpath2&"systemad/images/flash_next.gif"" width=11 border=0>');" & vbCrLf
			FlashStr=FlashStr&"document.write('</a> ');" & vbCrLf     
      			FlashStr=FlashStr&"document.write('</div>');"& vbCrLf
	  		
			FlashStr=FlashStr&"var fImgs = new Array();" & vbCrLf
			for i=0 to UBound(vnum)
				FlashStr=FlashStr&"fImgs["&i&"] = {title:"""&split(picname,"|")(i)&""",img:"""&rootpath2&""&split(picAddress,"|")(i)&""",href:"""&split(picUrl,"|")(i)&"""};" & vbCrLf
			next
			FlashStr=FlashStr&"imagePlay();"& vbCrLf
			FlashStr=FlashStr&"document.write('</div>');"& vbCrLf
		          Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
	end sub
	sub Create7cai(adid)
	 	Conndb
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
		pwidth=rshdp("AdPicWidth")
		pheight=rshdp("AdPicHeight")
		picname=split(rshdp("adhdpdetail"),"$$")(0)
		picUrl=split(rshdp("adhdpdetail"),"$$")(1)
		picAddress=split(rshdp("adhdpdetail"),"$$")(2)
		vnum=split(picname,"|")
		tcount=UBound(vnum)+1
			FlashStr=FlashStr&"var timeout2=5000;" & vbCrLf  
			FlashStr=FlashStr&"var timeout2=5000; " & vbCrLf  
			FlashStr=FlashStr&"var timeout3=10000; "& vbCrLf  
			FlashStr=FlashStr&"var now_content=0;"& vbCrLf  
			FlashStr=FlashStr&"var total_content="&tcount&";"& vbCrLf  
			FlashStr=FlashStr&"var way=1;"
			FlashStr=FlashStr&"var start_content=Math.round(Math.random()*(total_content-1))+1;"& vbCrLf  
			FlashStr=FlashStr&"function content_mouse(num){"& vbCrLf  
			FlashStr=FlashStr&"now_content=num;"& vbCrLf  
			FlashStr=FlashStr&"window.clearInterval(theTimer2);  "& vbCrLf   
			FlashStr=FlashStr&"for (var i=1;i<=total_content;i++){"& vbCrLf  
			FlashStr=FlashStr&"document.getElementById('divhl0'+i).style.display='none';"& vbCrLf  
			FlashStr=FlashStr&"}"& vbCrLf  
			FlashStr=FlashStr&" document.getElementById('divhl0'+num).style.display='block';"& vbCrLf  
			FlashStr=FlashStr&"theTimer2=setTimeout('change_content()', timeout3);"& vbCrLf  
			FlashStr=FlashStr&"}"& vbCrLf  
			FlashStr=FlashStr&"function change_content(){"& vbCrLf  
			FlashStr=FlashStr&"  for (var i=1;i<=total_content;i++){"& vbCrLf  						
			FlashStr=FlashStr&"document.getElementById('divhl0'+i).style.display='none';"& vbCrLf  
			FlashStr=FlashStr&"}"& vbCrLf  
			FlashStr=FlashStr&" document.getElementById('divhl0'+now_content).style.display='block';"& vbCrLf  
			FlashStr=FlashStr&"if (way) now_content++;"& vbCrLf  
			FlashStr=FlashStr&" else now_content--;"& vbCrLf  
			FlashStr=FlashStr&"if(now_content>total_content) {now_content=total_content-1;way=0;}"& vbCrLf  
			FlashStr=FlashStr&" else if(now_content==0) {now_content=1;way=1;}"& vbCrLf  
			FlashStr=FlashStr&"theTimer2=setTimeout('change_content()', timeout2);"& vbCrLf  
			FlashStr=FlashStr&"}"& vbCrLf  
			FlashStr=FlashStr&"theTimer2=setTimeout(function(){now_content=1;change_content();}, timeout2);"& vbCrLf  
			FlashStr=FlashStr&"document.write('<table border=0 cellpadding=0 cellspacing=0>');" & vbCrLf  
     			FlashStr=FlashStr&"document.write('<tr>');"& vbCrLf 
			for iii=0 to UBound(vnum)
				if (iii+1)=1 then
					web_bgcolor="#FE8E0A"
					 web_width="width=279"
					 web_style=""
				elseif (iii+1)=2 then
					web_bgcolor="#FA5886"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=3 then
					web_bgcolor="#ED3FBA"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=4 then
					web_bgcolor="#916DCB"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=5 then
					web_bgcolor="#4FB9E1"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=6 then
					web_bgcolor="#CCCC66"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=7 then
					web_bgcolor="#FF99CC"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=8 then
					web_bgcolor="#99CC33"
					web_width=""
					 web_style="style=display:none"
				end if
				FlashStr=FlashStr&"document.write('<td "&web_width&"><div id=divhl0"&(iii+1)&" "& web_style&"><div> <a href="&split(picUrl,"|")(iii)&" target=_blank><img src="&rootpath2&""&split(picAddress,"|")(iii)&" width="&pwidth&" height="&pheight&" border=0></a></div></div></td>');" & vbCrLf 
				FlashStr=FlashStr&"document.write('<td width=20 onMouseOver=content_mouse("&iii+1&") valign=top bgcolor="&web_bgcolor&" >');" & vbCrLf 
				FlashStr=FlashStr&"document.write('<table width=20 border=0 cellpadding=0 cellspacing=0>');" & vbCrLf
				FlashStr=FlashStr&"document.write('<tr><td width=20 height=23 align=center><img src="&rootpath2&"systemad/CreateJs/images/arrow.gif width=12 height=12></td></tr>');" & vbCrLf
				FlashStr=FlashStr&"document.write('<tr> <td align=center><a href="&split(picUrl,"|")(iii)&" target=_blank >"&split(picname,"|")(iii)&" </a></td>  </tr>');" & vbCrLf 
				FlashStr=FlashStr&"document.write('</table></td>');" & vbCrLf 
			next
			FlashStr=FlashStr&"document.write('</tr>');" & vbCrLf
			FlashStr=FlashStr&"document.write('</table>');" 
             		Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
	end sub
	sub Createhdp(adid)
		Randomize
		Randomize_i_Str =  CStr(Int((999 * Rnd) + 1))
	 	Conndb
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
		tmp=split(rshdp("adhdpdetail"),"$$")
		for i=0 to ubound(tmp)
			picname=tmp(0)
			picAddress=tmp(2)
			picUrl=tmp(1)
		next
		picAddress1=split(picAddress,"|")
		for ii=0 to ubound(picAddress1)
			picadd=picadd&"|"&rootpath2&picAddress1(ii)
		next
		 PicAdd1=replace(picadd,"|","",1,1)
		
					'FlashStr="<script type=""text/javascript"">"& Chr(13)
					FlashStr=FlashStr&" <!--"& Chr(13)
					dim PicWidthStr,PicHeightStr,txtheight
					PicWidthStr =rshdp("AdPicWidth")
					PicHeightStr=rshdp("AdPicHeight")
					txtheight = rshdp("adhdptxth")
					LinkStr=picUrl
					ImagesStr=PicAdd1
					TxtStr=picname
					FlashStr=FlashStr&" var focus_width"&Randomize_i_Str&"="&PicWidthStr& Chr(13)
					FlashStr=FlashStr&" var focus_height"&Randomize_i_Str&"="&PicHeightStr& Chr(13)
					FlashStr=FlashStr&" var text_height"&Randomize_i_Str&"="&txtheight& Chr(13)
					FlashStr=FlashStr&" var sww_height"&Randomize_i_Str&" = focus_height"&Randomize_i_Str&"+text_height"&Randomize_i_Str& Chr(13)
					FlashStr=FlashStr&" var pics"&Randomize_i_Str&"='"&ImagesStr&"'"&Chr(13)
					FlashStr=FlashStr&" var links"&Randomize_i_Str&"='"&LinkStr &"'"&Chr(13)
					FlashStr=FlashStr&" var texts"&Randomize_i_Str&"='"&TxtStr&"'"&Chr(13)
					FlashStr=FlashStr&" document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width=""'+ focus_width"&Randomize_i_Str&" +'"" height=""'+ sww_height"&Randomize_i_Str&" +'"">');"&Chr(13)
					FlashStr=FlashStr&" document.write('<param name=""allowScriptAccess"" value=""sameDomain""><param name=""movie"" value="""&rootpath2&"systemad/flash/focus.swf""><param name=""quality"" value=""high""><param name=""bgcolor"" value=""white"">');"&Chr(13)
					FlashStr=FlashStr&" document.write('<param name=""menu"" value=""false""><param name=wmode value=""opaque"">');"&Chr(13)
					FlashStr=FlashStr&" document.write('<param name=""FlashVars"" value=""pics='+pics"&Randomize_i_Str&"+'&links='+links"&Randomize_i_Str&"+'&texts='+texts"&Randomize_i_Str&"+'&borderwidth='+focus_width"&Randomize_i_Str&"+'&borderheight='+focus_height"&Randomize_i_Str&"+'&textheight='+text_height"&Randomize_i_Str&"+'"">');"&Chr(13)
					FlashStr=FlashStr&" document.write('<embed src="""&rootpath2&"systemad/flash/focus.swf"" wmode=""opaque"" FlashVars=""pics='+pics"&Randomize_i_Str&"+'&links='+links"&Randomize_i_Str&"+'&texts='+texts"&Randomize_i_Str&"+'&borderwidth='+focus_width"&Randomize_i_Str&"+'&borderheight='+focus_height"&Randomize_i_Str&"+'&textheight='+text_height"&Randomize_i_Str&"+'"" menu=""false"" bgcolor=""white"" quality=""high"" width=""'+ focus_width"&Randomize_i_Str&" +'"" height=""'+ sww_height"&Randomize_i_Str&" +'"" allowScriptAccess=""sameDomain"" type=""application/x-shockwave-flash"" plugiMSpage=""http://www.macromedia.com/go/getflashplayer"" />');"&Chr(13)
					FlashStr=FlashStr&" document.write('</object>');"&Chr(13)
					FlashStr=FlashStr&" //-->"& Chr(13)
					'FlashStr=FlashStr&"</script>"
			Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
	
			c_filepath=rootpath2&"systemad/"& adid &".js"
		
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
			
			
	end sub
	
	sub Create7cai(adid)
	 	Conndb
		set rshdp=Server.CreateObject("adodb.recordset")
		sql="select * from web_ad where  adid="&adid&""
		rshdp.open sql,conn,1,3
		pwidth=rshdp("AdPicWidth")
		pheight=rshdp("AdPicHeight")
		picname=split(rshdp("adhdpdetail"),"$$")(0)
		picUrl=split(rshdp("adhdpdetail"),"$$")(1)
		picAddress=split(rshdp("adhdpdetail"),"$$")(2)
		vnum=split(picname,"|")
		tcount=UBound(vnum)+1
			FlashStr=FlashStr&"var timeout2=5000;" & vbCrLf  
			FlashStr=FlashStr&"var timeout2=5000; " & vbCrLf  
			FlashStr=FlashStr&"var timeout3=10000; "& vbCrLf  
			FlashStr=FlashStr&"var now_content=0;"& vbCrLf  
			FlashStr=FlashStr&"var total_content="&tcount&";"& vbCrLf  
			FlashStr=FlashStr&"var way=1;"
			FlashStr=FlashStr&"var start_content=Math.round(Math.random()*(total_content-1))+1;"& vbCrLf  
			FlashStr=FlashStr&"function content_mouse(num){"& vbCrLf  
			FlashStr=FlashStr&"now_content=num;"& vbCrLf  
			FlashStr=FlashStr&"window.clearInterval(theTimer2);  "& vbCrLf   
			FlashStr=FlashStr&"for (var i=1;i<=total_content;i++){"& vbCrLf  
			FlashStr=FlashStr&"document.getElementById('divhl0'+i).style.display='none';"& vbCrLf  
			FlashStr=FlashStr&"}"& vbCrLf  
			FlashStr=FlashStr&" document.getElementById('divhl0'+num).style.display='block';"& vbCrLf  
			FlashStr=FlashStr&"theTimer2=setTimeout('change_content()', timeout3);"& vbCrLf  
			FlashStr=FlashStr&"}"& vbCrLf  
			FlashStr=FlashStr&"function change_content(){"& vbCrLf  
			FlashStr=FlashStr&"  for (var i=1;i<=total_content;i++){"& vbCrLf  						
			FlashStr=FlashStr&"document.getElementById('divhl0'+i).style.display='none';"& vbCrLf  
			FlashStr=FlashStr&"}"& vbCrLf  
			FlashStr=FlashStr&" document.getElementById('divhl0'+now_content).style.display='block';"& vbCrLf  
			FlashStr=FlashStr&"if (way) now_content++;"& vbCrLf  
			FlashStr=FlashStr&" else now_content--;"& vbCrLf  
			FlashStr=FlashStr&"if(now_content>total_content) {now_content=total_content-1;way=0;}"& vbCrLf  
			FlashStr=FlashStr&" else if(now_content==0) {now_content=1;way=1;}"& vbCrLf  
			FlashStr=FlashStr&"theTimer2=setTimeout('change_content()', timeout2);"& vbCrLf  
			FlashStr=FlashStr&"}"& vbCrLf  
			FlashStr=FlashStr&"theTimer2=setTimeout(function(){now_content=1;change_content();}, timeout2);"& vbCrLf  
			FlashStr=FlashStr&"document.write('<table border=0 cellpadding=0 cellspacing=0>');" & vbCrLf  
     			FlashStr=FlashStr&"document.write('<tr>');"& vbCrLf 
			for iii=0 to UBound(vnum)
				if (iii+1)=1 then
					web_bgcolor="#FE8E0A"
					 web_width="width=279"
					 web_style=""
				elseif (iii+1)=2 then
					web_bgcolor="#FA5886"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=3 then
					web_bgcolor="#ED3FBA"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=4 then
					web_bgcolor="#916DCB"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=5 then
					web_bgcolor="#4FB9E1"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=6 then
					web_bgcolor="#CCCC66"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=7 then
					web_bgcolor="#FF99CC"
					web_width=""
					 web_style="style=display:none"
				elseif (iii+1)=8 then
					web_bgcolor="#99CC33"
					web_width=""
					 web_style="style=display:none"
				end if
				FlashStr=FlashStr&"document.write('<td "&web_width&"><div id=divhl0"&(iii+1)&" "& web_style&"><div> <a href="&split(picUrl,"|")(iii)&" target=_blank><img src="&rootpath2&""&split(picAddress,"|")(iii)&" width="&pwidth&" height="&pheight&" border=0></a></div></div></td>');" & vbCrLf 
				FlashStr=FlashStr&"document.write('<td width=20 onMouseOver=content_mouse("&iii+1&") valign=top bgcolor="&web_bgcolor&" >');" & vbCrLf 
				FlashStr=FlashStr&"document.write('<table width=20 border=0 cellpadding=0 cellspacing=0>');" & vbCrLf
				FlashStr=FlashStr&"document.write('<tr><td width=20 height=23 align=center><img src="&rootpath2&"systemad/CreateJs/images/arrow.gif width=12 height=12></td></tr>');" & vbCrLf
				FlashStr=FlashStr&"document.write('<tr> <td align=center><a href="&split(picUrl,"|")(iii)&" target=_blank >"&split(picname,"|")(iii)&" </a></td>  </tr>');" & vbCrLf 
				FlashStr=FlashStr&"document.write('</table></td>');" & vbCrLf 
			next
			FlashStr=FlashStr&"document.write('</tr>');" & vbCrLf
			FlashStr=FlashStr&"document.write('</table>');" 
             		Set MyFile=Server.CreateObject(C_Web_FSO)
			If MyFile.FolderExists(Server.MapPath(Web_ad_path)) = false then
				MyFile.CreateFolder(Server.MapPath(Web_ad_path))
			End If
			adid =Returnflag(adid)
			if MyFile.FileExists(Server.MapPath(Web_ad_path)&"\"& adid &".js") then
				MyFile.DeleteFile(Server.MapPath(Web_ad_path)&"\"& adid &".js")
			end if
			c_filepath=rootpath2&"systemad/"& adid &".js"
			call save_file(FlashStr,c_filepath)
			set MyFile=nothing
	end sub
	Function CheckAd(obj)
		If Not obj.Eof Then
			If Cint(obj("AdLock"))=1 Then
				CheckAd=False
			
				Exit Function
			End If
			If Cint(obj("AdLoopFactor"))=1 Then
				If Cint(obj("AdClickNum")) > Cint(obj("AdMaxClickNum")) or Cint(obj("AdShowNum")) > Cint(obj("AdMaxShowNum")) Then
					CheckAd=False
					Exit Function
				End If
				If Trim(obj("AdEndDate"))<>"" And not IsNull(obj("AdEndDate")) Then
					If Cdate(obj("AdEndDate"))>timeformat(now(),0) Then
						CheckAd=False
						Exit Function
					End If		
				End If
			Else
				CheckAd=True
				Exit Function
			End If
		Else
			CheckAd=""
			Exit Function
		End If
		CheckAd=True
	End Function



%>

 

 
 



 
 

