/* usage
<body>
<div id="slideCont" style="position:relative;z-index:1;width:140px;left:0px;overflow:hidden;">
<div id="slideA" style="position:absolute;z-index:1;top:0px;left:0px;width:140px;overflow:hidden;">
your banners (images inside anchor tags)
<div id="slideB" style="position:relative;z-index:1;top:0px;left:0px;width:140px;overflow:hidden;">
your banners (images inside anchor tags)
</div>
</div>
</div>
</body>

*/

function clip() {
// width of the banner container
var contWidth = 590;
// height of the banner container
var contHeight = 106;

var id1 = document.getElementById('slideA');
var id2 = document.getElementById('slideB');
var height = id1.offsetHeight;

id1.style.top = parseInt(id1.style.top)-1 + 'px';

document.getElementById('slideCont').style.height = contHeight + "px";
document.getElementById('slideCont').style.clip = 'rect(auto,'+ contWidth +'px,' + contHeight +'px,auto)';
id2.style.display = '';
if(parseFloat(id1.style.top) == -(height/2)) {
id1.style.top = '0px';
}
setTimeout(clip,100)
}


function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}

addLoadEvent(function() {
clip();
});

