function showSendToFriend(jobID){
	if(YAHOO.util.Dom.getStyle('mask', 'visibility') != 'visible'){
		YAHOO.SJK.showMask();
	}
	YAHOO.SJK.sendToFriendOverlay.show();
	showLoader();
	sUrl = '/send_to_friend/do_stf_ajax/'+jobID;
	transaction = YAHOO.util.Connect.asyncRequest('GET', sUrl, showSendToFriendCallback);
}

var showSendToFriendCallback = {
	success: function(response) {
		YAHOO.util.Dom.get('stf_content').innerHTML = response.responseText;
		hideLoader();
	},
	failure: function(response) {
		alert('Request failed');	
	}
}

function closeSendToFriend(){
	YAHOO.util.Dom.get('stf_content').innerHTML = '';
	YAHOO.SJK.hideMask();
	YAHOO.SJK.sendToFriendOverlay.hide();
}

function showLoader(){
	YAHOO.util.Dom.setStyle('stf_content', 'visibility', 'hidden');
	YAHOO.util.Dom.setStyle('stfLoader', 'display', 'block');
}

function hideLoader(){
	YAHOO.util.Dom.setStyle('stf_content', 'visibility', 'visible');
	YAHOO.util.Dom.setStyle('stfLoader', 'display', 'none');
}

function doSTF(){
	formObject = YAHOO.util.Dom.get('stf_form');
	YAHOO.util.Connect.setForm(formObject);
	sUrl = '/send_to_friend/do_stf_ajax/';
	transaction = YAHOO.util.Connect.asyncRequest('POST', sUrl, showSendToFriendCallback);
	showLoader();
}
