
function swapClass(i,c) { 
	if (document.getElementById) {  
	document.getElementById(i).className =  c;  
	} else {
	document.all[i].className = c;	
	}
}

function getElement( base, i ) {
	if (base.getElementById) {  
		return base.getElementById(i);  
	} else {
		return base.all[i];	
	}
}

function swapSrc(i,c) { 
	if (document.getElementById) {  
	document.getElementById(i).src =  c;  
	} else {
	document.all[i].src = c;	
	}
}

//need to store the images globally so they don't go out of scope and not load.
//they appear to load in the order they are referenced on most browsers, so you
//can expect images to appear in the order you preload them.
preloadedImages = new Array();
function preloadImg( imgurl )
{
	var img = new Image();
	img.src = imgurl;
	preloadedImages[preloadedImages.length] = img;
}


function parseQueryString (str) {
  str = str ? str : location.search;
  var query = str.charAt(0) == '?' ? str.substring(1) : str;
  var args = new Object();
  if (query) {
    var fields = query.split('&');
    for (var f = 0; f < fields.length; f++) {
      var field = fields[f].split('=');
      args[unescape(field[0].replace(/\+/g, ' '))] = unescape(field[1].replace(/\+/g, ' '));
    }
  }
  return args;
}

