var wnd; var wndMap; var wndMap1; 

function showImage(url,w,h)
{
	if(!w)w=400
	if(!h)h=300
	if (wnd && !wnd.closed) wnd.close();
	wnd = window.open(url,"","resizable=yes,status=no,width="+w+",height=" +h);
}

function showFlash(url,w,h,id)
{
	//if(!w)w=400
	//if(!h)h=300
	//if (wnd && !wnd.closed) wnd.close();
	wnd = window.open("/app_genplan.asp?swf="+url+"&id="+id+"&width="+w+"&height="+h+"","flashWindow","resizable=yes,status=no,width="+w+",height=" +h);
	//var d=wnd.document;
	//var root=d.documentElement; 
	//var body=d.getElementsByTagName('body')[0];
	//if(!body)
	//{ 
	//	body=d.createElement('body');
	//	root.appendChild(body);
	//}
	//var div=d.createElement('div');
	//div.id='flafla';
	
	//var so = new SWFObject(url, "root", w, h, "6", "#ffffff");
	//so.addVariable("xmlpath", xmlpath);
	//so.addParam("quality", "best");
	//so.addParam("menu", "false");
	//so.addParam("wmode", "transparent");
	//so.write(div);
	//body.appendChild(div);
}

function popupWin(url,ww,hh)
{
	newWindow = window.open('','newWin','width='+(ww+20)+',height='+(hh+20)+'');
	newWindow.document.write("<html>\n<body bgcolor=#ffffff>\n<img src="+url+" width="+ww+" height="+hh+" border=0></body>\n</html>\n");
}

function showMap()
{	
	href="http://incom.eatlas.ru/index_short.asp?showlay=msk_cotteges_p&vis=3"	
 	if (wndMap && !wndMap.closed) wndMap.close();
	wndMap = window.open(href,"","resizable=no,location=no,status=no,width=578,height=560"); 
}

function printMap(href)
{	
	if (wndMap1 && !wndMap1.closed) wndMap1.close();
	wndMap = window.open(href,"","resizable=yes,location=no,scrollbars=yes,status=no,width=550,height=580");
}
	
function show3Dpanorama(url)
{
	if (wnd && !wnd.closed) wnd.close(); wnd = window.open(url,"","resizable=yes,status=no,width=350,height=300");
}
	
function showVideo(url)
{
	if (wnd && !wnd.closed) wnd.close(); wnd = window.open(url,"","resizable=yes,status=no,width=380,height=340");
}
	
function showPlan(url)
{
	if (wnd && !wnd.closed) wnd.close(); wnd = window.open(url,"","scrollbars=yes,resizable=yes,status=yes,width=500,height=500");
}
	
function showMapID(id)
{	
	href="http://incom.eatlas.ru/index_short.asp?map=msk_incom&zoom=10000&id=" + id + "&lay=Msk_cotteges_p&mapw=544&maph=425&vis=3&act=show_obj"
	if (wndMap && !wndMap.closed) wndMap.close();
	wndMap = window.open(href,"","resizable=no,location=no,status=no,width=578,height=550");
}

var max_link_dotted = 15;
function showlayer(layer){
	for (var i=1; i < max_link_dotted; i++){
		if (layer==i) i++;
		if (document.getElementById('layer'+i)) {
			document.getElementById('layer'+i).style.display='none'
		}
	}
	if (document.getElementById('layer'+layer)){
		if (document.getElementById('layer'+layer).style.display=='block'){
			document.getElementById('layer'+layer).style.display='none'
		}
		else{
			document.getElementById('layer'+layer).style.display='block'
		}
	}
}

// Добавить в Избранное 
function add_favorite(a) { 
  title=document.title; 
  url=document.location; 
  try { 
    // Internet Explorer 
    window.external.AddFavorite(url, title); 
  } 
  catch (e) { 
    try { 
      // Mozilla 
      window.sidebar.addPanel(title, url, ""); 
    } 
    catch (e) { 
      // Opera 
      if (typeof(opera)=="object") { 
        a.rel="sidebar"; 
        a.title=title; 
        a.url=url; 
        return true; 
      } 
      else { 
        // Unknown 
        alert('Нажмите Ctrl-D чтобы добавить страницу в закладки'); 
      } 
    } 
  } 
  return false; 
}
