/*
 * The minibrowser window, displayed when clicking the "borwse" icon for image objects...
 * */
function showMinibrowser(refElement, filter, url,targetInput){
	var params={};
	params.path=url;
	params.filter=filter;
	params.target=$(refElement).identify();
	params.targetInput=targetInput;

	new Ajax.Request('AJAXBrowser.php',
					{
						method: 'post',
						parameters:params,
						_container:'browserContainer',
						onSuccess: function(transport) {
							if(Controls.getGlobal('focus')){
								if($('overDiv') && !$('overDiv').visible()){
									$('overDiv').show();
								}

								var x = $(refElement).getLeft()-350;
								var y = $(refElement).viewportOffset()[1]+16;
								var w = 350;
								var h = 350;

								var windowSize=getWindowSize();

								if(y+h>windowSize[1]){
									y = windowSize[1]-h;
								}

								overlib(transport.responseText,
									LEFT,
									STICKY,
									FIXX, x,
									FIXY, y,
									WIDTH, w,
									HEIGHT, h
								);

								Controls.getGlobal('focus').scheduleClearFocus(null,null);
							}else{
								hideMinibrowser();
							}
						}
					});
}

function hideMinibrowser(){
	if($('overDiv')){
		$('overDiv').hide();
	}
}