var mainDomain="teninsurance.com";
var siteName="TEn Insurance Services Limited";

// @@@@@ generating a spam-safe e-mail address @@@@@

function drawEmail(alias,text,dn,title) {
  var at = '@'; // at symbol encoded
  var p1 = 'mail'; // protocol name encoded part 1
  var p2 = 'to:'; // protocol name encoded part 2
  if (!dn) dn=mainDomain;
  if (title) title=' title="'+title+'"'
    else title='';
  if (!text) text=alias+at+dn;
  document.write('<a href="'+p1+p2+alias+at+dn+'"'+title+'>'+text+'</a>');
}

// @@@@@ generic popup window @@@@@

function popup(doc,name,scroll,width,height,resize,status,toolbar,locbar,menubar,dirs) {
  var scr = ((scroll) ? ",scrollbars="+scroll : "");
  var wid = ((width) ? ",width="+width : "");
  var hei = ((height) ? ",height="+height : "");
  var res = ((resize) ? ",resizable="+resize : "");
  var sta = ((status) ? ",status="+status : "");
  var too = ((toolbar) ? ",toolbar="+toolbar : "");
  var loc = ((locbar) ? ",location="+locbar : "");
  var men = ((menubar) ? ",menubar="+menubar : "");
  var dir = ((dirs) ? ",directories="+dirs : "");
  remoteWin=window.open(doc,name,scr+wid+hei+res+sta+too+loc+men+dir);
  remoteWin.focus();
}
