$(document).ready(function() {
	$("a[class*='popup']").click(function() {
		classList = $(this).attr('class').split(' ');
		for(i in classList) {
			if(classList[i].substr(0,1) == 'w') {
				width = parseInt(classList[i].substr(1))
			} else if(classList[i].substr(0,1) == 'h') {
				height = parseInt(classList[i].substr(1))
			}
		}
		config = {
			url:	$(this).attr('href'),
			width:	width,
			height:	height
		}
		return openPopup(config);
	})
})

function openPopup(config) {
	defaultConfig = {
		popupId:	'popupWindow',
		width:		525,
		height:		725
	}
	
	config = jQuery.extend({}, defaultConfig, config);
	newWindow = window.open(config.url, config.popupId, "scrollbars=1,resizable,width=" + config.width + ",height=" + config.height);
	newWindow.focus();

	return false;
}
