var
	hint = false,
	overHint = false;

function showHint() {
	if (hint == true) {
		getElement("hint").className = "visible";
		getElement("hintName").className = "now";
	}
}

function closeHint() {
	if (hint == true && overHint == false) {
		getElement("hint").className = "hidden";
		getElement("hintName").className = "";
	}
}

function hintCoordinates() {
	hint = getCoordinates("hint");
	getElement("hint").style.marginTop = "-" + (hint.height - 5) + "px";
	getElement("hint").style.top = "auto";
	getElement("hintSource").className = "on";
	hint = true;
}

getBody().onclick = function () {
	closeHint();
}

var
	pagePrevious = 0;

function setSearch() {
	page = getCoordinates("pageHeader");
	page = page.width;
	
	if (page != pagePrevious) {
		var
			logotype = getCoordinates("logotype"),
			search = getElement("search");

		var
			width_ = page - ((logotype.width + 50) * 2) + 1;
		
		search.style.width = width_ + "px";
		setCookie("sw", width_, "", "/");
		
		pagePrevious = page;
	}
}

function getSearch() {
	window.setInterval("setSearch()", 100);
}

setOnload(getSearch);
setOnload(hintCoordinates);