function windowOpen(Url,Width,Height,Name,Php){if(navigator.userAgent.indexOf('Opera')>=0){var ow=document.body.clientWidth,oh=document.body.clientHeight}else{var ow=screen.width,oh=screen.height}Width=Width||640;Height=Height||480;var left=(ow-Width)/2;var top=(oh-Height)/2;var feats=new Array("width="+Width,"height="+Height,"left="+left,"top="+top,"scrollbars=1","status=1","resizable=1");if(!Name)Name=Url.replace(/([\W]+)/g,'');if(!Php)Php='iwindow.php';if(Url==''){Url='about:blank'}else{var base=document.getElementsByTagName('base');Url=base[0].href+Php+Url}nwind=window.open(Url,Name,feats.join(','));if(!nwind){alert('Ваш браузер блокирует всплывающие окна!, \r\nразрешите использовать всплывающие окна и повторите попытку.');return}nwind.focus()}function load(){if(window.name){focusForm();addEvent(document.body,'keyup',formKeyup);if(!window.opera)addEvent(window,'keyup',formKeyup)}else{addEvent(document.body,'keyup',keyup);if(!window.opera)addEvent(window,'keyup',keyup)}if(window.controller)InitControls();if(window.ToolTip){ToolTip.Init();addEvent(document.body,'keydown',keydown);addEvent(window,'keydown',keydown)}}function focusForm(){if(document.forms[0]){for(i=0;i<document.forms[0].length;i++){var item=document.forms[0].elements[i];if(item.type=='text'&&!item.disabled&&item.focus){item.focus();return}}}}function keyup(e){if(e.keyCode==113&&e.ctrlKey){base=document.getElementsByTagName('base')[0].href;if(window.location.href.indexOf(base+'bo')!=-1){window.location.href=window.location.href.replace(base+'bo/',base)}else{window.location.href=window.location.href.replace(base,base+'bo/')}}if(window.ToolTip&&e.keyCode==17)ToolTip.CtrlPressed=false}function formKeyup(e){if(e.keyCode==27)formClose()}function formClose(){if(!document.forms[0])return;form=document.forms[0];form.modified=false;for(i=0;i<form.elements.length;i++){switch(form.elements[i].type){case'radio':case'select-one':break;default:form.modified=form.elements[i].value!=form.elements[i].defaultValue}if(form.modified)break}if(!form.modified){window.close()}else{if(window.confirm('Data has been modified. Submit data?'))form.submit();else window.close()}}function keydown(e){ToolTip.CtrlPressed=e.keyCode==17}function addEvent(node,evtType,func){if(node.addEventListener){node.addEventListener(evtType,func,false);return true}else if(node.attachEvent){return node.attachEvent("on"+evtType,func)}else{return false}}function switchLang(langFrom,langTo){var href=window.location.href;re=new RegExp('/'+langFrom+'/');href=window.location.href.replace(re,'/'+langTo+'/');if(href==window.location.href){var base=document.getElementsByTagName('base');href=window.location.href.replace(base[0].href,base[0].href+langTo+'/')}if(href==window.location.href)return true;window.location.href=href;return false}function createFlash(Id,Url,Width,Height,Img,ImgW,ImgH,Alt){obj=document.getElementById(Id);if(!obj||!Url||!Width||!Height)return;if(Img){ImgW=ImgW||Width;ImgH=ImgH||Height;Alt=Alt||'';imgtag='<img src="'+Img+'" width="'+ImgW+'" height="'+ImgH+'" alt="'+Alt+'" />'}else{imgtag=''}obj.innerHTML='<object type="application/x-shockwave-flash" data="'+Url+'" width="'+Width+'" height="'+Height+'">'+'<param name="movie" value="'+Url+'" />'+imgtag+'</object>'}addEvent(window,'load',load);