function openmapwindow(wd, ht, mytext) {
var myWin, param;
param = "width=" + wd + ",";
param = param + "height=" + ht + ",";
param = param + "top=12,";
param = param + "left=12,";
param = param + "toolbar=0,";
param = param + "status=0,";
param = param + "menubar=0,";
param = param + "location=0,";
param = param + "scrollbars=0,";
param = param + "resizable=1";
myWin=window.open("", "mapwin", param);
myWin.document.open()
myWin.document.write('<html><head><title>3D-карта Архыза</title><base target="arhis"><script src="/arh.js"></script><script>window.onresize = function(){setmyieSize();};</script></head>');
myWin.document.write("<body>");
myWin.document.write(mytext);
myWin.document.write("<p><b>Внимание!  Работает в IE, Хроме и FF3! Требуется плагин Google Eath! Если не видно 3D поверхности, то страница отображается неправильно! На поверхности размещены схемы маршрутов, а не треки.<script>c=$get('map'); c.onload=function(){d = ($get('map').contentWindow || $get('map').x.contentDocument); if (d.document) d = d.document; base = d.createElement('base'); base.setAttribute('target', 'top'); head = d.documentElement.firstChild; head.appendChild(base);}</script></body></html>");
myWin.document.close();
}
function $get(n){
 return (document.getElementById(n));
}
function setmyieSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  $get('map').width = myWidth-12;
  $get('map').height = myHeight-150;
}
