
var calendar = null;
function selected(cal, date) {
	cal.sel.value = date; // just update the value of the input field
}
function closeHandler(cal) {
	cal.hide();			// hide the calendar

	// don't check mousedown on document anymore (used to be able to hide the
	// calendar when someone clicks outside it, see the showCalendar function).
	Calendar.removeEvent(document, "mousedown", checkCalendar);
}
function showCalendar(id) {
	var el = document.getElementById(id);
	if (calendar != null) {
		// we already have one created, so just update it.
		calendar.hide();		// hide the existing calendar
		calendar.parseDate(el.value); // set it to a new date
	} else {
		// first-time call, create the calendar
		var cal = new Calendar(true, null, selected, closeHandler);
		calendar = cal;		// remember the calendar in the global
		cal.setRange(1900, 2070);	// min/max year allowed
		calendar.create();		// create a popup calendar
		calendar.parseDate(el.value); // set it to a new date
	}
	calendar.sel = el;		// inform it about the input field in use
	calendar.showAtElement(el);	// show the calendar next to the input field

	// catch mousedown on the document
	Calendar.addEvent(document, "mousedown", checkCalendar);
	return false;
}
function checkCalendar(ev) {
	var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
	for (; el != null; el = el.parentNode)
	// FIXME: allow end-user to click some link without closing the
	// calendar.  Good to see real-time stylesheet change :)
	if (el == calendar.element || el.tagName == "A") break;
	if (el == null) {
		// calls closeHandler which should hide the calendar.
		calendar.callCloseHandler(); Calendar.stopEvent(ev);
	}
}

var isNN,isIE,isOpera;
var imageTitle="Podgl±d";
var imgWin;
var adding;
function showFull(img_tiny)
{
		PositionX = 100;
		PositionY = 100;
		defaultWidth = 520;
		defaultHeight = 520;
		var AutoClose = true;
		
		if (parseInt(navigator.appVersion.charAt(0))>=4){
		isNN=(navigator.appName=="Netscape")?1:0;
		isOpera=(navigator.appName=="Opera")?1:0;
		isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
		if (parseInt(navigator.appVersion.indexOf('MSIE 7.0'))!=-1){
			adding=140;
		}else{
			adding=0;
		}
		var optNN='statusbar=yes,scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
		var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
		
		if (isNN||isOpera){imgWin=window.open('about:blank','',optNN);}
		if (isIE){imgWin=window.open('about:blank','',optIE);}

		with (imgWin.document){
			writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
			writeln('</head><body bgcolor=000000 scroll="no" >')
			writeln('<img name="George" id="George" src="'+img_tiny+'"  style="display:block"></body></html>');
			close();
			
	}
	window.setTimeout('onimageload()',1);

		
		
return false;
}


function onimageload(){
	if(imgWin.document.getElementById("George").complete){
			
			if (isOpera){
				width=imgWin.document.images[0].width+8;
				height=imgWin.document.images[0].height+40;
				imgWin.resizeTo(width,height);
			}
			if(isIE){
				imgWin.resizeTo(0,0);
				width=100-(imgWin.document.body.clientWidth-imgWin.document.images[0].width);
				height=100-(imgWin.document.body.clientHeight-imgWin.document.images[0].height);
				width+=adding;	
				imgWin.resizeTo(width,height);
			}
			if (isNN){
					width=imgWin.document.images[0].width+10;
					height=imgWin.document.images[0].height+59;
					imgWin.resizeTo(width,height);
			}
			
			if(imgWin.innerHeight&&!isOpera){
				imgWin.resizeTo(0,0);
				imgWin.innerHeight=imgWin.document.getElementById("George").height;
				imgWin.innerWidth=imgWin.document.getElementById("George").width;
				
			}
			imgWin.document.title=imageTitle;	
	}else{
		window.setTimeout('onimageload()',1);
	}
}
