/**
 * Open facebook sharer
 */
function openFacebook(u, t)
{
	var url = 'http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t);
	var features = 'toolbar=0,status=0';	
	openCenteredWindow(url, 'sharer', 626, 436, features);
	
	return false;
}



/**
 * Open netlog share
 */
function openNetlog(t)
{
	var url = 'http://www.netlog.com/go/logs/shouts/view=friends&origin=external&message='+encodeURIComponent(t);
	var features = 'toolbar=0,status=0';	
	openCenteredWindow(url, 'sharer', 800, 600, features);
	
	return false;
}



/**
 * Open skyrock share
 */
function openSkyrock(id, title, text)
{	
	var url = 'http://www.skyrock.com/m/blog/share-widget.php?idp=135&idm=' + encodeURIComponent(id) + '&title=' + encodeURIComponent(title) + '&text=' + encodeURIComponent(text);
	var features = 'toolbar=0,scrollbars=1';	
	openCenteredWindow(url, 'sharer', 800, 600, features);
	
	return false;
}


function openCenteredWindow(url, name, width, height, features) 
{
    var width = width;
    var height = height;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));

    var windowFeatures = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
	if (features) windowFeatures += "," + windowFeatures;
    window.open(url, name, windowFeatures);
}




