﻿// JScript File

function addToFavorites(sErrorMessage) {
//    if (window.external)
//    { window.external.AddFavorite(location.href, document.title); }
//    else
//    { alert("Sorry! Your browser doesn't support this function."); }
    if (sErrorMessage.toString().length == 0) {
        sErrorMessage = "Please use CTRL + D to bookmark this website." 
        //"Sorry! Your browser doesn&amp;t support this function.";
    }
//    else {
//        sErrorMessage = sErrorMessage.replace("'", "&amp;");
//    }
    
    if (window.sidebar) // firefox
        window.sidebar.addPanel(document.title, location.href, "");
    else if (window.opera && window.print) { // opera
        var elem = document.createElement('a');
        elem.setAttribute('href', location.href);
        elem.setAttribute('title', document.title);
        elem.setAttribute('rel', 'sidebar');
        elem.click();
    }
    else if (document.all)// ie
        window.external.AddFavorite(location.href, document.title);

    else {
        alert(sErrorMessage);
    }    
}

function showEmailWindow(link) {
    var slink = link + '/SendEmail.aspx?link=' + location.href;
    var win = window.open(slink, 'SendEmail', 'left=200px,top=200px,width=520px,height=400px,scrollbars=0,location=0,menubar=0,statusbar=0,toolbar=0,resizable=0,modal=no');

}

function showShareYourStory(link) {
    var slink = link + '/CellEnrich.eu_home/For_Patients/Share_Your_Story.aspx?link=' + location.href;
    //var slink = '../ShareYourStory.aspx?link=' + location.href;
    var win = window.open(slink, 'ShareYourStory', 'left=10px,top=10px,width=1000px,height=800px,toolbar=0,scrollbars=1,location=100,statusbar=0,menubar=0,resizable=0,modal=no');

} 

function showVideoWindow(link)
  {
       //var slink = link + 'VideoPopup.aspx?link=' + location.href;
       var win = window.open(link,'Popup','left=100px,top=100px,width=680px,height=440px');
}