﻿//################# Hide E adrss
//Hides adds in html
//You Must send false if novalue for a parameter
//Parameters:
//myMal = name	
//myMalHost = dom
//malSub = subj
//malBod = bod
//arrow = adds an arrow to end of link
function eAdds(myMal, text, malSub, malBod, aClass, myMalHost, arrow) {
    //Set Text
    var myText;
    if (text == false) { myText = myMal + "@" + myMalHost; } //show add if no text
    else { myText = text; }
    //Add arrow
    if (arrow == true) { myText += " &raquo;"; }
    //Set Class
    var myClass = "";
    if (aClass != false) { myClass = "class=" + aClass; }
    //Add details  
    var queryStr = "";
    if (malSub != false) { queryStr = buildQuery(queryStr, 'subject', malSub); }
    if (malBod != false) { queryStr = buildQuery(queryStr, 'body', malBod); }
    //Set adds, extra mal text and write code
    document.write("<a " + myClass + " href=" + "mail" + "to:" + myMal + "@" + myMalHost + queryStr + ">" + myText + "</a>");
}
function buildQuery(querySrt, part, textStr) {
    //Add ? if nedded or &. Add Subject,body etc. URL Encode Str.
    if (querySrt == "")
    { querySrt = "?" + part + "=" + escape(textStr); }
    else
    { querySrt += "&" + part + "=" + escape(textStr); }
    return querySrt;
}

//##################################
