function doNothing(){
}

var showImagePopupImage = 0;
var showImagePopupUrl = 0;

function showImagePopupInternal(url){
	if (url != showImagePopupUrl)
		return;
	var height = showImagePopupImage.height;
	var width = showImagePopupImage.width;
	if ((width > 0) && (height > 0)){
		showPopWin(url, 'Podgląd', width + 40, height + 40, doNothing, true);	
	} else {
		setTimeout("showImagePopupInternal('" + url + "');", 100);
	}
}

function showImagePopup(url){
	showImagePopupUrl = url;
	showImagePopupImage = new Image();
	showImagePopupImage.src = 'http://platforma.hermin.edu.pl/' + url;
	showImagePopupInternal(url);
	return false;
}

function showDocumentPopup(documentId, caption, height){
	//todo: zrobic pobieranie z javascriptu szerokości i wysokosci...
	var width = 720;
	height = typeof(height) != 'undefined' ? height : 450;
	
	showPopWin('?component=document&documentPage=popup&documentId=' + documentId, caption, width, height, doNothing, false);
}

function hideDocumentPopup(){
	window.top.hidePopWin();
}
