function view_foto(adr,w,h){
var new_foto=window.open('view_foto.php?adr='+adr,'','width='+w+',height='+h);
}

function set_rezume(id){
var setrezume=window.open("set_rezume.php?id="+id,'setrezume','width=300,height=300,scrollbars=1');
}

function bgf(e,color){
	var targetElement=e.target?e.target:e.srcElement;
	targetElement.style.backgroundColor=color;
}

function view_img(id,alt){
var viewimg=window.open('view_img.php?id='+id+'&alt='+escape(alt),'','width=100,height=100,status=1');
}

function send_faq(){
var sendfaq=window.open('send_faq.php','send_faq','width=280,height=260');
}
function openPictureWindow(Width,Height,Path,Title)
{	
	if(Path=="images/map_b.gif")Hei=Height+60;
	else Hei=Height;
	WinFeatures = (Width<=screen.width && Height<=screen.height)? "top="+(screen.height-Height)/2+",left="+(screen.width-Width)/2+",width="+Width+",height="+Hei+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no" : "top="+(screen.height-Height)/2+",left="+(screen.width-Width)/2+",width="+(Width+20)+",height="+(Height+20)+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes";
	w = window.open("","PictureWindow",WinFeatures);
	w.document.open();
	w.document.write('<head><title>&quot;'+Title+'&quot;</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><link rel=stylesheet type=text/css href=main.css></head>');
	w.document.write("<body bgcolor=white leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><a href=JavaScript:self.close(); title='Закрыть окно'><IMG src='"+Path+"' height='"+Height+"' width='"+Width+"' alt='&quot;"+Title+"&quot;' border=0>"); 
	if(Path=="images/map_b.gif"){w.document.write("<p align=center><input type=button onClick=\"window.print();\" value='напечатать схему' class=knop></p>");}
	w.document.write("</a></body>");
	w.document.close();
}

function setFormElements(e,name){
	var targetElement=e.target?e.target:e.srcElement;
	targetElement.className=name;
}

function win_resize(e,intWidth,intHeight){
  var newW=(intWidth==null || intWidth=='' || isNaN(parseInt(intWidth)))? 800 : parseInt(intWidth);
  var newH=(intHeight==null || intHeight=='' || isNaN(parseInt(intHeight)))? 800 : parseInt(intHeight);
  if(is_ie4 || is_ie){newW+=10;newH+=29;}
  if(is_ns4 || is_ns){newW+=6;newH+=27;}
  if(is_opera){newW+=10;newH+=29;}
  if(is_firefox){newW+=0;newH+=22;}
	if(screen.width>newW)newLeft=Math.round((screen.width-newW)/2);
	 else newLeft=10;
	if(screen.height>newH)newTop=Math.round((screen.height-newH)/2);
	 else newTop=10;
  newH+=20;
  e.resizeTo(newW,newH);
  e.moveTo(newLeft,newTop);
}

function move_window_to_center_screen(){
if(is_ns4 || is_ns){
leftco=document.body.offsetWidth+16;
topco=document.body.offsetHeight+44;
}
if(is_ie || is_ie4 || is_firefox){
leftco=document.body.clientWidth;
topco=document.body.clientHeight;
}
if(is_opera){
leftco=document.body.clientWidth;
topco=document.body.clientHeight+200;
}
newLeft=Math.round((screen.width-leftco)/2);
newTop=Math.round((screen.height-topco)/2);

window.moveTo(newLeft,newTop);
}

var userAgent = navigator.userAgent.toLowerCase();
var is_opera  = (userAgent.indexOf('opera') != -1);
var is_firefox  = (userAgent.indexOf('firefox') != -1);
var is_saf    = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == 'Apple Computer, Inc.'));
var is_webtv  = (userAgent.indexOf('webtv') != -1);
var is_ie     = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));
var is_ie4    = ((is_ie) && (userAgent.indexOf('msie 4.') != -1));
var is_moz    = ((navigator.product == 'Gecko') && (!is_saf));
var is_kon    = (userAgent.indexOf('konqueror') != -1);
var is_ns     = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf));
var is_ns4    = ((is_ns) && (parseInt(navigator.appVersion) == 4));
var is_mac    = (userAgent.indexOf('mac') != -1);
