﻿var email_info = [105, 110, 45, 116, 111, 117, 99, 104, 64, 109, 105, 100, 97, 115, 46, 117, 107, 46, 99, 111, 109],
            email_join = [106, 111, 105, 110, 45, 117, 115, 64, 109, 105, 100, 97, 115, 46, 117, 107, 46, 99, 111, 109],
            email_temp = '',
            email_list = new Array();

for (var i = 0; i < email_info.length; i++) {
    email_temp += String.fromCharCode(email_info[i]);
}

email_list[0] = email_temp;
email_temp = '';

for (var i = 0; i < email_join.length; i++) {
    email_temp += String.fromCharCode(email_join[i]);
}

email_list[1] = email_temp;

function openpopWindow(mypage, myname, w, h, scroll, resize, pos) {
    if (pos == "random") { LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100; TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100; }
    if (pos == "center") { LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100; TopPosition = (screen.height) ? (screen.height - h) / 2 : 100; }
    else if ((pos != "center" && pos != "random") || pos == null) { LeftPosition = 0; TopPosition = 20 }
    settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=' + resize;
    win = window.open(mypage, myname, settings);
}

var share_page = encodeURIComponent(window.location);
var share_title = encodeURIComponent(document.title);

var sharecontrol = {
    twitter: function() {
        window.open('http://twitter.com/home?status=' + share_page,
            'sharer_twitter',
            'height=680,width=920,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
        return false;
    },

    digg: function() {
        window.open('http://www.digg.com/submit/?url=' + share_page,
            'sharer_digg',
            'height=680,width=920,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
        return false;
    },

    stumbleupon: function() {
        window.open('http://www.stumbleupon.com/submit?url=' + share_page,
            'sharer_stumbleupon',
            'height=680,width=920,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
    },

    reddit: function() {
        window.open('http://www.reddit.com/submit?url=' + share_page + '&title=' + share_title,
            'sharer_reddit',
            'toolbar=0,status=0,scrollbars=yes,width=726,height=436');
        return false;
    },

    delicious: function() {
        window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url=' + share_page + '&amp;title=' + share_title,
            'delicious',
            'toolbar=no,width=550,height=550');
        return false;
    }
};

