home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 January / chipcd20010102.iso / software / office / imgcotrack / CoTracker.exe / grab.___ < prev    next >
Encoding:
Text File  |  2000-10-31  |  19.2 KB  |  744 lines

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Grab Image</TITLE>
  4. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
  5. <STYLE TYPE="TEXT/CSS">
  6. <!--
  7. .dialogLight  {font-family: Verdana,Arial; font-size: 8pt; font-weight: lighter}
  8. .LongButton   {font-family: Verdana,Arial; font-size: 8pt; font-weight: bold; width: 180px}
  9. .dlgButton    {font-family: Verdana,Arial; font-size: 8pt; font-weight: bold; width: 80px}
  10. .smalls       {font-family: Verdana,Arial; font-size: 80%; font-weight: bold}
  11. -->
  12. </STYLE>
  13. <OBJECT ID="Engine" CLASSID="CLSID:04AB20C2-D25A-11D3-A94C-00C0F048995B">
  14. </OBJECT>
  15. <SCRIPT LANGUAGE="javascript" SRC="lib.js"></SCRIPT>
  16. <SCRIPT LANGUAGE="javascript" defer>
  17.  
  18. var IEVersion = null;
  19. var strPath = null;
  20.  
  21.  
  22. function ReplaceCTToTop (SourceX, newCIN)
  23. {
  24.  var    CTList = SourceX.selectSingleNode("root/CTLIST");
  25.  var    child = SourceX.selectSingleNode("root\/CTLIST\/CATEGORY[@CID="+newCIN+"]");  
  26.  var    childOldFirst = CTList.firstChild; 
  27.  
  28.     if (child && (child !== childOldFirst))
  29.     {
  30.      CTList.removeChild(child);
  31.      CTList.insertBefore(child, childOldFirst);
  32.      return 1;
  33.     }        
  34.     else
  35.      return 0;
  36. }
  37.  
  38.  
  39. function SaveSource( SourceX )
  40. {
  41.    var str;
  42.  
  43.    if (IEVersion == null)
  44.     IEVersion = window.navigator.appVersion.substring(22, 25);
  45.  
  46.    if (IEVersion.charAt(0) != '5')
  47.     return null;
  48.       
  49.     // check XML base encoding         
  50.     if (SourceX.childNodes[0].attributes[1].nodeValue != "utf-8")
  51.      SourceX.childNodes[0].attributes[1].nodeValue ="utf-8";
  52.  
  53.     if (!Engine)
  54.     {
  55.      alert("Unable to load ActiveX object.");
  56.      return null;
  57.     }
  58.  
  59.     dbversion = SourceX.selectSingleNode ("root[@dbversion]");
  60.     if (dbversion == null)
  61.     {
  62.        Root = SourceX.selectSingleNode ("root");
  63.        Root.setAttribute ("dbversion", "1.0");
  64.     }
  65.  
  66.     str = Engine.commitChanges( SourceX, 1);        
  67.     return str;
  68. }
  69.  
  70.  
  71. function ResolveJavaScriptURL (szJSData, szSourceURL)
  72. {
  73.  var pos1, pos2, pos3;
  74.  var bSign = 0;
  75.  
  76.  if (top.confirm ("It is internal site script code. Do you want try to resolve this reference?") == 0)
  77.   return "";  
  78.  
  79.  pos1 = szJSData.search(/\(\'/i);
  80.  if (pos1 == -1)
  81.  {
  82.   pos1 = szJSData.search(/\(\"/i);
  83.   bSign = 1;
  84.  }
  85.  
  86.  if (pos1 == -1)
  87.   return "";
  88.  
  89.  if (bSign == 1)
  90.  {
  91.    pos2 = szJSData.search(/\",/i);
  92.    pos3 = szJSData.search(/\"\)/i);
  93.  }
  94.  else
  95.  {
  96.    pos2 = szJSData.search(/\',/i);
  97.    pos3 = szJSData.search(/\'\)/i);
  98.  }
  99.  if ((pos2 == -1) && (pos3 == -1))
  100.   return "";
  101.  if (pos3 != -1) 
  102.  {
  103.   if ((pos2 == -1) || (pos2 > pos3))
  104.    pos2 = pos3;
  105.  }
  106.  
  107.  szURL = szJSData.substring(pos1+2, pos2);
  108.  if (szURL.search(/\./) == -1)
  109.   return "";
  110.  if  (szURL.charAt(0) == '/')
  111.  {
  112.   TailPos = szSourceURL.search ('://');
  113.   szSource = szSourceURL.substring(TailPos+3, szSourceURL.length-1);  
  114.   TailPos = szSource.search("/");
  115.   if (TailPos == -1)
  116.   {
  117.    szSite = szSourceURL;
  118.    if (szSite.charAt(szSite.length-1) =='/')
  119.     szSite = szSite.substring(0,szSite.length-1);
  120.   }
  121.   else
  122.    szSite = szSource.substring(0, TailPos);
  123.  }
  124.  else
  125.  {
  126.   szSite = szSourceURL;
  127.   if (szSite.charAt(szSite.length-1) !='/')  
  128.    szSite = szSite+'/';
  129.  }
  130.  
  131.   szURL = szSite + szURL;   
  132.   return szURL;
  133. }
  134.  
  135.  
  136. //============================================================================= defer script ================================================================
  137.  
  138. Engine.HdWnd = 0;
  139.  
  140.  var    Source;
  141.  var    SourceNew;
  142.  var    bSetDefCat;
  143.  
  144.  var Image;
  145.  
  146.  var ParentWin = external.menuArguments;
  147.  var Doc = ParentWin.document;
  148.  var CurEvent = ParentWin.event;
  149.  var    CurElement = CurEvent.srcElement;
  150.  
  151.  var    IMGNode = null;
  152.  var sz_IMGNode = "";
  153.  
  154.  var    sz_IMGOriginal = "";
  155.  var    sz_URLOriginal = "";
  156.  
  157.  var    sz_IMGTitle = "";
  158.  var    sz_IMGResolved = "";
  159.  var    sz_URLResolved = "";
  160.  
  161.  var    sz_BannerName = "";
  162.  var sz_Width = "";
  163.  var sz_Height = "";
  164.  
  165.  var sz_IsMap = "false";
  166.  var    sz_UseMap = "";
  167.  var    sz_IMGMap = "";
  168.  var bInput = 0;    
  169.  
  170.  
  171.  if ((CurElement.tagName == "IMG")    && (CurElement.readyState != "complete"))
  172.  {
  173.      window.dialogHeight="0px";
  174.      window.dialogWidth="0px";
  175.  
  176.      alert ("Please wait until the Web page is downloaded completely");
  177.      window.close();
  178.  }
  179.  else
  180.  {
  181.      window.dialogHeight="0px";
  182.      window.dialogWidth="0px";
  183.     window.dialogLeft=(window.screen.width-610)/2;
  184.     window.dialogTop=(window.screen.height-350)/2;   
  185.    
  186.         
  187.     Source = new ActiveXObject("Microsoft.XMLDOM");
  188.     Source.async = false;
  189.     //Source.load(sz_DataBaseFile);        
  190.     strPath = Engine.OpenXMLBase(Source,1, 1);    
  191.     if (!strPath)    
  192.     {
  193.         ElXML = Source.createProcessingInstruction('xml', ' version="1.0" encoding="utf-8" ');                
  194.         Source.insertBefore(ElXML, null);                
  195.  
  196.         //  insert root element 
  197.         var Root = Source.createElement("root");
  198.         Root.setAttribute("dbversion","1.0");
  199.         Root.text = "\n\t";
  200.         Source.appendChild(Root);        
  201.         
  202.                 
  203.         var CtList = Source.createElement("CTLIST");
  204.         CtList.setAttribute("CurrentCategory", "0000000000000000");
  205.                 
  206.         var CtCommon = Source.createElement("CATEGORY");
  207.         CtCommon.setAttribute("CID", "0000000000000001");
  208.         CtCommon.setAttribute("Name", "Common");
  209.         CtCommon.text = "\n";
  210.                 
  211.         Root.appendChild(CtList);
  212.         CtList.appendChild(CtCommon);
  213.  
  214.         var BannerBase = Source.createElement("BANNERBASE");
  215.         BannerBase.setAttribute("OpenMode", "_blank");
  216.         BannerBase.setAttribute("SortOrder", "-@CreationDate");
  217.         if (Engine.Options == -1)
  218.         {
  219.          BannerBase.setAttribute("ShowSlots", "191");
  220.          BannerBase.setAttribute("ConfirmDelete", "0");
  221.          BannerBase.setAttribute("SmallPictures", "0");
  222.          Engine.Options = 191;
  223.         }
  224.         else
  225.         {         
  226.          BannerBase.setAttribute("ShowSlots", Engine.Options & 255);
  227.  
  228.          if (Engine.Options & 1024)
  229.           BannerBase.setAttribute("ConfirmDelete", "1");
  230.          else
  231.           BannerBase.setAttribute("ConfirmDelete", "0");
  232.  
  233.          if (Engine.Options & 2048)
  234.           BannerBase.setAttribute("SmallPictures", "1");
  235.          else
  236.           BannerBase.setAttribute("SmallPictures", "0");
  237.         }
  238.         BannerBase.text = "\n\t\t";
  239.         Root.appendChild(BannerBase);
  240.  
  241.         strPath = SaveSource(Source);
  242.     }
  243.     
  244.     
  245.     
  246.     if (CurElement.tagName == "AREA")    
  247.     {
  248.         sz_UseMap = '#' + CurElement.parentElement.name;
  249.  
  250.         for (var CurArea = CurElement.parentElement.firstChild; CurArea != null; CurArea = CurArea.nextSibling)    
  251.         {
  252.          if ((CurArea.tagName) && (CurArea.tagName == "AREA"))
  253.          {
  254.              CurArea.href = Engine.resolveDivert(CurArea.href);
  255.  
  256.             
  257.              CurArea.onbeforecopy = null;
  258.              CurArea.onbeforecut = null;
  259.              CurArea.onbeforeeditfocus = null;
  260.              CurArea.onbeforepaste = null;
  261.              CurArea.onblur = null;                          
  262.              CurArea.onhelp = null;
  263.              CurArea.onclick = null;
  264.              CurArea.ondbclick = null;
  265.              CurArea.oncopy = null;
  266.              CurArea.oncut = null;
  267.              CurArea.ondrag = null;
  268.              CurArea.ondragend = null;
  269.              CurArea.ondragleave = null;
  270.              CurArea.ondragstart = null;
  271.              CurArea.ondrop = null;
  272.              CurArea.onfocus = null;
  273.              CurArea.onlosecapture = null;
  274.              CurArea.onpaste = null;
  275.              CurArea.onpropertychange = null;
  276.              CurArea.onreadystatechange = null;
  277.              CurArea.onselectstart = null;
  278.              CurArea.onkeydown = null;
  279.              CurArea.onkeyup = null;
  280.              CurArea.onkeypress = null;
  281.              CurArea.onmouseout = null;
  282.              CurArea.onmouseover = null;
  283.              CurArea.onmousemove = null;
  284.              CurArea.onmousedown = null;
  285.              CurArea.onmouseup = null;
  286.  
  287.              CurArea.CLASS=null;
  288.          }
  289.              
  290.         }
  291.  
  292.         //sz_IMGMap = CurElement.parentElement.outerHTML;
  293.         sz_IMGMap = CurElement.parentElement.innerHTML;
  294.  
  295.         var    ar_ImageMap = new Array(Doc.images.length);
  296.         for (var i = 0; i < Doc.images.length; i++)    
  297.         {
  298.             ar_ImageMap[i] = Doc.images[i].useMap;
  299.             Doc.images[i].useMap = "";
  300.         }
  301.         CurElement = Doc.elementFromPoint(CurEvent.clientX, CurEvent.clientY);
  302.         for (var i = 0; i < Doc.images.length; i++)    
  303.         {
  304.             Doc.images[i].useMap = ar_ImageMap[i];
  305.         }
  306.     }
  307.  
  308.     if (CurElement.tagName == "IMG")    
  309.     {
  310.         IMGNode = CurElement;
  311.         sz_IMGNode = CurElement.outerHTML;
  312.  
  313.         if (CurElement.isMap)    {
  314.             sz_IsMap = "true";
  315.         }
  316.  
  317.         sz_IMGTitle = CurElement.nameProp;
  318.         sz_IMGOriginal = CurElement.href;
  319.  
  320.         if (CurElement.alt != "")
  321.             sz_BannerName = CurElement.alt;
  322.         sz_Width = CurElement.width;
  323.         sz_Height = CurElement.height;
  324.  
  325.  
  326.         Image = CurElement;
  327.     }
  328.     
  329.     
  330.     if ((CurElement.tagName == "INPUT") && (((CurElement.type).toLowerCase()) == "image"))
  331.     {
  332.       IMGNode = CurElement;
  333.       sz_IMGNode = CurElement.outerHTML;
  334.  
  335.     
  336.       sz_Width = CurElement.width;
  337.       sz_Height = CurElement.height;
  338.       sz_BannerName = CurElement.alt;
  339.       sz_IMGOriginal = CurElement.src;
  340.       bInput = 1;           
  341.     }
  342.     
  343.  
  344.     while ((CurElement.tagName != "A") && (CurElement.tagName != "BODY"))    
  345.     {
  346.         if ((CurElement.tagName == "FORM") && (bInput))
  347.          break;
  348.         CurElement = CurElement.parentElement;        
  349.     }
  350.     if (CurElement.tagName == "A")    
  351.     {
  352.         sz_URLOriginal = CurElement.href;
  353.         if (sz_BannerName == "")
  354.             sz_BannerName = CurElement.alt;
  355.     }
  356.     
  357.     if (CurElement.tagName == "FORM")    
  358.     {
  359.      switch (CurElement.action.charAt(0))
  360.      {
  361.       case '/': 
  362.         szSite = unescape(Doc.location.href);
  363.         if (szSite.charAt(szSite.length-1) =='/')
  364.          szSite = szSite.substring(0,szSite.length-1);
  365.         sz_URLOriginal =szSite + CurElement.action;
  366.         break;
  367.       case 0:
  368.         sz_URLOriginal = unescape(Doc.location.href);
  369.         break;
  370.       default:
  371.        sz_URLOriginal = CurElement.action;
  372.        break;
  373.      }
  374.     }
  375.     
  376.  
  377.     sz_IMGResolved = sz_IMGOriginal;
  378.  
  379.     if (sz_IsMap == "false")    
  380.     {       
  381.        JSPos =  sz_URLOriginal.search("javascript:");
  382.        if (JSPos == -1)
  383.         JSPos =  sz_URLOriginal.search("vbscript:");
  384.        if (JSPos != -1)
  385.        {
  386.          //szScriptData = sz_URLOriginal.substring (JSPos, sz_URLOriginal.length-1);
  387.          sz_URLResolved = ResolveJavaScriptURL (sz_URLOriginal, unescape(Doc.location.href));
  388.        }
  389.        else  
  390.          sz_URLResolved = Engine.resolveDivert(sz_URLOriginal);
  391.     }
  392.     else    
  393.     {
  394.         //Bad case - Server Side Map in use - nothing can be done
  395.         sz_URLResolved = sz_URLOriginal;
  396.     }    
  397.  
  398.     var    sz_CurrentTitle = Doc.title;     
  399.  }
  400.  
  401.  
  402. function LoadDialog()
  403. {
  404.     if (sz_UseMap == "")
  405.     {        
  406.         isMap=0;
  407.         InitDialog();
  408.     }
  409.     else
  410.     {    
  411.         isMap=1;
  412.         InitDialog();
  413.     }
  414.     window.dialogHeight="100px";
  415.     window.dialogWidth="100px";
  416.     fnResize(document, window);
  417. }
  418.  
  419. function InitList ()
  420. {   
  421.     var CTListNames = Source.selectNodes("root\/CTLIST\/CATEGORY\/@Name");
  422.     var CTListIDs =   Source.selectNodes("root\/CTLIST\/CATEGORY\/@CID");              
  423.     var    CurrentCT = Source.selectSingleNode("root\/CTLIST\/@CurrentCategory");    
  424.     var    Sel = document.all.CT_LIST;  
  425.  
  426.     if ((CTListNames == null) || (CTListIDs == null) || (CurrentCT == null) || (Sel == null))
  427.      return;
  428.     
  429.     while (Sel.options[0])
  430.      Sel.options.remove(0);
  431.  
  432.     CurID = CurrentCT.nodeValue;
  433.     if (CurID == "0000000000000000")
  434.       CurID = "0000000000000001";
  435.  
  436.          
  437.     if ((CTListNames == null) || (CTListIDs == null))
  438.      alert (" Unable to read categories data.") 
  439.     else
  440.     {  
  441.        for (i=0; i< CTListNames.length; i++)
  442.        {
  443.         var objOption= document.createElement ("OPTION");
  444.         objOption.text =  CTListNames[i].nodeValue;             
  445.         objOption.value = CTListIDs[i].nodeValue;             
  446.         Sel.options.add (objOption);   
  447.         if (objOption.value == CurID)
  448.           objOption.selected = true;
  449.         else
  450.           objOption.selected = false;
  451.        }
  452.     }
  453. }
  454.  
  455.  
  456. function InitDialog ()
  457. {
  458.  IEVersion = window.navigator.appVersion.substring(22, 25);
  459.  if (IEVersion.charAt(0) != '5')
  460.  {
  461.    alert ("This program runs under Microsoft Internet Explorer 5.0 or higher only.");
  462.    window.close();
  463.    return;
  464.  }
  465.  
  466.  
  467.     var    CurrentCT;
  468.  
  469.     if (Source) 
  470.     {
  471.      CurrentCT = Source.selectSingleNode("root\/CTLIST\/@CurrentCategory");        
  472.      InitList ();
  473.     }
  474.  
  475.     if (isMap == 1)    
  476.      document.all["formUrl"].outerHTML = "<p>MAP - Cannot change the URL here.";
  477.     else
  478.      document.all["formUrl"].value = sz_URLResolved;
  479.      document.all["formName"].value = sz_BannerName;
  480.  
  481.     if ((!sz_BannerName) || (sz_BannerName == ""))
  482.     {
  483.             sz_BannerName = "Untitled";
  484.     }
  485.     document.all["formName"].value = sz_BannerName;
  486.  
  487.     if (strPath)
  488.     {
  489.      document.all.item("DBName").innerText = strPath;      
  490.      document.all.item("DBName").title = strPath;      
  491.     }
  492. }
  493.  
  494. function onCancel()
  495. {    
  496.     window.close();
  497. }
  498.  
  499. function onOk()
  500. {
  501.     if (isMap == 0)
  502.         sz_URLResolved = document.all["formUrl"].value;
  503.     if (document.all["formName"].value!="")
  504.     {
  505.         if (isMap == 0)
  506.         {
  507.             if ((sz_URLResolved.search ('://') == -1) && (sz_URLResolved.search ('@') == -1) && (sz_URLResolved.length>0))
  508.             {             
  509.                 sz_URLResolved="http://"+sz_URLResolved;
  510.             }
  511.             if ((sz_URLResolved.search('@')!=-1) && (sz_URLResolved.search('mailto:') == -1))
  512.             {
  513.                 sz_URLResolved = "mailto:" + sz_URLResolved;
  514.             }            
  515.         }
  516.         sz_Categories = document.all["CT_LIST"].options[document.all["CT_LIST"].selectedIndex].value;
  517.         sz_BannerName = document.all["formName"].value;
  518.         getComment = document.all["formComment"].value;        
  519.         bSetDefCat = document.all.CheckDef.checked;
  520.         if (addBanner())
  521.         {
  522.           window.close();
  523.         }
  524.     }
  525.     else
  526.     {
  527.         alert("The category name cannot be blank.");
  528.     }
  529. }
  530.  
  531.  
  532. function onOpenXML ()
  533. {
  534.     SourceNew = new ActiveXObject("Microsoft.XMLDOM");
  535.     SourceNew.async = false;
  536.     strPath = Engine.OpenXMLBase (SourceNew, 0, 1);     
  537.     if (strPath)
  538.     {
  539.      Source = SourceNew;     
  540.      InitList ();        
  541.      document.all.item("DBName").innerText = strPath;
  542.      document.all.item("DBName").title = strPath;
  543.     }
  544. }
  545.  
  546.  
  547. function onKeyPress()
  548. {
  549.     if (event.keyCode == 27)
  550.     {
  551.         onCancel();
  552.     }
  553.     if (event.keyCode == 13)
  554.     {
  555.         onOk();
  556.     }
  557. }
  558.  
  559.  
  560. function addBanner()
  561.  var ct_cur;
  562.   
  563.    
  564.   SourceNew = new ActiveXObject("Microsoft.XMLDOM");
  565.   SourceNew.async = false;    
  566.   strPath = Engine.OpenXMLBase(SourceNew, 1, 1);    
  567.   if (strPath && (SourceNew.selectSingleNode("root\/CTLIST\/CATEGORY[@CID="+sz_Categories+"]") != null))
  568.   {
  569.     //All three parameters mustn't be empty 
  570.     if ((sz_BannerName != null) && (sz_BannerName != "") && (sz_IMGResolved != ""))    
  571.     {
  572.         var    Root = SourceNew.selectSingleNode("root");
  573.         var    BannerBase = SourceNew.selectSingleNode("root/BANNERBASE");    
  574.         if (BannerBase == null)    
  575.         {
  576.             BannerBase = Source.createElement("BANNERBASE");
  577.  
  578.             BannerBase.setAttribute("OpenMode", "_blank");
  579.             BannerBase.setAttribute("SortOrder", "-@CreationDate");
  580.             if (Engine.Options == -1)
  581.             {
  582.              BannerBase.setAttribute("ShowSlots", "191");
  583.              BannerBase.setAttribute("ConfirmDelete", "0");
  584.              BannerBase.setAttribute("SmallPictures", "0");
  585.              Engine.Options = 191;
  586.             }
  587.             else
  588.             {         
  589.              BannerBase.setAttribute("ShowSlots", Engine.Options & 255);
  590.  
  591.              if (Engine.Options & 1024)
  592.               BannerBase.setAttribute("ConfirmDelete", "1");
  593.              else
  594.               BannerBase.setAttribute("ConfirmDelete", "0");
  595.  
  596.              if (Engine.Options & 2048)
  597.               BannerBase.setAttribute("SmallPictures", "1");
  598.              else
  599.               BannerBase.setAttribute("SmallPictures", "0");
  600.             }
  601.             BannerBase.text = "\n\t\t";
  602.  
  603.             Root.appendChild(BannerBase);
  604.         }
  605.  
  606.         if (BannerBase != null)    
  607.         {
  608.             var UIN = 0;
  609.             var    UINs = SourceNew.selectNodes("root/BANNERBASE/BANNER/@UIN");
  610.             for (Index = 0; Index < UINs.length; Index++)    
  611.             {
  612.                 if (parseInt(UINs[Index].text, 10) > UIN)
  613.                     UIN = parseInt(UINs[Index].text, 10);
  614.             }
  615.             UIN++;
  616.  
  617.  
  618.               
  619.             if (IEVersion == "5.0")
  620.               // save throw IE command -> clipboard
  621.               sz_IMGResolved = Engine.saveImage (IMGNode, UIN);
  622.             else
  623.               // save throw WinInet service
  624.               sz_IMGResolved = Engine.saveImage2 (IMGNode, UIN);
  625.  
  626.             var    Banner = SourceNew.createElement("BANNER");
  627.  
  628.             var    sc_UIN = "0000000000000000" + UIN;
  629.             sc_UIN = sc_UIN.substr(sc_UIN.length - 16);
  630.             Banner.setAttribute("UIN", sc_UIN);
  631.  
  632.             if (sz_IMGMap != "")
  633.              sz_URLResolved = "";
  634.  
  635.             Banner.setAttribute("Name", sz_BannerName);
  636.             Banner.setAttribute("Image", sz_IMGResolved);
  637.             Banner.setAttribute("Width", sz_Width);
  638.             Banner.setAttribute("Height", sz_Height);
  639.             Banner.setAttribute("Url", sz_URLResolved);
  640.             Banner.setAttribute("Map", escape(sz_IMGMap));
  641.             Banner.setAttribute("IsMap", sz_IsMap);
  642.             Banner.setAttribute("Comment", getComment);
  643.             Banner.setAttribute("SourceUrl", unescape(Doc.location.href));
  644.  
  645.             var    sc_Time = "0000000000000000" + Date.parse(new Date());
  646.             sc_Time = sc_Time.substr(sc_Time.length - 16);
  647.             Banner.setAttribute("LastAccess", sc_Time);
  648.             Banner.setAttribute("CreationDate", sc_Time);
  649.  
  650.  
  651.             Banner.setAttribute("IMGNode", sz_IMGNode);
  652.             Banner.setAttribute("ID_CATEGORY", sz_Categories);                        
  653.  
  654.  
  655.             if (bSetDefCat) 
  656.             {              
  657.               CurrentCT = SourceNew.selectSingleNode("root\/CTLIST\/@CurrentCategory");
  658.               nSel = document.all.CT_LIST.selectedIndex
  659.               CurrentCT.nodeValue = document.all.CT_LIST.options[nSel].value;
  660.               ReplaceCTToTop (SourceNew, sz_Categories);
  661.             }
  662.              
  663.  
  664.  
  665.              Banner.text = "\n\t\t";
  666.              BannerBase.appendChild(Banner);                                                   
  667.              SaveSource (SourceNew);
  668.              Engine.UpdateData (strPath);                
  669.              return 1;
  670.             }
  671.         }            
  672.     }
  673.     else
  674.     {
  675.       alert ("Unable to save image.");      
  676.       Source = SourceNew;
  677.       if (Source)
  678.        InitList ();
  679.       return 0;
  680.     }
  681.   }    
  682.  
  683. function fnGrabOnKeyDown(event)
  684. {
  685.     switch (event.keyCode)
  686.     {
  687.         case 37:
  688.         case 39:
  689.         case 35:
  690.         case 36:
  691.             return false;
  692.     }
  693.     event.returnValue = false;
  694.     return false;
  695. }
  696.  
  697. </SCRIPT>
  698. </HEAD>
  699. <BODY bgcolor=silver onKeyDown="onKeyPress()" onload="LoadDialog()" class="dialogLight" STYLE="MARGIN:5px;" SCROLL="no">
  700. <CENTER>
  701. <FIELDSET ID="Input" STYLE="WIDTH:590px; MARGIN:0px; PADDING:0px;">
  702. <FORM id=form1 name=form1>
  703. <TABLE border=0 cellspacing=4 cellpadding=0 width="100%">
  704. <TR>
  705. <TD CLASS="smalls" WIDTH="80px">Name:</TD>
  706. <TD><input id=formName style="WIDTH: 490px"></TD>
  707. </TR>
  708. <TR>
  709. <TD CLASS="smalls" WIDTH="80px">Comment:</TD>
  710. <TD><input id=formComment style="WIDTH: 490px"></TD>
  711. </TR>
  712. <TR>
  713. <TD CLASS="smalls" WIDTH="80px">Refers to:</TD>
  714. <TD><input id=formUrl style="WIDTH: 490px"></TD>
  715. </TR>
  716. <TR>
  717. <TD CLASS="smalls" WIDTH="80px">Catalog:</TD>
  718. <TD>
  719. <TABLE border=0 cellspacing=0 cellpadding=0 width="100%">
  720. <TD><INPUT type=text maxlength=1024 onkeydown="fnGrabOnKeyDown(event)" id=DBName style="background-color:lightgrey; WIDTH: 400px"></INPUT></TD>
  721. <TD><BUTTON onClick=onOpenXML() title="Open Image Catalog" id=button0 name=button0 class="LongButton" style="HEIGHT: 25px; WIDTH: 82px; left:-50;"><IMG src="color.bmp">Open...</BUTTON></TD>
  722. </TABLE>
  723. </TD>
  724. </TR>
  725. </TABLE>
  726. <TABLE border=0 cellspacing=4 cellpadding=0 width="100%">
  727. <TR>
  728. <TD CLASS="smalls" WIDTH="80px">Category:</TD>
  729. <TD width="120px"><SELECT NAME="CT_LIST" ALIGN="left" style="FONT-SIZE: 80%; WIDTH: 120px" id=CT_LIST></SELECT></TD>
  730. <TD width="250px" CLASS="smalls" align="right">Set as default category:</TD>
  731. <TD><INPUT TYPE="checkbox" align="left" NAME="CheckDef" id=CheckDef></TD>
  732. <TD></TD>
  733. </TR>
  734. </TABLE>
  735. </FORM>
  736. </FIELDSET>
  737. </CENTER>
  738. <P ALIGN=RIGHT STYLE="WIDTH:590px; MARGIN:0px; MARGIN-TOP:5px; PADDING:0px; text-align:right">
  739. <BUTTON onClick=onOk() accesskey="O" title="Press to add this image" id=button1 name=button1 class="dlgButton" STYLE="MARGIN:0px; MARGIN-RIGHT:3px; MARGIN-BOTTOM:5px; PADDING:0px"><IMG src="color.bmp">OK</BUTTON>
  740. <BUTTON onClick=onCancel() accesskey="C" title="Cancel" id=Cancel name=Cancel class="dlgButton" STYLE="MARGIN:0px; MARGIN-LEFT:4px; MARGIN-BOTTOM:5px; PADDING:0px"><IMG src="color.bmp">Cancel</BUTTON></P>
  741. </BODY>
  742. </HTML>
  743.