// JavaScript Document

function fMakePopUpWindow(handler,url,windowName,width,height,toolbar,location,directories,status,menubar,scrollbars,resizable,top,left) {
	if (!handler) var handler=null;
	if (!windowName) title='no_windowName';
	if (!width) width=200;
	if (!height) height=200;

  var x=(typeof(left)=='undefined')?(screen.availWidth - width)/2   : left;
  var y=(typeof(top) =='undefined')?(screen.availHeight - height)/2 : top;

	var windowFeatures = "width=" +width+ ",height=" +height+ ",screenX=" +x+ ",screenY=" +y+ ",top=" +y+ ",left=" +x+ ",toolbar="+toolbar+",location="+location+",directories="+directories+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable;
	//alert(windowFeatures);
	handler=window.open(url,windowName,windowFeatures);
	if (handler) {
		handler.focus();
		if (handler.opener == null) handler.opener = window;
	}
	
	return handler;
}

function makepopup(photo, width, height) {
	PhotoBig = null;
	
	//new_src=photo.src.replace('/s/','/');	
	
	if (PhotoBig) PhotoBig.close();
	PhotoBig=fMakePopUpWindow(PhotoBig,'about:blank','Photo',width,height,0,0,0,0,0,0,1);
	PhotoBig.document.write("<body topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0' marginheight='0' marginwidth='0' bgcolor=#ffffff><img src="+photo+" onclick='window.close()' style='cursor:hand'><br></body>");
	PhotoBig.document.close();
}



function openAppForm() {
	var width = screen.availWidth || 950;
	var height = (screen.availHeight || 850)>850 ? 850:screen.availHeight;
	
  var options = 'scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no'
							+',width=' + width + ',height=' + height
  						+',screenX=0,screenY=0,top=0,left=0';
  
  var request_form = window.open("/ru/request","request_form", options);
  request_form.focus();
}

