Click to See Complete Forum and Search --> : Random Images


GiGi
December 8th, 2003, 02:02 PM
I am using the following script in an includes file but when I try to run the file that the include is in, I get an error message that says "Expected end of statement
/sdu/PluggedIn_new/includes/rotating_faces.inc, line 16, column 9". Any ideas as to why this is happening? --Thanks...


<script language="JavaScript1.1">
<!--

/*Browsercheck:*/
if(document.all){
var ie=document.all?1:0;
//var n=0
}else{
var n=document.layers?1:0;
}

<%

'create file path to database

Dim path As String = Server.MapPath(Session("SDUVirtualBasePath")) & "/about_sdu/whos_who/database.txt"

'open the file
Dim sduAssociates As StreamReader
sduAssociates = File.OpenText(path)

'initialize counter

Dim counter As Integer = 0

'search through database
Dim name As String
Dim bio As String
Dim title As String
Dim alpha As String
Dim group As String
Dim splitName As String
Dim splitName2 As String

While sduAssociates.Peek() <> -1

name = sduAssociates.ReadLine()
bio = sduAssociates.ReadLine()
title = sduAssociates.ReadLine()
alpha = sduAssociates.ReadLine()
group = sduAssociates.ReadLine()
sduAssociates.ReadLine()

counter = counter + 1

'Create the link array

if instr(name, "'") then
splitName = Left(name, instr(name, "'") - 1)
splitName2 = Right(name, len(name) - instr(name, "'"))
name = splitName & splitName2
end if

response.write("var image" & counter & "=new Image()" & chr(10))
response.write("image" & counter & ".src=""" & Session("SDUSiteBase") & "/images/about_sdu/associates/" & name & ".jpg""" & chr(10) & chr(10))

End While

' close and clean up

sduAssociates.Close()
%>
//-->
</script>
<script language="JavaScript1.2">
function reapply(){
setTimeout("slideit()",3000)
return true
}
window.onerror=reapply
</script>
<base target="_self">
<script>
<!--

//change speed below (in seconds)
var speed=3
var random
var destHREF
Link=new Array()
AssociateName=new Array()
<%
'create file path to database

path = Server.MapPath(Session("SDUVirtualBasePath")) & "/about_sdu/whos_who/database.txt"

'open the file
sduAssociates = File.OpenText(path)

'initialize counter

counter = 0

'search through database

While sduAssociates.Peek() <> -1

name = sduAssociates.ReadLine()
bio = sduAssociates.ReadLine()
title = sduAssociates.ReadLine()
alpha = sduAssociates.ReadLine()
group = sduAssociates.ReadLine()
sduAssociates.ReadLine()

'Create the link array

if instr(name, "'") then
splitName = Left(name, instr(name, "'") - 1)
splitName2 = Right(name, len(name) - instr(name, "'"))
name = splitName & splitName2
end if

response.write("Link[" & counter & "]=""" & Session("SDUSiteBase") & "/about_sdu/whos_who/pop_up_associate.asp?id=" & name & """" & chr(10))
response.write("AssociateName[" & counter & "]=""" & name & """" & chr(10) & chr(10))

counter = counter + 1

End While

' close and clean up

sduAssociates.Close()
%>

function initIt(){
sdu_Name.style.filter = "blendTrans(duration=3)"
slideit();
}

function slideit(){
//alert("ok")
random=Math.round(Math.random()*<%=counter - 1%>)
destHREF=Link[random-1]
if (!document.images)
return
if (document.all)
sdu_Name.filters.blendTrans.Apply();
slide.filters.blendTrans.Apply();
sdu_Name.innerHTML = AssociateName[random-1];
document.images.slide.src = eval("image"+random+".src");
slide.filters.blendTrans.Play();
sdu_Name.filters.blendTrans.Play();
if (document.all)
setTimeout("slideit()",speed*1000+3000)
else
setTimeout("slideit()",speed*1000)
}

//-->
</script>