﻿// JScript File

function sw(v){window.open(v,'_blank');return false;}
function ws(v){window.open(v,'_blank');return true;}

function showdetails(p,n,w,h){
showwin(p,n,w,h,0);
}

function showwin(p,n,w,h,scroll){
                var s='';
                var width=w;
                var height=h;
                s=s+'left='+(screen.availWidth-width)/2+',';
                s=s+'top='+(screen.availHeight-height)/2+',';
                s=s+'width='+width+',height='+height+',toolbar=0,location=0,status=0,menubar=0,scrollbars='+1+',resizable=1';
                w=window.open(p,n,s);
                w.focus();
}

function capsDetect( e ) {
  var CapsMess = 'ОБРАТИТЕ ВНИМАНИЕ!\nУ Вас включен режим Caps Lock!\nСимволы в пароле регистрозависимые!';
  if( !e ) { e = window.event; } if( !e ) { return; }
  var theKey = 0;
  if( e.which ) { theKey = e.which; } //Netscape 4+, etc.
  else if( e.keyCode ) { theKey = e.keyCode; } //Internet Explorer, etc.
  else if( e.charCode ) { theKey = e.charCode } //Gecko - probably not needed
  var theShift = false;
  if( e.shiftKey ) { theShift = e.shiftKey; } //Internet Explorer, etc.
  else if( e.modifiers ) { //Netscape 4
    if( e.modifiers & 4 ) { //bitwise AND
      theShift = true;
    }
  }
  if( theKey > 64 && theKey < 91 && !theShift ) {
    alert( CapsMess );
  }
  else if( theKey > 96 && theKey < 123 && theShift ) {
    alert( CapsMess );
  }
}

function OpenEditor(idname)
{
	popUp = window.open('editor.htm?formname=' + document.forms[0].name + 
		'&id=' + idname , 
		'popupeditor', 
		'width=600,height=450,left=100,top=100,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1');
}

function winopen(p){
var s=s+'top=50,left=50,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1';
w=window.open(p,'_blank',s);
w.focus();
}

function Init()
{
  setupZoom();
}
    

window.onload = Init;

function handleError() {
	return true;
}

window.onerror = handleError;
