focus();
isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isMSIE=document.all && document.all.item //Microsoft Internet Explorer 4+
isMSIE5=isDOM && isMSIE //MSIE 5+
isOpera=isOpera5=window.opera && isDOM //Opera 5+
isOpera6=isOpera && window.print //Opera 6+
isOpera7=isOpera && navigator.userAgent.indexOf("Opera 7") > 0 ||
                    navigator.userAgent.indexOf("Opera/7") >= 0 //Opera 7
isNetscape4=document.layers //Netscape 4.*
isMozilla=isNetscape6=isDOM && (navigator.appName=="Netscape")
//Mozilla или Netscape 6.*

//'===================================================================
//'sub regw
//'Открыть окно
//'url	=	url
//'wname	=	имя окна
//'x		=	ширина
//'y		=	высота
function regw(url,wname,x,y) 
{
wwregw=window.open(url,wname,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width='+x+',height='+y+',resizable=no');
top.window.wwregw.focus();
};
//'=======================================================================
//'подтвердить удаление

function del_confirm(a){
	if (confirm(' Вы уверены ? ')) {
	document.location.href=a;
	}
};

//'========================================================================
//'отсабмитить форму, установив значение
//'submit_confirm(this.form,'act','delete')

function submit_confirm(a,loc,val){
	if (confirm(' Вы уверены ? ')) {
	a[loc].value=val;
	a.submit();
	}
};


//'=======================================================================
//Sub sel_input
//' при выборе <select>-ом поля selvalue показать поле ввода textname
//'formname	= имя формы
//'selname	= имя поля <select name=>
//'textname	= имя поля <input text=>
//'selvalue	= значение, при котором показывать <input>


function sel_input(formname,selname,textname,selvalue){
var sel_input = parseInt(document.forms[formname].elements[selname].options[document.forms[formname].elements[selname].options.selectedIndex].value,10);
if (sel_input== selvalue) {
document.forms[formname].elements[textname].style.display='';
document.forms[formname].elements[textname].select();
document.forms[formname].elements[textname].focus();
	}
else {
document.forms[formname].elements[textname].style.display='none';
 }
	}

//'=================================================================
//'открыть окно с картинкой, по её размерам.

function picpopup(url,x,y) 
{
wwpicpop=window.open(url,'picpopup','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width='+(x+10)+',height='+(y+10)+',resizable=no');
top.window.wwpicpop.document.write ('<html><head><title>SHOW IMAGES</title></head>'+'<body leftmargin=5 topmargin=5 onLoad="focus();">'+'<a title="close this window" href="javascript:window.close();"><img src="'+url+'" alt="" align="middle" width="'+x+'" height="'+y+'" border=0></a></body></html>')
top.window.wwpicpop.document.close()
};
//'=================================================================
function tobags(item,price_id) 
{
regw('/bags.asp?item='+item+'&price_id='+price_id+'&act=add','bags',490,350);
};
//'=================================================================
//'=================================================================
//'ввод текста и передача его в ссылку
function aprompt(url,old,title){
var newname=prompt(title,old);
if (newname!=old && newname!=null) {
document.location.href=url+escape(newname);
};
}
//'=================================================================
//'ввод пароля и передача его в ссылку

function apwd(url,title){
	if (title=='' || title==null) { var title='Введите пароль:'}
	if (isMSIE && !isOpera ) {
		var pwd="";
		var varResult;
		varResult = window.showModalDialog("/include/pwd.htm",[pwd,title],"dialogHeight:100px; dialogWidth:240px; help=no;status=no");
		if (varResult != null) {
			
		document.location.href=url+escape(varResult[0]);
//		document.location.href=url+escape(pwd);
//		alert(varResult[0]);
		}
	}
	else {
		var newname=prompt(title,'');
		if (newname!=null) {
		document.location.href=url+escape(newname);
		};
		}
}
//'=================================================================

