function updatePageApprovals(siteID){
	var go = confirm("This operation may take several minutes to complete.  Would you like to continue?");
	if ( !go ) return;
	var form = document.createElement('form');
	form.setAttribute('method','post');
	form.setAttribute('action', DATAFACE_SITE_HREF);
	var action = document.createElement('input');
	action.setAttribute('name', '-action');
	action.setAttribute('value', 'update_site_approval_statuses');
	action.setAttribute('type', 'hidden');
	form.appendChild(action);
	
	var table = document.createElement('input');
	table.setAttribute('name', '-table');
	table.setAttribute('value', 'webpage_sites');
	table.setAttribute('type', 'hidden');
	form.appendChild(table);
	
	var site_idEl = document.createElement('input');
	site_idEl.setAttribute('name', 'site_id');
	site_idEl.setAttribute('value', siteID);
	site_idEl.setAttribute('type', 'hidden');
	form.appendChild(site_idEl);
	
	document.getElementsByTagName('body')[0].appendChild(form);
	form.submit();
}

if ( typeof(jQuery) != 'undefined' ){
	jQuery(document).ready(function($){
		$('#record-actions-menu-update_page_approval_statuses, #update_page_approval_statuses-link').click(function(){
			var id = $(this).attr('title');
			if ( !id ){
				alert('No ID Specified');
				return;
			}
			//alert('here');
			updatePageApprovals(id);
			return false;
		});
	
	});
}


