// JavaScript Document

function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function') window.onload = func;
	else window.onload = function() {
	oldonload();
	func();
	}
}

function maxWindow(){
	self.moveTo(0,0);
	self.resizeTo(screen.availWidth,screen.availHeight);
}

function showPict(){
	var html = '<img src="imageThumb.php?imgfile='+imgfile+'&heightMax='+Number(window.getHeight()-5)+'" height="'+Number(window.getHeight()-5)+'"/>';
	$('background').setHTML(html);	
}
function onEnterClick(event, item){
	e = new Event(event).stop();
	if(! window.focus){ return; }
	//w = window.open(item,'full','fullscreen=yes');
	w = window.open(item,'full',"resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no,copyhistory=no,scrollbars=no,width="+(screen.width-10)+",height="+(screen.height-40)+",top=0,left=0");	
	w.focus();	
}

function init(){
	maxWindow();
	showPict();	
	$('enter').addEvent('click', function(event){ onEnterClick(event, $('enter')); }.bind(this));	
}

addLoadEvent(init);
onresize = init;