// ***************************************************
// protect against right click
// ***************************************************
/*function handle_right_click_IE()
{
	if (event.button==2) return false;
}

function handle_right_click_NS(e)
{
	if (document.layers||document.getElementById&&!document.all)
		if (e.which==2||e.which==3) return false;
}

if (document.layers)
{
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=handle_right_click_NS;
}
else if (document.all&&!document.getElementById)
	document.onmousedown=handle_right_click_IE;

document.oncontextmenu=new Function("return false");
// end of right click 'protection' */

var arrWindowSizes =  new Array();
arrWindowSizes['ff'] = new Array();
arrWindowSizes['ie'] = new Array();
arrWindowSizes['ff']['large'] = new Array();
arrWindowSizes['ff']['small'] = new Array();
arrWindowSizes['ie']['large'] = new Array();
arrWindowSizes['ie']['small'] = new Array();

arrWindowSizes['ff']['small']['width'] = 778;
arrWindowSizes['ff']['small']['height'] = 610;
arrWindowSizes['ff']['large']['width'] = 910;
arrWindowSizes['ff']['large']['height'] = 722;

arrWindowSizes['ie']['small']['width'] = 778;
arrWindowSizes['ie']['small']['height'] = 610;
arrWindowSizes['ie']['large']['width'] = 910;
arrWindowSizes['ie']['large']['height'] = 722;
	

function showWindowCentered( title, link, w, h )
{
	var top		= (screen.height - h)/2;
	var left	= (screen.width - w)/2;

	window.open(link, title, 'toolbar=no,titlebar=no, width=' + w + ',height=' + h + ',status=no,menubar=no,location=no,resizable=yes,left=' + left + ',top=' + top); 	
}


function showWindowCenteredWithOptions( title, link, w, h, user_options )
{
	var top		= (screen.height - h)/2;
	var left	= (screen.width - w)/2;
	
	if ( user_options )
		user_options = ',' + user_options;

	return window.open(link, title, 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + user_options); 	
}


function showPresentationWindow( title, link, size )
{
	if(size == 'large')
	{
		intWidth = 900; //970; //950
		intHeight = 640; //694; //660
	}
	else
	{
		intWidth = 768;
		intHeight = 528;
	}

	showWindowCentered( title, link, intWidth, intHeight );
}


function display_sort_order_disabled_message()
{
	alert('Please sort by Order column to enable this feature.');
}


function clear_field_value(strFieldId)
{
	if ( strFieldId != '' )
	{
		objField = document.getElementById(strFieldId);
		if ( objField != undefined )
			objField.value = '';
	}
}


function resize_window()
{
	return;
	strSize = strWindowSize;

	if(strSize == 'full')
	{
		intWidth = screen.width*0.95;
		intHeight = screen.height*0.95;
		window.resizable = 1;
	}
	else
	{
		if(detect_browser() == 'msie')
		{
			strBrowser = 'ie';
		}
		else
		{
			strBrowser = 'ff';
		}

		intWidth = arrWindowSizes[strBrowser][strSize]['width'];
		intHeight = arrWindowSizes[strBrowser][strSize]['height'];
	}

	window.setTimeout(__resize_window, 1000);
}

function __resize_window()
{
	if(self && window.opener != null)
	{
		self.resizeTo(intWidth, intHeight);
		self.moveTo(((screen.width - intWidth)/2),((screen.height - intHeight)/2));
	}
}
