function fdDraw(event, contentScript, queryString, showFader) {
	try {
		posX = window.event.clientX;
		posY = window.event.clientY;
	} catch (caught) {
		try {
			posX = event.page.x;
			posY = event.page.y;
		} catch (caughtAgain) {
			posX = 120;
			posY = 120;
		}
	}
	
	var thePopupBox;
	
	if ($('fdPopupBox') != null) {
		thePopupBox = $('fdPopupBox');
	} else {
		thePopupBox = document.createElement('div');
		document.body.appendChild(thePopupBox);
	}
	
	thePopupBox.setAttribute('id', 'fdPopupBox');
	thePopupBox = $('fdPopupBox');
	
	thePopupBox.style.width 	= '1px';
	thePopupBox.style.height 	= '1px';
	thePopupBox.style.position 	= 'absolute';
	thePopupBox.style.left 		= String(posX - 60) + 'px';
	thePopupBox.style.top 		= String(posY - 120) + 'px'; //posY;
	thePopupBox.style.zIndex 	= '900';
	thePopupBox.style.display 	= 'none';
	thePopupBox.style.border 	= 'none';
	
	if (showFader)
		fdPositionAndShowFader(contentScript, queryString);
	else
		fdGetContent(contentScript, queryString);
}

function fdPositionAndShowFader(contentScript, queryString) {
	var theFader;
	if ($('fdFader') != null) {
		theFader = $('fdFader');
	} else {
		theFader = document.createElement('div');
		document.body.appendChild(theFader);
	}
	theFader.setAttribute('id', 'fdFader');
	theFader = $('fdFader');
	
	//Scriptaculous Size getter
	//theFader.style.width 		= document.viewport.getDimensions().width;
	//theFader.style.height 		= document.viewport.getDimensions().height;
	
	theFader.style.width = '100%';
	theFader.setStyles({ 'top': -$(window).getScroll().y,'height':$(window).getScrollSize().y+$(window).getScroll().y });
	
	//theFader.style.width = '500px';
	//theFader.style.height = '500px';
	theFader.style.position 	= 'absolute';
	theFader.style.top 			= '0px';
	theFader.style.left 		= '0px';
	theFader.style.zIndex 		= '850';
	theFader.style.background 	= '#000';
	theFader.style.display 		= 'none';
	theFader.onclick			= fdClose;
	
	//**MooTools**
	theFader.fade('hide');
	
	theFader.style.display 	= 'block';
	
	//**MooTools**
	theFader.fade(0.3);
	
	fdGetContent(contentScript, queryString);
}

function fdGetContent(contentScript, queryString) {
	myConn = new XHConn();
	myConn.connect(contentScript, "POST", queryString, fdShow);
}

function fdShow(xml) {
	thePopupBox = $('fdPopupBox');
	thePopupBox.innerHTML = xml.responseText;
	
	//**MooTools**
	try {
		thePopupBox.fade('hide');
	} catch (caught) {
		thePopupBox.style.display = 'none';
	}
	
	thePopupBox.style.display = 'block';
	
	//**MooTools**
	thePopupBox.fade('in');
}

function fdClose() {
	if ($('fdPopupBox') != null) {
		//**MooTools**
		$('fdPopupBox').fade('out');
		if ($('fdFader') != null) {
			$('fdFader').fade('out');
		}
	}
}
