if (document.images) {
        
  for_investorson=new Image; for_investorsoff=new Image; 
  for_investorson.src="design/images/for_investors_over.gif"; for_investorsoff.src="design/images/for_investors.gif";    

  for_masson=new Image; for_massoff=new Image; 
  for_masson.src="design/images/for_mass-media_over.gif"; for_massoff.src="design/images/for_mass-media.gif";   

  for_developmenton=new Image; for_developmentoff=new Image; 
  for_developmenton.src="design/images/for_development_over.gif"; for_developmentoff.src="design/images/for_development.gif";   



  menu_abouton=new Image; menu_aboutoff=new Image; 
  menu_abouton.src="design/images/menu_about_over.gif"; menu_aboutoff.src="design/images/menu_about.gif";   
  
  menu_activityon=new Image; menu_activityoff=new Image; 
  menu_activityon.src="design/images/menu_activity_over.gif"; menu_activityoff.src="design/images/menu_activity.gif";
  
  menu_geographyon=new Image; menu_geographyoff=new Image; 
  menu_geographyon.src="design/images/menu_geography_over.gif"; menu_geographyoff.src="design/images/menu_geography.gif";  
  
  menu_presson=new Image; menu_pressoff=new Image; 
  menu_presson.src="design/images/menu_press_over.gif"; menu_pressoff.src="design/images/menu_press.gif";    
  
  menu_contactson=new Image; menu_contactsoff=new Image; 
  menu_contactson.src="design/images/menu_contacts_over.gif"; menu_contactsoff.src="design/images/menu_contacts.gif";
  
  
  foto1on=new Image; foto1off=new Image;
  foto1on.src="design/images/foto_mini_arrow.gif"; foto1off.src="design/images/spacer.gif";
}

function imageon(imgname, num)
{
  if (document.images) {
  var link_id = 'big_photo_link_'+num;
  var aa = $(link_id);
  if ($('search_glass_link') && ($(link_id))) {
    $('search_glass_link').href = aa.href;
  }
  imgon=eval(imgname+"on.src");
  document[imgname].src=imgon;}
}

function imageoff(imgname, num)
{
  if (document.images) {
  var link_id = 'big_photo_link_'+num;
  var aa = $(link_id);
  if ($('search_glass_link') && ($(link_id))) {
    $('search_glass_link').href = aa.href;
  }
  imgoff=eval(imgname+"off.src")
  document[imgname].src=imgoff;}
}

Event.observe(window, 'load', function() {
  var buttons =  $$('.button_add');
  buttons.each(function(button) {
    Event.observe(button, 'click', showNext);
    Event.observe(button, 'mouseover', showNext);
  })
  //Event.observe('signinForm', 'submit', checkForm);

  var drop_down_link = $('city_drop_down_link');
  var city_list = $('city_list');
  if (drop_down_link) {
    Event.observe(drop_down_link, 'mouseover', function(event) {
      var element = Event.element(event);
      if ('city_drop_down_link' == element.id) {
        if (!city_list.visible()) {
          city_list.show();
        }
      }
    }.bindAsEventListener(this));
    Event.observe(city_list, 'mouseout', function(event) {
      var element = Event.element(event);
      if ('city_list' == element.id) {
        if (city_list.visible()) {
          city_list.hide();
        }
      }
    }.bindAsEventListener(this));

    Event.observe(city_list, 'mouseover', function(event) {
      var element = Event.element(event);
      if ('city_list' == element.id) {
        if (city_list.visible()) {
          city_list.hide();
        }
      }
    }.bindAsEventListener(this));

  }

  var city_links = $$('.city_links');
  if (city_links) {
    city_links.each(function(link) {
     /* Event.observe(link, 'click', function(event) {
        var url = 'http://tashir.ru/activity/shopping_malls_and_markets.php?city='+this.id;
        location.href = url;
      });*/
      Event.observe(link, 'mouseover', function(event) {
        link.setStyle({textDecoration:"none"})
      });
      Event.observe(link, 'mouseout', function(event) {
        link.setStyle({textDecoration:"underline"})
      });
      link.setStyle({cursor:"pointer"});
    });
  }
});

function showNext() {
  if ($('upload_container2').visible() == false) {
    $('upload_container2').show(); 
    return true;
  }
  if ($('upload_container3').visible() == false) {
    $('upload_container3').show(); 
    return true;
  }
  if ($('upload_container4').visible() == false) {
    $('upload_container4').show(); 
    return true;
  }
  if ($('upload_container5').visible() == false) {
    $('upload_container5').show(); 
    $('button_add_1').removeClassName('button_add_active');
    $('button_add_1').addClassName('button_add_inactive');
    return true;
  }
}

function toggleCityList() {
  var city_list = $('city_list');
  if (city_list.visible()) {
    //setTimeout('city_list.hide()', 500);
    city_list.hide();
    $('city_drop_down_link').setStyle({borderBottom:'1px solid #dfe5ee'});
  }
  else {
    $('city_drop_down_link').setStyle({borderBottom:'0'});
    city_list.show();
  }
}
