/* 
-----------------------------------------------------------------
	BRANZ
	imageswapper.js
	
	Swaps out an image every 5 seconds.
	Requires that swap_image() is called on page load.
-----------------------------------------------------------------
*/

function swap_image() {
    var image = $class('csc-textpic-image');
    if ( ! image.hasChildNodes() || ! image.firstChild.hasChildNodes() ) return;
    image = image.firstChild.firstChild;
    if ( image == null ) return;
    // adds random number to force new image to load
    image.src = '/fileadmin/templates/resources/images/image_swapper/image.php?im='+Math.floor(Math.random()*10000001); 
    timer = setTimeout('swap_image()', 5000);
}

