O
Ollie
Hello, not sure if anyone can help me but Ive found the below script online
and want to use it on my FP 2003 website however when I insert it into my
page it doesnt work and all i get is the top two pictures fading into two
others once and then I get an error message at the bottom left of the screen
sayign "error on page" and then this turns into "Done". The pictures are then
static when all five should be fading into one another continuously . If I
run the code exactly as below everything works fine. I've done some
investigating on the web and found that it might be something to do with the
tables on the page where I want to insert the banners/fading pictures,
without any content in the body it works fine. Any ideas if its possible to
solve this issue or is this code a lost cause? Any assisstance is gratefully
received! )
Regards
Ollie
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script Language="JavaScript">
<!--
///////////////////
//www.fortochka.com
//Alexander Babichev 2006 Coopyright
//This script is free for private use. Otherwise a $10 fee per a site is
required.
//the script can be modified but the copyright notice should be left
unchanged.
///////////////////
var speed = 8000
function item(name, link){
this.name = name
this.link = link
}
var bannerArr = new Array
bannerArr[0] = new
item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")
bannerArr[1] = new
item("http://www.mysite.com/images/AD2.gif","http://www.mysite.com")
bannerArr[2] = new
item("http://www.mysite.com/images/AD3.gif","http://www.mysite.com")
bannerArr[3] = new
item("http://www.mysite.com/images/AD4.gif","http://www.mysite.com")
bannerArr[4] = new
item("http://www.mysite.com/images/AD5.gif","http://www.mysite.com")
bannerArr[5] = new
item("http://www.mysite.com/images/AD6.gif","http://www.mysite.com")
var kk = bannerArr.length
var ii
var imgArray = new Array()
for (ii=0;ii<kk;ii++){
imgArray[ii] = new Image()
imgArray[ii].src = bannerArr[ii].name
}
function displayBanners(){
document.write('<table>')
for (ii=0;ii<kk-1;ii++){
document.write('<tr><td><a ID= a' + ii + ' name= a' + ii + ' href=' +
bannerArr[ii].link + ' onClick="openNewWindow(this.href);return false;"><img
src=' + imgArray[ii].src + ' name = img' + ii + ' ID = img' + ii + '
border=0></a></td></tr>')
}
document.write('</table>')
myPause = setInterval("ready()",1000)
}
function ready(){
var start = true
for (ii=0;ii<kk;ii++){
if (imgArray[ii].complete == false){
start = false
}
}
if (start == true){
window.clearInterval(myPause)
myInterval = setInterval("show()",speed)
}
}
var numArray = new Array()
for (ii=0;ii<kk;ii++){
numArray[ii] = ii
}
function show(){
for (ii=0;ii<kk-1;ii++){
numArray[ii] = numArray[ii] - 1
if (numArray[ii] == -1){
numArray[ii] = kk-1
}
}
for (ii=0;ii<kk-1;ii++){
if (document.all){
eval('img' + ii).style.filter="blendTrans(duration=3)";
eval('img' + ii).filters.blendTrans.Apply();
eval('img' + ii).filters.blendTrans.Play();
}
eval('document.img' + ii).src = imgArray[numArray[ii]].src
eval("document.getElementById('a" + ii + "')").href =
bannerArr[numArray[ii]].link
}
}
function openNewWindow(href){
var newWindow
newWindow =
window.open(href,"","toolbar=yes,directories=yes,menubar=yes,resizable=yes,location=yes,status=yes,scrollbars=yes,copyhistory=yes")
}
// -->
</script>
</head>
<body>
<script Language="JavaScript">displayBanners()</script>
</body>
</html>
and want to use it on my FP 2003 website however when I insert it into my
page it doesnt work and all i get is the top two pictures fading into two
others once and then I get an error message at the bottom left of the screen
sayign "error on page" and then this turns into "Done". The pictures are then
static when all five should be fading into one another continuously . If I
run the code exactly as below everything works fine. I've done some
investigating on the web and found that it might be something to do with the
tables on the page where I want to insert the banners/fading pictures,
without any content in the body it works fine. Any ideas if its possible to
solve this issue or is this code a lost cause? Any assisstance is gratefully
received! )
Regards
Ollie
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script Language="JavaScript">
<!--
///////////////////
//www.fortochka.com
//Alexander Babichev 2006 Coopyright
//This script is free for private use. Otherwise a $10 fee per a site is
required.
//the script can be modified but the copyright notice should be left
unchanged.
///////////////////
var speed = 8000
function item(name, link){
this.name = name
this.link = link
}
var bannerArr = new Array
bannerArr[0] = new
item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")
bannerArr[1] = new
item("http://www.mysite.com/images/AD2.gif","http://www.mysite.com")
bannerArr[2] = new
item("http://www.mysite.com/images/AD3.gif","http://www.mysite.com")
bannerArr[3] = new
item("http://www.mysite.com/images/AD4.gif","http://www.mysite.com")
bannerArr[4] = new
item("http://www.mysite.com/images/AD5.gif","http://www.mysite.com")
bannerArr[5] = new
item("http://www.mysite.com/images/AD6.gif","http://www.mysite.com")
var kk = bannerArr.length
var ii
var imgArray = new Array()
for (ii=0;ii<kk;ii++){
imgArray[ii] = new Image()
imgArray[ii].src = bannerArr[ii].name
}
function displayBanners(){
document.write('<table>')
for (ii=0;ii<kk-1;ii++){
document.write('<tr><td><a ID= a' + ii + ' name= a' + ii + ' href=' +
bannerArr[ii].link + ' onClick="openNewWindow(this.href);return false;"><img
src=' + imgArray[ii].src + ' name = img' + ii + ' ID = img' + ii + '
border=0></a></td></tr>')
}
document.write('</table>')
myPause = setInterval("ready()",1000)
}
function ready(){
var start = true
for (ii=0;ii<kk;ii++){
if (imgArray[ii].complete == false){
start = false
}
}
if (start == true){
window.clearInterval(myPause)
myInterval = setInterval("show()",speed)
}
}
var numArray = new Array()
for (ii=0;ii<kk;ii++){
numArray[ii] = ii
}
function show(){
for (ii=0;ii<kk-1;ii++){
numArray[ii] = numArray[ii] - 1
if (numArray[ii] == -1){
numArray[ii] = kk-1
}
}
for (ii=0;ii<kk-1;ii++){
if (document.all){
eval('img' + ii).style.filter="blendTrans(duration=3)";
eval('img' + ii).filters.blendTrans.Apply();
eval('img' + ii).filters.blendTrans.Play();
}
eval('document.img' + ii).src = imgArray[numArray[ii]].src
eval("document.getElementById('a" + ii + "')").href =
bannerArr[numArray[ii]].link
}
}
function openNewWindow(href){
var newWindow
newWindow =
window.open(href,"","toolbar=yes,directories=yes,menubar=yes,resizable=yes,location=yes,status=yes,scrollbars=yes,copyhistory=yes")
}
// -->
</script>
</head>
<body>
<script Language="JavaScript">displayBanners()</script>
</body>
</html>