/* Email tool
 * - developer can choose to enable it
 */
 
function initEmailTool() {

    var lang = document.getElementsByTagName('html')[0].lang;

    /* exit if page tools element not found or if tool exists */
    if (!document.getElementById(idList.pageTools)) return false;
    if (document.getElementById(idList.emailTool)) return false;
    
    var objLink = document.createElement('a');
    objLink.href = 'javascript:// Send to Friend';
    objLink.id = idList.emailTool;
    addEvent(objLink,'click',function() {
	if (lang == 'fr')
	    window.open(window.location.protocol + '//' + 'web5.uottawa.ca/send-to-friend/email_page-f.php?title=' + escape(document.title) + '&url=' + escape(document.URL),  'send2friend', 'height=500,width=450');
	else
	    window.open(window.location.protocol + '//' + 'web5.uottawa.ca/send-to-friend/email_page-e.php?title=' + escape(document.title) + '&url=' + escape(document.URL),  'send2friend', 'height=500,width=450');
    });
	
	addEvent(objLink,'mouseover',function() { cssjs('add',this,cssClasses.over); } );
	addEvent(objLink,'mouseout',function() { cssjs('remove',this,cssClasses.over); } );
    
    /* insert tool in DOM */
    document.getElementById(idList.pageTools).appendChild(objLink);
}

