/* COPYRIGHT 2008 PEAKEY ENTERPRISE LLC HTTP://WWW.PEAKEY.COM/ */ function Disable_And_Submit(btn) { btn.disabled=true; var objHiddenField = document.createElement('input'); objHiddenField.setAttribute('id', 'hidden_postback_' + btn.id); objHiddenField.setAttribute('type', 'hidden'); objHiddenField.setAttribute('name', btn.name); objHiddenField.setAttribute('value', 'SELECTED'); if (typeof(btn.form) != 'undefined') { if (btn.form != null) { btn.form.appendChild(objHiddenField); btn.form.submit(); return; } } window.status = 'No Form Found to Submit'; } function Pop_Site(strURL) { var objWindow; objWindow = window.open(strURL, '', 'height=200,width=150'); if (window.focus) { objWindow.focus(); } return false; } /* ***************************************************************************************************************** ***************************************************************************************************************** ******XML PARSER CLASS******************************************************************************************* ***************************************************************************************************************** */ if (typeof(DOMParser) == 'undefined') { DOMParser = function(){}; DOMParser.prototype.parseFromString = function(str, contentType) { if (typeof ActiveXObject != 'undefined') { var d = new ActiveXObject('MSXML.DomDocument'); d.loadXML(str); return d; } else if (typeof XMLHttpRequest != 'undefined') { var req = new XMLHttpRequest; req.open('GET', 'data:' + (contentType || 'application/xml') + ';charset=utf-8,' + encodeURIComponent(str), false); if (req.overrideMimeType) { req.overrideMimeType(contentType); } req.send(null); return req.responseXML; } } } function PeakeyJSClass_XMLParser(xmlDocument) { this.xmlDoc = null; this.getXMLDocument = function() { return this.xmlDoc; } this.createDocument = function(strXML, strContentType) { var xmlDOC; var parser = new DOMParser(); xmlDOC = parser.parseFromString((strXML || ''), (strContentType || 'text/xml')); parser = null; return xmlDOC; } this.createTextNode = function(strNodeTag, strNodeText) { var xmlNode = this.xmlDoc.createElement(strNodeTag); var xmlText = this.xmlDoc.createTextNode(strNodeText); xmlNode.appendChild(xmlText); return xmlNode; } this.getElementsByTagName = function(TagName) { if (this.xmlDoc) { return this.xmlDoc.documentElement.getElementsByTagName(TagName); } return null; } this.getNodeValue = function(xmlNode) { if (xmlNode) { if (xmlNode.firstChild) { if (xmlNode.firstChild.nodeValue) { return xmlNode.firstChild.nodeValue; } } } return ' '; } this.selectNodes = function(XPath, xmlRootNode) { if (this.xmlDoc) { var strPath = XPath; var strTokens = XPath.split('/'); strPath = strPath.substring(strTokens[0].length + 1); var xmlDocEl = xmlRootNode; if (!xmlRootNode) { xmlDocEl = this.xmlDoc.documentElement; if (xmlDocEl.nodeName == strTokens[0]) { if (strTokens.length == 1) { return xmlDocEl; } else { var xmlTemp = this.selectNodes(strPath, xmlDocEl); if (xmlTemp) { return xmlTemp.childNodes; } else { return null; } } } else { return null; } } var intCounter; var xmlDocOUT = this.createDocument(); var xmlRoot = xmlDocOUT.documentElement; for (intCounter = 0; intCounter < xmlDocEl.childNodes.length; intCounter++) { if (xmlDocEl.childNodes[intCounter].nodeName == strTokens[0]) { if (strTokens.length == 1) { xmlRoot.appendChild(xmlDocEl.childNodes[intCounter].cloneNode(true)); } else { var xmlChildrenDoc = this.selectNodes(strPath, xmlDocEl.childNodes[intCounter]); if (xmlChildrenDoc) { if (xmlChildrenDoc.childNodes.length > 0) { var intSubCounter; for (intSubCounter = 0; intSubCounter < xmlChildrenDoc.childNodes.length; intSubCounter++) { xmlRoot.appendChild(xmlChildrenDoc.childNodes[intSubCounter].cloneNode(true)); } } } } } } return xmlRoot; } return null; } this.Get_XML_Field = function(record, TagName) { if (record.getElementsByTagName(TagName)[0]) { if (record.getElementsByTagName(TagName)[0].firstChild) { return record.getElementsByTagName(TagName)[0].firstChild.nodeValue; } } return ''; } if (xmlDocument) { this.xmlDoc = xmlDocument; } else { this.xmlDoc = this.createDocument(); } } var _Komodo_XMLRequest = new PeakeyJSClass_XMLRequset; /* ***************************************************************************************************************** ***************************************************************************************************************** ******XML REQUEST CLASS****************************************************************************************** ***************************************************************************************************************** */ function PeakeyJSClass_XMLRequset() { this.ROOT_URL = ''; this.Queue = new Array(); this.XMLRequest = null; this.Send_Request = function(url, send, callBackFunction) { var intIndex = this.Queue.length; this.Queue[intIndex] = new Object; this.Queue[intIndex].url = url; this.Queue[intIndex].send = send; this.Queue[intIndex].callBackFunction = callBackFunction; this.Check_Request_Queue(); } this.Check_Request_Queue = function() { if ((_Komodo_XMLRequest.XMLRequest == null) && (_Komodo_XMLRequest.Queue.length > 0)) { var url, send; url = _Komodo_XMLRequest.Queue[0].url; send = _Komodo_XMLRequest.Queue[0].send; if (window.XMLHttpRequest) { _Komodo_XMLRequest.XMLRequest = new XMLHttpRequest(); _Komodo_XMLRequest.XMLRequest.onreadystatechange = _Komodo_XMLRequest.processReqChange; } else if (window.ActiveXObject) { this.XMLRequest = new ActiveXObject("Microsoft.XMLHTTP"); if (_Komodo_XMLRequest.XMLRequest) { _Komodo_XMLRequest.XMLRequest.onreadystatechange = _Komodo_XMLRequest.processReqChange; } } _Komodo_XMLRequest.XMLRequest.open("POST", _Komodo_XMLRequest.ROOT_URL + url, true); _Komodo_XMLRequest.XMLRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); _Komodo_XMLRequest.XMLRequest.setRequestHeader("Cache-Control", "no-cache"); _Komodo_XMLRequest.XMLRequest.setRequestHeader("Pragma", "no-cache"); _Komodo_XMLRequest.XMLRequest.send(send); } } this.processReqChange = function() { var intReadyState = 0; if (typeof(_Komodo_XMLRequest.XMLRequest) == 'undefined') { intReadyState = 4; } else if (_Komodo_XMLRequest.XMLRequest == null) { intReadyState = 4; } else if (typeof(_Komodo_XMLRequest.XMLRequest.readyState) == 'undefined') { intReadyState = 4; } else if (_Komodo_XMLRequest.XMLRequest.readyState) { intReadyState = _Komodo_XMLRequest.XMLRequest.readyState; } else { intReadyState = 4; } if (intReadyState == 4) { if (typeof(_Komodo_XMLRequest.Queue[0].callBackFunction) != 'undefined') { if (_Komodo_XMLRequest.Queue[0].callBackFunction != null) { _Komodo_XMLRequest.Queue[0].callBackFunction(_Komodo_XMLRequest.XMLRequest.responseXML, _Komodo_XMLRequest.XMLRequest.responseText, _Komodo_XMLRequest.XMLRequest.status, _Komodo_XMLRequest.XMLRequest.statusText); } } _Komodo_XMLRequest.Queue.splice(0, 1); _Komodo_XMLRequest.XMLRequest = null; } _Komodo_XMLRequest.Check_Request_Queue(); } }