var tt_nBrowserType=1; function TT_Document() { this.GetLastKey = tt_GetLastKey; this.bRButton = false; this.nMouseX = 0; this.nMouseY = 0; this.strStyles = ""; this.strDiv = ""; this.GetMouseKoord = tt_GetMouseKoord; this.GetX = tt_GetX; this.GetY = tt_GetY; this.IsRButton = tt_IsRButton; this.SetLayerPos = tt_SetLayerPos; this.SetLayerX = tt_SetLayerX; this.SetLayerY = tt_SetLayerY; this.GetLayerX = tt_GetLayerX; this.GetLayerY = tt_GetLayerY; this.SetLayerVisible = tt_SetLayerVisible; this.Write = tt_Write; this.WriteLayer = tt_WriteLayer; this.SetMouseEvent = tt_SetMouseEvent; this.GetDoc = tt_GetDoc; this.SetImage = tt_SetImage; this.SetClipBounds = tt_SetClipBounds; this.SetIndex = tt_SetIndex; this.MoveImage = tt_MoveImage; this.GetLayerHeight = tt_GetLayerHeight; this.GetLayerWidth = tt_GetLayerWidth; this.GetTextFieldValue = tt_GetTextFieldValue; this.SetTextFieldValue = tt_SetTextFieldValue; this.WriteStyles = tt_WriteStyles; this.nOffsetX = 0; this.nOffsetY = 0; this.SetMouseOffset = tt_SetMouseOffset; this.strContainer=""; this.strImg=""; this.Checked = tt_Checked; this.GetRadioSel = tt_GetRadioSel; } function tt_SetMouseOffset(strContainer,strImg) { if(document.layers[strImg]) { this.nOffsetX=document.layers[strImg].pageX; this.nOffsetY=document.layers[strImg].pageY; if(this.nOffsetX==0&&this.nOffsetY==0) { this.strContainer=strContainer; this.strImg=strImg; } else { //alert(this.nOffsetX+" "+this.nOffsetY); this.strContainer=""; this.strImg=""; } } } function tt_WriteStyles() { this.Write(""); this.Write(this.strDiv); this.strDiv=""; this.strStyles=""; } function tt_GetMouseKoord(e) { if(this.strContainer||this.strImg) this.SetMouseOffset(this.strContainer,this.strImg); this.nMouseX=e.pageX-this.nOffsetX; this.nMouseY=e.pageY-this.nOffsetY; this.bRButton=(e.which==3); } function tt_GetX() { return this.nMouseX; } function tt_GetY() { return this.nMouseY; } function tt_IsRButton() { return this.bRButton; } function tt_SetLayerPos(nX,nY,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3,true); doc.left=nX; doc.top=nY; } function tt_SetLayerX(nPos,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3,true); doc.left=nPos; } function tt_SetLayerY(nPos,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3,true); doc.top=nPos; } function tt_SetLayerVisible(bShow,strName1,strName2,strName3) { var strValue=(bShow?"show":"hide"); var doc=this.GetDoc(strName1,strName2,strName3,true); doc.visibility=strValue; } function tt_GetLayerY(strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3,true); return doc.top; } function tt_GetLayerX(strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3,true); return doc.left; } function tt_Write(strValue,bToString) { if(bToString) { var strLower=strValue.toLowerCase(); if(strLower.indexOf("=0) this.strDiv+=strValue; else this.strStyles+=strValue; } else { document.write(strValue); } } function tt_WriteLayer(strValue,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3); doc.open(); doc.write(strValue); doc.close(); } function tt_SetMouseEvent(strEvent,func,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3); if(strEvent=="MOUSEDOWN") { doc.captureEvents(Event.MOUSEDOWN); doc.onmousedown = func; } else if(strEvent=="DBLCLICK") { doc.captureEvents(Event.DBLCLICK); doc.ondblclick = func; } else if(strEvent=="MOUSEUP") { doc.captureEvents(Event.MOUSEUP); doc.onmouseup = func; } else if(strEvent=="MOUSEMOVE") { doc.captureEvents(Event.MOUSEMOVE); doc.onmousemove = func; } else if(strEvent=="MOUSEOUT") { doc.captureEvents(Event.MOUSEOUT); doc.onmouseout = func; } else if(strEvent=="MOUSEOVER") { doc.captureEvents(Event.MOUSEOVER); doc.onmouseover = func; } else if(strEvent=="KEYPRESS") { doc.captureEvents(Event.KEYPRESS); doc.onkeypress = func; } } function tt_GetDoc(strName1,strName2,strName3,bOnlyLayer) { //if (!document.layers[strName1]) alert('test'); if(strName3) { if(bOnlyLayer) return document.layers[strName1].document.layers[strName2].document.layers[strName3]; else return document.layers[strName1].document.layers[strName2].document.layers[strName3].document; } else if(strName2) { if(bOnlyLayer) return document.layers[strName1].document.layers[strName2]; else return document.layers[strName1].document.layers[strName2].document; } else if(strName1) { if(bOnlyLayer) return document.layers[strName1]; else return document.layers[strName1].document; } return document; } function tt_SetImage(strImage,strImageName,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3); doc.images[strImageName].src=strImage; } function tt_SetClipBounds(nLeft,nTop,nRight,nBottom,strName1,strName2,strName3,strDummy) { var doc=this.GetDoc(strName1,strName2,strName3,true); doc.clip.height=nBottom; doc.clip.width=nRight; } function tt_SetIndex(nIndex,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3,true); doc.zIndex=nIndex; } function tt_MoveImage(nTop,nLeft,nOffsetX,nOffsetY,strName1,strName2,strName3) { this.SetLayerX(nTop+nOffsetX,strName1,strName2,strName3); this.SetLayerY(nLeft+nOffsetY,strName1,strName2,strName3); } function tt_GetLayerWidth(strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3,true); return doc.clip.width; } function tt_GetLayerHeight(strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3,true); return doc.clip.height; } function tt_GetTextFieldValue(strForm,strField,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3); return doc.forms[strForm].elements[strField].value; } function tt_Checked(strForm,strField,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3); return doc.forms[strForm].elements[strField].checked; } function tt_SetTextFieldValue(strValue,strForm,strField,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3); doc.forms[strForm].elements[strField].value=strValue; } function tt_GetLastKey(e) { return e.which; } function tt_GetRadioSel(strForm,strField,strName1,strName2,strName3) { var doc=this.GetDoc(strName1,strName2,strName3); var nCount=doc.forms[strForm].elements[strField].length; var i; for(i=0;i