function openWin($url) {
  msgWindow= window.open($url,"displayWindow","width=780,height=600,status=no,toolbar=no,menubar=no,scrollbars=yes");
}
function closeIt(){
  window.close();
}




function viewform(m, w, h) {
   var scroll = 'yes';
   var settings;
   var LeftPosition;
   var TopPosition;
   var win;
	      
   LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  
   settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll;
   settings = settings + ',resizable=no,maximize=no,status=no,toolbar=no,directories=no,menubar=no,location=no';
		      
   win = window.open(m, 'pre', settings);
   win.name = 'name';
   win.focus();
}
function viewformclose(m, w, h) {
   var scroll = 'yes';
   var settings;
   var LeftPosition;
   var TopPosition;
   var win;
	      
   LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  
   settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll;
   settings = settings + ',resizable=no,maximize=no,status=no,toolbar=no,directories=no,menubar=no,location=no';
		      
   win = window.open(m, 'pre', settings);
   win.name = 'name';
   win.focus();
   win.alert('!!!!!');
   win.document.write('window.close();');
}
function viewform2(m, w, h) {
//   var w = 300;
//   var h = 380;
   var scroll = 'yes';
   var settings;
   var LeftPosition;
   var TopPosition;
   var win;
	      
   LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  
   settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll;
   settings = settings + ',resizable=no,maximize=no,status=no,toolbar=no,directories=no,menubar=no,location=no';
		      
   win = window.open(m, 'pre', settings);
   win.name = 'name';
   win.focus();
}

function ViewOtherImg(name,main) {

   tmp_src = document.images[main].src;
   document.images[main].src = document.images[name].src;
   document.images[name].src = tmp_src;   
  
}				 

								  
function conf() {
  var reply = confirm('Запись будет удалена. Продолжить?');

  if(reply) {
     return true;
   } else {
     return false;
   }
}		
flag=false;

function ValidFocus(frm){
   if (flag == true) {
     frm.validfocus.value='valid';
     return true;
   }
   else return false;

}

