//### global variable declarations
//### -----------------------------------------------------

var debugCount = 0; //### counts the number of times the debug counter has been called

//### functions & subroutines
//### -----------------------------------------------------

function launchCMS(itemID)
{
	var availheight	= window.screen.availHeight;
	var availwidth	= window.screen.availWidth;
	var winheight	= 365;
	var winwidth	= 500;
	var url;
	if( itemID > 0 )
		url			= 'http://' + location.hostname.replace('www.','cms.') + '/authentication/login.asp?ObjectID=' + itemID;
	else
		url			= 'http://' + location.hostname.replace('www.','cms.') + '/authentication/login.asp';
	var features;
	//### -------------------------------------
	features		+= 'toolbar=no,statusbar=no,width=' + winwidth + ',height=' + winheight + ',resizeable=no,scrolling=no';
	features		+= ',top=' + ((availheight - winheight) / 2);
	features		+= ',left=' + ((availwidth - winwidth) / 2);
	//### -------------------------------------
	window.open( url, 'DiamaxCMS', features );
}

function element( elementID )
{
	return document.getElementById(elementID);
}

function dcount()
{
	alert( ++debugCount );
}