function setBookmark() {
	if (window.sidebar) {
		window.sidebar.addPanel(document.title, location.href, '');
	}
	else if (document.all) { 
		window.external.AddFavorite(location.href, document.title);
	}
	else {
		alert('Function is not available');
	}
	return false;
}

function setHomepage() {
	if (document.all) {
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(location.href);
		return false;
	}
	return true;
}

var search_text = "";

function search_onfocus()
{
        if(!search_text) {
            document.getElementById("s").value="";
        }
}

function search_onblur()
{
	search_text = document.getElementById("s").value;
	if(!search_text) {
		document.getElementById("s").value = searchdef_text;
	}
}

function showcalendar()
{
	calendar = 1 - calendar;
	if (calendar == 1)
	{
		document.getElementById("date_calendar").style.display = "block";
	}
	else
	{
		document.getElementById("date_calendar").style.display = "none";
	}
}

function calendar_list(arg)
{
	var month = 0;
	var year = 0;
	month = document.getElementById("month").value;
	year = document.getElementById("year").value;
	if (arg == -1)
	{
		if (month == 1)
		{
			month = 12;
			year = year - 1;
		}
		else
		{
			month = month - 1;
		}
	}
	else if (arg == 1)
	{
		if (month == 12)
		{
			month = 1;
			year = eval(year) + 1;
		}
		else
		{
			month = eval(month) + 1;
		}		
	}
	document.getElementById("month").value = month;
	document.getElementById("year").value = year;
	document.calendar_form.submit();
}

var FullWidth = 0;
var scrollWidth = document.documentElement.scrollWidth;
var scrollHeight = document.documentElement.scrollHeight;


function changeplace(liel)
{
	baseoffset = 28 + (scrollWidth - 1024)/2;
	ULBlockWidth = 191;
	ULBlockMarginL = 15;
//				obj1=document.getElementById("jsdata");
				//obj1.value = scrollWidth+" "+scrollHeight;
	obj2 = liel.getElementsByTagName("ul");		
	obj3 = liel.parentNode;
	obj4 = obj3.parentNode;
	obj3 = obj4.parentNode;
	if (FullWidth == 0)
	{
		FullWidth = baseoffset + liel.offsetLeft + ULBlockWidth;
//		obj1.value = (FullWidth);
		if (obj3.id != "nav")
		{
			if (obj2[0])
			{
				if (FullWidth > scrollWidth)
				{
					obj2[0].style.marginLeft = "-80px";
				}
				else
				{
					obj2[0].style.marginLeft = "0px";
				}	
			}
		}
	}
	if (obj3.id == "nav")
	{
		if (FullWidth == ULBlockWidth + ULBlockMarginL + baseoffset)
		{
			if (obj2[0])
			{
				FullWidth = baseoffset + obj4.offsetLeft + 2 * ULBlockWidth;
//				obj1.value = (FullWidth);
				if (FullWidth > scrollWidth)
				{
					if (navigator.appName == "Microsoft Internet Explorer" && parseFloat(navigator.appVersion) == 4.0)
					{
						obj2[0].style.marginLeft = "-304px";
					}
					else
					{
						obj2[0].style.marginLeft = "-299px";
					}
						
				}
				else
				{
					obj2[0].style.marginLeft = "45px";
				}				
			}
			else
			{
				FullWidth = baseoffset + obj4.offsetLeft + ULBlockWidth;
//				obj1.value = (FullWidth);
				if (FullWidth > scrollWidth)
				{
					obj2 = liel.parentNode;
					obj2.style.marginLeft = "-80px";
				}
				else
				{
					obj2 = liel.parentNode;
					obj2.style.marginLeft = "0px";
				}
			}
		}
	}
}

function changeback()
{
	FullWidth = 0;
	scrollWidth = document.documentElement.scrollWidth;
	scrollHeight = document.documentElement.scrollHeight;
}
