﻿// JScript File
var xmlhttp; 
function getChubbyClientDetails(url){ 
        
        //lets first find out if the client supports clientside xml parsing, if not lets create a hidden iframe (0,0 in size)
		
        if (window.XMLHttpRequest) 
        { 
            xmlhttp=new XMLHttpRequest();
            //xmlhttp.onreadystatechange=xmlhttpChange 
            xmlhttp.open("GET", url + "&xmlR=true",false);
            xmlhttp.send(null);
            eval(xmlhttp.responseText); 
        } 
        // code for IE 
        else if (window.ActiveXObject) 
        { 
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") 
                if (xmlhttp) 
                { 
                        xmlhttp.open("GET", url + "&xmlR=true",false); 
                        xmlhttp.send(); 
                        eval(xmlhttp.responseText); 
                } 
        } 
        else 
        { 
                //create iframe and it will run the javascript 
                if(document.getElementById("chubbyIframe") == null) 
                { 
                        htmlStr = "<IFRAME id='chubbyIframe' name='chubbyIframe' frameborder='0' width='0' height='0'>";

                        document.getElementById("html").insertAdjacentHTML('beforeEnd', htmlStr); 
                        document.getElementById("chubbyIframe").src = url + "&xmlR=false"; 
                } 
                else 
                { 
                        document.getElementById("chubbyIframe").src = url + "&xmlR=false"; 
                } 
        } 
  
} 

// insertAdjacentHTML(), insertAdjacentText() and insertAdjacentElement() 
// for Netscape 6/Mozilla by Thor Larholm thor@jscript.dk 
// Usage: include this code segment at the beginning of your document 
// before any other Javascript contents. 

if(typeof HTMLElement!="undefined" && ! 
HTMLElement.prototype.insertAdjacentElement){ 
        HTMLElement.prototype.insertAdjacentElement = function 
(where,parsedNode) 
        { 
                switch (where){ 
                case 'beforeBegin': 
                        this.parentNode.insertBefore(parsedNode,this) 
                        break; 
                case 'afterBegin': 
                        this.insertBefore(parsedNode,this.firstChild); 
                        break; 
                case 'beforeEnd': 
                        this.appendChild(parsedNode); 
                        break; 
                case 'afterEnd': 
                        if (this.nextSibling) 
this.parentNode.insertBefore(parsedNode,this.nextSibling); 
                        else this.parentNode.appendChild(parsedNode); 
                        break; 
                } 
        } 

        HTMLElement.prototype.insertAdjacentHTML = function 
(where,htmlStr) 
        { 
                var r = this.ownerDocument.createRange(); 
                r.setStartBefore(this); 
                var parsedHTML = r.createContextualFragment(htmlStr); 
                this.insertAdjacentElement(where,parsedHTML) 
        } 



        HTMLElement.prototype.insertAdjacentText = function 
(where,txtStr) 
        { 
                var parsedText = document.createTextNode(txtStr) 
                this.insertAdjacentElement(where,parsedText) 
        } 
} 

