/**
* @author Cristian Ciobanu
*/
function openWindow(URL,width,height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width="+width+",height="+height+",left = 50,top = 50');");
	return false;
}

function swapPIC(id, source) {document.getElementById(id).src = source;return false;}

function trim(a) {a = a.replace(/^\s+/, '');return a.replace(/\s+$/, '');}

function followLink(url) {window.location = url;}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null ) node = document;
	if ( tag == null ) tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {if ( pattern.test(els[i].className) ) {classElements[j] = els[i];j++;}}
	return classElements;
}