function sizeDef()
{
	currentSize = 0;
	dw_fontSizerDX.reset();
}

function sizeMiddle()
{
	if (currentSize > 2)
	{
		currentSize = -2;
		dw_fontSizerDX.adjust(currentSize);
	}
	else if (currentSize == 0)
	{
		currentSize = 2;
		dw_fontSizerDX.adjust(currentSize);
	}
	currentSize = 2;
}

function sizeMax()
{
	if (currentSize == 2)
	{
		currentSize = 2;
		dw_fontSizerDX.adjust(currentSize);
	}
	else if (currentSize == 0)
	{
		currentSize = 4;
		dw_fontSizerDX.adjust(currentSize);
	}			
	currentSize = 4;
}
	
function opengallery (src)
{
	document.getElementById("gallery_frame").src = src;
	document.getElementById("gallery_opacity").style.display='block';
	window.scroll(0,0);
	document.getElementById("gallery_body").style.display='block';
	getHeight();
}


function closegallery ()
{
	document.getElementById("gallery_frame").src = context + "index.php/mod/gallery/act/view/gal_id/0";
	document.getElementById("gallery_body").style.display='none';
	document.getElementById("gallery_opacity").style.display='none';
	document.getElementById("body_content").style.height = "auto";
	document.getElementById("body_content").style.overflow = "visible";	
}

function rolloverprev ()
{
	document.getElementById("prev_photo_img").style.display = 'none';
	document.getElementById("prev_photo_img_hover").style.display = 'block';
}

function rolloutprev ()
{
	document.getElementById("prev_photo_img").style.display = 'block';
	document.getElementById("prev_photo_img_hover").style.display = 'none';
}

function rollovernext ()
{
	document.getElementById("next_photo_img").style.display = 'none';
	document.getElementById("next_photo_img_hover").style.display = 'block';
}

function rolloutnext ()
{
	document.getElementById("next_photo_img").style.display = 'block';
	document.getElementById("next_photo_img_hover").style.display = 'none';
} 

/*function getHeight()
{
	obj = document.getElementById("gallery_opacity");
	obj.style.height = document.documentElement.scrollHeight+"px";
	obj.style.width = document.documentElement.scrollWidth+"px";
}*/

function getHeight()
{
	var MaxHeight = document.documentElement.clientHeight;
	var h = document.getElementById("gallery_frame").clientHeight;
	if (h > MaxHeight) MaxHeight = h;
		
	obj = document.getElementById("gallery_opacity");
	obj.style.height = MaxHeight+"px";
	document.getElementById("body_content").style.height = MaxHeight-12+"px";
	document.getElementById("body_content").style.overflow = "hidden";
	obj.style.width = document.documentElement.scrollWidth+"px";
	obj = document.getElementById("gallery_opacity");
} 


function correct_menu()
{
	obj = document.getElementById("nav");
	var width = 0;
	liobj = obj.firstChild;
		if (liobj.clientWidth != undefined)
		{
			width += liobj.clientWidth;
		}
	while (liobj = liobj.nextSibling)
	{
		if (liobj.clientWidth != undefined)
		{
			width += liobj.clientWidth;
		}		
	}
	document.getElementById("index_table").style.width = width+"px";
}

var FullWidth = 0;
var scrollWidth = document.documentElement.scrollWidth;
var scrollHeight = document.documentElement.scrollHeight;

function changeplace(liel)
{
	baseoffset = 312 + (scrollWidth - 834)/2;
	ULBlockWidth = 145;
	ULBlockMarginL = 11;
	obj2 = liel.getElementsByTagName("ul");		
	obj3 = liel.parentNode;
	obj4 = obj3.parentNode;
	obj3 = obj4.parentNode;
	if (FullWidth == 0)
	{
		FullWidth = baseoffset + liel.offsetLeft + ULBlockWidth;
		if (obj3.id != "nav")
		{
			if (obj2[0])
			{
				if (FullWidth > scrollWidth)
				{
					obj2[0].style.marginLeft = "-80px";
				}
				else
				{
					obj2[0].style.marginLeft = "30px";
				}	
			}
		}
	}
	if (obj3.id == "nav")
	{
		if (FullWidth == ULBlockWidth + ULBlockMarginL + baseoffset)
		{
			if (obj2[0])
			{
				FullWidth = baseoffset + obj4.offsetLeft + ULBlockWidth + 58;
				if (FullWidth > scrollWidth)
				{
					if (navigator.appName == "Microsoft Internet Explorer" && parseFloat(navigator.appVersion) == 4.0)
					{
						obj2[0].style.marginLeft = "-259px";
					}
					else
					{
						obj2[0].style.marginLeft = "-259px";
					}
						
				}
				else
				{
					obj2[0].style.marginLeft = "5px";
				}				
			}
			else
			{
				FullWidth = baseoffset + obj4.offsetLeft + ULBlockWidth;
				if (FullWidth > scrollWidth)
				{
					obj2 = liel.parentNode;
					obj2.style.marginLeft = "-80px";
				}
				else
				{
					obj2 = liel.parentNode;
					obj2.style.marginLeft = "30px";
				}
			}
		}
	}
}

function changeback()
{
	FullWidth = 0;
	scrollWidth = document.documentElement.scrollWidth;
	scrollHeight = document.documentElement.scrollHeight;
}