function InitJobRecipients( id ) {

}

function RefreshJobRecipientsCallback( id , data ) {
	var i;
	var s = "";
	for (i in data) {
		s+="<input type=\"checkbox\" checked=\"checked\" name=\""+id+"_"+i+"\" id=\""+id+"_"+i+"\" />";
		s+=data[i] + "<br/>";
	}
	var o = $("#"+id+"_customs");
	s+="<div class=\"selrecipients\"><span class=\"nrmlink\" onclick=\"if (typeof switchTab == 'function') switchTab( 'search_quote' , 1 );\">" + aJSLangDefs["Modify_job_recipients"] +" &raquo;</span></div>";
	o.html( s );
	if (s!="") {
		$("#"+id+"_custom").attr("checked","checked" );
		$("#td_"+id+"_custom").css("display","table-cell");
		o.css("display","block");
	} else {
		$("#"+id+"_all").attr("checked","checked" );
		$("#td_"+id+"_custom").css("display","none");
		o.css("display","none" );
	}
}

function RefreshJobRecipients( id ) {
	$.ajax(
		{
			type: "POST",
			cache: false,
			data: (
				{
					inajax : 1,
					ajaxevent : "refresh_job_recipients",
					wid : id
				}
			),
			success: function(ret) {
				var data = eval( ret );
				RefreshJobRecipientsCallback( id , data );
			}
		}
	);
}
