/**
 * (c) Copyright 2010 Systema Logistic. All Rights Reserved.
 */

$(document).ready(init);

function init()
{
  $("ul.v_tabs").tabs("div.v_panes > div");
  $("ul.h_tabs").tabs("div.h_panes > div");

  hiding_catalog_elements();

  $("ul.catalog_elements > li").click(function(){
    hiding_catalog_elements();

    /*$.each("ul.catalog_elements > li", function(){
      if($("." + this).hasClass("catalog_el_selected")) $("." + this).removeClass("catalog_el_selected");
    });

    $(this).addClass("catalog_el_selected");
    if($(this).hasClass("catalog_el_selected")) $(this).removeClass("catalog_el_selected");
    else
    {
      $(this).addClass("catalog_el_selected");
      *//*$('html, body').animate({scrollTop: element_position}, 800);*//*
    }*/
  });
  
}

function hiding_catalog_elements()
{
  var catalog = ['c_elem_01', 'c_elem_02', 'c_elem_03',
                 'c_elem_04', 'c_elem_05', 'c_elem_06',
                 'c_elem_07', 'c_elem_08', 'c_elem_09',
                 'c_elem_10', 'c_elem_11', 'c_elem_12',
                 'c_elem_14', 'c_elem_14'];
  $.each(catalog, function(){
    $("." + this).hide();
  });
}

function goTop()
{
  $('html, body').animate({scrollTop: '0px'}, 800);
  return false;
}

function catalog_element(element)
{
  $("." + element).slideToggle();
  window.location = "#" + element;
  return false;
}

function show_certificate(cert)
{
  $("#cert").html("");
  switch(cert)
  {
    case 'certamu':
      $("#cert").load("tpl/cert/certamu.html");
      break;
    case 'certiso':
      $("#cert").load("tpl/cert/certiso.html");
      break;
    case 'dipamu':
      $("#cert").load("tpl/cert/dipamu.html");
      break;
  }
}
