

function writeEmail(contact, email, emailHost) {
  document.write("<a href=" + "&#109a&#105l" + "&#116&#111:" + email + "@" + emailHost+ ">" + contact + "@" + emailHost+"</a>");
}

// We are using this on the Company.php page for the staff sections. It allows us to
// show or hide a div when the li is clicked. It also toggles the +/- images that are
// defined in the CSS as .collapse and .expand
function expandCollapse(liID, divID, color) {
  //If the DIV is visible (currently it's expanded) then we need to hide (collapse) it and then show the Expand (+) image
  if ($(divID).visible()) {
    $(liID).removeClassName(color+'_expanded').addClassName(color+'_collapsed');
  } else {
    $(liID).removeClassName(color+'_collapsed').addClassName(color+'_expanded');
  }
  Effect.toggle(divID, 'blind', { duration: .3 });
}

//For this to work you have to use an <h3> for the "list item" that's clickable. You also need to apply
//a fake style like "orange_div_expanded" in the HTML to the first DIV that starts off expanded.
var status = new Object;
status["orange"] = "01";
status["blue"] = "01";
status["red"] = "01";
status["green"] = "01"; 
function expandOneCollapseRest(index, color) {
  //If the DIV is visible (currently it's expanded) then we need to hide (collapse) it and then show the Expand (+) image
  if ($('div_'+color+'_'+index).visible()) {
    //Do nothing - this DIV is already the visible one
  } else {
    //Get the DIV that's currently expanded (it's not this one) and collapse it
    $('h3_'+color+'_'+status[color]).removeClassName(color+'_expanded').addClassName(color+'_collapsed');
    Effect.toggle($('div_'+color+'_'+status[color]), 'blind', { duration: .3, queue:'end' });

    //Expand this DIV now
    $('h3_'+color+'_'+index).removeClassName(color+'_collapsed').addClassName(color+'_expanded');
    Effect.toggle('div_'+color+'_'+index, 'blind', { duration: .3, queue:'end' });
    
    status[color] = index;
  }
}

// POP UP
function pop(url, name, props) {
	window.open(url, name, props);
}


