﻿function bookmark() 
{
    var title = document.title;
    var url = document.location.href;
    
    if(document.all)
    {
        if(window.external != undefined && window.external != null) 
        {
           window.external.AddFavorite(url,title);
        }
        else
        {
            alert("Sorry! Your browser doesn't support this function.\n Press CTRL+D or select 'Bookmark This Page' from your 'Bookmarks' menu.");
        }
    }
    else
    {
        window.sidebar.addPanel(title, url, '');
    }
}

function emailme()
{
    var title = document.title;
    var url = document.location.href;
    var subject = "IFG Pensions Website";
    var bodyText = "I saw this page and though you might like to see it " + url;
   
    window.location.href = "mailto:?subject="+ subject + "&body=" + bodyText;
   
}

function createLinks()
{
    document.write('<ul id="actions">');
    document.write('<li><a href="javascript:self.print()">print page</a></li>');
    document.write('<li><a href="javascript:emailme()">email page</a></li>');
    document.write('<li class="last"><a href="javascript:bookmark()">bookmark</a></li>');
    document.write('</ul>');
    
    
}


var clickmessage="Sorry, you are not permitted to right click on this image"

function protectImages() 
{
    if (document.all)
        document.oncontextmenu=disableclick
    else if (document.getElementById)
        document.oncontextmenu=disableclick
    else if (document.layers)
        associateimages()
}  

function disableclick(e) {
if (document.all) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}  