A Qcodo based CMS/ecommerce framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.8 KiB

12 years ago
  1. function treenavToggleImage(strControlId) {
  2. var blnShow = treenavToggleDisplay(strControlId + "_sub", null, "block");
  3. var objImage = document.getElementById(strControlId + "_image");
  4. var strPath = qc.imageAssets + "/treenav_expanded.png";
  5. var strPathNotExpanded = qc.imageAssets + "/treenav_not_expanded.png";
  6. if (blnShow)
  7. objImage.src = strPath;
  8. else
  9. objImage.src = strPathNotExpanded;
  10. strActualControlId = strControlId.substr(0, strControlId.indexOf('_'));
  11. qcodo.recordControlModification(strActualControlId, 'ItemExpanded', strControlId + ((blnShow) ? ' 1' : ' 0'));
  12. };
  13. function treenavToggleDisplay(mixControl, strShowOrHide, strDisplayStyle) {
  14. // Toggles the display/hiding of the entire control (including any design/wrapper HTML)
  15. // If ShowOrHide is blank, then we toggle
  16. // Otherwise, we'll execute a "show" or a "hide"
  17. var objControl; if (!(objControl = qcodo.getControl(mixControl))) return;
  18. if (strShowOrHide) {
  19. if (strShowOrHide == "show") {
  20. objControl.style.display = strDisplayStyle;
  21. return true;
  22. } else {
  23. objControl.style.display = "none";
  24. return false;
  25. };
  26. } else {
  27. if (objControl.style.display == "none") {
  28. objControl.style.display = strDisplayStyle;
  29. return true;
  30. } else {
  31. objControl.style.display = "none";
  32. return false;
  33. };
  34. };
  35. };
  36. function treenavItemUnselect(strControlId, strStyleName) {
  37. var objControl = document.getElementById(strControlId);
  38. objControl.className = strStyleName;
  39. objControl.onmouseout = function() {treenavItemSetStyle(strControlId, strStyleName);};
  40. };
  41. function treenavItemSetStyle(strControlId, strStyleName) {
  42. var objControl = document.getElementById(strControlId);
  43. objControl.className = strStyleName;
  44. };
  45. function treenavRedrawElement(strElementId, strHtml) {
  46. document.getElementById(strElementId).innerHTML = strHtml;
  47. };