// Show an image
function showImage(url, alt)
{
  if (alt == undefined) alt = '';
  if (document.getElementById('image_block') != undefined) JSPcloseWindow('image_block');
  var content = '<div id="image_block" onclick="JSPcloseWindow(\'image_block\')">' +
	'<div id="image_block_content"><img src="/'+url+'" alt="'+alt+'" /></div>' +
	'</div>';

  JSPopenWindow("image_block", content, "center", 150);
}

// 
function switchSummaryBlock(id)
{
  for (i=1;i<8;i++) {
    if (document.getElementById("summary_block_"+i) != undefined)
      document.getElementById("summary_block_"+i).style.display = 'none';
    if (document.getElementById("summarySwitcher"+i) != undefined)
      document.getElementById("summarySwitcher"+i).className = 'none';
  }

  document.getElementById("summary_block_"+id).style.display = 'block';
  document.getElementById("summarySwitcher"+id).className = 'active';
}

// 
function switchPpBlock(id)
{
  for (i=1;i<5;i++) {
    if (document.getElementById("partnership_block_"+i) != undefined)
      document.getElementById("partnership_block_"+i).style.display = 'none';
    if (document.getElementById("ppSwitcher"+i) != undefined)
      document.getElementById("ppSwitcher"+i).className = 'none';
  }

  document.getElementById("partnership_block_"+id).style.display = 'block';
  document.getElementById("ppSwitcher"+id).className = 'active';
}


// Shows a length of filled value of field
function showFilledLength(element, counter)
{
  document.getElementById(counter).innerHTML = element.value.length;
} 

// 
function showLoginBlock()
{
  document.getElementById('login').style.display = 'block';
  document.login_form.login.focus();
}
