function shareUrl(service, options) {
    options = options || {};
	var u          = options.url || window.location;
	var t          = options.title || window.document.title;
	var width      = options.width || 800;
	var height     = options.height || 500;
	var param      = options.param || '';

	var c          = options.content || '<div style="text-align:center;"><a href="' + u + '" target="_blank" style="text-decoration:none;" title="Cliquez-ici !">Cliquez-ici<\/a><\/div>';

	/* exemple de l'objet options
	options = {
        oid : oid,
        type : 'video',
        labelPage : 'home',
        ...
    };
    */

    var labelPage  = options.labelPage || '';
    var type       = options.type || '';
    if(type != '') {
       type = ' - type : ' + type;
    }

	switch(service) {
        case "facebook"     : open_center_window('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t), service, width, height, param);
            return true;
        case "google"       : open_center_window('http://www.google.com/bookmarks/mark?op=edit&bkmk='+encodeURIComponent(u)+'&title='+encodeURIComponent(t), service, width, height, param);
            return true;
        case "delicious"    : open_center_window('http://del.icio.us/post?partner=addthis&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t)+'&notes=', service, width, height, param);
            return true;
        case "digg"         : open_center_window('http://digg.com/submit?partner=addthis&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t)+'&bodytext=', service, width, height, param);
            return true;
        case "live"         : open_center_window('https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&top=1&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t), service, width, height, param);
            return true;
        case "twitter"      : open_center_window('http://twitter.com/home?status='+encodeURIComponent(u+' via @maxicours'), service, width, height, param);
            return true;
	}
	return false;
}

function likeIt(service, options) {
    options = options || {};
    options.url = options.url || window.location;
    var html = '';
    switch(service) {
        case 'facebook':
        options.width = options.width || "450px";
        options.height = options.height || "50px";
        var url = 'http://www.facebook.com/plugins/like.php?href='+encodeURIComponent(options.url)+'&layout=standard&show_faces=true&width='+parseInt(options.width)+'&action=like&font=verdana&colorscheme=light&locale=fr_FR';
        html = '<'+'iframe src'+'="'+url+'" scrolling="no" frameborder="0" allowTransparency="true" style'+'="border:none; width:'+options.width+'; height:'+options.height+'"><'+'/iframe>';
        break;
    }
    document.writeln(html);
}


