//YUI JavaScript Files document.write("" + "" + "" + "" + ""); //Panel Styles document.write(""); var panel = { /***************************************************************************** * Function: Load Container Panel * Description: Creates a new panel div object and inserts it into the body * of the page * Arguments: txtHeader (string) - The header text of the panel object * txtFooter (string) - The footer text of the panel object * contentFunc (function) - The function call which returns a string * with the content of the main body of the * object * idValue (string) - ID of the panel * setupArray (associative array) - Contains name / value pairs for * YUI panel setup. * locked (boolean) - true if panel is locked / false if not *****************************************************************************/ init: function(txtHeader, txtFooter, content, idValue, setupArray, locked, sender_id, sender_name){ //reuse panel element if it already exists if (document.getElementById(idValue)){var divCnt = document.getElementById(idValue); } else { //pring out panel box var divCnt = document.createElement("div"); var lockPlace = ""; //note options if (sender_id){ lockPlace = panel.loadNoteOptions(sender_id); } divCnt.setAttribute("id", idValue); divCnt.setAttribute("style", "position:relative"); divCnt.innerHTML = "
" + txtHeader + "
" + content + "
"; //print footer as well as note options for non form entry panels if (idValue != "frmNoteEntry"){ divCnt.innerHTML += "
" + txtFooter + panel.loadNoteOptions(sender_id, sender_name, idValue) + "
"; } else { divCnt.innerHTML += "
" + txtFooter + panel.loadFormOptions() + "
"; } } document.body.appendChild(divCnt); var myPanel = new YAHOO.widget.Panel(idValue); //setup variables for the panel for (var i in setupArray) { myPanel.cfg.queueProperty(i, setupArray[i]); } //subscribe to panel close and panel drag events myPanel.hideEvent.subscribe(panelClose, new Array(idValue)); if (idValue != "frmNoteEntry"){ myPanel.dragEvent.subscribe(panelSave, new Array(idValue)); } myPanel.render(); }, loadNoteOptions: function(sender_id, sender_name, idValue){ if (window.loadNoteOptions) return loadNoteOptions(sender_id, sender_name, idValue); }, loadFormOptions: function(){ if (window.loadFormOptions) return loadFormOptions(); } } /****************************************************************** * Function: Panel Close Default * Description: Hides YUI panel on close. Function only in effect * if default YUI close is not used ******************************************************************/ function panelClose(sType, sArgs, panelID){ document.getElementById(panelID[0]).style.visibility = "hidden"; } /****************************************************************** * Function: Panel Close Default * Description: Hides YUI panel on close. Function only in effect * if default YUI close is not used ******************************************************************/ function panelSave(sType, sArgs, panelID){ if(sArgs[0] == "endDrag"){ panelLock(panelID[0]); } }