/*  
    Copyright (c) 2010 More Style Than Cash

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

function addHomeToFavorites () {
    var URL = "http://www.morestylethancash.com"; 
    var Title = "More Style Than Cash";
    if (window.sidebar) {
        window.sidebar.addPanel(Title, URL,"");
    } else if (document.all) {
        window.external.AddFavorite(URL, Title);
    } else {
        alert ("Sorry, your browser does not appear to support automated bookmarking. \n\nPlease try adding the bookmark manually.");
    }
}

function likeButtonCurrentPage () {
    // General Variables
    var border = 'none';
    var colorscheme = 'light';
    var height = 35;
    var href = location.href.split('//')[1];
    var layout = 'button_count';
    var overflow = 'hidden';
    var show_faces = 'false';
    var width = 450;

    // Variables than compose a section of the iframe element
    var src = 'src="'
    + 'http://www.facebook.com/plugins/like.php?'
    + 'href=' + href + '&amp;'
    + 'layout=' + layout + '&amp;'
    + 'show_faces=' + show_faces + '&amp;'
    + 'width=' + width + '&amp;'
    + 'action=' + 'like' + '&amp;'
    + 'colorscheme=' + colorscheme + '&amp;'
    + 'height=' + height; + '"';

    var scrolling = 'scrolling="no"';

    var frameborder = 'frameborder="0"';

    var style = 'style="'
    + 'border:' + border + '; '
    + 'overflow:' + overflow + '; '
    + 'width:' + width + 'px; '
    + 'height:' + height + 'px; '
    + '"';

    var allowTransparency = 'allowTransparency="True"';

    // Finally the iframe element
    var iframe = '<iframe ' + src + ' '
    + scrolling + ' '
    + frameborder + ' ' 
    + style + ' '
    + allowTransparency + ' '
    + '>' + '</iframe>';

    return iframe;
}
