function max_height(objcontainer, obj, height) {	
	if (objcontainer.offsetHeight > height && obj.offsetHeight >= height) {
		obj.style.top = (objcontainer.offsetHeight - height) / 2 + 'px';
		return height + 'px';
	}
	else {
		obj.style.top = '0px';		
		var resultHeight = objcontainer.offsetHeight;		
		return (resultHeight % 2 ? resultHeight - 1 : resultHeight) + 'px';
	}
}
function _max_height_(container, content, max_height, percentage_value_height, margin_bottom) {
	var resultHeight = 0;
	var height_container = container.offsetHeight - margin_bottom;
	var height_content = (height_container * percentage_value_height) / 100;
	
	if (height_content > max_height) {		
		resultHeight = max_height;
	}
	else {
		resultHeight = Math.floor(height_content);
		resultHeight = (resultHeight % 2 ? resultHeight - 1 : resultHeight);
	}
	content.style.top = (height_container - resultHeight) + 'px';
	return resultHeight + 'px';
}
function even(value) {
	return Math.floor(value) % 2 ? Math.floor(value) - 1 : value;
}
function fixPNG(element)
{
	if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent))
	{
		var src;
	
		if (element.tagName=='IMG')
		{
			if (/\.png$/.test(element.src))
			{
			src = element.src;
			element.src = "/f/blank.gif";
			}
		}
		else
		{
			src = element.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i)
			if (src)
			{
				src = src[1];
				element.runtimeStyle.backgroundImage="none";
			}
		}
		if (src) element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
	}
}
var set_cookie = function (name, value, path) {
	document.cookie = name + "=" + escape(value) + (path ? "; path=" + path : "");
}
var get_cookie = function (name) {
	var allcookies = document.cookie;
	var pos = allcookies.indexOf(name + "=");
	if (pos != -1) {
		var start = pos + name.length + 1;
		var end = allcookies.indexOf(";", start);
		if (end == -1) end = allcookies.length;
		return unescape(allcookies.substring(start, end));
	}
}
function getDateTime() {
	return (new Date()).getTime();	
}