/**
 * cite.js - handle the citation modal box
 *
 * @version 23 October 2008
 * @author	Bobbi Fox
 *  uses Joseph Oster, wingo.com, javascripts:
 *  jt_.js, jt_AppDialogs.js, jt_DialogBox.js, MyApp_dialogs.js
 *   See those for licenses
 *
 */
 
 var i18N_MyAppAlert = "Cite this resource";
 var boxWidth = 600;
 
 function showCite(e) {
    var title = (document.getElementById("cite_title"))?document.getElementById("cite_title").innerHTML : "No Citation Available";
    var content = (document.getElementById("cite_content"))?document.getElementById("cite_content").innerHTML : "No Citation Available";
 	MyAppAlertSetXY(e.clientX + 20, e.clientY + 10);
 	MyAppAlert(content,
 		title);
 		alertDialog.setWidth(boxWidth);
    var okbutton = document.getElementById("_jtButton1");
    location.href="#citeIt";
    okbutton.focus();
    
 	return false;
 }
 function viewContent() {
    var title = (document.getElementById("cite_title"))?document.getElementById("cite_title").innerHTML : "No Citation Available";
    var content = (document.getElementById("cite_content"))?document.getElementById("cite_content").innerHTML : "No Citation Available";
  	alertDialog.setTitle(title);
 	alertDialog.setContent(title);
 	alertDialog.setWidth(boxWidth);
 }
 
 function hideDialogs() {
   if (alertDialog) alertDialog.hide();
 }
 
 function setCiteModals() {
 /*	if (document.getElementById &&
 		document.getElementsByTagName) {
	 		var cite = document.getElementById('cite');
	 		if (cite) {
	 			cite.onclick = function() {
	 				MyAppAlertXY(event);
	 				showCite();
	 				return false;
	 			};
	 		}
	 }
 */
}
function doCite(event) {
	MyAppAlertXY(event);
	 				showCite();
	 				return false;
}	