/**
**	======================
**	Simple DHTML Functions
**	© 2003 Shaun Johnston
**	Compverse
**	shaun@compverse.com.au
**	======================
*/

/*****************************************************************************/

/**
**	sd_SetIdClass:
**	Set the css class of a DOM object with id 'id' to the class 'value'.
*/

function sd_SetIdClass(id,value) {
	var styleObject = document.getElementById(id);
	if (styleObject != null) {
		styleObject.className = value;
	}
}

/*****************************************************************************/

/**
**	Floater Functions
**	Combined, these functions 'float' a specified number of objects
**	from the bottom to the top of a specified element.
*/

/*****************************************************************************/

/**
**	floater_newObj
**	Initialises new Floater object
*/

function floater_newObj(q,t){
	o[q] = new Array(left + parseInt(Math.random()*(document.body.clientWidth-(document.body.clientWidth-width))),bottom,1+Math.random()*riseSpeed);
	if(t==1){
		document.write('<img src="'+im+'" border="0" id="b'+q+'" style="position: absolute; z-index: '+(64+q)+'; visibility: visible; top: '+o[q][1]+'px; left: '+o[q][0]+'px;">');
	}
	if(t==0){
		tem=document.getElementById('b'+q);
		document.getElementById('b'+q).style.left = (left+(imwid/2)) + parseInt(Math.random()*(document.body.clientWidth-(document.body.clientWidth-width)-(imwid))) + 'px';
	}
}

/**
**	floater_doFloat
**	Repositions Floater object to new coordinate in path.
*/

function floater_doFloat(){
	for (i = 0; i < no; i++) {
		if(o[i][1]<top){ 
			floater_newObj(i,0); 
		}
		document.getElementById('b'+i).style.top = (o[i][1]-o[i][2])+'px';
		o[i][1]-=o[i][2];
	}
	dofall = setTimeout("floater_doFloat()", updateSpeed);
}

/**
** floater_makeFloater
** Runs through initialisation of Floater objects, then starts animation.
*/

function floater_makeFloater() {
	for (i = 0; i < no; i++){ 
		floater_newObj(i,1); 
	}
	var dofall = setTimeout("floater_doFloat(o)", 1);
}

/*****************************************************************************/
