if (self.location != top.location) { top.location = self.location; }
var bOK = document.getElementsByTagName;

function init() {
	if (typeof(initMap) == "function") {
		initMap();
	}
	if (typeof(initFlakes) == "function") {
		initFlakes();
	}
	var oLI = document.getElementById("li");
	if (oLI) {
		oLI.href = "http://www.liveinternet.ru/click";
	}
}

function uninit() {
	if (document.getElementById("google-map")) {
		GUnload;
	}
}

document.createHTMLElement = function(elemName, attribs) {
	var i, elem, isNamespaced;
	if (document.createElementNS && elemName != "a") {
		elem = document.createElementNS("http://www.w3.org/1999/xhtml", elemName);
		isNamespaced = true;
	} else {
		elem = document.createElement(elemName);
		isNamespaced = false;
	}
	if (typeof attribs != 'undefined') {
		for (i in attribs) {
			switch (true) {
			case (i == "text")  : elem.appendChild(document.createTextNode(attribs[i])); break;
			case (i == "class") : elem.className = attribs[i]; break;
			case (i == "id") : elem.id = attribs[i]; break;
			default :
				if (isNamespaced) {
					elem.setAttributeNS("http://www.w3.org/1999/xhtml", i, attribs[i]);
				} else {
					elem.setAttribute(i, attribs[i]);
				}
			}
		}
	}
	return elem;
}

var showpic = function(link) {
	link.blur();
	link.setAttribute("target", "imwin");
	var iw = window.open("","imwin","width=200,height=200,resizable=1");
	iw.focus();
	return true;
}

if (bOK) {
	window.onload = init;
	window.onunload = uninit;
}
