﻿// JScript File
//write out link to create a bookmark/favorite
function createBookmarkLink(page_url, page_title, img_url) 
{
    try{
        if (window.sidebar) 
        {   // Mozilla Firefox Bookmark -- There is currently no way to save a bookmark in firefox without it being launch in the side-panel when clicked
            //return document.write('<a href="javascript:createBookmarkEntry(\'' + page_url + '\', \'' + page_title + '\')");"><img src=\"~/images/bookmark.gif\" alt=\"Bookmark This Page\" border=\"0\"/></a>'); 
        } 
        else if (window.external) 
        {   // IE Favorite
            return document.write('<a href="javascript:createBookmarkEntry(\'' + page_url + '\', \'' + page_title + '\')");"><img src="'+ img_url +'" alt="Add to Favorites" border="0" /></a>');
        } 
        else if (window.opera && window.print) 
        {   // Opera Hotlist
            return document.write('<a rel="sidebar" href="' + page_url + '" title="' + page_title + '"><img src="'+ img_url +'" alt="Bookmark this Page" border="0" /></a>');
        } 
    }catch(err) {/* do nothing*/  }
}

function createpopup(url)
{
    //alert("http://sbrcmsdev01" + url);
    window.open(url, 'EmailRefer', 'height=610,width=760');
}

function createBookmarkEntry(page_url, page_title) 
{
      try{
            if (window.sidebar) 
            {   // Mozilla Firefox Bookmark -- There is currently no way to save a bookmark in firefox without it being launch in the side-panel when clicked
                  //return window.sidebar.addPanel(page_title, page_url, "");
            } 
            else if( window.external ) 
            {   // IE Favorite
                  return window.external.AddFavorite( page_url, page_title); 
            } 
            else if(window.opera && window.print) 
            {   // Opera Hotlist
                  return true; 
            }
      }catch(err){/* do nothing*/}
      alert('Unable to create a bookmark on your browser.');
}   
