
function Submit(form)
{
  var obj = document.getElementById(form);
  if (obj)
  {
    obj.submit();
  }
}

function DoOnClick(key, value)
{
  var obj = document.getElementById(key);
  if (obj)
  {
    obj.value=value;
    obj.form.submit();
  }
}

function DoOnClick2(key, value, key_2, value_2) 
{
  var obj = document.getElementById(key);
  if (obj)
  {
    obj.value=value;
  }
  var obj_2 = document.getElementById(key_2);
  if (obj_2)
  {
    obj_2.value=value_2;
  }
  if (obj)
  {
    obj.form.submit();
  }
}

function ElementExists(name)
{
  var obj = document.getElementById(name);
  if (obj)
  {
    return true
  } else
  {
    return false
  }
}

function DoOnClick3(key, value, form)
{
  var obj = document.getElementById(key);
  if (obj)
  {
    obj.value=value;
    var obj_form = document.getElementById(form);
    if (obj_form)
    {
      obj_form.submit();
    } else
    {
      obj.form.submit();
    }
  }
}

function DoOnClick4(key, value, key_2, value_2, form)
{
  var obj = document.getElementById(key);
  if (obj)
  {
    obj.value=value;
    var obj2 = document.getElementById(key_2);
    if (obj2)
    {
      obj2.value=value_2;
      var obj_form = document.getElementById(form);
      if (obj_form)
      {
        obj_form.submit();
      } else
      {
        obj.form.submit();
      }
    }
  }
}

function DoOnClick5(key, value, key_2, value_2, key_3, value_3, form)
{
  var obj = document.getElementById(key);
  if (obj)
  {
    obj.value=value;
    var obj2 = document.getElementById(key_2);
    if (obj2)
    {
      obj2.value=value_2;
      var obj3 = document.getElementById(key_3);
      if (obj3)
      {
        obj3.value=value_3;
        var obj_form = document.getElementById(form);
        if (obj_form)
        {
          obj_form.submit();
        }
      }
    }
  }
}


function ButtonOver(button) 
{
  button.style.color = "#C5EB1A";
}

function ButtonOut(button) 
{
  button.style.color = "";
}

function ButtonOver2(button)
{
  button.style.backgroundColor = "#C5EB1A";
}

function ButtonOut2(button)
{
  button.style.backgroundColor = "";
}

function ButtonOver3(button)
{
  button.style.color = "#FFFFFF";
  button.style.backgroundColor = "#155900";
}

function ButtonOut3(button)
{
  button.style.backgroundColor = "";
  button.style.color = "";
}

/*
function replace_img(selector)
{
  var image = $$(selector);
  var parent;
  var co;
  var p;
  var width_i = 0;
  if (Object.isArray(image))
  {
    image.each(function(item) {
      width = item.getWidth();
      height = item.getHeight();
      url = item.getAttribute('src');
      tag = '<div class="rounded_image" style="float: left; margin-left: 10px;margin-right: 10px; border: 2px solid #A2A19D; width: ' + width + 'px; height: ' + height + 'px; background-image: url(\'' + url + '\');"></div>';
      //tag = '<div class="rounded_image" style="margin: 0 auto; border: 2px solid #A2A19D; width: ' + width + 'px; height: ' + height + 'px; background-image: url(\'' + url + '\');"></div>';
      if (Object.isUndefined(p))
      {
        width_i = width + 20;
        p = item.parentNode;
        parent = new Element('div');
        parent.setStyle('float: left; width: 100%;');
        co = new Element('div');
        co.setStyle('');
        Element.insert(p,parent);
        Element.insert(parent,co);
        Element.insert(co,tag);
      } else
      {
        if (p!==item.parentNode)
        {
          alert('W=' + p.getWidth() + ' w=' + width_i);
          width_i = ((p.getWidth() - width_i) / 2);
          //co.setStyle('position: relative; left: ' + width_i + 'px;');
          width_i = width + 20;
          p = item.parentNode;
          parent = new Element('div');
          parent.setStyle('float: left; width: 100%;');
          co = new Element('div');
          co.setStyle('');
          Element.insert(p,parent);
          Element.insert(parent,co);
          Element.insert(co,tag);
        } else
        {
          Element.insert(co,tag);
          width_i = width_i + width + 20;
        }
      }
      Element.remove(item);
    });
  }
  imgs = $$("div.rounded_image").last();
  if (imgs)
  {
    co = imgs.parentNode;
    p = co.parentNode;
    if (width_i>20)
    {
      //alert('pw=' + p.getWidth() + ' wd=' + width_i);
      //co.setStyle('position: relative; left: ' + ((p.getWidth() - width_i) / 2) + 'px;');
    } else
    {
      //co.setStyle('position: relative; left: ' + ((p.getWidth() - imgs.getWidth() - 20) / 2) + 'px;');
    }
  }
}

*/



