﻿/* SHARE */
function fbShare(video_id, title, thumb, width, height, id, jcvPK, description) {
    var domain = getDomain();
    var fbUrl = domain + 'VideoPlayer.aspx?src=' + video_id + '&title=' + title + '&desc=' + description
    + '&thumb=' + thumb + "&width=" + width + "&height=" + height + '&id=' + id + '&jcv=' + jcvPK + '&sn=fb';
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(fbUrl) + '&t=' + encodeURIComponent(title));
    //alert('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(fbUrl) + '&t=' + encodeURIComponent(title));
}
function eShare(jcvPK, name) {
    var domain = getDomain();
    var eUrl = domain + 'VideoPlayer.aspx?jcv=' + jcvPK;
    location.href = 'mailto:?subject=' + name + ' wants you to check out this video&body=Hey,%0A%0AThere is a video about saving energy on ' + getDomain() + ' I want you to see.%0A%0ACheck it out here: ' + encodeURIComponent(eUrl) + '%0A%0AThanks for looking!%0A%0A' + name;

}
function twitterShare(jcvPK) {
    var domain = getDomain();
    var twitterUrl = domain + 'VideoPlayer.aspx?jcv=' + jcvPK;
    window.open('http://twitter.com/home?status=Great+Video ' + twitterUrl);
}
function myspaceShare(title, description, thumb, jcvPK) {
    var domain = getDomain();
    var myspaceUrl = domain + 'VideoPlayer.aspx?jcv=' + jcvPK;
    window.open('http://www.myspace.com/index.cfm?fuseaction=postto&t=' + encodeURIComponent(title) + '&c=' + encodeURIComponent('<a href=\"' + myspaceUrl + '\" target=\"_blank\"><img src=\"' + thumb + '\" align=\"left\" style=\"\padding-right: 5px; padding-bottom: 5px; border: none; cursor: pointer;\" /></a>Check out this video <br />' + description) + '&u=' + encodeURIComponent(myspaceUrl));

}
