function popup(url,w,h,sb)
{

	atr = '';
	atr = atr + 'toolbar=no,';
	if (sb)
	{
		atr = atr + 'scrollbars=no,';
	}
	else
	{
		atr = atr + 'scrollbars=yes,';
	}
	atr = atr + 'location=no,';
	atr = atr + 'statusbar=no,';
	atr = atr + 'menubar=no,';
	atr = atr + 'resizable=no,';
	atr = atr + 'status=no,';
	atr = atr + 'toolbar=no,';
	atr = atr + 'menubar=no,';
	if (w) {
	atr = atr + 'width='+w+',';
	atr = atr + 'height='+h+',';
	}
	else{
	atr = atr + 'width=700,';
	atr = atr + 'height=700,';
	}
	atr = atr + ' left='+String((screen.width-w)/2)+', top='+String((screen.height-h)/2);
	new_window=window.open(url,'_blank',atr);
	new_window.focus();
}

function ShowSub(elem, ids, type)
{
  a=ids;
  a=a.split(','); 

	obj = document.getElementById(type+'_0');						if (obj != null)	obj.style.display = "none";

  for(i=0; i < a.length; i++)
  {
	obj = document.getElementById(type+'_'+a[i]);				if (obj != null)	obj.style.display = "none";
	obj = document.getElementById(type+'_link_'+a[i]);		if (obj != null)	obj.className = "link";	
  }
  obj = document.getElementById(type+'_'+elem); 			if (obj != null)	obj.style.display = "block";
  obj = document.getElementById(type+'_link_'+elem);	if (obj != null)	obj.className  = "active";

  return false;
}

function img_popup(img)	{
	atr = '';
	atr = atr + 'scrollbars=no,';
	atr = atr + 'location=no,';
	atr = atr + 'statusbar=yes,';
	atr = atr + 'menubar=no,';
	atr = atr + 'status=yes,';
	atr = atr + 'toolbar=no,';
	atr = atr + 'resizable=no,';
	atr = atr + 'width=300,';
	atr = atr + 'height=300,';
	atr = atr + ' left=150, top=150';

	html = '<html><head><title></title></head><body style="margin:0 0 0 0;" bgcolor="#FFFFFF"><script>function fit_img(w,h,img){ window.resizeTo(w+10,h+49);window.status=" ";}</script><div id="r1"><img src="'+img+'" alt="закрыть окно" border=0 onClick="window.close(self)" style="cursor:hand;" id="img" onload="fit_img(this.width, this.height, this);"></div></body></html>';

	win=window.open('','',atr);
	win.document.write(html);
	win.focus();
	return(false);
}


function img_popup_scroll(img)	{
	atr = '';
	atr = atr + 'scrollbars=yes,';
	atr = atr + 'location=no,';
	atr = atr + 'statusbar=yes,';
	atr = atr + 'menubar=no,';
	atr = atr + 'status=yes,';
	atr = atr + 'toolbar=no,';
	atr = atr + 'resizable=no,';
	atr = atr + 'width=300,';
	atr = atr + 'height=300,';
	atr = atr + ' left=150, top=150';

	html = '<html><head><title></title></head><body style="margin:0 0 0 0;" bgcolor="#FFFFFF"><script>function fit_img(w,h,img){ window.resizeTo(w+10,h+49);window.status=" ";}</script><div id="r1"><img src="'+img+'" alt="закрыть окно" border=0 onClick="window.close(self)" style="cursor:hand;" id="img" onload="fit_img(this.width, this.height, this);"></div></body></html>';

	win=window.open('','',atr);
	win.document.write(html);
	win.focus();
	return(false);
}

