function openwindow(url, width, height) {

	var userLeft = parseInt((window.screen.width/2) - (width/2));
	var userTop = parseInt((window.screen.height/2) - (height/2));
	popupVab = window.open(url, 'VABPopup', 'menubar=0, resizable=0, scrollbars=1, width=' + width + ', height=' + height + ', left='+userLeft+', top='+userTop);

}



function newImageWindow(href, target, width, height, scroll) {

	if (!scroll) {

		scroll = 'no';

	}

	var top = (document.body.clientHeight - height) / 2;
	var left = (document.body.clientWidth - width) / 2;
	top = Math.round(top);

	content = '<title>Просмотр</title><body style="margin: 0; padding: 0"><img src="' + href + '" border="0" alt="Закрыть" title="Закрыть" style="cursor: pointer" onclick="window.close()"><br>';
	win =  window.open('about:blank', 'new_windows', 'toolbar=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left + ', scrollbars=' + scroll + ', status=yes, resizable=yes');
	win.document.open();
	win.document.write(content);

}



function switchList(obj) {

	var currentLi = getParentElement(obj, 'li');
	var ul = getParentElement(obj, 'ul');
	var liArray = ul.getElementsByTagName('li');

	for (var a = 0, b = liArray.length; a < b; a++) {

		if (currentLi == liArray[a]) {

			liArray[a + 1].style.display = (liArray[a + 1].style.display == 'none') ? '' : 'none';

			return;

		}

	}

}



function getParentElement(obj, tag_name) {

	while (obj.tagName.toLowerCase() != tag_name) {

		obj = obj.parentNode;

	}

	return obj;

}
