function showimage(i)
{
  s = i.src;
  n = i.name;
  a = i.alt;

  fixedimagewidth = 550
  x = eval(n.toLowerCase() + "_x");
  y = eval(n.toLowerCase() + "_y");
  newy = Math.round(y/x*fixedimagewidth);
  

  re=/\/thumbnails\/Var\_TN\_/gi;
  news=s.replace(re, "/gallery/");
  
  document.mainimage.src=news;
  document.mainimage.width=fixedimagewidth;
  document.all.maintable.style.display='';
  document.mainimage.alt=a;
  document.all.imagecaption.innerHTML = "<strong>" + a + "</strong>";
  document.location="#scrollto";

//  document.mainimage.height = newy;
   
}

function showimagenewwindow(i)
{
  s = i.src;
  window.open(s)
}


function showprops(obj, obj_name)
{
  var result = ""
  for (var i in obj)  {
    result += obj_name + "." + i + " = " + obj[i] + "\n"
  }
  return result;
}


function gbformvalidation(formobj)
{
  name = trim(document.messageform.gb_name.value);
  title = trim(document.messageform.gb_title.value);
  content = trim(document.messageform.gb_content.value);

  if (name.length <= 0) 
  {
    alert('Your name is required.');
    document.messageform.gb_name.focus(); 
    return false;
  }
  else if (title.length <= 0) 
  {
    alert('Message subject is required.');
    document.messageform.gb_title.focus(); 
    return false;
  }
  if (content.length <= 0) 
  {
    alert('Message content is required.');
    document.messageform.gb_content.focus(); 
    return false;
  }
  
  
} 

function trim(str) 
{
  return str.replace(/^\s+/,'').replace(/\s+$/,'');
}



