function objFromID(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

function obj(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

function addElement(what, where, name) {
	var p = obj(where) ;
	var c = document.createElement('div'); 
	c.setAttribute('id',name); 
	c.innerHTML = what ;
	p.appendChild(c); 
} 

function removeElement(what, where) { 
	var p = obj(where) ;
	var c = obj(what) ;
	//alert('removing: ' + what + '(' + c + ') from ' + where + ' (' + p + ')') ;
	p.removeChild(c) ; 
	//alert(what + " (" + c + ") removed from " + where + " (" + p + ")") ;
} 

function imgSwap(what, where) {
	obj(where).src = what ;
}

var preload_images = new Array() ;

function preload() {
    for (var i = 0; i < arguments.length; i++){
        preload_images[i] = document.createElement('img');
        preload_images[i].setAttribute('src',arguments[i]);
    };
};