//You can pass in a parameter to the javascript function that could customize the message shown in facebook

function generateLink(identifier,campaign) {

	//alert(identifier + " : " + campaign);

	switch (campaign){
		case "parcel":
		var u ="http://redcrossparcel.redcross.org.uk/parcel.aspx";
		break;
		case "uk":
		var u ="http://redcrossparcel.redcross.org.uk/uk/parcel.aspx";
		break;
		case "uganda":
		var u ="http://redcrossparcel.redcross.org.uk/uganda/parcel.aspx";
		break;
	}
	
	//Split off the parameters so we aren't posting any sensitive info
	var theparams = u.indexOf('?');
	if(theparams!= -1){
		u = u.substring(0,theparams);
		u = u + "?ParcelId=" + identifier + "&source=facebook";
	}else{
		u = u + "?ParcelId=" + identifier + "&source=facebook";
	}
	
	var t ="I'm supporting the Red Cross";		

	var url;
	url="http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t);

	//alert(url);

	return url;
}


function postToFaceBook(identifier, campaign) {
	var url = generateLink(identifier,campaign);
	popup = window.open(url,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=700,height=500,top=100,left=100');
	popup.focus();					
}	