var opswin;
var top_=10;
var left_=10;
function adm_opwin(a,w,h){
	if (navigator.userAgent.toLowerCase().indexOf("opera")==-1 && opswin!=null && !opswin.closed)opswin.close();
	//tops(w,h);
	opswin=window.open(a,'',"height="+h+",width="+w+",status=yes,toolbar=no,menubar=no,location=yes,top="+top_+",left="+left_+",scrollbars=auto,resizable=yes");
	opswin.focus();
}
function tops(w,h){
	if(navigator.appName == "Netscape") {
		top_=window.innerHeight/2-h/2;
		left_=window.innerWidth/2-w/2;
	}
	else{
		top_=document.body.clientHeight/2-h/2;
		left_=document.body.clientWidth/2-w/2;
	}
	if(top_<0)top=0;
	if(left_<0)top=0;
}
var ind=0;
function iframe_href(a){
	window.frames['iframe_index'+ind].location.href='iframe_index.php?'+a;
	if(++ind>4)ind=0;
}
function iframe_href_select(a,i){
	window.frames['iframe_index'+i].location.href='/adm/iframe_index.php?'+a;
}
function popwin(nam,w,h){
	var linkk='/popwin.html?link='+nam;
	//tops(w,h);
	param = 'top='+top_+',left='+left_+',width='+w+',height='+h;
	if(navigator.userAgent.toLowerCase().indexOf("opera")==-1 && opswin!=null && !opswin.closed)opswin.close();
	opswin=window.open(linkk,'',param+',status=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes');
	opswin.focus();
	return false;
}
var edit_layer_id_old='-';
function edit_layer_show(a){
	edit_layer_cleartimeout();
	if(edit_layer_id_old!='-' && document.getElementById('t'+edit_layer_id_old)){
		document.getElementById('t'+edit_layer_id_old).style.display='none';
		edit_layer_id_old='-';
	}
	if(document.getElementById('t'+a)){
		document.getElementById('t'+a).style.display='block';
		edit_layer_id_old=a;
	}
}
function edit_layer_hide(a){
	if(document.getElementById('t'+a))document.getElementById('t'+a).style.display='none';
}
var edit_layer_timeout;
function edit_layer_hide_timeout(a){
	edit_layer_timeout=setTimeout("edit_layer_hide('"+a+"')",500);
}
function edit_layer_cleartimeout(){
	clearTimeout(edit_layer_timeout);
}

/*function ident_form(a){
	var f=document.forms[0];
	f.select_name.value=a;
}
function submit_form(a){
	var f=document.forms[0];
	f.select_all.value=a;
	f.submit();
	f.select_all.value='';
}
function conf_func(a){
	return confirm('Подтвердите удаление:\n'+a);
}*/
var start_div='-';
function show_alt_mouse(nim,t){
	if(document.getElementById("div_"+nim) ){//&& dhtml_objects["div_"+nim]
		show_alt_cleartimeout();
		var d=document.getElementById("div_"+nim).style;
		show_alt_hide(start_div);
		start_div=nim;
		d.display='block';
		//d.left=-dhtml_objects["div_"+nim].get_width();
		//if(t){
			//d.top=-(5+dhtml_objects["div_"+nim].get_height());
		//}
	}
}
function show_alt_hide(a){
	if(document.getElementById('div_'+a)){
		document.getElementById('div_'+a).style.display='none';
	}
}
var show_alt_timeout;
function show_alt_hide_timeout(a){
	show_alt_timeout=setTimeout("show_alt_hide('"+a+"')",500);
}
function show_alt_cleartimeout(){
	clearTimeout(show_alt_timeout);
}
function displays_div(m){
	if (document.getElementById('map_g_'+m).style.display=='block') 	document.getElementById('map_g_'+m).style.display='none';
	else	document.getElementById('map_g_'+m).style.display='block';
	return false;
}
