function IsOpera()
{ return (navigator.userAgent.IndexOf('Opera')!=-1);}
// Показать визитку
function Vizit(q,x,y,s){
var d=new Date();
window.open('/vizit.html'+q,'Visit'+d.valueOf(),'status=yes,resizable=no,scrollbars='+(s==1?'yes':'no')+',width='+((x==null?400:x)+(s==1?16:0))+',height='+(y==null?270:y)).moveTo((screen.width-x)/3,(screen.height-y)/3);
}

function GetInnerSize () {
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return [x,y];
}
// Процедура устанавливает размеры окна по передаваемым размерам.
function ResizeToInner (w, h, x, y) {
	// make sure we have a final x/y value
	// pick one or the other windows value, not both
	if (x==undefined) x = window.screenLeft || window.screenX;
	if (y==undefined) y = window.screenTop || window.screenY;
	// for now, move the window to the top left
	// then resize to the maximum viewable dimension possible
	window.moveTo(0,0);
	window.resizeTo(screen.availWidth,screen.availHeight);
	// now that we have set the browser to it's biggest possible size
	// get the inner dimensions.  the offset is the difference.
	var inner = GetInnerSize();
	var ox = screen.availWidth-inner[0];
	var oy = screen.availHeight-inner[1];
	// now that we have an offset value, size the browser
	// and position it
	window.resizeTo(w+ox, h+oy);
	window.moveTo(x,y);
}

// Отработать результат опроса
function Answer(p){
var d=new Date();
window.open('answer.html?'+p,'Answer'+d.valueOf(),'resizable=no,width=490,height=200,scrollbars=no').moveTo((screen.width-600)/3,(screen.height-180)/3);
}
// Показать список фото по фирме
function Photos(q,x,y){
var d=new Date();
window.open('firm_photo.html'+q,'FirmPhotos'+d.valueOf(),'status=yes,resizable=no,scrollbars=yes,width='+x+',height='+y).moveTo((screen.width-x)/3,(screen.height-y)/3);
}
// Показать список фото по точке
function PhotosP(q,x,y){
var d=new Date();
window.open('point_photo.html'+q,'PointPhotos'+d.valueOf(),'status=yes,resizable=no,scrollbars=yes,width='+x+',height='+y).moveTo((screen.width-x)/3,(screen.height-y)/3);
}
// Показать фото
function Photo(q,x,y){
var d=new Date();
x-=4; y-=4;
window.open('fullsize.html'+q,'PhotoForm'+d.valueOf(),'status=yes,resizable=no,scrollbars=no,width='+x+',height='+y).moveTo((screen.width-x)/3,(screen.height-y)/3);
}
// Возвращает свойства объекта
function ObjProps(obj,showval)
{ var i=0,o=new Array();
  for (prop in obj) if (showval) o.push(' '+prop+'='+obj[prop]); else o.push(' '+prop);
  return o.sort();
}

function showToggle(blockId)
{
	divStyle = document.getElementById(blockId).style.display;
	if (divStyle == 'none') document.getElementById(blockId).style.display = 'block';
			   else document.getElementById(blockId).style.display = 'none';
}

