﻿/* Stenstrom.NET Library v10.03 */
/* CONSTANTS 					*/
var ELEMENT_NODE=1;var ATTRIBUTE_NODE=2;var TEXT_NODE=3; var CDATA_SECTION_NODE=4;var ENTITY_REFERENCE_NODE=5;var ENTITY_NODE=6;var PROCESSING_INSTRUCTION_NODE=7;var COMMENT_NODE=8;var DOCUMENT_NODE=9;var DOCUMENT_TYPE_NODE=10;var DOCUMENT_FRAGMENT_NODE=11;var NOTATION_NODE=12;var HTTP_OK=200;var HTTP_Created=201;var HTTP_Accepted=202;var HTTP_NoContent=204;var HTTP_ResetContent=205;var HTTP_BadRequest=400;var HTTP_Unauthorized=401;var HTTP_NotFound=404;var HTTP_MethodNotAllowed=405;var HTTP_NotAcceptable=406;var HTTP_RequestTimeout=408;var HTTP_RequestURITooLong=414;var HTTP_UnsupportedMediaType=415;var HTTP_InternalServerError=500;var HTTP_NotImplemeted=501;var HTTP_BadGateway=502;var HTTP_ServiceUnavailable=503;var HTTP_GatewayTimeout=504;var ANY_TYPE=1;var NUMBER_TYPE=2;var STRING_TYPE=3;var BOOLEAN_TYPE=4;var UNORDERED_NODE_ITERATOR_TYPE=4;var ORDERED_NODE_ITERATOR_TYPE=5;var UNORDERED_NODE_SNAPSHOT_TYPE=6;var ORDERED_NODE_SNAPSHOT_TYPE=7;var ANY_UNORDERED_NODE_TYPE=8;var FIRST_ORDERED_NODE_TYPE=9;
/* Base Object Definition       */
if(!window.Stenstrom){var Stenstrom={}};if(!Stenstrom.NET){Stenstrom.NET={}};if(!Stenstrom.NET.System){Stenstrom.NET.System={}};if(!Stenstrom.NET.Web){Stenstrom.NET.Web={}};if(!Stenstrom.NET.Web.Xml){Stenstrom.NET.Web.Xml={}};if(!Stenstrom.NET.Web.UI){Stenstrom.NET.Web.UI={}};if(!window.Spade){var Spade={}};if(!Spade.DataManagers){Spade.DataManagers={}};Stenstrom.NET.System.Object=function(){this.Type="Stenstrom.NET.System.Object";this.toString=function(){return(this.Type)};this.valueOf=function(){return(this.Type)};this.IsMSIE=(navigator.userAgent.indexOf("MSIE")!=-1);this.ActiveXSupport=(window.ActiveXObject!=undefined);this.ActiveXEnabled=(function(){if(!(window.ActiveXObject!=undefined))return false;try{var objTest=new ActiveXObject("MSXML2.DOMDocument");if(objTest!=null&&typeof(objTest)!=='undefined')return true}catch(err){return false}})();this.getGUID=function(){var guid="";var randomNo=Math.random();var miliseconds=(new Date()).valueOf()+"";miliseconds+=(new Date()).valueOf();var alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var i=0;i<=7;i++){var flag=Math.random()*10;if(flag<3){var idxPos=(flag*10)/4;guid+=alphabet.substr(idxPos,1)}else{var idxPos=(flag*10)/7;guid+=miliseconds.substr(idxPos,1)}}guid+="-";for(var i=0;i<=3;i++){var flag=Math.random()*10;if(flag<3){var idxPos=(flag*10)/4;guid+=alphabet.substr(idxPos,1)}else{var idxPos=(flag*10)/7;guid+=miliseconds.substr(idxPos,1)}}guid+="-";for(var i=0;i<=3;i++){var flag=Math.random()*10;if(flag<3){var idxPos=(flag*10)/4;guid+=alphabet.substr(idxPos,1)}else{var idxPos=(flag*10)/7;guid+=miliseconds.substr(idxPos,1)}}guid+="-";for(var i=0;i<=3;i++){var flag=Math.random()*10;if(flag<5){var idxPos=(flag*10)/4;guid+=alphabet.substr(idxPos,1)}else{var idxPos=(flag*10)/7;guid+=miliseconds.substr(idxPos,1)}}guid+="-";for(var i=0;i<=11;i++){var flag=Math.random()*10;if(flag<3){var idxPos=(flag*10)/4;guid+=alphabet.substr(idxPos,1)}else{var idxPos=(flag*10)/7;guid+=miliseconds.substr(idxPos,1)}}return(guid)}};
/* Core Functions Definition    */
String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};String.prototype.ltrim=function(){return this.replace(/(^\s*)/g,"")};String.prototype.rtrim=function(){return this.replace(/(\s*$)/g,"")};String.prototype.isEmpty=function(){if("undefined"==typeof(this))return(true);if(undefined==this)return(true);if(null==this)return(true);var sValue=this.trim();if(sValue.length>0)return(false);else return(true)};String.prototype.isPhone=function(){var pattern=/^(\(?\d\d\d\)?)?( |-|\.)?\d\d\d( |-|\.)?\d{4,4}(( |-|\.)?[ext\.]+ ?\d+)?$/;if(this.trim().match(pattern)!=null)return(true);else return(false)};String.prototype.isZipCode=function(){var pattern=/^\d{5}(-\d{4})?$/;if(this.trim().match(pattern)!=null)return(true);else return(false)};String.prototype.isEmail=function(){var pattern=/^([\w-]+\.)*?[\w-]+@[\w-]+\.([\w-]+\.)*?[\w]+$/;if(this.trim().match(pattern)!=null)return(true);else return(false)};String.prototype.isURL=function(){var pattern=/^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU|UK|INFO|US|NAME|BIZ|DE|TV|CC|BZ)$/;if(this.trim().match(pattern)!=null)return(true);else return(false)};String.prototype.toHTML=function(){var result=null;var pattern=/\n/g;result=this.replace(pattern,"<br/>");pattern=/\r/g;result=result.replace(pattern,"<br/>");return(result)};String.prototype.isNumeric=function(){var pattern=/^0$|^[1-9][0-9]*$|^[1-9][0-9]{0,2}(,[0-9]{3})$/;if(this.trim().match(pattern)!=null)return(true);else return(false)};Math.FormatAsUSD=function(num){num=num.toString().replace(/\$|\,/g,'');if(isNaN(num))num="0";sign=(num==(num=Math.abs(num)));num=Math.floor(num*100+0.50000000001);cents=num%100;num=Math.floor(num/100).toString();if(cents<10)cents="0"+cents;for(var i=0;i<Math.floor((num.length-(1+i))/3);i++)num=num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));return(((sign)?'':'-')+'$'+num+'.'+cents)};Math.isBetween=function(numToTest,lowNum,highNum){if(numToTest<lowNum)return false;if(numToTest>highNum)return false;return true};var dateFormat=function(){var token=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,timezoneClip=/[^-+\dA-Z]/g,pad=function(val,len){val=String(val);len=len||2;while(val.length<len)val="0"+val;return val};return function(date,mask,utc){var dF=dateFormat;if(arguments.length==1&&Object.prototype.toString.call(date)=="[object String]"&&!/\d/.test(date)){mask=date;date=undefined}date=date?new Date(date):new Date;if(isNaN(date))throw SyntaxError("invalid date");mask=String(dF.masks[mask]||mask||dF.masks["default"]);if(mask.slice(0,4)=="UTC:"){mask=mask.slice(4);utc=true}var _=utc?"getUTC":"get",d=date[_+"Date"](),D=date[_+"Day"](),m=date[_+"Month"](),y=date[_+"FullYear"](),H=date[_+"Hours"](),M=date[_+"Minutes"](),s=date[_+"Seconds"](),L=date[_+"Milliseconds"](),o=utc?0:date.getTimezoneOffset(),flags={d:d,dd:pad(d),ddd:dF.i18n.dayNames[D],dddd:dF.i18n.dayNames[D+7],m:m+1,mm:pad(m+1),mmm:dF.i18n.monthNames[m],mmmm:dF.i18n.monthNames[m+12],yy:String(y).slice(2),yyyy:y,h:H%12||12,hh:pad(H%12||12),H:H,HH:pad(H),M:M,MM:pad(M),s:s,ss:pad(s),l:pad(L,3),L:pad(L>99?Math.round(L/10):L),t:H<12?"a":"p",tt:H<12?"am":"pm",T:H<12?"A":"P",TT:H<12?"AM":"PM",Z:utc?"UTC":(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(Math.floor(Math.abs(o)/60)*100+Math.abs(o)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]};return mask.replace(token,function($0){return $0 in flags?flags[$0]:$0.slice(1,$0.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(mask,utc){return dateFormat(this,mask,utc)};
/* Web Library Definition       */
Stenstrom.NET.Web.QueryString=function(sQueryString){Stenstrom.NET.System.Object.call(this);Stenstrom.NET.Web.QueryString.prototype=new Stenstrom.NET.System.Object();Stenstrom.NET.Web.QueryString.prototype.constructor=Stenstrom.NET.Web.QueryString;this.Type="Stenstrom.NET.Web.QueryString";QueryString_Initialize(this,sQueryString)};function QueryString_Initialize(obj,sQueryString){obj._queryString="";obj._queryStringParameterArray=new Array();obj._queryStringKeyArray=new Array();obj._queryStringValueArray=new Array();if(sQueryString.substring(0,1)=="?"){sQueryString=sQueryString.substring(1,sQueryString.length);obj._queryString=sQueryString}var arrTemp=sQueryString.split("&");for(var i=0;i<arrTemp.length;i++){var keyValuePair=arrTemp[i].split("=");var key=keyValuePair[0];var value=keyValuePair[1];obj._queryStringParameterArray.push(keyValuePair);obj._queryStringKeyArray.push(key);obj._queryStringValueArray.push(value)}obj.GetValue=function(sKey){for(var i=0;i<this._queryStringParameterArray.length;i++){if(this._queryStringParameterArray[i][0].toLowerCase()==sKey.toLowerCase())return this._queryStringParameterArray[i][1]}return null};obj.GetKeys=function(){return(this._queryStringKeyArray)};obj.GetValues=function(){return(this._queryStringValueArray)};obj.toString=function(){return(this._queryString)}};Stenstrom.NET.Web.Navigator=function(){Stenstrom.NET.System.Object.call(this);Stenstrom.NET.Web.Navigator.prototype=new Stenstrom.NET.System.Object();Stenstrom.NET.Web.Navigator.prototype.constructor=Stenstrom.NET.Web.Navigator;this.Type="Stenstrom.NET.Web.Navigator";Navigator_Initialize(this)};function Navigator_Initialize(obj){obj.IsMSIE=(navigator.userAgent.indexOf("MSIE")!=-1);obj.ActiveXSupport=(window.ActiveXObject!=undefined);obj.QueryString=new Stenstrom.NET.Web.QueryString(location.search);obj.ActiveXEnabled=function(){if(!this.ActiveXSupport)return false;try{var objTest=new ActiveXObject("MSXML2.DOMDocument");if(objTest!=null)return true}catch(err){return false}};obj.SetCookie=function(key,value,expiry){if(expiry==null)document.cookie=key+"="+escape(value)+"; path=/";else{var expDate=new Date();expDate.setTime(expDate.getTime()+expiry);document.cookie=key+"="+escape(value)+"; path=/"+"; expires="+expDate.toGMTString()}};obj.GetCookie=function(key){var CookieString=document.cookie;var CookieSet=CookieString.split(';');var SetSize=CookieSet.length;var ReturnValue="";var CookiePieces;for(var x=0;((x<SetSize)&&(ReturnValue==""));x++){CookiePieces=CookieSet[x].split('=');if(CookiePieces[0].substring(0,1)==' ')CookiePieces[0]=CookiePieces[0].substring(1,CookiePieces[0].length);if(CookiePieces[0]==key)ReturnValue=CookiePieces[1]}if(ReturnValue=="")return(null);else return unescape(ReturnValue)};obj.GetKeys=function(){var arrCookies=(unescape(document.cookie)).split(";");var arrKeys=new Array();for(var i=0;i<arrCookies.length;i++){var cookiePair=arrCookies[i].split("=");arrKeys.push(cookiePair[0])}return(arrKeys)};obj.ClearCookie=function(key){var expDate=new Date();expDate.setTime(expDate.getTime()-1);document.cookie=key+"=; path=/; expires="+expDate.toGMTString()};obj.ClearAllCookies=function(){var CookieString=document.cookie;var CookieSet=CookieString.split(';');var SetSize=CookieSet.length;var ReturnValue="";var CookiePieces;for(var x=0;((x<SetSize)&&(ReturnValue==""));x++){CookiePieces=CookieSet[x].split('=');if(CookiePieces[0].substring(0,1)==' ')CookiePieces[0]=CookiePieces[0].substring(1,CookiePieces[0].length);var expDate=new Date();expDate.setTime(expDate.getTime()-1);document.cookie=CookiePieces[0]+"=; path=/; expires="+expDate.toGMTString()}}};
/* Web.HTML Library Definiton   */
Stenstrom.NET.Web.DocType=function(){Stenstrom.NET.System.Object.call(this);Stenstrom.NET.Web.DocType.prototype=new Stenstrom.NET.System.Object();Stenstrom.NET.Web.DocType.prototype.constructor=Stenstrom.NET.Web.DocType;this.Type="Stenstrom.NET.Web.DocType";DocType_Initialize(this)};function DocType_Initialize(obj){obj._doctype=(function(){var doctype=null;if(obj.IsMSIE){if(document.firstChild.tagName=="!"){doctype=document.firstChild}}else{doctype=(document.doctype!=null&&typeof(document.doctype)!='undefined')?document.doctype:null}return(doctype)})();obj.PublicId=(function(){var pubId=null;if(obj.IsMSIE){if(obj._doctype!=null){var pieces=obj._doctype.text.split("\"");pubId=pieces[1]}}else{pubId=(obj._doctype!=null)?obj._doctype.publicId:null}return(pubId)})();obj.SystemId=(function(){var sysId=null;if(obj.IsMSIE){if(obj._doctype!=null){var pieces=obj._doctype.text.split("\"");sysId=pieces[3]}}else{sysId=(obj._doctype!=null)?obj._doctype.systemId:null}return(sysId)})();obj.TopElement="HTML*";obj.Availability="PUBLIC*";obj.Registration="";obj.Organization="";obj.Class="";obj.Label="HTML*";obj.Version="";obj.Definition="";obj.Language="";obj.URL="";obj.StandardsCompliant=(document.compatMode=="CSS1Compat")?true:false;(function(){var outerPieces=obj.PublicId.split("//");var innerPieces=outerPieces[2].split(" ");obj.Registration=(outerPieces[0]=="-")?"Un-Registered":"Registered";obj.Organization=outerPieces[1];obj.Class=(innerPieces.length>=1)?innerPieces[0]:"DTD*";obj.Label=(innerPieces.length>=2)?innerPieces[1]:"HTML*";obj.Version=(innerPieces.length>=3)?innerPieces[2]:"n/a*";obj.Definition=(innerPieces.length>=4)?innerPieces[3]:"n/a*";obj.Language=(outerPieces.length>=4)?outerPieces[3]:"EN*";obj.URL=obj.SystemId})()};Stenstrom.NET.Web.HTMLElement=function(tag){Stenstrom.NET.System.Object.call(this);Stenstrom.NET.Web.HTMLElement.prototype=new Stenstrom.NET.System.Object();Stenstrom.NET.Web.HTMLElement.prototype.constructor=Stenstrom.NET.Web.HTMLElement;this.Type="Stenstrom.NET.Web.HTMLElement";if(typeof(tag)=='object'&&typeof(tag.tagName)!='undefined'){this.Element=tag;HTMLElement_Initialize(this)}else if(typeof(tag)=='string'){this.Element=document.createElement(tag);HTMLElement_Initialize(this)}else{var sMsg="";sMsg+="typeof: "+typeof(tag)+"\n";sMsg+="typeof(tag.tagName): "+typeof(tag.tagName)+"\n";alert("Invalid HTML element"+"\n\n"+sMsg);return}};function HTMLElement_Initialize(obj,tag){for(var name in obj.Element){try{obj[name]=obj.Element[name]}catch(err){}}obj._isCompliant=(document.compatMode=="CSS1Compat")?true:false;obj.currentStyle=(function(){if(obj.Element.currentStyle){return(obj.Element.currentStyle)}else if(window.getComputedStyle){return(window.getComputedStyle(obj.Element,''))}})();obj.getProperty=function(sName){for(var name in this){if(name==sName){return(this.Element[name]);break}}};obj.setProperty=function(sName,sValue){for(var name in this){if(name==sName){this[name]=sValue;this.Element[name]=sValue;break}}};obj.getAttribute=function(sName){var attrNode=this.attributes[sName];if(attrNode!=null&&attrNode.nodeValue){return(attrNode.nodeValue)}else if(attrNode!=null&&attrNode.value){return(attrNode.value)}};obj.setAttribute=function(sName,sValue){for(var attribute in this.attributes){if(attribute.name&&attribute.name.toLowerCase()==sName.toLowerCase()){attribute.value=sValue;break}else if(attribute.nodeName&&attribute.nodeName.toLowerCase()==sName.toLowerCase()){attribute.nodeValue=sValue;break}}this.Element.setAttribute(sName,sValue)};obj.getOccupiedDimensions=function(){var nHeight=this.Element.offsetHeight;var nWidth=this.Element.offsetWidth;var marginLeft=parseInt(this.currentStyle.marginLeft);marginLeft=(isNaN(marginLeft))?0:marginLeft;var marginRight=parseInt(this.currentStyle.marginRight);marginRight=(isNaN(marginRight))?0:marginRight;var marginTop=parseInt(this.currentStyle.marginTop);marginTop=(isNaN(marginTop))?0:marginTop;var marginBottom=parseInt(this.currentStyle.marginBottom);marginBottom=(isNaN(marginBottom))?0:marginBottom;nHeight+=(marginTop+marginBottom);nWidth+=(marginLeft+marginRight);return{height:nHeight,width:nWidth}};obj.getInnerDimensions=function(){var nHeight=this.Element.offsetHeight;var nWidth=this.Element.offsetWidth;var paddingLeft=parseInt(this.currentStyle.paddingLeft);paddingLeft=(isNaN(paddingLeft))?0:paddingLeft;var paddingRight=parseInt(this.currentStyle.paddingRight);paddingRight=(isNaN(paddingRight))?0:paddingRight;var paddingTop=parseInt(this.currentStyle.paddingTop);paddingTop=(isNaN(paddingTop))?0:paddingTop;var paddingBottom=parseInt(this.currentStyle.paddingBottom);paddingBottom=(isNaN(paddingBottom))?0:paddingBottom;var borderLeft=parseInt(this.currentStyle.borderLeftWidth);borderLeft=(isNaN(borderLeft))?0:borderLeft;var borderRight=parseInt(this.currentStyle.borderRightWidth);borderRight=(isNaN(borderRight))?0:borderRight;var borderTop=parseInt(this.currentStyle.borderTopWidth);borderTop=(isNaN(borderTop))?0:borderTop;var borderBottom=parseInt(this.currentStyle.borderBottomWidth);borderBottom=(isNaN(borderBottom))?0:borderBottom;nHeight-=(paddingTop+paddingBottom+borderTop+borderBottom);nWidth-=(paddingLeft+paddingRight+borderLeft+borderRight);return{height:nHeight,width:nWidth}};obj.getOuterDimensions=function(){var nHeight=this.Element.offsetHeight;var nWidth=this.Element.offsetWidth;return{height:nHeight,width:nWidth}};obj.getScreenPosition=function(){var left=0;var top=0;var target=this.Element;while(target.offsetParent){left+=target.offsetLeft;top+=target.offsetTop;target=target.offsetParent}left+=(target.offsetLeft);top+=(target.offsetTop);return{x:left,y:top}};obj.attachEvent=function(sEvent,fpHandler){if(fpHandler==null||typeof(fpHandler)!="function"){var err=new Error("Invalid Event Handler defined");throw err;}if(obj.Element.attachEvent){sEvent=(sEvent.toLowerCase().substring(0,2)!="on")?"on"+sEvent:sEvent;obj.Element.attachEvent(sEvent,fpHandler);obj[sEvent]=obj.Element[sEvent]}else{sEvent=(sEvent.toLowerCase().substring(0,2)=="on")?sEvent.substring(2):sEvent;obj.Element.addEventListener(sEvent,fpHandler,false)}};obj.detachEvent=function(sEvent,fpNotify){if(fpHandler==null||typeof(fpHandler)!="function"){var err=new Error("Invalid Event Handler defined");throw err;}if(obj.Element.detachEvent){sEvent=(sEvent.toLowerCase().substring(0,2)!="on")?"on"+sEvent:sEvent;obj.Element.detachEvent(sEvent,fpHandler);obj[sEvent]=obj.Element[sEvent]}else{sEvent=(sEvent.toLowerCase().substring(0,2)=="on")?sEvent.substring(2):sEvent;obj.Element.removeEventListener(sEvent,fpHandler,false)}};obj.getOuterHTML=function(){if(this.outerHTML){return(this.Element.outerHTML)}else{var openingTag="<"+this.nodeName+" ";for(var sName in this.attributes){var attrNode=this.attributes[sName];var attrName="";var attrValue="";if(attrNode!=null&&attrNode.nodeValue){attrName=attrNode.nodeName;attrValue=attrNode.nodeValue}else if(attrNode!=null&&attrNode.value){attrName=attrNode.name;attrValue=attrNode.value}if(attrNode!=null&&attrValue!=null&&typeof(attrValue)!='undefined'&&attrValue!="")openingTag+=(attrName+"=\""+attrValue+"\" ")}if(this.style.cssText!="")openingTag+=" style=\""+this.style.cssText+"\"";openingTag=openingTag.trim()+">";var closeTag="</"+this.nodeName+">";return(openingTag+this.Element.innerHTML+closeTag)}};obj.appendChild=function(oElem){if(typeof(oElem)!="object"||oElem.nodeType==undefined||(oElem.nodeType!=ELEMENT_NODE&&oElem.nodeType!=TEXT_NODE)){var sErrMsg="Invalid Argument in appendChild()";var err=new Error(sErrMsg);throw err;}this.Element.appendChild(oElem)};obj.getWindowDimensions=function(){var nHeight=0;var nWidth=0;if(window.screen){nHeight=window.screen.availHeight;nWidth=window.screen.availWidth}else{nHeight=document.body.offsetHeight;nWidth=document.body.offsetWidth}return{height:nHeight,width:nWidth}}};
/* Web.Xml Library Definition   */
Stenstrom.NET.Web.Xml.HttpRequest=function(){Stenstrom.NET.Web.Navigator.call(this);delete Stenstrom.NET.Web.Xml.HttpRequest.SetCookie;delete Stenstrom.NET.Web.Xml.HttpRequest.GetCookie;delete Stenstrom.NET.Web.Xml.HttpRequest.ClearCookie;delete Stenstrom.NET.Web.Xml.HttpRequest.ClearAllCookies;delete Stenstrom.NET.Web.Xml.HttpRequest.QueryString;Stenstrom.NET.Web.Xml.HttpRequest.prototype=new Stenstrom.NET.System.Object();Stenstrom.NET.Web.Xml.HttpRequest.prototype.constructor=Stenstrom.NET.Web.Xml.HttpRequest;this.Type="Stenstrom.NET.Web.Xml.HttpRequest";Xml_HttpRequest_Initialize(this)};function Xml_HttpRequest_Initialize(obj){var progIdList=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];obj.RequestVersion=null;obj.Request=null;(function(){var factory=null;var version="Un-Supported";if(obj.ActiveXSupport&&obj.ActiveXEnabled()){for(var i=0;i<progIdList.length;i++){try{factory=new ActiveXObject(progIdList[i]);version=progIdList[i];break}catch(err){continue}}}else{factory=new XMLHttpRequest();version="XMLHttpRequest"}obj.RequestVersion=version;obj.Request=factory})();obj.GetText=function(sURL){if(this.Request==null)return;this.Request.open("GET",sURL,false);this.Request.send(null);if(this.Request.status!=200){var err=new Error("An HTTP "+this.Request.status+" error occured while retrieving the file : "+sURL);throw err;}else{return this.Request.responseText}}};Stenstrom.NET.Web.Xml.DOMDocument=function(sXML,bIsFreeThreaded){Stenstrom.NET.Web.Xml.HttpRequest.call(this);Stenstrom.NET.Web.Xml.DOMDocument.prototype=new Stenstrom.NET.System.Object();Stenstrom.NET.Web.Xml.DOMDocument.prototype.constructor=Stenstrom.NET.Web.Xml.DOMDocument;this.Type="Stenstrom.NET.Web.Xml.DOMDocument";this.bIsFreeThreaded=(bIsFreeThreaded==null)?false:bIsFreeThreaded;Xml_DOMDocument_Initialize(this,bIsFreeThreaded);if(sXML!=null&&typeof(sXML)!="undefined")this.LoadXML(sXML)};function Xml_DOMDocument_Initialize(obj,bIsFreeThreaded){obj.SelectionLanguage="XPath";obj.DocumentElement=null;obj.Xml="";obj.Dom;obj.DomVersion;(function(){var progIdList;if(obj.ActiveXSupport&&obj.ActiveXEnabled()){if(!obj.bIsFreeThreaded){progIdList=["MSXML2.DOMDocument.6.0","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"]}else{progIdList=["MSXML2.FreeThreadedDOMDocument.6.0","MSXML2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.4.0","MSXML2.FreeThreadedDOMDocument.3.0","MSXML2.FreeThreadedDOMDocument","MSXML.FreeThreadedDOMDocument","Microsoft.FreeThreadedXMLDOM"]}var factory=null;var version="Un-Supported";for(var i=0;i<progIdList.length;i++){try{factory=new ActiveXObject(progIdList[i]);factory.setProperty("SelectionLanguage",obj.SelectionLanguage);factory.async=false;version=progIdList[i];break}catch(err){continue}}obj.Dom=factory;obj.DomVersion=version}else if(obj.ActiveXSupport&&!obj.ActiveXEnabled()){alert("ActiveX must be enabled")}else if(!obj.ActiveXSupport){obj.Dom=new DOMParser();obj.DomVersion="DOMParser"}})();obj.LoadXML=function(sXML){var xmlText;if(typeof(sXML)=="object"&&sXML.tagName.toLowerCase()=="xml"){if(sXML.getAttributeNode("src")!=null){var src=sXML.getAttribute("src");xmlText=this.GetText(src)}else{if(this.IsMSIE)xmlText=sXML.documentElement.xml;else xmlText=sXML.innerHTML}}else if(typeof(sXML)=="string"){var isXmlString=(sXML.indexOf("<")!=-1)?true:false;var isDataIsland=(!isXmlString&&(document.getElementById(sXML)!=null&&document.getElementById(sXML).tagName.toLowerCase()=="xml"))?true:false;var isFilePath=(!isXmlString&&!isDataIsland)?true:false;if(isXmlString)xmlText=sXML;else if(isFilePath){try{xmlText=this.GetText(sXML)}catch(err){var errMsg="ERROR Retrieving XML : Could not load XML Src.\n\n ";errMsg+="The file, '"+sXML+"' was unable to be loaded. Verify that the file exists.";var err=new Error(errMsg);throw err;}}else if(isDataIsland){var dataIsland=document.getElementById(sXML);if(dataIsland.getAttributeNode("src")!=null){var src=dataIsland.getAttribute("src");xmlText=this.GetText(src)}else{if(this.IsMSIE){if(dataIsland.documentElement==null){var errMsg="ERROR Loading XML: Unable to initialize DOMDocument\n\n";errMsg+="Verify that the xml Data Island Source contains only valid XML";var err=new Error(errMsg);throw(err);}else{xmlText=dataIsland.documentElement.xml}}else{xmlText=dataIsland.innerHTML}}}else{var errMsg="";errMsg+="ERROR Retrieving XML : Invalid XmlDOM source.\n\n XmlDOM Source must be ... \n";errMsg+="1. A reference to, or the ID of, a valid Xml Data Island ( ie. an <xml> element) \n";errMsg+="2. Path to a valid XML document.\n";errMsg+="3. A valid XML String";var err=new Error(errMsg);throw err;}}else{var errMsg="";errMsg+="ERROR Retrieving XML : Invalid XmlDOM source.\n\n XmlDOM Source must be ... \n";errMsg+="1. A reference to, or the ID of, a valid Xml Data Island ( ie. an <xml> element) \n";errMsg+="2. Path to a valid XML document.\n";errMsg+="3. A valid XML String";var err=new Error(errMsg);throw err;}xmlText=xmlText.substring(xmlText.indexOf("<"));if(this.ActiveXSupport){if(!this.Dom.loadXML(xmlText)){var errMsg="PARSER ERROR: Unable to initialize DOMDocument\n\n";errMsg+="Verify that the xml Source contains only valid XML";var err=new Error(errMsg);throw(err);}this.DocumentElement=this.Dom.documentElement;this.Xml=this.DocumentElement.xml}else{this.Dom=this.Dom.parseFromString(xmlText,"text/xml");this.DocumentElement=this.Dom.documentElement;this.Xml=(new XMLSerializer()).serializeToString(this.DocumentElement);if(this.DocumentElement.nodeName=="parsererror"){var errMsg="PARSER ERROR: Unable to initialize DOMDocument\n\n";errMsg+="Verify that the xml Source contains only valid XML";var err=new Error(errMsg);throw(err);}}};obj.GetOuterXml=function(){if(this.ActiveXSupport){this.Xml=this.DocumentElement.xml;return(this.Xml)}else{this.Xml=(new XMLSerializer()).serializeToString(this.DocumentElement);return(this.Xml)}};obj.SelectSingleNode=function(sXPath){var singleNode=null;if(this.IsMSIE){singleNode=this.DocumentElement.selectSingleNode(sXPath)}else{var xPathResult=this.Dom.evaluate(sXPath,this.Dom,null,FIRST_ORDERED_NODE_TYPE,null);singleNode=xPathResult.singleNodeValue}return(singleNode)};obj.SelectNodes=function(sXPath){var nodeArray=new Array();if(this.IsMSIE){var nodeList=this.Dom.documentElement.selectNodes(sXPath);for(var i=0;i<nodeList.length;i++){nodeArray.push(nodeList[i])}}else{var xPathResult=this.Dom.evaluate(sXPath,this.Dom,null,ORDERED_NODE_ITERATOR_TYPE,null);var node=xPathResult.iterateNext();while(node){nodeArray.push(node);node=xPathResult.iterateNext()}}return(nodeArray)};obj.CreateElement=function(sElementName){return(this.Dom.createElement(sElementName))};obj.CreateCDATASection=function(sText){return(this.Dom.createCDATASection(sText))};obj.CreateTextNode=function(sText){return(this.Dom.createTextNode(sText))}};
