var OpenedWindow = null;
//var scrollbarH = 0;

function OpenPanoWin(e,intPanoId,width,height)
{
	if(OpenedWindow!=null)
	{
		OpenedWindow.close();
		fnCloseWin();
	}
	var lpos;
	var tpos;
	/*var brName = navigator.appName;
	if(brName == 'Microsoft Internet Explorer' || brName.indexOf('msie') != -1)
	{
		lpos = e.x;
		tpos = e.y-height;
	}
	else
	{
		lpos = e.screenX;
		tpos = e.screenY-height;
	}*/
	lpos = 20
	tpos = 20
	OpenedWindow = window.open('panorama/view.asp?id=' + intPanoId + '&h=' + height + '&w=' + width,'PanoramaViews','resizable=yes,width=' + width+ ',height=' + (height+30) + ',scrollbars=no,top=' + tpos + ',left=' + lpos);
}

function OpenWin(e,strUrl,width,height,title)
{
	//scrollbarH = document.body.scrollTop;
	if(OpenedWindow!=null)
	{
		OpenedWindow.close();
		fnCloseWin();
	}
	var lpos;
	var tpos;
	/*var brName = navigator.appName;
	if(brName == 'Microsoft Internet Explorer' || brName.indexOf('msie') != -1)
	{
		lpos = e.x;
		tpos = e.y-height;
	}
	else
	{
		lpos = e.screenX;
		tpos = e.screenY-height;
	}*/
	lpos = 20
	tpos = 20
	//OpenedWindow = window.open(strUrl);
	OpenedWindow = window.open(strUrl,title,'resizable=yes,width=' + width + ',height=' + height + ',scrollbars=no,top=' + tpos + ',left=' + lpos);
	OpenedWindow.focus();
	//}
	//this.blur();
	//fnCheckScrB();
}

function fnCloseWin()
{
	OpenedWindow = null;
}

function fnCheckScrB()
{
	alert(scrollbarH);
	if(scrollbarH>0)
	{
		window.scrollTo(0,scrollbarH);
	}
}
