$ = function(id) {
	return document.getElementById(id);
}

wOpen = function(url, width, height){
	new_window = window.open(url, 'popup', 'status=no, location=no, toolbar=no, scrollbars=yes, directories=no, resizable=no, width='+width+', height='+height) ;
	return new_window;
}

getElementsByClassName = function(className, sourceElement) {
	var source = sourceElement || document;
	if(typeof(source) == 'string') source = $(source);

	var elts = source.getElementsByTagName('*');
	var classArray = new Array();
	for (var j=0; j<elts.length; ++j) {
		if (elts[j].className.indexOf(className) != -1) {
			classArray.push(elts[j]);
		}
	}
	return classArray;
}

addZero = function(number, length) {
	if(!length) length = 2;
	if(number<10) {
		return '0'+number;
	}
	return number;
}
