function trim(str) {
	var whitespace = new String(" \t\n\r");
	var s = new String(" " + str + " ");
	if (whitespace.indexOf(s.charAt(0)) != -1) {
		var j=0, i = s.length;
            while (j < i && whitespace.indexOf(s.charAt(j)) != -1) {
			j++;
		}
            s = s.substring(j, i);
	}

	if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
		var i = s.length - 1;       
            while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) {
			i--;
		}
            s = s.substring(0, i+1);
	}
	return s;
}

function openLightWindow(href, title, caption, height, width) {
	myLightWindow.activateWindow({
		href: href,
		title: title,
		caption: caption,
		height: height,
		width: width
	});
}

function curvy() {
	settings = {
		tl: { radius: 10 },
		tr: { radius: 10 },
		bl: { radius: 10 },
		br: { radius: 10 },
		antiAlias: true,
		autoPad: true,
		validTags: ["div"]
	}
	var myBoxObject = new curvyCorners(settings, "curvy");
	myBoxObject.applyCornersToAll();
}

if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", curvy, false);
}