
var MAXImageWidth= 800;
var MAXImageHeight= 600;

function getImageDimensions(width, height)	{
	var maxWith,maxHeight= 0;
	if ((width < MAXImageWidth) || (height < MAXImageHeight)) {
		maxWidth= width;maxHeight= height;
	}
	
	var percent,newWidth,newHeight= 0;	
	if (width>=height)	{
		percent= MAXImageWidth/width;
		newWidth= MAXImageWidth;
		newHeight= Math.round(height*percent);
	}	else	{
		percent= MAXImageHeight/height;
		newHeight= MAXImageHeight;
		newWidth= Math.round(width*percent);
		//alert('W='+newWidth+' H=' + newHeight);			
	}
	var result= new Array();
	result[0]= newWidth;result[1]= newHeight;
	return result;
}

function getImageWidth(i_w)	{
	var defaultImageSize= 800;

	if (i_w >= defaultImageSize)
		return defaultImageSize;
	else
		return i_w;
}

function getImageHeight(i_w, i_h)	{
	var w= getImageWidth(i_w);
	return i_h * (w/i_w);
}

function getThumbWidth()	{
	return 100;
}

function getThumbHeight()	{
	return 100;
}

function getNavigatorWidth()	{
	return screen.width;
}

function getNavigatorHeight()	{
	return screen.height;
}


