﻿var searchInterface;
function load(loadMap)
{
	searchInterface=new cSearchInterface();
	searchInterface.init(loadMap);
	searchInterface.yadirectinit();
};
function loadWaysHistory_(){
	searchInterface.loadWaysHistory()
};
function searchFromHistory_(id){
	searchInterface.searchFromHistory(id)
};
function showElement_(id){
	searchInterface.showElement(id)
};
function hideElement_(id){
	searchInterface.hideElement(id)
};
function toggleMap_(){
	searchInterface.toggleMap()
};
function toggleObj_(){
	searchInterface.toggleObj()
};
function showNumPointsWin_(event,srcElem,numPoints){
	searchInterface.showNumPointsWin(event,srcElem,numPoints);
};
function closeNumPointsWin_(srcElem,numPoints){
	closeNumPointsWin(srcElem,numPoints);
};
function getBestTargetRoute_(routeNum,target){
	searchInterface.getBestTargetRoute(routeNum,target);
};
function switchRoute_(wayid,na,nb,unitNum,routeNum,target,type){
	searchInterface.switchRoute(wayid,na,nb,unitNum,routeNum,target,type);
};
function switchTrafTime()
{
	searchInterface.switchTrafTime()
};
function selectTextarea(textarea)
{
	searchInterface.selectTextarea(textarea)
};
function showTrafficWin(uid,unit)
{
	searchInterface.showTrafficWin(uid,unit)
};
function closeTrafficWin(uid,unit)
{
	searchInterface.closeTrafficWin(uid,unit)
};
function closeLinkToRoutes()
{
	searchInterface.closeLinkToRoutes()
};
function showLinkToRoutes(offsetElem)
{
	searchInterface.showLinkToRoutes(offsetElem)
};
function reSortRoutes(combo)
{
	searchInterface.reSortRoutes(combo)
};
function requestBySubstr()
{
	searchInterface.requestBySubstr()
};
function keydown_(event,pt)
{
	searchInterface.keydown(event,pt)
};
function closeObjFinder()
{
	searchInterface.closeObjFinder()
};
function setObject(lat,lng,name,addr)
{
	searchInterface.setObject(lat,lng,name,addr)
};
function toRoot()
{
	searchInterface.toRoot()
};
function getObjsByType(typeid)
{
	searchInterface.getObjsByType(typeid)
};
function getObject(pt)
{
	searchInterface.getObject(pt)
};
function doSearch()
{
	searchInterface.getRoutesPrepare();
};
function mainChange(combo){
	searchInterface.mainChange(combo);
};
function typeChange(combo){
	searchInterface.typeChange(combo);
};
function objChange(combo){
	searchInterface.objChange(combo);
};
function echoSerp_(start,containerId){
	echoSerp(start,containerId);
};
function showHint(){
	searchInterface.showHint();
};
function typeAddrHelp(a)
{
	if(a=='show')
	{
		gid('basics').style.display='none';
		gid('typeaddrhelp').style.display='block'
	}
	else
	{
		gid('basics').style.display='block';
		gid('typeaddrhelp').style.display='none'
	}
};
function doQuestion_(){
	searchInterface.doQuestion_();
}
function switchMap(a,b)
{
	searchInterface.switchMap(a,b)
};
function printPage(num){
	searchInterface.printPage(num);
};
function toPrint(a,b){
	searchInterface.toPrint(a,b);
};
function closePrint(){
	searchInterface.closePrint();
};
/*function pointByAddr(a,b,c,d,e)
{
	searchInterface.pointByAddr(a,b,c,d,e)
};*/
function clearPoints()
{
	searchInterface.clearPoints()
};
function newSearch_()
{
	searchInterface.newSearch()
};
function focusinput_(input, defaultstr,pt){
	searchInterface.focusinput(input, defaultstr,pt);
};
function blurinput_(input, defaultstr,pt){
	searchInterface.blurinput(input, defaultstr, pt);
};
function switchMenu(a)
{
	var b=a=='mapclick'?'typeaddr':'mapclick';
	searchMethod=a;
	gid(b+'link').className="ajaxlink";
	gid(a+'link').className="ajaxlink checked";
	gid(b).style.display='none';
	gid(a).style.display='block'
};
function closeCurrentMarker(){
	searchInterface.closeCurrentMarker();
};
function loadTest(){
	var oElement = document['body']; 
	if(oElement != null && typeof(oElement) != "undefined") { load(); } 
	else { setTimeout(function() { loadTest(); }, 0); } 
};
function toggleOtherLinks_(){
	searchInterface.toggleOtherLinks();
};
function toggleBlock_(id){
	searchInterface.toggleBlock(id);
};
function fillStreet_(point,str){
	searchInterface.fillStreet(point,str);
};
function getCurrentRoutesXML(){
	return currentRoutesXML;
};
function getPointAaddr(){
	return pointAaddr;
};
function getPointBaddr(){
	return pointBaddr;
};
function getPointA(){
	return pointA;
};
function getPointB(){
	return pointB;
};
window.onload=function(){window.onload;loadTest()};
window.onunload=function(){window.onunload;GUnload()};


/*var kostroma_warn_showed=0;
function kostroma_warn() {
  if ( CITYID__==443
      && (
        gid('pointastreet').value != gid('pointastreet').defaultValue ||
        gid('pointbstreet').value != gid('pointbstreet').defaultValue
        ) && !kostroma_warn_showed++ 
      ){
    var x = document.createElement( "div" );
    x.setAttribute( "id", "kost_win" );
    x.setAttribute( "onclick", "document.getElementById(\'kost_win\').style.display = \'none\';" );
    x.setAttribute( "style", "z-index:99;position:absolute; top:30%; left:45%; width:30%;margin:0;background:#ffffe1; border:solid 1px black; padding: 4px; text-align:center;" );
    x.appendChild( document.createTextNode( 'Введённый Вами адрес может не соответствовать его фактическому нахождению на карте из-за проблем поставщика картографического сервиса. Проверьте, пожалуйста, расположение «стрелок» на карте. В случае несоответствия, переместите их в необходимое место вручную и повторно нажмите "найти маршрут".' ) );
    var z = document.createElement( "br" );
    x.appendChild( z );
    var y = document.createElement( "div" );
    y.setAttribute( "style", "cursor:pointer; display:inline-block; margin:2px; border:1px solid; border-color:lightgrey #404040 #404040 lightgrey; padding:0 4px 0 4px; background:#d4d0c8;");
    x.appendChild( y );
    y.appendChild( document.createTextNode( "закрыть" ) );
    document.body.appendChild( x );
  }
}*/
