//***************** Vars *******************// var fdElement = ''; var prevPopupID = false; //***************** Show and Hide Popup *******************// var IE = document.all?true:false if (!IE) document.captureEvents(Event.MOUSEMOVE) var tmpMouseX = 0 var tmpMouseY = 0 var MouseX = 0 var MouseY = 0 var clickX = 0 var clickY = 0 var scrnX = 0 var scrnY = 0 document.onmousemove = getMouseXY; function getMouseXY(e) { if (IE) { try { tmpMouseX = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft tmpMouseY = event.clientY + document.body.scrollTop + document.documentElement.scrollTop } catch(e) { } scrnX = event.screenX; scrnY = event.screenY; } else { tmpMouseX = e.pageX tmpMouseY = e.pageY scrnX = e.screenX; scrnY = e.screenY; } if (scrnX < 0){scrnX = 0} if (scrnY < 0){scrnY = 0} if (tmpMouseX < 0){tmpMouseX = 0} if (tmpMouseY < 0){tmpMouseY = 0} MouseX = parseInt(tmpMouseX) MouseY = parseInt(tmpMouseY) return true } function getPageScroll() { var scrollY = 0; if (self.pageYOffset) { scrollY = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict scrollY = document.documentElement.scrollTop; } else if (document.body) { // all other Explorers scrollY = document.body.scrollTop; } return scrollY; } function showFixedPopup(hoverPopupID) { hidePrevPopup(hoverPopupID); hp = document.getElementById(hoverPopupID); if(clickX==0) clickX = MouseX; if(clickY==0) clickY = MouseY; var tmpClickX = screen.width * .28; var tmpClickY = (screen.height * .15) + getPageScroll(); hp.style.top = (tmpClickY - 15) + "px"; hp.style.left = (tmpClickX + 20) + "px"; hp.style.visibility = "Visible"; } function showCustomPopup(hoverPopupID, x, y) { hidePrevPopup(hoverPopupID); hp = document.getElementById(hoverPopupID); hp.style.top = y + "px"; hp.style.left = x + "px"; hp.style.visibility = "Visible"; } function showPopup(hoverPopupID) { hidePrevPopup(hoverPopupID); hp = document.getElementById(hoverPopupID); if(clickX==0) clickX = MouseX; if(clickY==0) clickY = MouseY; hp.style.top = (clickY - 30) + "px"; hp.style.left = (clickX + 30) + "px"; hp.style.visibility = "Visible"; } function hidePopup(hoverPopupID) { hp = document.getElementById(hoverPopupID); hp.style.visibility = "Hidden"; if(hidePopupTimeout != false) { clearTimeout(hidePopupTimeout); hidePopupTimeout = false; } } function hidePrevPopup(hoverPopupID) { if(prevPopupID != false) { try { document.getElementById(prevPopupID).style.visibility = 'hidden'; } catch(e) {} } prevPopupID = hoverPopupID; if(hidePopupTimeout != false) { clearTimeout(hidePopupTimeout); hidePopupTimeout = false; } } function setBgDefault() { if(fdElement != '') { document.getElementById(fdElement).style.backgroundColor = "#FFFFFF"; fdElement = ''; } } function setBgSelected(elementID) { if(fdElement != '') setBgDefault(); document.getElementById(elementID).style.backgroundColor = "#CCCCCC"; fdElement = elementID; } //****************** FCK Editor Content ***********************// function getFckEditorContent(fieldName) { var fieldValue = FCKeditorAPI.GetInstance(fieldName).GetXHTML(); //fieldValue = escape(fieldValue); return fieldValue; } //*********** AJAX Object *************// var ajxReq, ajxVarHandleHttpResponse; var ajxDivID, ajxListName, ajxFrmName, ajxModuleDir; var globalUrl = "http://www.elesbuilding.co.uk/Global"; function DsAjax() { var ajxUrl, ajxMethod, ajxParams, varHandleHttpResponse, ajxFrmName; this.initAjaxRequest = function () { this.ajxUrl = ""; this.ajxMethod = "GET"; this.ajxParams = ""; ajxVarHandleHttpResponse = eval("this.defaultGetResponseData"); if(window.XMLHttpRequest) ajxReq = new XMLHttpRequest(); else if (window.ActiveXObject) ajxReq = new ActiveXObject("Microsoft.XMLHTTP"); else alert("Your browser does not support XmlHttp"); }; this.setAjaxUrl = function (ajxUrl) {this.ajxUrl = ajxUrl;}; this.setAjaxMethod = function (ajxMethod) {this.ajxMethod = ajxMethod;}; this.setAjaxParams = function (ajxParams) {this.ajxParams = ajxParams;}; this.setQueryString = function (queryString) {this.ajxParams = queryString;}; this.setFinalReadyStateFunction = function (varHandleHttpResponse) {ajxVarHandleHttpResponse = eval(varHandleHttpResponse)}; this.setDivID = function (divID) {ajxDivID = divID;}; this.setAjaxParamsByForm = function (frm) { var params = ""; var paramArr = "document." + frm + ".elements"; paramArr = eval(paramArr); paramArrLen = paramArr.length; for(var i=0; i"; setTimeout("document.getElementById('" + element + "').innerHTML=' '", 2000); typeof(hideElement!= "undefined") { hidePopupTimeout = setTimeout("hidePopup('" + hideElement + "')", 2000); } } function resetTimoutMessage(element) { setTimeout("document.getElementById('" + element + "').innerHTML=' '", 2000); } function findElementPosition(elementObj) { var curleft =0 var curtop = 0 if (elementObj.offsetParent) { curleft = elementObj.offsetLeft curtop = elementObj.offsetTop while (elementObj = elementObj.offsetParent) { curleft += elementObj.offsetLeft curtop += elementObj.offsetTop } } return [curleft,curtop]; }