function set_content_wrap_height()
{
//    debug('in set_content_wrap_height()');
    var cwrap = document.getElementById("contentwrap");
	var cont = document.getElementById("content");
    if (!cont || !cwrap)
	   error('expected content and contentwrap');
	else
	   {
//       debug('cwrap='+cwrap.id+', cont='+cont.id);
//	   debug('cont height: '+cont.offsetHeight.toString()+'cwrap height: '+cwrap.offsetHeight.toString());
	   cwrap.style.height = cont.offsetHeight.toString()+"px"; //"1000px";//cont.style.height;
//       debug('cwap.style.height='+cwrap.style.height);
	   }
}

function gen_contact_email(contactname, contactadd, contacthost, subject)
{
   if (contactname=="")
      contactname = contactadd;
   var hr = '<a target="_blank" href="scripts/contact.php?cn=' + encodeURIComponent(contactname) + '&ca=' + 
   encodeURIComponent(contactadd) + '&ch=' + encodeURIComponent(contacthost) + '&s=' + encodeURIComponent(subject) + '">';	
   document.write(hr);
   document.write(contactname+'</a>');
}

function contact_email(contactname, contactadd, contacthost, subject)
{
   if (contactname=="")
      contactname = contactadd;
   var hr = 'scripts/contact.php?cn=' + encodeURIComponent(contactname) + '&ca=' + 
   encodeURIComponent(contactadd) + '&ch=' + encodeURIComponent(contacthost) + '&s=' + encodeURIComponent(subject);	
   window.open(hr);
}

function gen_email_link(name, domain)
{
   if (!name || !domain)
      document.write('N/A');
   else
      {
	   document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
	   document.write(name + '@' + domain + '</a>');
	  }
}

function gen_email_text_link(name, domain, textstr)
{
   if (!name || !domain)
      {
	  if (textstr)
	     document.write(textstr);
      else
	     document.write('N/A');
      }
   else
      {
	   document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
	   document.write(textstr + '</a>');
	   }
}
