
function initFolderList() {
	$("#folderlist:hidden").show();
	itemsize = defaultsize;
	itemcounts = Math.floor($(document).width()/itemsize);
	itemsize = Math.round(($(document).width()-80)/itemcounts);
	$("#folderlist .item").css('width', itemsize+'px');
}

function initImage() {
	$(window).unbind('resize');
	var $image = $("#theimage");
	var winheight = $(window).height()-160;
	var winwidth = $(window).width()-100;
	var imgheight = $image.height();
	var imgwidth = $image.width();
	$image.removeAttr('height');
	$image.removeAttr('width');
	if(imgheight>imgwidth) {
		$image.attr('height', winheight);
	} else {
		$image.attr('width', winwidth);
		if($image.height()>winheight) {
			$image.removeAttr('width');
			$image.attr('height', winheight);
		}
	}
	$("#loadingback").hide();
	$("#theimage:hidde").fadeIn(500);
	$(window).resize(initImage);
}