var shareUrls = new Array();
shareUrls["facebook"] = "http://www.facebook.com/sharer.php?u=__URL__";
shareUrls["twitter"] = "http://twitter.com/home?status=__URL__";
shareUrls["digg"] = "http://digg.com/submit?url=__URL__";
shareUrls["reddit"] = "http://reddit.com/submit?&url=__URL__";
shareUrls["myspace"] = "http://www.myspace.com/Modules/PostTo/Pages/?u=__URL__";
shareUrls["delicious"] = "http://www.delicious.com/post?url=__URL__";
shareUrls["buzz"] = "http://www.google.com/reader/link?url=__URL__";

var shareImagesUrl = "__BASE__/ShareOnFacebook.aspx?t=__TYPE__&id=__IMAGE__";

function shareTest(profiloRisultante){
	  var url = shareUrls["facebook"];
    var siteUrl = getCurrentBaseUrl();
    url = url.replace("__URL__", encodeURIComponent(siteUrl+"sharer_test_sostenibilita.php?pr="+profiloRisultante));
    popupCenter(url, 'Aquafresh', 900, 600);
}

function shareTest2(profiloRisultante){
	  var url = shareUrls["facebook"];
    var siteUrl = getCurrentBaseUrl();
    url = url.replace("__URL__", encodeURIComponent(siteUrl+"sharer_test_goccia.php?pr="+profiloRisultante));
    popupCenter(url, 'Aquafresh', 900, 600);
}

function share_goccia(idGoccia) {
    var url = shareUrls["facebook"];
    var siteUrl = getCurrentBaseUrl();
    url = url.replace("__URL__", encodeURIComponent(siteUrl+"sharer_adesioni.php?goccia="+idGoccia));
    popupCenter(url, 'Aquafresh', 900, 600);
}

function getCurrentBaseUrl() {
  var siteUrl = location.href;
  siteUrl =  'http://'+window.location.host+"/";
	
  return siteUrl;
}

function popupCenter(pageURL, title, w, h) {
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	var targetWin = window.open(pageURL, title, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+w+',height='+h+',top='+top+',left='+left);
}

