var checkAll = false;

var ie=ns=op=false;

if (navigator.userAgent.indexOf ("Opera") != -1) {op=true}
else if (navigator.userAgent.indexOf ("MSIE") != -1) {ie=true}
else if (navigator.userAgent.indexOf ("Netscape") != -1 ||
         navigator.userAgent.indexOf ("Gecko") != -1 ||
         navigator.userAgent.indexOf ("Mozilla") != -1 ||
         navigator.userAgent.indexOf ("Firefox") != -1) {ns=true}

function PreloadImages() {
 if (document.images) {
  var imgFiles = PreloadImages.arguments;
  var preloadArray = new Array();
  for (var i=0; i<imgFiles.length; i++) {
   preloadArray[i] = new Image();
   preloadArray[i].src = imgFiles[i];}}
}

function Point(id,n)
{
 if (ActivePoint != 0)
  {
   document.getElementById('Point'+ActivePoint).className = "hid";
  }
 ActivePoint = id;
 CanUnpoint = false;
 document.getElementById('Point'+ActivePoint).style.top = pointTop+(pointStep*(n-1));
 document.getElementById('Point'+ActivePoint).className = "vis";
 if (document.all['Bold'+id+'_'+n])
  {
   document.getElementById('Bold'+id+'_'+n).className = "lite1i_ovr";
  }
}

function BtnUnPoint(id,n)
{
 CanUnpoint = true;
 document.getElementById('Bold'+id+'_'+n).className = "lite1i";
}

function UnPoint()
{
 if (CanUnpoint)
  {
   document.getElementById("Point"+ActivePoint).className = "hid";
  }
}


function GridOvr(n,img, kv)
{
 if (document.getElementById('Cell'+n).className == "grid")
  {
   if (img)
    {
     document.getElementById('Img'+img).src = "http://www.dsbw.ru/data/gridimages/"+img+"-ovr.jpg";
    }
   document.getElementById('Cell'+n).className = "grid_hi";
   if (kv)
    {
     document.getElementById('Kvd'+n).className = "nomer_hi";
    }
  }
 else
  {
   if (img)
    {
     document.getElementById('Img'+img).src = "http://www.dsbw.ru/data/gridimages/"+img+".jpg";
    }
   document.getElementById('Cell'+n).className = "grid"
   if (kv)
    {
     document.getElementById('Kvd'+n).className = "nomer";
    }
  }
}

function GridOvr2(n)
{
 if (document.getElementById('Cell'+n).className == "grid2")
  {
   document.getElementById('Cell'+n).className = "grid_hi2";
  }
 else
  {
   document.getElementById('Cell'+n).className = "grid2";
  }
}


function StepOvr(n)
{
 document.getElementById('Step'+n).src = "http://www.dsbw.ru/_gfx/step-"+n+"-ovr.gif";
}


function StepOut(n)
{
 document.getElementById('Step'+n).src = "http://www.dsbw.ru/_gfx/step-"+n+".gif";
}


function GridPresentOvr()
{
 if (document.getElementById('Present').className == "grid")
  {
   document.getElementById('ImgPresent').src = "http://www.dsbw.ru/_gfx/v-mark2-1.gif";
   document.getElementById('Present').className = "grid_hi"
  }
 else
  {
   document.getElementById('ImgPresent').src = "http://www.dsbw.ru/_gfx/v-mark2.gif";
   document.getElementById('Present').className = "grid"
  }
}


function LoadFrame(n, adr)
{
 parent[n].location = adr;
}


function ShowDiv(n, el, ovr, out)
{
 if (document.getElementById(n).className == "hid")
  {
   if (el)
    {
     document.getElementById(el).src = "http://www.dsbw.ru/_gfx/"+ovr;
    }
   document.getElementById(n).className = "vis";
  }
 else
  {
   if (el)
    {
     document.getElementById(el).src = "http://www.dsbw.ru/_gfx/"+out;
    }
   document.getElementById(n).className = "hid";
  }
}


function ShowFilter(n, m)
{
 if (document.getElementById(n).className == "hid")
  {
   document.getElementById(m).className = "hid";
   document.getElementById(n).className = "vis";
   document.getElementById('TDBACK').className = "filtr";
   document.getElementById('eye_search').src = "http://www.dsbw.ru/_gfx/eye-white.gif";
   document.getElementById('mark_search').src = "http://www.dsbw.ru/_gfx/v-mark4.gif";
  }
 else
  {
   document.getElementById(n).className = "hid";
   document.getElementById(m).className = "vis";
   document.getElementById('TDBACK').className = "";
   document.getElementById('eye_search').src = "http://www.dsbw.ru/_gfx/eye-orange2.gif";
   document.getElementById('mark_search').src = "http://www.dsbw.ru/_gfx/v-mark3.gif";

  }
}

function ConvertPrice(n, count)
{
 var str;
 var euro = eval("Euro" + n);
 if (!euro)
  {
   var kurs = Kurs;
   document.all['PrBtn'+n].innerHTML = 'ЦЕНА В РУБЛЯХ НА СЕГОДНЯ';
  }
 else
  {
   var kurs = 1/Kurs;
   document.all['PrBtn'+n].innerHTML = 'ЦЕНА В ЕВРО';
  }
 for (var i = 0; i < count; i++)
  {
   if (document.all['Pr'+n+'_'+i])
    {
     str = document.all['Pr'+n+'_'+i].innerHTML;
     if (str.indexOf(' / ') != -1)
      {
       val = '';
       arr = str.split(' / ');
       for (var j = 0; j < arr.length; j++)
        {
         if (parseInt(arr[j], 10))
      	  {
      	   val += Math.round(arr[j]*kurs*100)/100+' / ';
 	  }
 	 else
      	  {
      	   val += arr[j]+' / ';
 	  }
        }
       document.all['Pr'+n+'_'+i].innerHTML = val.substring(0, val.length-3);
      }
     else if (str.indexOf('/') != -1)
      {
       val = '';
       arr = str.split('/');
       for (var j = 0; j < arr.length; j++)
        {
         if (parseInt(arr[j], 10))
          {
           val += Math.round(arr[j]*kurs*100)/100+' / ';
          }
         else
          {
           val += arr[j]+' / ';
          }
        }
       document.all['Pr'+n+'_'+i].innerHTML = val.substring(0, val.length-3);
      }
     else
      {
       if (parseInt(str, 10))
      	{
         document.all['Pr'+n+'_'+i].innerHTML = Math.round(str*kurs*100)/100;
      	}
      }
    }
  }
}


function OpenCabinetWindow(tour_sub)
{
 var par="width=750,height=560,copyhistory=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0";
 if (tour_sub)
  {
   var url = "cabinet.php?tour_sub="+tour_sub;
  }
 else
  {
   var url = "cabinet.php";
  }
 CabinetW=window.open(url,"CabinetWindow",[par]);
 CabinetW.focus();
}


/*function OpenPhotoWindow(parentID, photoID, type)
{
 var par="width=780,height=566,copyhistory=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0";
 PhotoW=window.open("/photo.php?parentID="+parentID+"&photoID="+photoID+"&type="+type,"PhotoWindow",[par]);
 PhotoW.focus();
}*/


function ShowPopupWindow(type, id)
{
 var par="width=536,height=420,copyhistory=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0";
 PopupW=window.open("/popup.php?type="+type+"&id="+id,"PopupWindow",[par]);
 PopupW.focus();
}


function ShowReservWindow(type, id)
{
 var par="width=650,height=450,copyhistory=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0";
 ReservW=window.open("/reserv.php?type="+type+"&id="+id,"ReservWindow",[par]);
 ReservW.focus();
}


function ShowTourPopupWindow(link)
{
 var par="width=650,height=617,copyhistory=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0";
 TourPopupW=window.open("/frame.php?"+link,"TourPopupWindow",[par]);
 TourPopupW.focus();
}

function ShowBookWindow(id)
{
 var par="width=780,height=640,copyhistory=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0";
 BookW=window.open("http://online.dsbw.ru/dsbw/book.php?id="+id,"BookWindow",[par]);
 BookW.focus();
}

function ShowHelpWindow()
{
 var par="width=760,height=300,copyhistory=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0";
 HelpW=window.open("/help.php","HelpWindow",[par]);
 HelpW.focus();
}

function WinCenter()
{
 if (ie) {
  self.moveTo((screen.availwidth-self.document.body.clientWidth)/2,(screen.availheight-self.document.body.clientHeight)/2);}
 if (ns) {
  self.moveTo((screen.width-self.window.innerWidth)/2,(screen.height-self.window.innerHeight)/2);}
 if (op) {
  self.moveTo((screen.width-self.window.innerWidth)/2,(screen.height-self.window.innerHeight-130)/2);}
}


function LogOut()
{
 SetCookie('DSBWuser', '');
 window.close();
}


function ScrollLeft()
{
 if ((scroll-1) >= 0)
  {
   scroll--;
  }
 if (photoID.length < 4)
  {
   for (var i=0; i < photoID.length; i++)
    {
     AssignImage(i+1, i);
    }
  }
 else
  {
   var n = 0;
   for (var i=scroll; i < scroll+4; i++)
    {
     n++;
     AssignImage(n, i);
    }
  }
}


function ScrollRight()
{
 if ((scroll+1) <= (photoID.length-4))
  {
   scroll++;
  }
 if (photoID.length < 4)
  {
   for (var i=0; i < photoID.length; i++)
    {
     AssignImage(i+1, i);
    }
  }
 else
  {
   var n = 0;
   for (var i=scroll; i < scroll+4; i++)
    {
     n++;
     AssignImage(n, i);
    }
   }
}


function AssignImage(n,i)
{
 document.getElementById('IMG'+n).src = '/data/photo/'+photoID[i]+'.jpg';
 document.getElementById('IMG'+n).className = 'ref';
 if (photoName[i])
  {
   document.getElementById('IMG'+n).title = photoName[i];
  }
}

function FirstAssignImage()
{
 for (var i=0; i < 4; i++)
  {
   document.getElementById('IMG'+(i+1)).src = 'http://www.dsbw.ru/_gfx/empty.gif';
   document.getElementById('IMG'+(i+1)).title = '';
   document.getElementById('IMG'+(i+1)).className = '';
  }
 if (photoID.length < 4)
  {
   for (var i=0; i < photoID.length; i++)
    {
     AssignImage(i+1, i);
    }
  }
 else
  {
   var n = 0;
   for (var i=scroll; i < 4; i++)
    {
     AssignImage(i+1, i);
    }
  }
}


function ShowPhoto(type, n)
{
 if (photoID.length == 0 || n >= photoID.length)
  {
   return false;
  }
 OpenPhotoWindow(parentID, photoID[n+scroll], type);
}


function OpenHotel(id)
{
 window.open('http://hotels.dsbw.ru/site/hotel/hotel.php?WareID='+id, '', 'toolbar=0,menubar=0,location=0,status=0,scrollbars=yes,resizable=0,height=500,width=700,left=50,top=50');
}


function CheckCountryList(count, fName, vName)
{
 var list = '';
 var checkAll = true;
 for (var i=1; i<count; i++)
  {
   if (document.forms[fName]['chk'+i].checked == true)
    {
     list = list+document.forms[fName]['chk'+i].value+'|';
    }
   else
    {
     checkAll = false;
    }
  }
 document.forms[fName][vName].value = list.substring(0, list.length-1);
 if (checkAll)
  {
   document.forms[fName]['chkALL'].checked = true;
  }
 else
  {
   document.forms[fName]['chkALL'].checked = false;
  }
}


function SelectAllInlist(count, fName, vName)
{
 var list = '';
 for (var i=1; i<count; i++)
  {
   document.forms[fName]['chk'+i].checked = checkAll;
    if (checkAll)
     {
      list = list+document.forms[fName]['chk'+i].checked+'|';
     }
  }
 document.forms[fName][vName].value = list.substring(0, list.length-1);
 if (checkAll)
  {
   document.forms[fName]['chkALL'].checked = true;
  }
 else
  {
   document.forms[fName]['chkALL'].checked = false;
  }
 checkAll = !checkAll;
}


function PrintTourName(n)
{
 //re = /<br>/gi;
 var str = document.all['Name'+n].innerHTML;
 if (document.all['Days'+n])
  {
   var days = document.all['Days'+n].innerHTML;
  }
 if (document.all['Price'+n])
  {
   var price = document.all['Price'+n].innerHTML;
  }
 if (days && price)
  {
   var str_right = "<table cellpadding=0 cellspacing=0 width=195><tr><td rowspan=3 width=1><img src='http://www.dsbw.ru/_gfx/v-line.gif'></td><td align='right'><b style='margin-right: 8'>"+days+"</b></td></tr><tr height=1><td bgcolor=#000000></td></tr><tr><td align='right'><b style='margin-right: 8'>"+price+"</b></td></tr></table>";
  }
 else if (days)
  {
   var str_right = "<table cellpadding=0 cellspacing=0 width=195><tr><td width=1><img src='http://www.dsbw.ru/_gfx/v-line.gif'></td><td align='right'><b style='margin-right: 8'>"+days+"</b></td></tr></table>";
  }
 else if (price)
  {
   var str_right = "<table cellpadding=0 cellspacing=0 width=195><tr><td width=1><img src='http://www.dsbw.ru/_gfx/v-line.gif'></td><td align='right'><b style='margin-right: 8'>"+price+"</b></td></tr></table>";
  }
 else
  {
   var str_right = "";
  }
// var result = "<table cellpadding=0 cellspacing=0 width=100%><tr height=36><td><p class='in_grid5'>"+str.replace(re, ' ')+"</p></td><td width=180 nowrap align='right'>"+str_right+"</td></tr></table>";
 var result = "<table cellpadding=0 cellspacing=0 width=100%><tr height=36><td><p class='in_grid7'>"+str+"</p></td><td width=195 nowrap align='right'>"+str_right+"</td></tr></table>";
// parent.document.all['SelectedTour'].innerHTML = "<img src='http://www.dsbw.ru/_gfx/selected-tour.gif'>";
// parent.document.all['SelectedTour'].innerHTML = "";
 parent.document.all['TourList'].innerHTML = "<a href='JavaScript:document.location.reload()' class='navi'><nobr>ТУРЫ РАЗДЕЛА</nobr></a><br><img src='http://www.dsbw.ru/_gfx/hl1.gif' width=102 height=4>";
 parent.document.all['Tab'].innerHTML = result;
}


function PrintTourHeader()
{
 var result = "<table cellpadding=0 cellspacing=0 width=100%><tr height=36><td width=8 nowrap></td><td width=130 nowrap><b>название тура</b></td><td width=130 nowrap><b>ближайшие даты</b></td><td width=50 nowrap><b>места</b></td><td width=80 nowrap><b>цена</b></td><td width=130 nowrap><b>менеджер тура</b></td><td><b>бронирование</b></td></tr></table>";
// document.all['SelectedTour'].innerHTML = "";
 document.all['TourList'].innerHTML = "";
 document.all['Tab'].innerHTML = result;
}


function CheckFormData(fName, arrData)
{
 for(var i=0; i<arrData.length; i++)
  {
   if (!document.forms[fName][arrData[i]].value)
    {
     return false;
    }
  }
}


function PrintCharterName(n)
{
 var str = document.all['Name'+n].innerHTML;
 parent.document.all['CharterList'].innerHTML = "<a href='JavaScript:charter_list.history.back(); ClearCharterName()' class='navi'><nobr>К СПИСКУ</nobr></a><br><img src='http://www.dsbw.ru/_gfx/hl1.gif' width=65 height=4>";
 parent.document.all['CharterName'].innerHTML = "<p class='in_grid5'>"+str+"</p>";
}

function ClearCharterName()
{
 parent.document.all['CharterList'].innerHTML = "";
 parent.document.all['CharterName'].innerHTML = "";
}


function servm(elem, targ)
{
	len = elem.options.length;
	ser = '';
	for (var i = 0; i < len; i++)
	{
		ev = new String(elem.options[i].value);
		if(elem.options[i].selected)
		{
			ser = ser+'#'+ev;
		}
	}
	targ.value = ser.substring(1);
}


function SubmitFilterForm()
{
	servm(HotelFilter.ServicePre, HotelFilter.Service);
	servm(HotelFilter.LocationPre, HotelFilter.Location);
	servm(HotelFilter.PricePre, HotelFilter.Price);
	HotelFilter.submit();
}


function HotelFilterSubmit(id, sub, page)
{
	HotelFilter.action = "/web/type/reshotel/id/"+id+"/sub/"+sub+"/page/"+page+"/index.php";
	HotelFilter.submit();
}


function Frame_SetPoint(pointID, newZoom)
{
	parent.document['map_drag'].SetVariable('pointID', pointID);
	parent.document['map_drag'].SetVariable('newZoom', newZoom);
}

/*function SetPoint(pointID, newZoom)
{
	document['map_drag'].SetVariable('pointID', pointID);
	document['map_drag'].SetVariable('newZoom', newZoom);
}*/


function ShowTourists(n, t)
{
 for (var i=10; i>t; i--)
  {
   document.all['FIO'+n+'_'+i].value='';
   document.all['SEX'+n+'_'+i].value='';
   document.all['DAY'+n+'_'+i].value='';
   document.all['MONTH'+n+'_'+i].value='';
   document.all['YEAR'+n+'_'+i].value='';
   document.getElementById('tourist'+n+'_'+i).className = 'hid';
  }
 for (i=1; i<=t; i++)
  {
   document.getElementById('tourist'+n+'_'+i).className = 'vis';
  }

}


function CheckResHotel()
{
 var n = 0;
 var k = 0;
 if (!document.all['day1'].value || !document.all['month1'].value || !document.all['year1'].value || !document.all['day2'].value || !document.all['month2'].value || !document.all['year2'].value)
  {
   alert('Укажите дату заезда и отъезда');
   return false;
  }
 if (document.all['DBL'].value < 1 && document.all['SGL'].value < 1 && document.all['TRIPL'].value < 1 && document.all['CHILD'].value < 1)
  {
   alert('Укажите количество туристов');
   return false;
  }
 if (document.all['DBL'].value > 0)
  {
   k = parseInt(document.all['DBL'].value)+1;
   n = 1;
   for(var i=1; i<k; i++)
    {
     if (!document.all['FIO'+n+'_'+i].value || !document.all['SEX'+n+'_'+i].value || !document.all['DAY'+n+'_'+i].value || !document.all['MONTH'+n+'_'+i].value || !document.all['YEAR'+n+'_'+i].value)
      {
       alert('Введите данные туристов');
       return false;
      }
    }
  }
 if (document.all['SGL'].value > 0)
  {
   k = parseInt(document.all['SGL'].value)+1;
   n = 2;
   for(var i=1; i<k; i++)
    {
     if (!document.all['FIO'+n+'_'+i].value || !document.all['SEX'+n+'_'+i].value || !document.all['DAY'+n+'_'+i].value || !document.all['MONTH'+n+'_'+i].value || !document.all['YEAR'+n+'_'+i].value)
      {
       alert('Введите данные туристов');
       return false;
      }
    }
  }
 if (document.all['TRIPL'].value > 0)
  {
   k = parseInt(document.all['TRIPL'].value)+1;
   n = 3;
   for(var i=1; i<k; i++)
    {
     if (!document.all['FIO'+n+'_'+i].value || !document.all['SEX'+n+'_'+i].value || !document.all['DAY'+n+'_'+i].value || !document.all['MONTH'+n+'_'+i].value || !document.all['YEAR'+n+'_'+i].value)
      {
       alert('Введите данные туристов');
       return false;
      }
    }
  }
 if (document.all['CHILD'].value > 0)
  {
   k = parseInt(document.all['CHILD'].value)+1;
   n = 4;
   for(var i=1; i<k; i++)
    {
     if (!document.all['FIO'+n+'_'+i].value || !document.all['SEX'+n+'_'+i].value || !document.all['DAY'+n+'_'+i].value || !document.all['MONTH'+n+'_'+i].value || !document.all['YEAR'+n+'_'+i].value)
      {
       alert('Введите данные туристов');
       return false;
      }
    }
  }

 if (!document.all['USERTYPE'].value || (document.all['USERTYPE'].value == 1 && (!document.all['Z_FIO'].value || !document.all['Z_PHONE'].value || !document.all['Z_MAIL'].value)) || (document.all['USERTYPE'].value == 2 && (!document.all['A_NAME'].value || !document.all['A_FIO'].value || !document.all['A_PHONE'].value || !document.all['A_MAIL'].value)))
  {
   alert('Введите контактные данные');
   return false;
  }

}


function CheckResTicket()
{
 var n = 0;
 var k = 0;
 if (!document.all['day1'].value || !document.all['month1'].value || !document.all['year1'].value || !document.all['day2'].value || !document.all['month2'].value || !document.all['year2'].value)
  {
   alert('Укажите дату вылета и прилета');
   return false;
  }
 if (document.all['PASS'].value < 1)
  {
   alert('Укажите количество пассажиров');
   return false;
  }
 if (document.all['PASS'].value > 0)
  {
   k = parseInt(document.all['PASS'].value)+1;
   n = 1;
   for(var i=1; i<k; i++)
    {
     if (!document.all['FIO'+n+'_'+i].value || !document.all['SEX'+n+'_'+i].value || !document.all['DAY'+n+'_'+i].value || !document.all['MONTH'+n+'_'+i].value || !document.all['YEAR'+n+'_'+i].value)
      {
       alert('Введите данные пассажиров');
       return false;
      }
    }
  }

 if (document.all['city_v'].value == 'other' && !document.all['city_v_text'].value)
  {
   alert('Укажите город вылета');
   return false;
  }
 if (!document.all['city1'].value)
  {
   alert('Укажите город туда');
   return false;
  }
 if (!document.all['city2'].value)
  {
   alert('Укажите город обратно');
   return false;
  }

 if (!document.all['USERTYPE'].value || (document.all['USERTYPE'].value == 1 && (!document.all['Z_FIO'].value || !document.all['Z_PHONE'].value || !document.all['Z_MAIL'].value)) || (document.all['USERTYPE'].value == 2 && (!document.all['A_NAME'].value || !document.all['A_FIO'].value || !document.all['A_PHONE'].value || !document.all['A_MAIL'].value)))
  {
   alert('Введите контактные данные');
   return false;
  }

}

function DisableStopSaleItems(p)
{
 switch (p) {
  case 1:
   document.all['TOURS'].disabled = true;
   document.all['KEYWORD'].disabled = false;
   document.all['CATALOGS'].disabled = false;
   document.all['region'].disabled = false;
   document.all['day1'].disabled = false;
   document.all['month1'].disabled = false;
   document.all['year1'].disabled = false;
   document.all['day2'].disabled = false;
   document.all['month2'].disabled = false;
   document.all['year2'].disabled = false;
   document.all['m_yes'].disabled = false;
   document.all['m_no'].disabled = false;
   document.all['m_lit'].disabled = false;
   document.all['price'].disabled = false;
   document.all['BUTTON'].disabled = false;
  break;
  case 2:
   document.all['TOURS'].disabled = false;
   document.all['KEYWORD'].disabled = true;
   document.all['CATALOGS'].disabled = true;
   document.all['region'].disabled = true;
   document.all['day1'].disabled = true;
   document.all['month1'].disabled = true;
   document.all['year1'].disabled = true;
   document.all['day2'].disabled = true;
   document.all['month2'].disabled = true;
   document.all['year2'].disabled = true;
   document.all['m_yes'].disabled = true;
   document.all['m_no'].disabled = true;
   document.all['m_lit'].disabled = true;
   document.all['price'].disabled = true;
   document.all['BUTTON'].disabled = true;
  break;

  }
}

function GroupDivs(n)
{
 document.getElementById('Info').className = "hid";
 document.getElementById('Search').className = "hid";
 document.getElementById('TourMap').className = "hid";
 for(var i=1; i<4; i++)
  {
   if (i != n)
    {
     document.getElementById('BTN'+i+'_x').className = "hid";
     document.getElementById('BTN'+i).className = "vis";
    }
   else
    {
     document.getElementById('BTN'+i).className = "hid";
     document.getElementById('BTN'+i+'_x').className = "vis";
    }
  }
}


function ShowBigMap(n)
{
 var par="width=634,height=600,copyhistory=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0";
 MapW=window.open("/map.php?id="+n,"MapWindow",[par]);
 MapW.focus();
}

