function refreshLinks(caller) {
 links = document.getElementsByTagName('A');
 for (var i=0; i<links.length; i++) {
     if (links[i].className == 'link_sel') {links[i].className = 'link'}
 }
 caller.className = 'link_sel';
 focus(document);
}
function openPage(pageId, caller) {
  new Ajax.Updater('page_content', 'ajax/page.php',
    {method: 'get',
     parameters:
         {id: pageId}});
  refreshLinks(caller);
}
function openFabrics(category, caller) {
  new Ajax.Updater('page_content', 'ajax/fabrics.php',
    {method: 'get',
     parameters:
         {category: category}});
  refreshLinks($('fabrics'));
}
function openFasads(type, caller) {
  new Ajax.Updater('page_content', 'ajax/fasads.php',
    {method: 'get',
     parameters:
         {type: type}});
  refreshLinks($('fasads'));
}
function openGoods(sectionId, pageNo, subSection, caller) {
  new Ajax.Updater('page_content', 'ajax/goods.php',
    {method: 'get',
     parameters:
         {section_id: sectionId,
          page_no: pageNo,
          sub_section: subSection}});
  refreshLinks(document.getElementById(sectionId));
}
function openGoodsDetails(goodsId, sectionId, caller) {
  new Ajax.Updater('page_content', 'ajax/goods.php',
    {method: 'get',
     parameters:
         {mode: 'details',
          goods_id: goodsId}});
  refreshLinks(document.getElementById(sectionId));
}
function openNewsBrief() {
  new Ajax.Updater('news_brief', 'ajax/news.php',
    {method: 'get',
     parameters:
         {count: 4}});
}
function openNews(id) {
  new Ajax.Updater('page_content', 'ajax/news.php',
    {method: 'get',
     parameters:
         {count: 0,
          mode: 'full',
          id: id}});
  refreshLinks($('news'));
}
