// Copyright 2005-2009 Enzon
// design by Enzon.cz [http://www.enzon.cz]

function preload(file){
	img = new Image();
	img.src = file;
}
function bodyload(){
	
	var contentHeight = 0;
	contentHeight = document.body.clientHeight-255;
	if(contentHeight<300) contentHeight = 300;
	SZN.gEl("layoutContentPadding").style.height = contentHeight+'px';
	
}
function confirmMessage(text){
	if(!confirm(text)){
		return false;
	}		
}

function openImage(root,title,image,next){
	var img = new Image();
	img.src = image;
	var width = img.width;
	var height = img.height;
	if(width>screen.availWidth) width = screen.availWidth;
	if(height>screen.availHeight) width = screen.availHeight;
	if(next){
		var newWin = window.open(root+"/image.php?title="+title+"&image="+image+"&next="+next, Math.ceil(Math.random()*4000000), "width="+width+", height="+height+",left="+((screen.availWidth/2)-(width/2))+",top="+((screen.availHeight/2)-(height/2)));
		newWin.focus();
	}else{
		var newWin = window.open(root+"/image.php?title="+title+"&image="+image, Math.ceil(Math.random()*4000000), "width="+width+", height="+height+",left="+((screen.availWidth/2)-(width/2))+",top="+((screen.availHeight/2)-(height/2)));
		newWin.focus();
		window.close();
	}
	return false;
}
