//!!BELOW FUNCTIONS ARE JAVASCRIPT NOT PHP!! //global variables :-( All good coding rules have exceptions var gPopUpVeilId = ""; var gPopUpId = ""; var gFieldId = ""; var gValue = ""; var gAction=""; var noValue=""; //iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii function showPopUp($vPopUpId, $vFieldId, $vVeilId, $vAction, $vTop, $vLeft) { //positions and renders popup visible and display:block //vPopUpId = id of the iframe to make visible //vAction = action to be performed when value selected //vTop, vLeft position, assumes absolute set and reference is an outer container var vPopUpId = $vPopUpId; var vFieldId = $vFieldId; var vVeilId = $vVeilId; var vAction = $vAction; var vTop = $vTop; var vLeft = $vLeft; //alert ("showPopUp vAction=" + vAction) //alert ('showPopUp vPopUpId=' + vPopUpId + '; vFieldId=' + vFieldId) //set globals for popUp and Field gPopUpId = vPopUpId; gPopUpVeilId = vVeilId; gFieldId = vFieldId; gAction = vAction; var myPopUpFrame = document.getElementById(vPopUpId); //alert ('showPopUp check 1') myPopUpFrame.style.visibility = "visible"; myPopUpFrame.style.display = "block"; myPopUpFrame.style.position = "absolute"; //alert ('showPopUp check 2') var noValue = ''; if (typeof vTop != 'undefined' && vTop != undefined ) { myPopUpFrame.style.top = vTop; } if (typeof vLeft != 'undefined' && vLeft != undefined ) { myPopUpFrame.style.left = vLeft; } //alert ('showPopUp check 3') /* if (typeof vVeilId != 'undefined' && vVeilId != undefined ) { var myPopUpVeil = document.getElementById(vVeilId); myPopUpVeil.style.display = "block"; } */ } //iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii function setAndClearPopUp($fieldValue ) { //assumes the field id is stored in gFieldId var lField = gFieldId; var fieldNode = document.getElementById(gFieldId); fieldNode.value = $fieldValue; //below line messed this up when used for non color stuff //why did I set that here? if (gFieldId == "colorInpFieldId") fieldNode.style.backgroundColor = $fieldValue; gValue = $fieldValue; clearPopUp(); // onChange will NOT trigger if value is set this way // do I want to check gAction to see if an action is required when this is set? if (!gAction == noValue) { eval(gAction); //doColor(); } } //iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii function clearPopUp() { //used in both Iframe and Div PopUps //get values from globals var popUpId = gPopUpId; var veilId = gPopUpVeilId; var noValue = ''; //alert ("clearPopUp popUpId=" + popUpId); var myPopUpFrame = document.getElementById(popUpId); myPopUpFrame.style.display = "none"; if ((!veilId == noValue) && (veilId.value.length > 0)) { var myPopUpVeil = document.getElementById(veilId); myPopUpVeil.style.display = "none"; } } //iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii