function popUpDoc(url, target) {
	popUp(url, target, '80%', '70%', 1);
}

function popUpFoto(url, target) {
	popUp(url, target, 620, 480, 0);
}

function popUp(url, target, popUpWidth, popUpHeight, scrollable) {
	popUpWidth = toWidth(popUpWidth);
	popUpHeight = toHeight(popUpHeight);
	var screenWidth = screen.width;
	var screenHeight = screen.height;
	var popUpLeft = (screenWidth - popUpWidth) / 2;
	var popUpTop = (screenHeight - popUpHeight) / 2;
	var properties = ''
		+ 'directories=no,'
		+ 'location=no,'
		+ 'menubar=0,'
		+ 'resizable=1,'
		+ 'scrollbars=' + scrollable + ','
		+ 'width=' + popUpWidth + ','
		+ 'height=' + popUpHeight + ','
		+ 'top=' + popUpTop + ','
		+ 'left=' + popUpLeft;
	window.open(url, target, properties);
}

function toWidth(dimensionWidth) {
	return toDimension(dimensionWidth, screen.width)
}

function toHeight(dimensionHeight) {
	return toDimension(dimensionHeight, screen.height)
}

function toDimension(dimension, screenTotal) {
	var formatedNumber = '' + dimension;
	if (formatedNumber.lastIndexOf('%') != -1) {
		formatedNumber = formatedNumber.substring(0, dimension.length - 1);
		if (isNaN(formatedNumber)) {
			return;
		}
		return (formatedNumber * screenTotal) / 100;
	}
	if (isNaN(formatedNumber)) {
			return;
	}
	return formatedNumber;
}
