d = document;
mymenu = new Array();
divArray = new Array();
myStatic = 0;
MY_ALLIGN = 'left';
budilnik = null;
activeLayer  = 0;
// Получит дом обьект по имени
//////////////////////////////////////////
function getElement(name){
	 return d.getElementById(name);
}

// Получит ширину положение
//////////////////////////////////////////
function getWidth(object)
{
  return object.offsetWidth;
}

// Получит высоту положение
//////////////////////////////////////////
function getHeight(object)
{
  return object.offsetHeight;
}

// Изменит контент обьекта
//////////////////////////////////////////
function changeContent(object, text)
{
  object.innerHTML = text;
  return true;
}

function myParentSort(array){
	i = 0;
	while(array[i] != null) {
		j =  0;
		while(array[j] != null) {
			if (array[i].parent < array[j].parent ) {
				temp = array[j];
				array[j] = array[i];
				array[i] = temp;
			}
			j++;
		}
		i++;
	}
	return array;
}
function getObjectTop(object) {
	return getSummRelativeProperty(object, "BODY", "offsetTop");
}

function getObjectLeft(object){
	return getSummRelativeProperty(object, "BODY", "offsetLeft");
}

function getSummRelativeProperty(o, relativeTagName, property) {
	var str = "";
	var par = o.offsetParent;
	var val = eval("o."+property);
	str += " +" + eval("o."+property);
	while(par.tagName != relativeTagName) {
		val += eval("par."+property);
		str += " + "+ par.tagName + "." + property+ "=" + eval("par."+property);
		par = par.offsetParent;
	}
	return val;
}

function alertObject(object, onlyNotEmptyFields) {
	var str = "";
	var i = 0;
	if (typeof object == "object" || typeof object == "Array")
	for(key in object) {
		if (onlyNotEmptyFields && object[key] == "") {
			continue;
		}
		if (typeof object[key] == "function") {
			continue;
		}
		str += "object."+key + " = "+ object[key]+ " "+ (++i%3 ? ";\t" : ";\n")+"";
	}
	if (str == "") {
		alert(object + " / " + typeof object );
	} else {
		alert(str);
	}
}