function cursorChange(ID) {
	ID.style.cursor = 'default';
	}

function highlight(ID) {
	ID.className = 'tdmenuHighlight'
	ID.style.cursor = 'default';
	}

function unHighlight(ID) {
	ID.className = 'tdmenu'
	ID.style.cursor = 'default';
	}

function changeSRC(source) {
	document.location = source;
	}

function openNew(source) {
	myRef = window.open(source, 'mywin', 'left=10, top=10, width=700, height=500, resizable=1, scrollbars=1');
	}

function openParentUrl(source) {
	window.opener.document.location = source;
	window.close();
	}

function ErrorPopup(msg){
	var e = new Element('div').update(msg);
	jQuery(e).dialog({
			modal:true,
				title: "Error",
				buttons: {
				Ok: function() {
					jQuery(this).dialog('close');
				}
			}				
		});
}

function WarningPopup(msg){
	var e = new Element('div').update(msg);
	jQuery(e).dialog({
			modal:true,
				title: "Warning",
				buttons: {
				Ok: function() {
					jQuery(this).dialog('close');
				}
			}				
		});
}



function GreyLoader(){		
	//Create overlay and append to body:
	jQuery('<div id="overlay"/>').addClass('ui-widget-overlay').hide().appendTo('body');
	jQuery('#overlay').css({'height': jQuery(document).height() + 'px'});
	//append another overlay with the loading spinner to the previous overlay.
	jQuery('<div id="overlaySpinner"/>').css({
				'position': 'fixed',
					'top': 0,
					'left': 0,
					'width': '100%',
					'height': jQuery(window).height() + 'px',
					'background': 'url(images/core/loadingcircle.gif) no-repeat center'
					}).appendTo('#overlay');
		jQuery('#overlay').show();
}

function GreyLoaderHide(){
	jQuery('#overlay').hide();
}


function MessagePopup(msg, buttonCallback){
	jQuery( '<div id="MessagePopupDiv" />' ).html(msg).dialog({
			resizable: true,
			modal: true,
			buttons: {
				"OK": function() {
					if(buttonCallback != null){
						buttonCallback();
					}
					jQuery(this).dialog( "close" );
				}//end OK button
			}
		});
}
