PDA

View Full Version : Joining two scripts



dead-poetic
07-10-2005, 07:36 PM
I found this slide show script

<script language="JavaScript">
// Advanced Random Images Start
// Copyright 2001-2002 All rights reserved, by Paul Davis - www.kaosweaver.com
var j,d="",l="",m="",p="",q="",z="",KW_ARI= new Array()
// KW_ss[3000]
KW_ARI[KW_ARI.length]='pictures/Background Pictures/1s.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/2.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/3.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/4.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/5.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/6.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/7.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/8.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/9.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/10.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/11s.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/12.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/13.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/14.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/15r.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/16.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/173.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/18.jpg';
KW_ARI[KW_ARI.length]='pictures/Background Pictures/19.jpg';
j=parseInt(Math.random()*KW_ARI.length);
j=(isNaN(j))?0:j;
document.write("<img name='seqSlideShow' src='"+KW_ARI[j]+"' width='983' height='545'>");
function seqSlideShow(t,l) { // Sequential Slideshow by Kaosweaver
x=document.seqSlideShow; j=l; j++; if (j==KW_ARI.length) j=0;
x.src=KW_ARI[j]; setTimeout("seqSlideShow("+t+","+j+")",t);
}
seqSlideShow(5000,0)
// Advanced Random Images End
</script>
<!-- KW ARI Image -->

and I found this script http://javascript.internet.com/bgeffects/full-size-image.html

<!-- THREE STEPS TO INSTALL FULL SIZE IMAGE:

1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Eddie Traversa (psych3@primus.com.au) -->
<!-- Web Site: http://nirvana.media3.net -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function Is() {
var agent = navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);
this.ns = ((agent.indexOf('mozilla') != -1) &&
(agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1) && (agent.indexOf('opera') == -1) && (agent.indexOf('webtv') == -1));
this.ns2 = (this.ns && (this.major == 2));
this.ns3 = (this.ns && (this.major == 3));
this.ns4 = (this.ns && (this.major == 4));
this.ns6 = (this.ns && (this.major >= 5));
this.ie = (agent.indexOf("msie") != -1);
this.ie3 = (this.ie && (this.major < 4));
this.ie4 = (this.ie && (this.major == 4) &&
(agent.indexOf("msie 5.0") == -1));
this.ie5 = (this.ie && (this.major == 4) &&
(agent.indexOf("msie 5.0") != -1));
this.ieX = (this.ie && !this.ie3 && !this.ie4);
}
var is = new Is();
function layerObject(id,left,top,visibility) {
if (is.ie5||is.ns6){
this.obj = document.getElementById(id).style;
this.obj.left = left;
this.obj.top = top;
this.obj.visibility = visibility;
return this.obj;
}
else if(is.ie4) {
this.obj = document.all[id].style;
this.obj.left = left;
this.obj.top = top;
this.obj.visibility = visibility;
return this.obj;
}
else if(is.ns4) {
this.obj = document.layers[id];
this.obj.left = left;
this.obj.top = top;
this.obj.visibility = visibility;
return this.obj;
}
}
function layerSetup() {
backgroundLyr = new layerObject('backgroundLayer', 0,0,'visible');
}
function findSize() {
if(is.ns4 ||is.ns6) {
available_width=innerWidth;
available_height=innerHeight;
layerSetup();
} else if(is.ie4 || is.ie5) {
available_width=document.body.clientWidth;
available_height=document.body.clientHeight;
layerSetup();
}
}
function winResize() {
if(is.ns4 ||is.ns6||is.ie4||is.ie5) {
history.go(0);
}
}
// End -->
</script>

</HEAD>

<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->

<BODY onLoad="findSize();" onResize="winResize()">

<!-- STEP THREE: Copy this code into the BODY of your HTML document -->

<div id="backgroundLayer" style="position:absolute; width:200px; height:115px; z-index:1; left: 0px; top: 0; visibility: hidden">

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Eddie Traversa (psych3@primus.com.au) -->
<!-- Web Site: http://nirvana.media3.net -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
if(is.ns4 || is.ns6) {
available_width = innerWidth;
available_height = innerHeight;
}
else if(is.ie4 || is.ie5) {
available_width=document.body.clientWidth;
available_height=document.body.clientHeight;
}
if(is.ie4 || is.ie5 || is.ns6 || is.ns4) {
image1_width = (available_width * 1.00);
image1_height = (available_height * 1.00);
var image1 = '<img src="http://javascript.internet.com/img/logo.gif" width="' + image1_width + '" height="' + image1_height + '">';
document.write(image1);
}
// End -->
</script>
</div>
I am trying to make the slide show script adjust to the users current screen size. Can somebody please help me.

jscheuer1
07-10-2005, 08:38 PM
Trust me, you don't want to do that.