function form_submit( frm )
{
  frm.getElementsByTagName( 'input' )[ 0 ].click( );
}

function form_submit_by_id( id )
{
  var el = document.getElementById( id );
  var x = el.getElementsByTagName('input');
  x[ 0 ].click( );
  /*
  if( x.length > 0 )
  {
    //x[ 0 ].click( );
    var el = document.createElement('input');
    el.setAttribute('type', 'hidden');
    el.setAttribute('name', x[ 0 ].name);
    el.setAttribute('id', x[ 0 ].name);
    el.setAttribute('value', '');
    x[ 0 ].form.appendChild(el);
    x[ 0 ].form.submit( );
  }
  //alert( 'go!' );
  //x[ 0 ].form.submit( );
  //return true;
  */
}

function popitup( url, w, h )
{
  newwindow = window.open( url, 'popup', 'height=' + h.toString( ) + ',width=' + w.toString( ) );
  if( window.focus ) 
  {
    newwindow.focus( );
  }
  return false;
}

function toggle(s)
{
  var layer = 'p'+s;
  var a = 'a'+s;
  if (getProp(layer, "display")!="none")
  {
    setProp(layer, "display", "'none'");
    setProp(a, "background",  "'url(plus.gif) 0 4px no-repeat'");
  }
  else
  {
    setProp(layer, "display",  "''");
    setProp(a, "background",  "'url(minus.gif) 0 4px no-repeat'");
  }
}

function show_table( id )
{
  var el = document.getElementById(id);
  if( el ) 
  {
    var attr = el.style.display;
    el.style.display = (attr == 'block') ? 'none' : 'block';
  }
}

function toggle_val( id, val1, val2 )
{
  var el = document.getElementById(id);
  if( el )
  {
    if( el.innerHTML == val1 )
    {
      el.innerHTML = val2;
    }
    else if( el.innerHTML == val2 )
    {
      el.innerHTML = val1;
    }
  }
}

var card_ImageObject = 0;
var card_PicBlackWhite = '';
var card_PicNormal = '';

var card_PicVeryBig = '';

function card_Image(obj, pic)
{
   var el = document.getElementById(obj);
   if (el)
       el.src = pic;
}


/* added */
function openFullImage()
{
        window.open(card_PicVeryBig, '_blank', 'toolbar=no,resize=no,status=no,menu=no');
}
/* /// added */

/* ------------------------------------------------------------------------------------- */
function cardClick(currObj, fullImage, picNormal, picBlack, veryBigImage)
{
   if (card_ImageObject)
   {
       setTimeout("card_Image('" + card_ImageObject + "', '" + card_PicNormal + "');", 75);
   }
      card_ImageObject         = currObj;
          card_PicBlackWhite         = picBlack;
      card_PicNormal             = picNormal;
          card_PicVeryBig                       = veryBigImage;
          
      setTimeout("card_Image('" + currObj + "', '" + picBlack + "');", 150);
      setTimeout("card_Image('bigimage', '" + fullImage + "');", 180);
}

function setActivePhoto(imageId, picNormal, picBlack, picBig)
{
    card_ImageObject         = imageId;
    card_PicBlackWhite         = picBlack;
    card_PicNormal             = picNormal;
    card_PicVeryBig = picBig;
}

function submit_call( node, name_submit )
{
        var parent = node.parentNode;
        var elements = parent.getElementsByTagName('select');
        var el = 0;
        for(i=0; i<elements.length; i++)
        {
                if (elements[i].name == name_submit)
                {
                        el = elements[i];
                        break;
                }
        }
        
        var present = 0;
        if (el)
        {  
          for(i=0; i<el.options.length; i++)
          {
            if( el.options[ i ].selected == true )
              present++;
          }
        }
        
        if( present == 0 )
        {
            var opt = new Option('', '-1');
            opt.selected = true;
            el.options.length++;
            el.options[el.options.length-1] = opt;
        }
        
        return true;
}

