function ecPopup(site, width, height) {
	w = window.open(site, 'events', 'width=' + width + ',height=' + height + ',top=10,left=200,resizable=yes,scrollbars=yes,dependent');
	w.focus();
}

function ecResizeImages() {
	for (var i = 0; i < document.images.length; i++) {
		if (document.images[i].className == 'ecEmbeddedImage') {
			var imageWidth = document.images[i].width;
			var imageHeight = document.images[i].height;
			
			if ((ecImageMaxWidth != 0 && imageWidth > ecImageMaxWidth) || (ecImageMaxHeight != 0 && imageHeight > ecImageMaxHeight)) {
				if (ecImageMaxWidth != 0) 
					var ratio1 = ecImageMaxWidth / imageWidth;
				else 
					var ratio1 = 1;
				if (ecImageMaxHeight != 0) 
					var ratio2 = ecImageMaxHeight / imageHeight;
				else 
					var ratio2 = 1;
							
				if (ratio1 < ratio2) {
					document.images[i].width = ecImageMaxWidth;
					document.images[i].height = Math.round(imageHeight * ratio1);
				} else {
					document.images[i].height = ecImageMaxHeight;
					document.images[i].width = Math.round(imageWidth * ratio2);
				}
			}
		}
	}
}