
schedule("searchField", initSearchField);
schedule("window", initSearchConsultations);
schedule("main", initIcons);




function initSearchField()
{
	var searchField = document.getElementById("searchField");
	
	searchField.className = searchField.className.addClass("grey");
	searchField.onfocus = onfocusSearchField;
	
	return true;
}




function onfocusSearchField()
{
	if (typeof this.clicked == "undefined")
	{
		this.className = this.className.removeClass("grey");
		this.value = "";
		this.clicked = true;
	}
	
	return true;
}




function initSearchConsultations()
{
	var searchConsultations = document.getElementById("searchConsultations");
	
	if (searchConsultations != null)
	{
		searchConsultations.className = searchConsultations.className.addClass("grey");
		searchConsultations.onfocus = onfocusSearchConsultations;
	}
	
	return true;
}




function onfocusSearchConsultations()
{
	if (typeof this.clicked == "undefined")
	{
		this.className = this.className.removeClass("grey");
		this.value = "";
		this.clicked = true;
	}
	
	return true;
}




function initIcons()
{
	var breadcrumbTrail = document.getElementById("breadcrumbTrail");
	var list = breadcrumbTrail.getElementsByTagName("ul")[0];
	
	if (list != null)
	{
		var anchors = list.getElementsByTagName("a");
		
		for (var i = 0; i < anchors.length; i++)
		{
			anchors[i].onmouseover = onmouseoverIcon;
			anchors[i].onmouseout = onmouseoutIcon;
			
			if (anchors[i].parentNode.id == "printPage")
			{
				anchors[i].onclick = onclickPrint;
			}
		}
	}
	
	return true;
}




function onmouseoverIcon()
{
	this.className = this.className.addClass("hover");
	
	return true;
}




function onmouseoutIcon()
{
	this.className = this.className.removeClass("hover");
	
	return true;
}




function onclickPrint()
{
	print();
	
	return false;
}