if ((navigator.appName.indexOf("Internet Explorer") != -1) && (navigator.userAgent.indexOf("Opera") == -1)){
	bw_type = "ie";
}else if (navigator.appName.indexOf("Netscape") != -1){
	bw_type = "nn";
	if (parseInt(navigator.appVersion) >= 5){
		bw_type += "6";
	}
}else if (navigator.userAgent.indexOf("Opera") != -1){
	bw_type = "op";
	if(navigator.userAgent.indexOf("Opera 7") != -1){
		bw_type += "7";
	}
}else{
	bw_type="other";
}
if(bw_type == "ie" || bw_type == "nn6" || bw_type == "op7"){
	bw_ok = true;
}else{
	bw_ok = false;
}

mitems = new Array;

function wopen(_wurl,_wn,_ww,_wh,_wscrl){
 if(screen.width){
  wpos_x = (screen.width-_ww)/2;
  if (wpos_x < 0){ wpos_x = 0;}
  wpos_y = (screen.height-_wh)/2;
  if (wpos_y < 0){ wpos_y = 0;}
 }else{
  wpos_x = 0;
  wpos_y = 0;
 }
 if(_wn==""){ _wn = "w_test";}
 _wind_desc = window.open(_wurl,_wn,"alwaysRaised=0,top="+wpos_y+",left="+wpos_x+",height="+_wh+",width="+_ww+",menubar=0,resizable=0,scrollbars="+_wscrl+",status=0");
 _wind_desc.focus();
 return _wind_desc;
}

function top(){ window.scrollTo(0,0); }

function select_src(srcid){
var r=document.body.createTextRange();
//rid = document.all[srcid.parentElement.children[1].id];
rid = srcid.parentElement.children[1];
r.moveToElementText(rid);
r.select();
}

function get_mitem_st(iid){
	for(i=0; i<mitems.length; i++){
		if(mitems[i]==iid)
			return true;
	}
	return false;
}

function clear_mitem_st(iid){
	temp_items = new Array;
	j=0;
	for(i=0; i<mitems.length; i++){
		if(mitems[i]!=iid){
			temp_items[j] = mitems[i];
			j++;
		}
	}
	mitems = temp_items;
}

function mitem_vis(iid, ist){
	if(document.all){
		if(eval("document.all['"+iid+"']"))
			document.all[iid].style.display=(ist)?"block":"none";
		if(eval("document.all['sp_"+iid+"']"))
			document.all["sp_"+iid].style.display=(ist)?"block":"none";
	}else if(document.getElementById){
		if(eval("document.getElementById('"+iid+"')"))
			document.getElementById(iid).style.display=(ist)?"block":"none";
		if(eval("document.getElementById('sp_"+iid+"')"))
			document.getElementById("sp_"+iid).style.display=(ist)?"block":"none";
	}
	if(document.images){
		document.images["img_"+iid].src="img/bul"+ist+".gif";
	}
}

function mitem_cl(iid){
	if(get_mitem_st(iid)){
		mitem_vis(iid, 0);
		clear_mitem_st(iid);
	}else{
		mitem_vis(iid, 1);
		mitems[mitems.length] = iid;
	}
}

function srch(){
	alert('This function is under construction');
	return;

	with(document.fsrch){
		if(skeyw.value.length==0){
			alert("Введите ключевое слово");
			skeyw.focus();
		}else{
			submit();
		}
	}
}

function check_srch(){
	with(document.fsrch){
		if(skeyw.value.length==0){
			srch();
		}else{
			submit();
		}
	}
}