//***************** Vars *******************// var fdElement = ''; var ckContentField = 'content'; //***************** 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) { tmpMouseX = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft tmpMouseY = event.clientY + document.body.scrollTop + document.documentElement.scrollTop 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, x, y) { if(x==undefined) x = 0; if(y==undefined) y = 0; hp = document.getElementById(hoverPopupID); var scrollY = getPageScroll(); var tmpClickX = parseInt((screen.width-x) * .5); var tmpClickY = parseInt(scrollY + (screen.height - y) * .30); hp.style.top = (tmpClickY) + "px"; hp.style.left = (tmpClickX) + "px"; hp.style.visibility = "Visible"; } function showCustomPopup(hoverPopupID, x, y) { hp = document.getElementById(hoverPopupID); hp.style.top = y + "px"; hp.style.left = x + "px"; hp.style.visibility = "Visible"; } function showPopup(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) { //alert(hoverPopupID); hp = document.getElementById(hoverPopupID); hp.style.visibility = "Hidden"; } 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; } //****************** Editor Content ***********************// function getCkEditorContent(fieldName) { var fieldValue = CKEDITOR.instances[fieldName].getData(); return fieldValue; } 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.stfillanscc.org.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