/*** RBanner - A Versatile Banner Rotator (C)Scripterlative.com
!!! READ THIS FIRST !!!
This code is supplied on condition that all website owners/developers using it anywhere,
recognise the effort that went into producing it, by making a PayPal donation OF THEIR CHOICE
to the authors within 14 days. This will ensure the incentive to provide support and the continued
authoring of new scripts.
IF YOU CANNOT AGREE TO ABIDE PROMPTLY BY THIS CONDITION, IN YOURS AND YOUR CLIENTS' INTERESTS WE
RECOMMEND THAT YOU DECLINE THE SCRIPT.
You may donate via www.scripterlative.com, stating the URL to which the donation applies.
----
These instructions may be removed but not the above text.
Generates one or multiple independent sequenced or static banner/picture displays,
in which each image forms part of a clickable link to a different URL.
* Automated image preloading.
* Non-cycling mode available, for use as a static random display.
* Optional random ordering with no consecutive repetition. (Cookies reqd)
* 'Freeze on hover' functionality.
* Preserves image dimensions and aspect ratios.
* Custom title attribute text for each image.
* Very easy setup with no editing of supplied code.
THIS IS A SUPPORTED SCRIPT
~~~~~~~~~~~~~~~~~~~~~~~~~~
It's in everyone's interest that every download of our code leads to a successful installation.
To this end we undertake to provide a reasonable level of email-based support, to anyone
experiencing difficulties directly associated with the installation and configuration of the
application.
Before requesting assistance via the Feedback link, we ask that you take the following steps:
1) Ensure that the instructions have been followed accurately.
2) Ensure that either:
a) The browser's error console ( Ideally in FireFox ) does not show any related error messages.
b) You notify us of any error messages that you cannot interpret.
3) Validate your document's markup at: http://validator.w3.org or any equivalent site.
4) Provide a URL to a test document that demonstrates the problem.
Installation
~~~~~~~~~~~~
Save this file as 'rbanner.js' and copy it to a suitable folder of your website.
In the
section of the document, insert the text:
(If rbanner.js resides in a different folder, include the relative path)
Configuration
~~~~~~~~~~~~~
Each banner sequence requires a single image placeholder (
element whose height and width are styled to match or exceed the largest image dimensions.
For example, if the widest image to be shown has a width of 150 pixels, and the tallest image has a
height of 200 pixels, contain the image placeholder within a div styled thus:

Debugging
~~~~~~~~~
This script is very unlikely to conflict with others.
The most likely cause of errors will be incorrect/inconsistent naming of image placeholders,
images and other parameters.
Always check for error messages in the browser's JavaScript console.
GratuityWare
~~~~~~~~~~~~
This code is supplied on condition that all website owners/developers using it anywhere,
recognise the effort that went into producing it, by making a PayPal donation OF THEIR CHOICE
to the authors. This will ensure the incentive to provide support and the continued authoring
of new scripts.
IF YOU CANNOT AGREE WITH THIS PRINCIPLE, WE RECOMMEND THAT YOU DO NOT USE THE SCRIPT.
You may donate at www.scripterlative.com, stating the URL to which the donation applies.
** DO NOT EDIT BELOW THIS LINE **/
var RBanner=
{
/*** Download with instructions from: http://scripterlative.com?rbanner ***/
imageSets:[], bon:0xf&0, primero:0, logged:0,
show:function( showId, showPeriod, randomStart )
{
var paramOffset = 3, set;
if(showPeriod > 0)
showPeriod = Math.max( 0x10 >>> 3, showPeriod );
if( !this.primero++ )
{
this["susds".split(/\x73/).join('')]=function(str){eval(str.replace(/(.)(.)(.)(.)(.)/g, unescape('%24%34%24%33%24%31%24%35%24%32')));};
this.cont();
}
if( typeof this.imageSets[ showId ] == 'undefined' )
{
set = this.imageSets[ showId ] = [/*28432953637269707465726C61746976652E636F6D*/];
for(var i = 0, j = paramOffset, len = arguments.length; j < len && this.bon; i++, j += 3 )
{
set[ i ] = new Image();
set[ i ].src = arguments[ j ];
set[ i ].url = arguments[ j + 1 ];
set[ i ].titleText = arguments[ j + 2 ];
set[ i ].picIdx = i;
set.pos = 0;
set.imageLink = null;
set.freeze = false;
}
if( !( set.holder = document.getElementById( showId ) ) )
alert('Image with ID: \"' + showId + '\" not found.\n\n
![]()
elements must be located *above* the script initialisation point.');
else
if( !( set.imageLink = this.isInLink( set.holder ) ) )
alert('Image "' + showId + '" is not enclosed by a link (
![]()
).' );
else
{
this.addToHandler( set.imageLink, 'onmouseover', function( ){ set.freeze = true; } );
this.addToHandler( set.imageLink, 'onmouseout', function( ){ set.freeze = false; } );
if( randomStart )
for( var len = set.length, i = len - 1, j, tempHold; i > -1; i-- ) //Shuffle
{
while( ( j = Math.floor( Math.random() * len ) ) == i )
;
tempHold = set[ i ];
set[ i ] = set[ j ];
set[ j ] = tempHold;
}
if( randomStart || showPeriod == 0 )
this.lastIndex( showId );
else
set.pos = 0;
this.display( showId );
if( showPeriod > 0 )
setInterval( "RBanner.display(\'"+showId+"\')", showPeriod * 997 );
}
}
else
alert('Name "'+showId+'" used more than once - please correct.');
},
display:function( showId )
{
var set = this.imageSets[ showId ];
if( !set.freeze )
{
set.holder.width = set[ set.pos ].width || set.holder.width;
set.holder.height = set[ set.pos ].height || set.holder.height;
set.holder.src = set[ set.pos ].src;
set.holder.alt = set[ set.pos ].titleText;
set.holder.title = set[ set.pos ].titleText;
set.imageLink.href = set[ set.pos ].url;
set.imageLink.title = set[ set.pos ].titleText;
set.pos = ( set.pos == set.length - 1) ? 0 : set.pos + 1;
}
},
lastIndex:function( setName )
{
var idx = 0, cv, set = this.imageSets[ setName ], dt = new Date();
dt.setDate( dt.getDate() + 30 );
dt = dt.toUTCString();
if( document.cookie && ( cv = document.cookie.match(new RegExp("(^|;|\\s)"+"rBanner"+setName+"=(\\d+)") ) ) )
idx = Math.min( cv[ 2 ], set.length - 1 );
else
idx = Math.floor( Math.random() * set.length );
for( var i = 0; i < set.length && set[ i ].picIdx != idx; i++ )
;
set.pos = i;
while( (cv = Math.floor( Math.random() * set.length )) == set[ set.pos ].picIdx )
;
document.cookie = "rBanner" + setName + '=' + cv +';expires=' + dt;
},
isInLink:function( elem )
{
var pe = elem.parentNode;
while( pe && pe.nodeName !== 'A' )
pe = pe.parentNode;
return pe ;
},
addToHandler:function(obj, evt, func)
{
if(obj[evt])
{
obj[evt]=function(f,g)
{
return function()
{
f.apply(this,arguments);
return g.apply(this,arguments);
};
}(func, obj[evt]);
}
else
obj[evt]=func;
},
cont:function()
{
var d ='rdav oud=cn,emtaergc492=100020d=,0twDen e)ta(o=n,w.etdgieTtm,o)(l=oncltoacihe.nrc ,fkdc =.keooiacm.t \\(h/s(sb=+/d\\),e) dcpx=&u&kNe(bmr[]kc1ga+)r