mouseover=true; var CurrentID; var TableMenuHTML; var DesktopMenuHTML; var ClickedTable; var BackorText; var TablePartID; var Resizing=false; var ObjectNum; //RegEx to check it's the right table we're moving TableRE=/^Tab[0-9]+/; //Must be something like Tab1 or Tab12, etc. TabHeaderRE=/TabHeader[0-9]+/; //The header tab ID RegEx; CloseRE=/Close[0-9]+/; //The close button ID RegEx; CloseTabRE=/CloseTab[0-9]+/; //The close table cell ID RegEx; ResizeTabRE=/ResizeTab[0-9]+/; //The resize picture ID RegEx; BodyTabRE=/BodyTab[0-9]+/; //The body tab ID RegEx; TableMenuHTML=""; DesktopMenuHTML="
"; TableMenuHTML=TableMenuHTML+""; TableMenuHTML=TableMenuHTML+""; TableMenuHTML=TableMenuHTML+""; TableMenuHTML=TableMenuHTML+""; TableMenuHTML=TableMenuHTML+""; TableMenuHTML=TableMenuHTML+""; TableMenuHTML=TableMenuHTML+""; TableMenuHTML=TableMenuHTML+""; TableMenuHTML=TableMenuHTML+"
Change Background Colour
Change Text Colour

Send to back
Bring to front
Hide

Refresh
"; DesktopMenuHTML=DesktopMenuHTML+"Change Background Colour"; DesktopMenuHTML=DesktopMenuHTML+"
"; DesktopMenuHTML=DesktopMenuHTML+"Refresh"; DesktopMenuHTML=DesktopMenuHTML+""; function nocontextmenu() { //document.all['test'].visibility="visible"; event.cancelBubble = true, event.returnValue = false; return false; } function coordinates() { CurrentID=String(event.srcElement.id); if (CurrentID!="popupmenu") { document.all['popupmenu'].style.visibility="hidden"; document.oncontextmenu = nocontextmenu; } //if (CurrentID=="Start") //return; if (event.button==2) { } else if (event.button==1) { if (TableRE.test(CurrentID) || TabHeaderRE.test(CurrentID) || CloseTabRE.test(CurrentID)) { if (TableRE.test(CurrentID)) ParentID=String("Parent" + CurrentID); else if (TabHeaderRE.test(CurrentID)) ParentID=String("ParentTab" + CurrentID.substr("TabHeader".length,CurrentID.length-"TabHeader".length)); else if (CloseTabRE.test(CurrentID)) ParentID=String("ParentTab" + CurrentID.substr("CloseTab".length,CurrentID.length-"CloseTab".length)); RaiseTab(ParentID); Obj=new Object(document.all[ParentID].style); BasicObj=new Object(document.all[ParentID]); mouseover=true; pleft=Obj.pixelLeft; ptop=Obj.pixelTop; xcoor=event.clientX;//-document.all['BodyLayer'].style.left; ycoor=event.clientY;//-document.all['BodyLayer'].style.top; document.onmousemove=moveImage; } else if (ResizeTabRE.test(CurrentID)) { if (ResizeTabRE.test(CurrentID)) { ObjectNum=CurrentID.substr("ResizeTab".length,CurrentID.length-"ResizeTab".length); ParentID=String("ParentTab" + ObjectNum.toString()); ParentBodyID=String("BodyTab" + ObjectNum.toString()); NewsContainer=String("newscontainer" + ObjectNum.toString()); } RaiseTab(ParentID); Obj=new Object(document.all[ParentID].style); BasicObj=new Object(document.all[ParentID]); BodyObj=new Object(document.all[ParentBodyID].style); BasicBodyObj=new Object(document.all[ParentBodyID]); //alert("Hello"); if (document.all[NewsContainer]!=null) { NewsContainerObj=new Object(document.all[NewsContainer].style); NewsContainerBasicObj=new Object(document.all[NewsContainer]); } mouseover=true; pleft=Obj.pixelLeft; ptop=Obj.pixelTop; xcoor=event.clientX; ycoor=event.clientY; Resizing=true; document.onmousemove=moveImage; } else { return; } } } function moveImage() { if (ResizeTabRE.test(CurrentID) && Resizing) { Obj.pixelWidth=BasicObj.offsetWidth+(event.clientX-xcoor); BodyObj.pixelHeight=BasicBodyObj.offsetHeight+(event.clientY-ycoor); if (document.all[NewsContainer]!=null) { NewsContainerObj.pixelWidth=Obj.pixelWidth-8; NewsContainerObj.pixelHeight=BodyObj.pixelHeight-2; } xcoor=event.clientX; ycoor=event.clientY; document.all['coords'].innerHTML="X: " + BasicObj.offsetWidth + "
Y: " + BasicObj.offsetHeight; document.all['coords'].style.zIndex=1; document.all['coords'].style.pixelLeft=event.clientX; document.all['coords'].style.pixelTop=event.clientY+20; document.all['coords'].style.visibility="visible"; return false; } else if (mouseover&&event.button==1) { Obj.pixelLeft=pleft+event.clientX-xcoor; Obj.pixelTop=ptop+event.clientY-ycoor; document.all['coords'].innerHTML="X: " + BasicObj.offsetLeft + "
Y: " + BasicObj.offsetTop; document.all['coords'].style.zIndex=1; document.all['coords'].style.pixelLeft=event.clientX; document.all['coords'].style.pixelTop=event.clientY+20; document.all['coords'].style.visibility="visible"; return false; } } function mouseup() { Resizing=false; CurrentID=String(event.srcElement.id); if ((CurrentID=="LeftPanel") || (CurrentID=="Body")) CurrentID="Desktop"; if (event.button==1 && CurrentID!="Desktop" && CurrentID!="popupmenu") { document.all['coords'].style.visibility="hidden"; mouseover=false; if (TableRE.test(CurrentID)) Obj.zIndex=1; } else if (event.button==2) { if (TableRE.test(CurrentID) || TabHeaderRE.test(CurrentID) || BodyTabRE.test(CurrentID)) { TablePartID=CurrentID; ClickedTable="ParentTab"+CurrentID.substr("ParentTab".length,CurrentID.length-"ParentTab".length); document.all['popupmenu'].innerHTML=TableMenuHTML; document.all['popupmenu'].style.zIndex=1; document.all['popupmenu'].style.pixelLeft=event.clientX;//-document.all['Desktop'].style.pixelLeft; document.all['popupmenu'].style.pixelTop=event.clientY;//-document.all['Desktop'].style.pixelTop; document.all['popupmenu'].style.visibility="visible"; } else // if (CurrentID=="Desktop" || ) { if (CurrentID!="" && CurrentID!="Desktop") { TablePartID=CurrentID; document.all['popupmenu'].innerHTML=DesktopMenuHTML; document.all['popupmenu'].style.zIndex=1; document.all['popupmenu'].style.pixelLeft=event.clientX;//-document.all['Desktop'].style.pixelLeft; document.all['popupmenu'].style.pixelTop=event.clientY;//-document.all['Desktop'].style.pixelTop; document.all['popupmenu'].style.visibility="visible"; } } } } document.oncontextmenu = nocontextmenu; //Hide the default IE right-click popup menu document.onmousedown=coordinates; document.onmouseup=mouseup; function ShowColourTable() { document.all['popupmenu'].style.visibility="hidden"; document.all['colourtable'].style.zIndex=1; document.all['colourtable'].style.pixelLeft=document.all['popupmenu'].style.pixelLeft;//-document.all['BodyLayer'].style.pixelLeft; document.all['colourtable'].style.pixelTop=document.all['popupmenu'].style.pixelTop;//-document.all['BodyLayer'].style.pixelTop; document.all['colourtable'].style.visibility="visible"; } function SetColour(Colour) { if (BackorText=="Back") { document.all[TablePartID].style.backgroundColor=Colour; if (TabHeaderRE.test(TablePartID)) { //change the colour of the close picture background as well TempID="CloseTab"+TablePartID.charAt(TablePartID.length-1); document.all[TempID].style.backgroundColor=Colour; //change the colour of the move picture background as well TempID="MoveTab"+TablePartID.charAt(TablePartID.length-1); document.all[TempID].style.backgroundColor=Colour; document.all['Cell'+TablePartID].style.backgroundColor=Colour;//parent.left.document.all[TablePartID].style.backgroundColor=Colour; } } else if (BackorText=="Text") { document.all[TablePartID].style.color=Colour; if (TabHeaderRE.test(TablePartID)) { document.all['Link' + TablePartID].style.color=Colour;//parent.left.document.all['Link' + TablePartID].style.color=Colour; } } } function CloseTab(Which) //Close the table (Just hide it) { if (Which=="FromMenu") document.all[ClickedTable].style.visibility="hidden"; else document.all[Which].style.visibility="hidden"; } function RaiseTab(Which) //If the table is clicked on, send it to the front. { if (Which=="FromMenu") Which=ClickedTable; document.all[Which].style.zIndex=1; } function LowerTab(Which) //If the table is clicked on, send it to the front. { if (Which=="FromMenu") Which=ClickedTable; document.all[Which].style.zIndex=0; } function ChangePic(OldPic,NewSrc) { document.all[OldPic].src=NewSrc; } function ShowHideTable(Table) { if (document.all[Table].style.visibility=='visible') document.all[Table].style.visibility='hidden'; else { RaiseTab(Table); document.all[Table].style.visibility='visible'; } } function delay(gap) /* gap is in millisecs */ { var then,now; then=new Date().getTime(); now=then; while((now-then)