/*
function ArrayList() {
	this.array = new Array();
	this.add = function(obj){
		if (this.getById(obj.id)) 
			throw("ID must be unique - (" + obj.id + ")")
		this.array[this.array.length] = obj;
		return(obj);
	}
	
	this.iterator = function () {
		return new Iterator(this)
	}
	
	this.length = function () {
	return this.array.length;
	}
	
	this.get = function (index) {
		return this.array[index];
	}

	this.set = function(index, value) {
		this.array[index] = value;
		return this.array[index];
	}
	this.remove = function( from, to) {
		var rest = this.array.slice((to || from) + 1 || this.array.length);
		this.array.length = from < 0 ? this.array.length + from : from;
		return this.array.push.apply(this.array, rest);
	}
	
	this.removeById = function(id) {
		this.remove(this.getIndexOfId(id));
	}
	
	this.getById = function (id) {
		return this.array[this.getIndexOfId(id)];
	}
	
	this.getIndexOfId = function(id) {
		for (var i=0; i < this.array.length; i++) {
			if (this.array[i].id == id)
			return i;
		}
	}

	this.addAll = function (obj) {
		if (obj instanceof Array){
			for (var i=0;i<obj.length;i++) {
				this.add(obj[i]);
			}
		} else if (obj instanceof ArrayList) {
			for (var i=0;i<obj.length();i++) {
			alert("E" + obj[i]);
				this.add(obj.get(i));
			}
		}
	}	
}

function Iterator (arrayList){
	this.arrayList;
	this.index = 0;
	this.hasNext = function (){
		return this.index < this.arrayList.length();
	}
	this.next = function() {
		return this.arrayList.get(index++);
	}
}



function isDefined( variable) {
    return (typeof(variable) == "undefined")?  false: true; 
}
*/

 function getStyle(element, style) { //this is taken from prototype and modified slightly
    //element = $(element);
	if (element) {
		//style = style == 'float' ? 'cssFloat' : style;
		var value = element.style[style];
		if (!value) {
				var css = document.defaultView.getComputedStyle(element, null);
				value = css ? css[style] : null;
		}
		//if (style == 'opacity') return value ? parseFloat(value) : 1.0;
		return parseFloat(value);
	}
	return value == 'auto' ? null : value;
  }

function gup( name ) {
	//this function was written by lobo235 on netlobo.com
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function getElementsByClassName(className) {
	var allElements = (document.all) ? document.all : document.getElementsByTagName("*");
	var results = new Array();
	var re = new RegExp("\\b" + className + "\\b");
	for (var i = 0; i < allElements.length; i++) {
		if (re.test(allElements[i].className)) {
			results.push(allElements[i]);
		}
	}
	return results;
}



