function confirmdelete(url, msg)
{
	if ( ! msg )
	{
		msg = 'PLEASE CONFIRM:\nOK to proceed with delete?';
	}
	
	if (confirm( msg ))
	{
		window.location.href = url;
	}
	else
	{
		alert ( 'OK, action cancelled!' );
	} 
}

//==========================================
// Hide / Unhide menu elements
//==========================================

function cb_showhide(id1, id2)
{
	if (id1 != '') cb_toggleview(id1);
	if (id2 != '') cb_toggleview(id2);
}
	
//==========================================
// Get element by id
//==========================================

function cb_getbyid(id)
{
	itm = null;
	
	if (document.getElementById)
	{
		itm = document.getElementById(id);
	}
	else if (document.all)
	{
		itm = document.all[id];
	}
	else if (document.layers)
	{
		itm = document.layers[id];
	}
	
	return itm;
}

//==========================================
// Show/hide toggle
//==========================================

function cb_toggleview(id)
{
	if ( ! id ) return;
	
	if ( itm = cb_getbyid(id) )
	{
		if (itm.style.display == "none")
		{
			cb_show_div(itm);
		}
		else
		{
			cb_hide_div(itm);
		}
	}
}

//==========================================
// Set DIV ID to hide
//==========================================

function cb_hide_div(itm)
{
	if ( ! itm ) return;
	
	itm.style.display = "none";
}

//==========================================
// Set DIV ID to show
//==========================================

function cb_show_div(itm)
{
	if ( ! itm ) return;
	
	itm.style.display = "";
}

function clickTab(n,m) {
e = document.getElementById('mybox'+n+'t'+seltabs[n]);
if (e) { e.className = ''; }

e = document.getElementById('mybox'+n+'t'+m);
if (e) { e.className = 'boxsel'; e.blur(); }

e = document.getElementById('mybox'+n+'con'+seltabs[n]);
if (e) { e.style.display = 'none'; }

e = document.getElementById('mybox'+n+'con'+m);
if (e) { e.style.display = 'block'; }

seltabs[n]=m;

}
