
function bookmarksite(title, url) {
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}
//---------------------------------------------------------------

function confirmSubmit() {
	var agree = confirm("Are you sure?");
	if (agree) return true ; else return false ;
}
//---------------------------------------------------------------

/*
	Removes the spaces from begin of string and from end.
	It means, if string is "  string   " it makes "string"
	Params:
		str string [string witch need to check]
*/
function trimString (str) {

	while (str.charAt(0) == ' ')
		str = str.substring(1);
	while (str.charAt(str.length - 1) == ' ')
		str = str.substring(0, str.length - 1);

	return str;
}
//---------------------------------------------------------------

function menus()
{
	if (document.getElementById(parent))
		document.getElementById(parent).className = "selected";

	if (document.getElementById(sub_id))
		showSubMenu(sub_id);
}
//---------------------------------------------------------------

function showSubMenu(id)
{
	if (!id)
		id = "null";
	if ((sub_id) && (document.getElementById(sub_id)))
	{
		document.getElementById(sub_id).style.display = "none";
	}

	if (parent != id.substr(0, id.length - 4))
		document.getElementById(parent).className = "";

	if (document.getElementById(id))
	{
		document.getElementById(id).style.display = 'block';
		document.getElementById(id.substr(0, id.length - 4)).className = "selected";
	}
}
//---------------------------------------------------------------

function hideSubMenu(id)
{
	if (!id)
		id = "null";
	if ((sub_id != id) && (document.getElementById(id)))
	{
		document.getElementById(id).style.display = "none";
		document.getElementById(id.substr(0, id.length - 4)).className = "";
	}
	if ((sub_id) && (document.getElementById(sub_id)))
	{
		document.getElementById(sub_id).style.display = "block";
	}
	if (document.getElementById(parent))
		document.getElementById(parent).className = "selected";
}
//---------------------------------------------------------------
