home *** CD-ROM | disk | FTP | other *** search
Text File | 2001-04-24 | 43.6 KB | 1,648 lines |
- <HTML>
- <HEAD>
- <TITLE>Image Co-Tracker</TITLE>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
- <HTA:APPLICATION ID="oMyApp"
- APPLICATIONNAME="{130C4DD1-7A96-11d4-BE19-00C0F0489117}"
- BORDER="yes"
- CAPTION="yes"
- ICON=".\\bpad.ico"
- SHOWINTASKBAR="yes"
- SINGLEINSTANCE="yes"
- SYSMENU="yes"
- WINDOWSTATE="maximize">
- </HTA:APPLICATION>
- <OBJECT ID="Engine" CLASSID="CLSID:04AB20C2-D25A-11D3-A94C-00C0F048995B">
- </OBJECT>
-
- <SCRIPT language="javascript">
-
- // File2Tracker constants
- @set @NEW_XMLDB=0
- @set @OPEN_XMLDB=1
- @set @SAVE_XMLDB=2
-
-
- var gnImageNum = 0;
- var gIntId=null;
- var bOpenList = 0;
- var szPath, szProductPath;
- var bCallTPrint=0;
- var gnPicLoopCount = 0;
- var idLoadPicIntv = 0;
- var bInsertOrRename = false;
- var bOk = false;
-
-
- szPath = new String (top.location.pathname);
- szPath = szPath.toLowerCase();
- if (szPath.charAt(0) == "/")
- szPath = szPath.substring(1, szPath.length);
- nPos = szPath.search ("app.hta");
- szProductPath = unescape(szPath.substring(0,nPos-1));
-
- var sz_XSLPath = szProductPath + "\\store.xsl";
-
-
- var Source;
- var Style;
- var StyleFirst;
- //var WshShell;
-
- var sc_BeforeChange = "";
- var ChangeParent = null;
- var bNoRestore = 0;
- var idImgTimer = 0;
- var idTimeout = 0;
- var idDis = 0;
- var IEVersion;
-
-
- function SaveSource()
- {
- var str;
-
- // check XML base encoding
- if (Source.childNodes[0].attributes[1].nodeValue != "utf-8")
- Source.childNodes[0].attributes[1].nodeValue ="utf-8";
-
- dbversion = Source.selectSingleNode ("root[@dbversion]");
- if (dbversion == null)
- {
- Root = Source.selectSingleNode ("root");
- Root.setAttribute ("dbversion", "1.0");
- }
-
-
- if (!Engine)
- alert("Unable to create Image Co-Tracker object!");
-
- str = Engine.commitChanges(Source, 0);
-
- return str;
- }
-
- function ChangeStringValue(ItemToChange)
- {
-
- ChangeParent = ItemToChange.offsetParent; // BANNER
- sc_BeforeChange = ChangeParent.innerHTML;
- var sc_OldValue = ChangeParent.all.item("Value").innerText;
-
- ChangeParent.innerHTML = "<INPUT TYPE=TEXT CLASS=width80 onkeydown=top.ChangeOnKeyPress(this) id=TEXT1 name=TEXT1 onblur=top.MyClick()></INPUT>"
- ChangeParent.firstChild.value = sc_OldValue;
- ChangeParent.firstChild.select();
- ChangeParent.firstChild.focus();
- }
-
-
- function GetSortMode ()
- {
- var sz_Sort= top.frames[0].document.all.item("SortOrder").value;
- switch (sz_Sort)
- {
- case "All categories":
- return 0;
- case "-@CreationDate":
- return 1;
- case "@Name; -@CreationDate":
- return 2;
- case "-@LastAccess":
- return 3;
- case "@Comment; -@CreationDate":
- return 4;
- case "@ID_CATEGORY; -@CreationDate":
- return 5;
- }
- return 0;
- }
-
- function IsNeedSort (szSlotName)
- {
- switch (szSlotName)
- {
- case "Name":
- if (GetSortMode() == 2)
- return 1;
- else
- return 0;
-
- case "Comment":
- if (GetSortMode() == 4)
- return 1;
- else
- return 0;
-
- case "Category":
- if (GetSortMode() == 5)
- return 1;
- else
- return 0;
- }
- return 0;
- }
-
- function OnListKeyDown (Select)
- {
- var Key=top.frames[1].event.keyCode;
- if (Key == 27)
- {
- ChangeParent.innerHTML = sc_BeforeChange;
- ChangeParent.focus();
- bOpenList = 0;
- ChangeParent = null;
- }
- else
- if (Key == 13)
- {
- ChangeBannerCategory(Select);
- ChangeParent = null;
- }
- }
-
-
- function ChangeBannerCategory (Select)
- {
- var Banner = Source.selectSingleNode("root\/BANNERBASE\/BANNER[@UIN="+ChangeParent.offsetParent.id+"]");
- sc_NewValue = Select.options[Select.selectedIndex].value;
- if (Banner != null)
- {
- Banner.setAttribute("ID_CATEGORY", sc_NewValue);
- szNewCTName = Select.options[Select.selectedIndex].text;
- ChangeParent.innerHTML = sc_BeforeChange;
- ChangeParent.all.item("Value").innerText = szNewCTName;
- ChangeParent.focus();
- Sort(1);
- ChangeParent = null;
- }
- bOpenList = 0;
- }
-
-
- // call XSL on category/change
- function ChangeCategoryValue(ItemToChange)
- {
- bOpenList = 1;
-
- var CTListNames = Source.selectNodes("root\/CTLIST\/CATEGORY\/@Name");
- var CTListIDs = Source.selectNodes("root\/CTLIST\/CATEGORY\/@CID");
- var b_cat;
- var Banner;
- var k=0;
-
- if ((CTListNames == null) || (CTListIDs == null))
- return;
-
- ChangeParent = ItemToChange.offsetParent;
- sc_BeforeChange = ChangeParent.innerHTML;
- var sc_OldValue = ChangeParent.all.item("Value").innerText;
- ChangeParent.innerHTML = "<SELECT NAME=INT_CT_LIST ALIGN=ABSMIDDLE CLASS=width40p id=INTCTLIST onkeydown=top.OnListKeyDown(this) onblur=top.MyClick() onchange=top.ChangeBannerCategory(this) ondblclick=top.ChangeBannerCategory(this)><\SELECT>";
-
- Banner = Source.selectSingleNode("root\/BANNERBASE\/BANNER[@UIN="+ChangeParent.offsetParent.id+"]");
- if (Banner != null)
- b_cat = Banner.getAttribute("ID_CATEGORY");
-
- for (i=0; i < CTListIDs.length; i++)
- {
- var objOption= top.frames[1].document.createElement ("OPTION");
- objOption.text = CTListNames[i].nodeValue;
- objOption.value =CTListIDs[i].nodeValue;
- if (Banner && (b_cat == objOption.value))
- k=i;
- top.frames[1].document.all["INT_CT_LIST"].options.add (objOption);
- }
- top.frames[1].document.all["INT_CT_LIST"].selectedIndex = k;
- ChangeParent.firstChild.focus();
- }
-
-
- function ChangeOnInsertOrRename(Edit, bInsert, bMode)
- {
- var Key;
- if (bMode)
- Key=13;
- else
- Key=top.frames[0].event.keyCode; //27 - Esc, 13 - Enter
-
- if (Key == 27)
- {
- ChangeParent.style.display = "none";
- ChangeParent.innerHTML = "";
- ChangeParent.insertAdjacentHTML("beforeEnd", sc_BeforeChange);
- ChangeParent.style.display = "";
- ChangeParent = null;
- return;
- }
- if (Key != 13)
- return;
-
- var CatName = Edit.value;
-
- if ((CatName == null) || (CatName == "") || (CatName == " ") || (CatName == " "))
- {
- alert ("The category name cannot be blank.");
- //ChangeParent.firstChild.focus();
- return;
- }
-
-
- var CTListNames = Source.selectNodes("root\/CTLIST\/CATEGORY\/@Name");
- var CIDs = Source.selectNodes("root\/CTLIST\/CATEGORY\/@CID");
- var CurrentCT = Source.selectSingleNode("root\/CTLIST\/@CurrentCategory");
-
- if (((CurrentCT.nodeValue == "0000000000000000") || (CurrentCT.nodeValue == "0000000000000001")) && (!bInsert))
- {
- return;
- }
-
- var Category = Source.selectSingleNode("root\/CTLIST\/CATEGORY[@CID="+CurrentCT.nodeValue+"]");
- var newCID = 0;
-
- for (i=0; i < CTListNames.length; i++)
- {
- if (CTListNames[i].nodeValue == CatName)
- {
- alert("This category already exists!");
- //ChangeParent.firstChild.focus();
- return;
- }
- }
-
- if (bInsert)
- {
- for (Index = 0; Index < CIDs.length; Index++)
- {
- if (parseInt(CIDs[Index].text, 10) > newCID)
- newCID = parseInt(CIDs[Index].text, 10);
- }
- newCID++;
- var sc_CID = "0000000000000000" + newCID;
- sc_CID = sc_CID.substr(sc_CID.length - 16);
-
- // check empty page
- var Root = Source.selectSingleNode("root");
- if (Root == null)
- {
- // insert processing instruction
- ElXML = Source.createProcessingInstruction('xml', ' version="1.0" encoding="utf-8" ');
- Source.insertBefore(ElXML, null);
-
- // insert root element
- Root = Source.createElement("root");
- Root.text = "\n\t";
- Source.appendChild(Root);
- }
- var CtList = Source.selectSingleNode("root/CTLIST");
- if (CtList == null)
- {
- CtList = Source.createElement("CTLIST");
- CtList.setAttribute("CurrentCategory", "0000000000000000");
- CurrentCT = Source.selectSingleNode("root\/CTLIST\/@CurrentCategory");
- }
-
- CtNew = Source.createElement("CATEGORY");
- CtNew.setAttribute("CID", sc_CID);
- CtNew.setAttribute("Name", CatName);
- CtNew.text = "\n";
-
- Root.appendChild(CtList);
- CtList.appendChild(CtNew);
-
- AddCTToList (CatName, sc_CID, CurrentCT.nodeValue);
- }
- else
- {
- Select=top.frames[0].document.all["CT_LIST"];
- Select.options[Select.selectedIndex].text=CatName;
- Category.setAttribute("Name", CatName);
- }
-
- ChangeParent.style.display = "none";
- ChangeParent.innerHTML = sc_BeforeChange;
- ChangeParent.style.display = "";
- if (bInsert)
- SaveSource ();
- else
- Sort(1);
- ChangeParent = null;
- }
-
-
- function UpdateDisabledButtons ()
- {
- var CurrentCT = Source.selectSingleNode("root\/CTLIST\/@CurrentCategory");
- if ((CurrentCT.nodeValue == "0000000000000000") || (CurrentCT.nodeValue == "0000000000000001"))
- {
- top.frames[0].document.all["btnDelCT"].src = "delct_d.gif";
- top.frames[0].document.all["btnRenameCT"].src = "renct_d.gif";
- top.frames[0].document.all["btnRenameCT"].runtimeStyle.cursor = "default";
- top.frames[0].document.all["btnDelCT"].runtimeStyle.cursor = "default";
- top.frames[0].document.all["btnDelCT"].UpdateButton(1, 0);
- top.frames[0].document.all["btnRenameCT"].UpdateButton(1, 0);
- }
- else
- {
- top.frames[0].document.all["btnDelCT"].src = "delct_g.gif";
- top.frames[0].document.all["btnRenameCT"].src = "renct_g.gif";
- top.frames[0].document.all["btnRenameCT"].runtimeStyle.cursor = "hand";
- top.frames[0].document.all["btnDelCT"].runtimeStyle.cursor = "hand";
- top.frames[0].document.all["btnDelCT"].UpdateButton(0, 0);
- top.frames[0].document.all["btnRenameCT"].UpdateButton(0, 0);
- }
- }
-
- function CheckToolbar ()
- {
- if (top.frames[0].document.all["btnDelCT"]!=null)
- {
- clearInterval (idDis);
- UpdateDisabledButtons();
- }
- }
-
-
- function InsertOrRenameCategory (ItemToChange, bInsert)
- {
- bOk = false;
- var CurrentCT = Source.selectSingleNode("root\/CTLIST\/@CurrentCategory");
- if (((CurrentCT.nodeValue == "0000000000000000") || (CurrentCT.nodeValue == "0000000000000001")) && (!bInsert))
- {
- //alert ("This category cannot be renamed.");
- return;
- }
-
- SetButtonImage(ItemToChange, 1);
-
- ChangeParent = ItemToChange.parentElement; //offsetParent;
- sc_BeforeChange = ChangeParent.innerHTML;
- if (bInsert)
- {
- ChangeParent.innerHTML = "<INPUT TYPE=TEXT id=idEdit onkeydown=top.ChangeOnInsertOrRename(this,1) onblur='setTimeout(\"top.MyClick()\", 500)' id=TEXTINSERT name=TEXTINSERT style='width:160px; height:20px;margin-bottom:9px; font-size:11px;'></INPUT><BUTTON TYPE=BUTTON ONCLICK='bOk=true;top.ChangeOnInsertOrRename(idEdit,1, true);return false;' style='margin-bottom:9px; font-family: Verdana,Arial; font-size: 8pt;'>ok</BUTTON>";
- ChangeParent.firstChild.value = "";
- }
- else
- {
- var Category = Source.selectSingleNode("root\/CTLIST\/CATEGORY[@CID="+CurrentCT.nodeValue+"]");
- CatName = Category.getAttribute("Name");
- ChangeParent.innerHTML = "<INPUT TYPE=TEXT id=idEdit onkeydown=top.ChangeOnInsertOrRename(this,0) onblur='setTimeout(\"top.MyClick()\", 500)' id=TEXTRENAME name=TEXTRENAME style='width:160px; height:20px; margin-bottom:9px; font-size:11px;'></INPUT><BUTTON TYPE=BUTTON ONCLICK='bOk=true;top.ChangeOnInsertOrRename(idEdit,0, true);return false;' style='margin-bottom:9px; font-family: Verdana,Arial; font-size: 8pt;'>ok</BUTTON>";
- ChangeParent.firstChild.value = CatName;
- ChangeParent.firstChild.select();
- }
-
- ChangeParent.firstChild.focus();
- ChangeParent.firstChild.focus();
- ChangeParent.firstChild.focus();
-
- bInsertOrRename = true;
- }
-
-
- function DeleteCategory ()
- {
-
- szCID = top.frames[0].document.all["CT_LIST"].options[top.frames[0].document.all["CT_LIST"].selectedIndex ].value;
-
- if ((szCID == "0000000000000000") || (szCID == "0000000000000001")) // all categories
- {
- //alert ("This category cannot be deleted.");
- return;
- }
-
-
- if (szCID == "0000000000000001") // common category
- {
- //alert ("This category cannot be deleted.");
- return;
- }
-
- if (top.confirm ("Do you want to delete a category and all the images it contains?") == 0)
- return;
-
-
- if (Source.readyState == 4)
- {
- var Banners = Source.selectNodes("root\/BANNERBASE\/BANNER[@ID_CATEGORY="+szCID+"]");
- var Category = Source.selectSingleNode("root\/CTLIST\/CATEGORY[@CID="+szCID+"]");
-
- if (Category != null)
- Category.parentNode.removeChild(Category);
-
- for (i = 0; i < Banners.length; i++)
- {
- var Banner = Banners[i];
- Engine.DeleteImageFile (Banner);
- Banner.parentNode.removeChild(Banner);
- }
- top.frames[0].document.all["CT_LIST"].options.remove(top.frames[0].document.all["CT_LIST"].selectedIndex);
- top.frames[0].document.all["CT_LIST"].selectedIndex = 0;
-
-
- //set "all categories"; save document, too
- SetCategory();
- }
- }
-
-
- function MyClick ()
- {
- //if ((!bInsertOrRename) && (!bOpenList))
- if (!ChangeParent)
- return;
-
- if (bInsertOrRename)
- {
- bInsertOrRename = false;
- idDis = setInterval (CheckToolbar, 400);
-
- if (bOk)
- {
- bOk=false;
- return;
- }
- }
-
- if (bOpenList)
- bOpenList = 0;
- ChangeParent.innerHTML = sc_BeforeChange;
-
- ChangeParent = null;
- }
-
-
- function ChangeOnKeyPress(EditBox, bMode)
- {
- var Key;
- if (bMode)
- key = 13;
- else
- Key=top.frames[1].event.keyCode; //27 - Esc, 13 - Enter
-
- if (Key == 27)
- {
- EditBox.style.display = "none";
- ChangeParent.innerHTML = sc_BeforeChange;
- ChangeParent.focus();
- ChangeParent = null;
- }
- else
- if (Key == 13)
- {
- var bDestroyMap = true;
- bNoRestore = 1;
- var Banner = Source.selectSingleNode("root\/BANNERBASE\/BANNER[@UIN="+ChangeParent.offsetParent.id+"]");
- var sc_NewValue = EditBox.value;
- ChangeParent.innerHTML = sc_BeforeChange;
- if ((top.frames[1].document.all.item("" + ChangeParent.offsetParent.id + "-IMG").useMap != "") && (ChangeParent.all.item("Value").name == "Url"))
- {
- if (confirm("Changing the URL here will destroy the multiple URL references accosiated with the image.\nAre you sure?"))
- {
- ChangeParent.all.MURL.outerHTML = "";
- top.frames[1].document.all.item("" + ChangeParent.offsetParent.id + "-IMG").useMap = "";
- if (Banner != null)
- {
- Banner.setAttribute("Map", "");
- //SaveSource();
- }
- }
- else
- {
- bDestroyMap = false;
- }
- }
- if (bDestroyMap)
- {
- if (ChangeParent.all.item("Value").name == "Url")
- {
- strl = sc_NewValue;
- str = new String (strl);
- if ((str.search ('://') == -1) && (str.search ('@') == -1) && (str.length>0))
- {
- strl="http://"+strl;
- sc_NewValue = strl;
- }
- if ((str.search('@')!=-1) && (str.search('mailto:') == -1))
- {
- strl = "mailto:" + strl;
- sc_NewValue = strl;
- }
- top.frames[1].document.all.item("" + ChangeParent.offsetParent.id + "-URL").href = sc_NewValue;
- ChangeParent.all.item("Value").href=sc_NewValue;
- }
- else if (ChangeParent.all.item("Value").name == "Name")
- {
- top.frames[1].document.all.item("" + ChangeParent.offsetParent.id + "-IMG").alt = sc_NewValue;
- }
-
- EditBox.style.display = "none";
- ChangeParent.all.item("Value").innerHTML = sc_NewValue;
- ChangeParent.focus();
-
- if (Banner != null)
- {
- Banner.setAttribute(ChangeParent.all.item("Value").name, sc_NewValue);
- }
- }
- bNoRestore = 0;
- if (IsNeedSort(ChangeParent.all.item("Value").name))
- Sort(1);
- else
- SaveSource();
-
- ChangeParent = null;
- }
- }
-
- function RealySort()
- {
- Sort(1);
- top.focus();
- }
-
-
- function Sort( bSave )
- {
-
- var SortOrder = top.frames[0].document.all.item("SortOrder");
- if (SortOrder != null)
- {
- var sz_Order = SortOrder.value;
-
- if (Source.readyState == 4)
- {
- var Orders = Source.getElementsByTagName("root/BANNERBASE/@SortOrder");
- for (var Index = 0; Index < Orders.length; Index++)
- Orders[Index].nodeValue = sz_Order;
-
- if (bSave)
- SaveSource();
- }
-
- if (Style.readyState == 4)
- {
- var Orders = Style.getElementsByTagName("*/xsl:for-each/@order-by");
- var OrdersF = StyleFirst.getElementsByTagName("*/xsl:for-each/@order-by");
-
-
- // set order for second xsl template
- for (var Index = 0; Index < Orders.length; Index++)
- Orders[Index].nodeValue = sz_Order;
-
- // set order for first xsl template
- for (var Index = 0; Index < OrdersF.length; Index++)
- OrdersF[Index].nodeValue = sz_Order;
-
-
- DisplayDocument(1);
- }
- }
- }
-
- function DeleteAll()
- {
-
- if (showModalDialog ("wrn.htm", "", "dialogWidth:292px; dialogHeight:140px; center:yes; border:thin; status:no; scroll:no; help:no;") == 0)
- return;
-
- if (Source.readyState == 4)
- {
- var Banners = Source.getElementsByTagName("root/BANNERBASE/BANNER");
-
- for (i=0; i < Banners.length; i++)
- {
- var Banner = Banners[i];
- Engine.DeleteAllImages (Banner.parentNode);
- Banner.parentNode.removeChild(Banner);
- }
-
- Sort(1);
- }
- }
-
-
-
-
-
-
- function DeleteBanner(sz_Index)
- {
-
- if (Source.readyState == 4)
- {
-
- var ConfirmDelete = Source.selectSingleNode("root\/BANNERBASE\/@ConfirmDelete");
- if (ConfirmDelete && (ConfirmDelete.nodeValue == 1))
- if (!confirm("Do you want to delete this image?"))
- return;
-
- var Banners = Source.selectNodes("root\/BANNERBASE\/BANNER[@UIN="+sz_Index+"]");
-
- if (Banners.length > 0)
- {
- var Banner = Banners[0];
- Engine.DeleteImageFile (Banner);
- Banner.parentNode.removeChild(Banner);
- }
-
-
- SaveSource();
- CurElement = top.frames[1].event.srcElement;
- Div=CurElement.parentElement.parentElement.parentElement.parentElement.parentElement;
- Div.style.display = "none";
- //Div.outerText="";
- if (!LoadPictures ())
- setTimeout (LoadPictures, 100);
- }
- }
-
- function AccessBanner(sz_Index)
- {
-
- if (Source.readyState == 4)
- {
- var Banner = Source.selectSingleNode("root\/BANNERBASE\/BANNER[@UIN="+sz_Index+"]");
-
- if (Banner != null)
- {
- var sc_Time = "0000000000000000" + Date.parse(new Date());
- sc_Time = sc_Time.substr(sc_Time.length - 16);
-
- Banner.setAttribute("LastAccess", sc_Time);
- SaveSource();
- if (GetSortMode() == 3)
- Engine.UpdateData (null);
- }
- }
- }
-
- function ReplaceCTToTop (newCIN)
- {
- var CTList = Source.selectSingleNode("root/CTLIST");
- var child = Source.selectSingleNode("root\/CTLIST\/CATEGORY[@CID="+newCIN+"]");
- var childOldFirst = CTList.firstChild;
-
- if (child && (child !== childOldFirst))
- {
- CTList.removeChild(child);
- CTList.insertBefore(child, childOldFirst);
- return 1;
- }
- else
- return 0;
- }
-
-
- function SetCategory ()
- {
- var CurrentCT = Source.selectSingleNode("root\/CTLIST\/@CurrentCategory");
- var CIN = top.frames[0].document.all["CT_LIST"].options[top.frames[0].document.all["CT_LIST"].selectedIndex].value;
- if (CurrentCT == null)
- return;
-
- CurrentCT.nodeValue=CIN;
- if ((CIN== "0000000000000000") || (CIN== "0000000000000001"))
- {
- top.frames[0].document.all["btnRenameCT"].src = "renct_d.gif";
- top.frames[0].document.all["btnDelCT"].src = "delct_d.gif";
- top.frames[0].document.all["btnRenameCT"].runtimeStyle.cursor = "default";
- top.frames[0].document.all["btnDelCT"].runtimeStyle.cursor = "default";
- top.frames[0].document.all["btnDelCT"].UpdateButton(1, 0);
- top.frames[0].document.all["btnRenameCT"].UpdateButton(1, 0);
- }
- else
- {
- top.frames[0].document.all["btnRenameCT"].src = "renct_g.gif";
- top.frames[0].document.all["btnDelCT"].src = "delct_g.gif";
- top.frames[0].document.all["btnRenameCT"].runtimeStyle.cursor = "hand";
- top.frames[0].document.all["btnDelCT"].runtimeStyle.cursor = "hand";
- top.frames[0].document.all["btnDelCT"].UpdateButton(0, 0);
- top.frames[0].document.all["btnRenameCT"].UpdateButton(0, 0);
-
- }
-
- // replace current category to the top of the list
- bb = ReplaceCTToTop (CIN);
- // sort/save
- Sort (1);
- // fill category list anew
- if (bb)
- FillCTList ();
- top.focus();
- }
-
-
- function AddCTToList (sz_Name, CID, CurrentCID)
- {
- var objOption= top.frames[0].document.createElement ("OPTION");
- objOption.text = sz_Name;
- objOption.value = CID;
- top.frames[0].document.all["CT_LIST"].options.add (objOption);
- if (CID == CurrentCID)
- objOption.selected=true;
- else
- objOption.selected=false;
- }
-
- function FillCTList ()
- {
- var CTList = Source.getElementsByTagName("root/CTLIST/CATEGORY");
- var CurrentCT = Source.selectSingleNode("root\/CTLIST\/@CurrentCategory");
- var Sel = top.frames[0].document.all.CT_LIST;
-
- while (Sel.options[1])
- Sel.options.remove(1);
-
-
- if (CTList == null)
- return;
-
- for (i=0; i<CTList.length; i++)
- {
- var Category = CTList[i];
- AddCTToList (Category.attributes[1].value, Category.attributes[0].value, CurrentCT == null ? null : CurrentCT.nodeValue);
- }
-
- if ((CurrentCT.nodeValue == "0000000000000000") || (CurrentCT.nodeValue == "0000000000000001"))
- {
- top.frames[0].document.all["btnDelCT"].src = "delct_d.gif";
- top.frames[0].document.all["btnRenameCT"].src = "renct_d.gif";
- top.frames[0].document.all["btnRenameCT"].runtimeStyle.cursor = "default";
- top.frames[0].document.all["btnDelCT"].runtimeStyle.cursor = "default";
- top.frames[0].document.all["btnDelCT"].UpdateButton(1, 0);
- top.frames[0].document.all["btnRenameCT"].UpdateButton(1, 0);
- }
- }
-
-
-
- function LoadPictures()
- {
- var Height = 0;
- var Image;
-
- if (idTimeout)
- idTimeout = 0;
-
-
- DIVs = top.frames[1].document.all.tags("DIV");
- topMargin = top.frames[1].document.body.scrollTop;
- bottomMargin = topMargin + top.frames[1].document.body.clientHeight;
- if (topMargin == bottomMargin)
- return 0;
-
- for (i=1; i < DIVs.length;i++)
- {
- Image = DIVs[i].all.tags("IMG")[0];
- if ((Image) && (!Image.useMap))
- {
- if ((Height+DIVs[i].scrollHeight >= topMargin) && (Height <= bottomMargin))
- {
- Image.src = Image.TEMPSRC;
- }
- else
- {
- Image.src = "";
- }
- }
- Height += DIVs[i].scrollHeight;
- }
-
- return 1;
- }
-
-
-
-
- function DisplayDocument(bFirst)
- {
-
- if ((Source.readyState == 4) && (Style.readyState == 4) && (StyleFirst.readyState == 4))
- {
-
-
- var str;
-
-
-
- if (bFirst)
- {
- top.frames[1].document.all.item("XSLResult").style.display="none";
-
- sz_HTML = Source.transformNode(StyleFirst);
- top.frames[1].document.all.XSLResult.innerHTML = sz_HTML;
- }
- else
- {
- sz_HTML = Source.transformNode(Style);
- top.frames[1].document.all.XSLResult.insertAdjacentHTML("beforeEnd", sz_HTML);
- }
-
- var szText = "";
-
- var MapsToEscape = top.frames[1].document.all.tags("MAP");
- if (MapsToEscape != null)
- {
- for (var Index = MapsToEscape.length - 1; Index >= 0; Index--)
- {
- MapsToEscape[Index].innerHTML = unescape(MapsToEscape[Index].innerHTML);
- }
- }
-
- var MapsToChange = top.frames[1].document.all.tags("MAPTOCHANGE");
- if (MapsToChange != null)
- {
- for (var MapIndex = 0; MapIndex < MapsToChange.length; MapIndex++)
- {
- var AreasToChange = MapsToChange[MapIndex].parentElement.all.tags("AREA");
- if (AreasToChange != null)
- {
- for (var AreaIndex = 0; AreaIndex < AreasToChange.length; AreaIndex++)
- {
- AreasToChange[AreaIndex].target = "_blank";
- }
- }
- MapsToChange[MapIndex].parentElement.outerHTML = MapsToChange[MapIndex].nextSibling.outerHTML;
- MapIndex--; // becouse there is decrement collection length
- }
-
- }
-
-
- if (bFirst)
- top.frames[1].document.all.XSLResult.style.display="block";
-
-
- if (bFirst && (top.frames[1].document.all.tags("DIV").length == 31))
- {
- setTimeout("DisplayDocument(0)", 300);
- }
-
-
- if (bFirst)
- setTimeout(LoadPictures, 50);
-
- }
- }
-
-
- function ChangeXSL(sz_FileName)
- {
- var b_Ok = Style.load(sz_FileName);
-
- StyleFirst.load("first.xsl");
-
- if (!b_Ok)
- alert ("Error loading Image Co-Tracker StyleSheet (" + sz_FileName + ")");
-
-
-
- return b_Ok;
- }
-
- function SetNewBase (NewSourceXML, bMode)
- {
- ElXML = NewSourceXML.createProcessingInstruction('xml', ' version="1.0" encoding="utf-8" ');
- NewSourceXML.insertBefore(ElXML, null);
-
- // insert root element
- var Root = NewSourceXML.createElement("root");
- Root.setAttribute("dbversion","1.0");
- Root.text = "\n\t";
- NewSourceXML.appendChild(Root);
-
- var CtList = NewSourceXML.createElement("CTLIST");
- CtList.setAttribute("CurrentCategory", "0000000000000000");
-
- var CtCommon = NewSourceXML.createElement("CATEGORY");
- CtCommon.setAttribute("CID", "0000000000000001");
- CtCommon.setAttribute("Name", "Common");
- CtCommon.text = "\n";
-
- Root.appendChild(CtList);
- CtList.appendChild(CtCommon);
-
- var BannerBase = NewSourceXML.createElement("BANNERBASE");
-
- BannerBase.setAttribute("OpenMode", "_blank");
- BannerBase.setAttribute("SortOrder", "-@CreationDate");
- if (Engine.Options == -1)
- {
- BannerBase.setAttribute("ShowSlots", "191");
- BannerBase.setAttribute("ConfirmDelete", "0");
- BannerBase.setAttribute("SmallPictures", "0");
- Engine.Options = 191;
- }
- else
- {
- BannerBase.setAttribute("ShowSlots", Engine.Options & 255);
-
- if (Engine.Options & 1024)
- BannerBase.setAttribute("ConfirmDelete", "1");
- else
- BannerBase.setAttribute("ConfirmDelete", "0");
-
- if (Engine.Options & 2048)
- BannerBase.setAttribute("SmallPictures", "1");
- else
- BannerBase.setAttribute("SmallPictures", "0");
- }
-
- BannerBase.text = "\n\t\t";
-
- Root.appendChild(BannerBase);
-
- if (bMode)
- {
- var str = Engine.GetXMLPath();
- if (str)
- {
- var szSrcPath = szProductPath + "\\1.png";
- Engine.CopyImageFile(szSrcPath, str);
- }
-
- // insert banner with link to program's tutorial
- var Banner = NewSourceXML.createElement("BANNER");
-
- Banner.setAttribute("UIN", "0000000000000001");
- Banner.setAttribute("Name", "INTRODUCTION: HOW TO USE IMAGE CO-TRACKER");
- Banner.setAttribute("Image", str + "1.png");
- Banner.setAttribute("Width", "738");
- Banner.setAttribute("Height", "359");
- Banner.setAttribute("Url", "http://cogitum.com/co-tracker/howtouse.html");
- Banner.setAttribute("Map", "");
- Banner.setAttribute("IsMap", "false");
- Banner.setAttribute("Comment", "Launch Microsoft Internet Explorer 5.0 or higher. Click the right " +
- "mouse button on any Internet image, and select the Grab Image option from the pop-up menu. " +
- "Write in comments and select a category if you want, then click OK. To begin work with catalog of " +
- "'grabbed' images, click the Start button and select Image Co-Tracker from the Programs menu. " +
- "For more information, click on the '?' icon on the toolbar.");
- Banner.setAttribute("SourceUrl", "http://cogitum.com/co-tracker/howtouse.html");
- Banner.setAttribute("LastAccess", "0000971160889000");
- Banner.setAttribute("CreationDate", "0000971160889000");
- Banner.setAttribute("IMGNode", "<IMG alt=Cogitum height=52 src="img/h_lhead.gif" width=284>");
- Banner.setAttribute("ID_CATEGORY", "0000000000000001");
-
- BannerBase.appendChild(Banner);
- }
-
- }
-
-
- function ChangeXML()
- {
- var strCaption;
-
- strCaption = Engine.OpenXMLBase (Source, 1, 0);
- if (!strCaption)
- {
- SetNewBase (Source, true);
- strCaption = SaveSource();
- DisplayDocument(1);
- }
- else
- CheckOptions();
-
-
- var SortOrders = Source.getElementsByTagName("root/BANNERBASE/@SortOrder");
- if (SortOrders.length > 0)
- {
- var SortOrder = top.frames[0].document.all.item("SortOrder");
- if (SortOrder != null)
- {
- for (Index = 0; Index < SortOrder.options.length; Index++)
- {
- if (SortOrder.options(Index).value == SortOrders[0].nodeValue)
- SortOrder.options(Index).selected = true;
- }
- }
- }
- else
- top.frames[0].document.all.item("SortOrder").value = "-@CreationDate";
-
- SetCaptionBar (strCaption);
- return strCaption;
- }
-
- function AboutDlg ()
- {
- showModalDialog ("about.htm", Engine, "dialogWidth=500px;dialogHeight=340px;center=yes;border=thin;status=no;scroll=no; help:no;");
- }
-
- function UsePrgDlg ()
- {
- showHelp ('ctrack.chm');
- }
-
- function ChooseCtListDlg ()
- {
- bSave = showModalDialog ("choose.htm", Source, "dialogWidth=530px;dialogHeight=420px;center=yes;border=thin;status=no;scroll=no; help:no;");
- if (bSave)
- {
- SaveSource();
- FillCTList ();
- }
- }
-
-
- function ShowOptions()
- {
-
- var BBase = Source.selectSingleNode("root\/BANNERBASE");
- var ShowSlots = Source.selectSingleNode("root\/BANNERBASE\/@ShowSlots");
- // for previous XML format compatible
- if (ShowSlots == null)
- {
- BBase.setAttribute("ShowSlots", 191);
- ShowSlots = Source.selectSingleNode("root\/BANNERBASE\/@ShowSlots");
- }
- ShowSlotsVal = ShowSlots.nodeValue;
- var ConfirmDelete = Source.selectSingleNode("root\/BANNERBASE\/@ConfirmDelete");
- if (ConfirmDelete == null)
- {
- BBase.setAttribute("ConfirmDelete", 0);
- ConfirmDelete = Source.selectSingleNode("root\/BANNERBASE\/@ConfirmDelete");
- }
- ConfirmDeleteVal = ConfirmDelete.nodeValue;
- var SmallPictures = Source.selectSingleNode("root\/BANNERBASE\/@SmallPictures");
- if (SmallPictures == null)
- {
- BBase.setAttribute("SmallPictures", "0");
- SmallPictures = Source.selectSingleNode("root\/BANNERBASE\/@SmallPictures");
- }
- SmallPicturesVal = SmallPictures.nodeValue;
-
- if (isNaN(ShowSlotsVal))
- ShowSlotsVal = parseInt(ShowSlotsVal, 10);
-
- var RowBitsOld = ShowSlotsVal;
- if (parseInt(ConfirmDeleteVal))
- RowBitsOld=RowBitsOld | 1024;
- if (parseInt(SmallPicturesVal))
- RowBitsOld=RowBitsOld | 2048;
-
-
- RowBits = showModalDialog ("options.htm", RowBitsOld, "dialogWidth:230px; dialogHeight:100px; dialogTop:150px; center:yes; border:thin; status:no; scroll:no; help:no;");
- if (RowBits != RowBitsOld)
- {
- Engine.Options = RowBits;
-
- if (top.frames[1].document.selection)
- top.frames[1].document.selection.empty();
-
- if (RowBits & 1024)
- BBase.setAttribute("ConfirmDelete", 1);
- else
- BBase.setAttribute("ConfirmDelete", 0);
-
-
- if (RowBits & 2048)
- BBase.setAttribute("SmallPictures", 1);
- else
- BBase.setAttribute("SmallPictures", 0);
- BBase.setAttribute("ShowSlots", RowBits & 255);
- Sort(1);
- }
-
- }
-
-
-
- function ChangeXML_XSL(sz_XSLFileName)
- {
- if (ChangeXML())
- if (ChangeXSL(sz_XSLFileName))
- {
- Sort(0);
- return true;
- }
-
- return false;
- }
-
-
- function SetCaptionBar (str)
- {
- if (str != null)
- {
- // set new captionbar
- str = "Image Co-Tracker - " + str;
- top.document.title = str;
- }
- }
-
-
- function Init()
- {
- var str;
-
- IEVersion = window.navigator.appVersion.substring(22, 25);
- //if (IEVersion.charAt(0) != '5')
- //{
- //alert ("This program runs under Microsoft Internet Explorer 5.0 or higher only.");
- //top.close();
- //return;
- //}
-
- var userAgent = navigator.userAgent;
- var MSIEIndex = userAgent.indexOf("MSIE");
- if ((userAgent.indexOf("Win") == -1 )
- || (userAgent.indexOf("MSIE") == -1)
- || userAgent.substring((MSIEIndex + 5),(MSIEIndex + 6)) < 5)
- {
- alert ("This program runs under Microsoft Internet Explorer 5.0 or higher only.");
- top.close();
- return;
- }
-
- if (top.frames[0].document.body.clientHeight == 0)
- return;
-
- Engine.HdWnd = 1;
-
- //fs = new ActiveXObject("Scripting.FilesystemObject");
- //WshShell = new ActiveXObject("WScript.Shell");
-
- Source = new ActiveXObject("Microsoft.XMLDOM");
- Source.async = false;
-
- Style = new ActiveXObject("Microsoft.XMLDOM");
- Style.async = false;
-
- StyleFirst = new ActiveXObject("Microsoft.XMLDOM");
- StyleFirst.async = false;
-
- ChangeXML_XSL(sz_XSLPath);
-
-
- FillCTList ();
-
- FnHead2ScreenSize();
- }
-
- //===================================================================================================================================================
- //========================================== Find functions =========================================================================================
-
- function TFind ()
- {
- top.frames[1].focus();
- Engine.CallIECommand (0);
- }
-
- function OnFind ()
- {
- top.frames[1].focus();
- setTimeout (TFind, 500);
- }
-
- //====================================================================================================================================================
- //========================================== Print functions =========================================================================================
-
- function TPrint ()
- {
- LoadAllPics();
- if (gnImageNum > 0)
- idImgTimer = top.frames[1].setInterval (TWaitLoadImages, 20);
- else
- fnPrint();
- }
-
- function OnPrint ()
- {
- if (ConfirmPrint ())
- {
- top.frames[1].focus();
- top.frames[1].setTimeout (TPrint, 50);
- }
- }
-
- function TWaitLoadImages ()
- {
- if (CheckLoadingPics ())
- fnPrint();
- }
-
-
- function fnPrint ()
- {
- if (idImgTimer)
- {
- top.frames[1].clearInterval(idImgTimer);
- idImgTimer = 0;
- }
- top.frames[1].focus();
- Engine.CallIECommand (1);
- }
-
- function ConfirmPrint ()
- {
- var DIVs = top.frames[1].document.all.tags("DIV");
-
- if ((DIVs.length > 150) && (!confirm ("You want to print more than 150 images. It may cause some troubles. Do you want to continue?")))
- return 0;
- else
- return 1;
- }
-
-
- function CheckLoadingPics ()
- {
- var DIVs = top.frames[1].document.all.tags("DIV");
-
- for (i=1; i < DIVs.length;i++)
- {
- CurImage = DIVs[i].all.tags("IMG")[0];
- if (CurImage && (!CurImage.useMap) && (CurImage.fileSize) && (CurImage.readyState != "complete"))
- {
- return 0;
- }
- }
- return 1;
- }
-
-
- function LoadAllPics ()
- {
- var CurImage;
- var DIVs = top.frames[1].document.all.tags("DIV");
- var NumImg;
-
- NumImg = 0;
- for (i=1; i < DIVs.length;i++)
- {
- CurImage = DIVs[i].all.tags("IMG")[0];
- if (CurImage && (!CurImage.useMap) && (CurImage.fileSize == -1))
- {
- NumImg++;
- CurImage.src = CurImage.TEMPSRC;
- }
- }
- gnImageNum = NumImg;
- }
-
- function fnBeforePrint ()
- {
- var Button;
- var DIVs = top.frames[1].document.all.tags("DIV");
-
- for (i=1; i < DIVs.length;i++)
- {
- Button = DIVs[i].all.tags("INPUT")[0];
- if (Button)
- Button.style.display = "none";
- }
- }
-
-
-
-
- function fnAfterPrint ()
- {
- var Button;
- var DIVs = top.frames[1].document.all.tags("DIV");
-
- for (i=1; i < DIVs.length;i++)
- {
- Button = DIVs[i].all.tags("INPUT")[0];
- if (Button)
- Button.style.display = "";
- }
- }
-
- //============================================Head resize functions======================================================================================
- function FnHead2ScreenSize ()
- {
- if (top.frames[0].document.body)
- top.document.all.tags('FRAMESET')[0].rows = top.frames[0].document.body.scrollHeight + "px, *";
- }
-
-
- function FnHeadResize (HeadFrame)
- {
- if (top.frames[0].document.body)
- top.document.all.tags('FRAMESET')[0].rows = top.frames[0].document.body.scrollHeight + "px, *";
- }
-
-
- //=======================================================================================================================================================
-
- function SetButtonImage(oImg, bGray)
- {
- var CurrentCT;
-
- if (Source == null)
- return;
-
- CurrentCT = Source.selectSingleNode("root\/CTLIST\/@CurrentCategory");
- if (((CurrentCT.nodeValue == "0000000000000000") || (CurrentCT.nodeValue == "0000000000000001")) && ((oImg.id == "btnDelCT") || (oImg.id == "btnRenameCT")))
- return;
-
-
-
-
- if (bGray == 1)
- oImg.src = oImg.graysrc;
- else
- oImg.src = oImg.colorsrc;
- }
-
- function File2Tracker (nCommand)
- {
- var strCaption;
-
- switch (nCommand)
- {
- case @NEW_XMLDB:
- SourceNew = new ActiveXObject("Microsoft.XMLDOM");
- SourceNew.async = false;
- SetNewBase (SourceNew);
- strCaption = Engine.NewXMLBase (SourceNew);
- if (strCaption)
- {
- Source = SourceNew;
- Engine.UpdateData(null);
- }
- break;
-
- case @OPEN_XMLDB:
- SourceNew = new ActiveXObject("Microsoft.XMLDOM");
- SourceNew.async = false;
- strCaption = Engine.OpenXMLBase (SourceNew, 0, 0);
- if (strCaption)
- {
- Source = SourceNew;
- Engine.UpdateData(null);
- }
- break;
-
- case @SAVE_XMLDB:
- strCaption = Engine.SaveAsXMLBase (Source);
- if (strCaption)
- SetCaptionBar(strCaption);
- break;
- }
-
- }
-
-
- function CheckOptions ()
- {
- var BBase = Source.selectSingleNode("root\/BANNERBASE");
- var ShowSlots = Source.selectSingleNode("root\/BANNERBASE\/@ShowSlots");
- var ConfirmDelete = Source.selectSingleNode("root\/BANNERBASE\/@ConfirmDelete");
- var SmallPictures = Source.selectSingleNode("root\/BANNERBASE\/@SmallPictures");
- var CtOptions = Engine.Options;
- var Val;
- var bNoChange = true;
-
- //debugger;
-
-
- if (CtOptions == -1)
- {
- Val = ShowSlots.nodeValue & 255;
- if ((ConfirmDelete) && (ConfirmDelete.nodeValue == 1))
- Val = Val | 1024;
- if ((SmallPictures) && (SmallPictures.nodeValue == 1))
- Val = Val | 2048;
-
- Engine.Options = Val;
- }
- else
- {
- if ((!ShowSlots) || (ShowSlots.nodeValue != (CtOptions & 255)))
- {
- Val = CtOptions & 255;
- BBase.setAttribute("ShowSlots", Val);
- bNoChange = false;
- }
-
- if ((!ConfirmDelete) || (ConfirmDelete.nodeValue != (CtOptions & 1024)))
- {
- if ( CtOptions & 1024 )
- BBase.setAttribute("ConfirmDelete", 1);
- else
- BBase.setAttribute("ConfirmDelete", 0);
- bNoChange = false;
- }
-
-
- if ((!SmallPictures) || (SmallPictures.nodeValue != (CtOptions & 2048)))
- {
- if ( CtOptions & 2048 )
- BBase.setAttribute("SmallPictures", 1);
- else
- BBase.setAttribute("SmallPictures", 0);
- bNoChange = false;
- }
-
- if (bNoChange == false)
- SaveSource();
- }
- }
-
-
- function ExportF ()
- {
- Engine.Export (null);
- }
-
- function ImportF ()
- {
- Engine.Import (null);
- }
-
- function PublishHTML ()
- {
- var HTMLText;
- var strDirName;
-
- str = Engine.GetHTMLName ();
-
- if (str != null)
- {
- strTmp = str;
- strDir = "";
- do
- {
- nPos = strTmp.search (/\\/i);
- if (nPos != -1)
- {
- strTmp = strTmp.substring (nPos+1, strTmp.length);
- strDir = str.substring (0, nPos+strDir.length+1);
- }
- } while (nPos != -1);
-
- nPos = strTmp.search (/\./);
- if (nPos != -1)
- strTmp = strTmp.substring (0, nPos);
- strDir = strDir + strTmp + "_images\\";
- strDirName = strTmp + "_images\\"; // name subdirectory with images
-
-
- var PSlotsOld = Source.selectSingleNode("root\/BANNERBASE\/@PubSlots");
- var BBase = Source.selectSingleNode("root\/BANNERBASE");
-
- if (PSlotsOld == null)
- {
- PSlotsOld = Source.selectSingleNode("root\/BANNERBASE\/@ShowSlots");
- if (PSlotsOld)
- BBase.setAttribute("PubSlots", PSlotsOld.nodeValue);
- else
- {
- BBase.setAttribute("PubSlots", "191");
- PSlotsOld = Source.selectSingleNode("root\/BANNERBASE\/@PubSlots");
- }
- SaveSource();
- }
-
- var PNamesOld = Source.selectSingleNode("root\/BANNERBASE\/@FieldNames");
- if (PNamesOld == null)
- {
- BBase.setAttribute("FieldNames", "1");
- PNamesOld = Source.selectSingleNode("root\/BANNERBASE\/@FieldNames");
- SaveSource();
- }
-
- if (PNamesOld.nodeValue == 1)
- nSlots = PSlotsOld.nodeValue | 1024;
- else
- nSlots = PSlotsOld.nodeValue;
-
- var nSlots = showModalDialog ("pub_opts.htm", nSlots, "dialogWidth:230px; dialogHeight:100px; dialogTop:150px; center:yes; border:thin; status:no; scroll:no; help:no;");
- if (!nSlots)
- return;
-
- if ((nSlots & 191) != PSlotsOld.nodeValue)
- {
- BBase.setAttribute("PubSlots", (nSlots & 191));
- SaveSource();
- }
-
- if ((nSlots & 1024) != PNamesOld.nodeValue)
- {
- if (nSlots & 1024)
- BBase.setAttribute("FieldNames", "1");
- else
- BBase.setAttribute("FieldNames", "0");
- }
-
-
- XSL4HTML = new ActiveXObject("Microsoft.XMLDOM");
- XSL4HTML.load("htm.xsl");
- HTMLText = Source.transformNode(XSL4HTML);
- top.frames[2].document.all.XSLResult.innerHTML = HTMLText;
-
- var MapsToEscape = top.frames[2].document.all.tags("MAP");
- if (MapsToEscape != null)
- {
- for (var Index = MapsToEscape.length - 1; Index >= 0; Index--)
- MapsToEscape[Index].innerHTML = unescape(MapsToEscape[Index].innerHTML);
- }
-
- var MapsToChange = top.frames[2].document.all.tags("MAPTOCHANGE");
- if (MapsToChange != null)
- {
- for (var MapIndex = 0; MapIndex < MapsToChange.length; MapIndex++)
- {
- var AreasToChange = MapsToChange[MapIndex].parentElement.all.tags("AREA");
- if (AreasToChange != null)
- {
- for (var AreaIndex = 0; AreaIndex < AreasToChange.length; AreaIndex++)
- AreasToChange[AreaIndex].target = "_blank";
- }
- MapsToChange[MapIndex].parentElement.outerHTML = MapsToChange[MapIndex].nextSibling.outerHTML;
- MapIndex--; // becouse there is decrement collection length
- }
-
- }
-
- var Imgs = top.frames[2].document.all.tags("IMG");
- for (i=0; i<Imgs.length; i++)
- {
- StrSrc = unescape (Imgs[i].src);
- Engine.CopyImageFile (Imgs[i].src, strDir);
- do
- {
- nPos = StrSrc.search ('/');
- if (nPos != -1)
- StrSrc = StrSrc.substring (nPos+1, StrSrc.length);
- } while (nPos != -1);
-
- StrSrc = strDirName + StrSrc;
- Imgs[i].src = StrSrc;
- }
-
- HTMLText = top.frames[2].document.all.XSLResult.innerHTML;
- HTMLText = "<HTML><BODY STYLE='background-color:white'>" + HTMLText + "</BODY></HTML>"
- top.frames[2].document.all.XSLResult.innerHTML = "";
-
- var fso = new ActiveXObject("Scripting.FilesystemObject");
- var fstream = fso.CreateTextFile (str, true, true);
- fstream.Write (HTMLText);
- fstream.Close ();
-
- }
-
- }
-
-
- function fnContextMenuBubble ()
- {
- if (event)
- {
- event.cancelBubble = true;
- event.returnValue = false;
- }
- else
- {
- top.frames[0].event.cancelBubble = true;
- top.frames[0].event.returnValue = false;
- }
-
- return false;
- }
-
-
- function fnContextMenuCheck ()
- {
- if ((top.frames[1].event.srcElement.tagName != "IMG") && (top.frames[1].event.srcElement.tagName != "INPUT"))
- {
- top.frames[1].event.cancelBubble = true;
- top.frames[1].event.returnValue = false;
- return false;
- }
- }
-
-
- function Attach2Email (bPopup)
- {
- //top.frames[0].document.all["btnMail"].UpdateButton(0, 1);
- if (top.frames[0].event)
- {
- x = top.frames[0].event.x;
- y = top.frames[0].event.y;
- }
- else
- {
- x=0;
- y=50;
- }
-
- if (bPopup)
- Engine.MailClientsPopupMenu (1, x, y);
- else
- Engine.MailClientsPopupMenu (0, x, y);
-
- //top.frames[0].document.all["btnMail"].UpdateButton(0, 0);
- top.window.focus();
- }
-
- </SCRIPT>
- </HEAD>
- <FRAMESET BORDER=0 ROWS="40px, *, 0px" ID=Main onload="Init()" oncontextmenu="fnContextMenuBubble()">
- <FRAME FRAMEBORDER=1 SCROLLING=NO SRC=hd.htm APPLICATION="yes" onresize="FnHeadResize (this)" NORESIZE>
- <FRAME FRAMEBORDER=0 SCROLLING=AUTO SRC=data.htm APPLICATION="yes" onresize="LoadPictures()" NORESIZE>
- <FRAME SRC=data.htm style="display:none" APPLICATION="yes" NORESIZE>
- <NOFRAMES> There is no frame support! </NOFRAMES>
- </FRAMESET>
- </HTML>
-