//<![CDATA[


function getPageSize() {
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	arrayPageSize = new Array(windowWidth,windowHeight) 
	return arrayPageSize;
}


function fadeIn(objName,fromOpacity,toOpacity) {
	var obj = document.getElementById(objName);

	if (fromOpacity<toOpacity) {
		if (fromOpacity==0)	{
			obj.style.display	= 'block';
		}
		fromOpacity					= fromOpacity+10;
		obj.style.filter			= 'alpha(opacity: '+ fromOpacity +')';
		obj.style.opacity			= fromOpacity>0 ? fromOpacity/100 : 0;
		obj.style['-moz-opacity']	= fromOpacity>0 ? fromOpacity/100 : 0;
		setTimeout('fadeIn(\''+ objName +'\','+ fromOpacity +','+ toOpacity +')',1);
	}
}


function fadeOut(objName,fromOpacity,toOpacity) {
	var obj = document.getElementById(objName);

	if (fromOpacity>toOpacity) {
		fromOpacity					= fromOpacity-10;
		obj.style.filter			= 'alpha(opacity: '+ fromOpacity +')';
		obj.style.opacity			= fromOpacity>0 ? fromOpacity/100 : 0;
		obj.style['-moz-opacity']	= fromOpacity>0 ? fromOpacity/100 : 0;
		
		setTimeout('fadeOut(\''+ objName +'\','+ fromOpacity +','+ toOpacity +')',1);
	} else {
		obj.style.filter	= 'alpha(opacity: 0)';
		obj.style.opacity	= 0;
		obj.style['-moz-opacity']	= 0;
		obj.style.display	= 'none';
	}
}


function showImageBox(imSrc,imW,imH) {
	var pageSize		= getPageSize();

	var obj				= document.getElementById('imageContainer');
	obj.style.left		= Math.floor((pageSize[0]-imW-20)/2)+'px';
	obj.style.top		= Math.floor((pageSize[1]-imH-20)/2)+'px';
	obj.style.width		= imW+'px';
	obj.style.height	= imH+'px';
	obj.innerHTML		= '<img src="'+imSrc+'" width="'+imW+'" height="'+imH+'" style="cursor: pointer" onClick="hideImageBox();">';

	fadeIn('imageBox',0,50);
	fadeIn('imageContainer',0,100);
};


function hideImageBox() {
	fadeOut('imageBox',50,0);
	fadeOut('imageContainer',100,0);
};


//]]>
