function borders () {
	if (document.getElementById('little_pics')) {
		var div=document.getElementById('little_pics');
		var ul=div.getElementsByTagName('ul');
		var divs=ul[0].getElementsByTagName('div');
		for (var i=0;i<divs.length;i++) {
			divs[i].onmouseover=function() {
				this.style.border="1px solid #4b9700";
			}
			divs[i].onmouseout=function() {
				this.style.border="1px solid #a38670";
			}
		}
		}
	
}
function popupbyname(url,w,h,id){
		if (typeof(w) == 'undefined') 
	{ 
		xPos = window.screenLeft+10;
		yPos = window.screenTop+20;
		win = window.open(siteURL + '/objects/editor/viewpopup.php?url='+url, 'filepopup', "width=400,height=230,left="+xPos+",top="+yPos+",scrollbars=no,resizable=no,toolbars=no");
	} else {
		xPos = Math.round(document.getElementsByTagName('body')[0].clientWidth/2)-Math.round(w/2);
		yPos = Math.round(document.getElementsByTagName('body')[0].clientHeight/2)-Math.round(h/2);
		args = "width="+w+",height="+h+",left="+xPos+",top="+yPos+",scrollbars=no,resizable=no,toolbars=no";
		//name =  name.substr(0, name.indexOf("."));
		win = window.open(url, id, args);
	}	
}

function show_hide () {
	if (document.getElementById('questions')) {
		var dl=document.getElementById('questions');
		var dd=dl.getElementsByTagName('dd');
		for (var i=0; i<dd.length;i++) {
			if (dd[i].className=="show_hide") {
				dd[i].onclick=function () {
					var next_dd=this.nextSibling;
					if (next_dd.nodeType==3) {
						next_dd=next_dd.nextSibling;
					}
					if (next_dd.style.display=="block") {
					next_dd.style.display="none";
					this.innerHTML='Открыть ответ';
					this.style.backgroundImage="url("+siteURL+"/im/down.gif)";
					}
					else {
					next_dd.style.display="block";
					this.innerHTML='Скрыть ответ';
					this.style.backgroundImage="url("+siteURL+"/im/up.gif)";
					}
				}
			}
		}
	}
}