function ajaxClear (div) {
  // прелоадер: подставляет строку в DIV
  $(div).style.display = 'none';
//  $(div).style.pixelTop=-1000;
}

function ajaxUpdate (div, uri, param) {
  $(div).style.display = '';
  // прелоадер: подставляет строку в DIV
  $(div).innerHTML = '<TABLE cellSpacing=1 cellPadding=5 border=0 bgcolor=\"#CDC8A5\" width="150" height="150"><tr><td align=\"center\"><img src="images/ajax.gif" border="0"><br>Загрузка...</td></tr></table>';

  // выполняет запрос к странице uri
  // с переменными param методом get
  // и подставляет результат в DIV
  var ajax = new Ajax.Updater(
    div, // значение атрибута id у DIV’а
    uri, // внешняя страница (скрипт)
    {
      method: 'get',
      parameters: param // переменные разделённые символом &
    }
  );
//  return false;


}

function addfoto () {  var count = eval('document.tovar.countfoto.value');
  document.tovar.countfoto.value = eval(count+'+1');

  var newDiv = document.createElement('div');
  newDiv.innerHTML = '<input name=\"userfile'+eval(count+'+1')+'\" type=\"file\" style=\"width=550px\">';
  add_foto.appendChild(newDiv);
}

function bigfoto (div, id) {
  $(div).innerHTML = '<img src=\"foto.php?id=' + id + '\" border=0 onclick=\"javascript:litlefoto(fototovar'+id+', '+id+')\" alt=\"Уменьшить фотографию\">';
}
function litlefoto (div, id) {
  $(div).innerHTML = '<img src=\"foto.php?id=' + id + '&r=m\" border=0 onclick=\"javascript:bigfoto(fototovar'+id+', '+id+')\" alt=\"Увеличить фотографию\">';
}
function refresh(div, data) {current_date = new Date();
  $(div).innerHTML = '<img src=\"kcaptcha/index.php?d='+current_date+'312\"><br><a href=\"javascript:refresh(kcaptcha)\">Обновить рисунок</a>';
}


function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}

function fforum (uri) {

   document.getElementById('site_forum').innerHTML = 'Загрузка...';

    var xmlhttp = getXmlHttp();
   var current_date = new Date();
   xmlhttp.open('GET', 'http://b2y.ru/phpBB3/', true);
   xmlhttp.onreadystatechange = function() {
   if (xmlhttp.readyState == 4)
   {
    if(xmlhttp.status == 200)
    {
     document.getElementById('site_forum').innerHTML = xmlhttp.responseText;
    }
   }
 }
xmlhttp.send(null);


}
