// Delete confirm
function delete_confirm(table_name, id, flow_id, redir_url)
{
	if (confirm("Are you sure you want to delete this record?"))
	{
		location.href = "../common_files/delete.php?table_name=" + table_name + "&id=" + id + "&flow_id=" + flow_id + "&redir_url=" + redir_url
	}
}


// Function to add this page to your favourites
function add_to_favorites(page_title)
{
	window.external.AddFavorite(top.location.href, page_title);
}


// Function to print this page
function print_this_page(page_id)
{
	window.open('/contents/print_this_page.php?page_id=' + page_id, 'PrintPage', 'width=100, height=100, top=100')
}


// Function to email this page to a friend
function email_this_page(page_id)
{
	window.open('/contents/email_this_page.php?page_id=' + page_id, 'PrintPage', 'width=400, height=370, top=200, left=350')
}


// Functions to make this page your homepage
	function set_homepage(obj)
	{
		HomePage = top.location.href;
		if (document.layers) setNSHomepage(HomePage);
		else if (isIE5up)
		{
			obj.style.behavior='url(#default#homepage)';
			obj.setHomePage(HomePage);
		}
		else alert('Sorry, not supported in this browser,\n please change this setting manually');
		return false;
	}

	navVer = navigator.appVersion;
	IEPos = navVer.indexOf('MSIE');
	ver = parseFloat(navVer.substring(IEPos+5,navVer.indexOf(';',IEPos)));
	isIE5up = ((IEPos != -1) && (ver >= 5));

	// For NetScape
		function setNSHomepage(URL)
		{  // this HAS to be signed if it is to run on the web
	  		var Text = '';
	  		Text += 'Due to Netscapes security handling, making this page your homepage, will show you a dialog with a warning.\n';
	  		Text += 'If you do not wish to grant this site the access to your browser settings,';
	  		Text += ' you can manually copy the current location and paste it in the location field in Edit / Preferences / Navigator.';
	  		if (confirm(Text))
	  		{
	    		netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
	    		navigator.preference('browser.startup.homepage',URL);
	  		}
		}
