

function displayMail(username, domain)
{
	document.write("<a href=" + "mail" + "to:" + username + "@" + domain + ">" + username + "@" + domain + "</a>");
}


function displayIconMail(username, domain, altName)
{
	document.write("<a href=" + "mail" + "to:" + username + "@" + domain + "><img style='border:0px; margin-right:5px; padding:0px;' src='/dde/images/emailIcon.gif' /></a>");
}

/* Prompt bar */
    var Prompt = {
      autoHideTime: 5000

      ,display: function( msg, options ) {
        $('yellowBar_message').innerHTML = msg;
        Prompt.show();
        if( options && options.autoHide )
          setTimeout('Prompt.hide()', options.autoHideTime || Prompt.autoHideTime );
      }

      ,working: function(msg, options) {
        Prompt.display( msg, options );
      }

      , _center: function(){
        //$('yellowBar').style.left = ( ( document.viewport.getWidth() - parseInt( $('yellowBar').offsetWidth ) ) / 2 ) + 'px' ;
      }

      ,show: function(){
        Prompt._center();
        new Effect.Move ($('yellowBar'),{x: parseInt( $('yellowBar').style.left ), y: 0, mode: 'absolute', duration: 0.2});
      }
      ,hide: function( msg) {
        new Effect.Move ($('yellowBar'),{x: parseInt( $('yellowBar').style.left ), y: -40, mode: 'absolute', duration: 0.1});
      }
    }


function setFieldHeights(){
    fE=$("fieldsetEvents").getHeight();
    fN=$("fieldsetNews").getHeight();
    fHeight=Math.max(fE,fN);
    $("fieldsetEvents").setStyle({height: fHeight + 'px'});
    $("fieldsetNews").setStyle({height: fHeight + 'px'});
}

function setMapItemsHeights(){
    myArray=$$(".mapItem");
    for (var index = 0; index < myArray.length; index++) {
        var item = myArray[index];
        var h1=item.getHeight();
        index=index+1;
        item2 = myArray[index];
        var h2=item2.getHeight();
        fHeight=Math.max(h1,h2);
        item.setStyle({height: fHeight + 'px'});
        item2.setStyle({height: fHeight + 'px'});
    }
}

// Expand elem and collapse elements
// Change class marked to selected in "current" element
function expandOnly(elem,elements){
    collapseGroup(elem,elements);
    if ($(elem).style.display!="none"){
       Effect.BlindUp(elem, {duration: 0.2});
       $(elem+"li").removeClassName("selected");
       $(elem+"li").addClassName("marked");

    }
    else{
        Effect.BlindDown(elem, {duration: 0.2});
        $(elem+"li").removeClassName("marked");
        $(elem+"li").addClassName("selected");
    }
}

// Collapse all items in elements except elem
function collapseGroup(elem,elements){
   elements.each(function(item) {
   if (elem!=item.id) {
       Effect.BlindUp(item, {duration: 0.2});
    $(item.id+"li").removeClassName("selected");
    $(item.id+"li").addClassName("marked");
   }
});
}





