// JavaScript Document

function rand( min, max ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Leslie Hoare
    // *     example 1: rand(1, 1);
    // *     returns 1: 1
 
    if( max ) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
    } else {
        return Math.floor(Math.random() * (min + 1));
    }
}

function getNewImage() {
	var img = document.getElementById('textimage');
	if (!img) { return false; }
	img.src='/textimage.php?'+rand(1000, 10000);
	return true;
}

function initImage() { 
	if (getNewImage()) { return; }
	setTimeout('initImage()', 100);
}
setTimeout("initImage()", 10);