        // to get parameters
        var scriptSrc = document.getElementById("reviewwidgetscript").src.toLowerCase();
        qs = new QueryStringObject(scriptSrc);
        var params = qs;
        
        var reviewWidgetHandlerPath = GetHandlerPath(scriptSrc);
        
        // to retrieve parameters
        function QueryStringObject(querystring) {
            //Create regular expression object to retrieve the qs part 
            var qsReg = new RegExp("[?][^#]*", "i");
            hRef = unescape(querystring);
            var qsMatch = hRef.match(qsReg);

            //removes the question mark from the url
            qsMatch = new String(qsMatch);
            qsMatch = qsMatch.substr(1, qsMatch.length - 1);

            //split it up 
            var rootArr = qsMatch.split("&");
            for (i = 0; i < rootArr.length; i++) {
                var tempArr = rootArr[i].split("=");
                if (tempArr.length == 2) {
                    tempArr[0] = unescape(tempArr[0]);
                    this[tempArr[0]] = tempArr[1];
                }
            }
        }

        // to get widget data
        function getReviews(jsonData) {
            var updatePanel = document.getElementById('results');
            updatePanel.innerHTML = jsonData;
            bObj.removeScriptTag();
            }

         
        // REST request URL to the constructor
        function JSONscriptRequest(fullUrl) {
            // REST request path
            this.fullUrl = fullUrl;
            // Keep IE from caching requests
            this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
            // Get the DOM location to put the script tag
            this.headLoc = document.getElementsByTagName("head").item(0);
            // Generate a unique script tag id
            this.scriptId = 'JscriptId' + JSONscriptRequest.scriptCounter++;
        }

        // Script ID counter
        JSONscriptRequest.scriptCounter = 1;

        // BuildScriptTag  
        JSONscriptRequest.prototype.buildScriptTag = function() {

        // Create the script tag
        this.scriptObj = document.createElement("script");
        // Add script object attributes
        this.scriptObj.setAttribute("type", "text/javascript");
        this.scriptObj.setAttribute("charset", "utf-8");
        this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
        this.scriptObj.setAttribute("id", this.scriptId);
        }

        // RemoveScriptTag  
        JSONscriptRequest.prototype.removeScriptTag = function() {
            // Destroy the script tag
            this.headLoc.removeChild(this.scriptObj);
        }

        // AddScriptTag method
        JSONscriptRequest.prototype.addScriptTag = function() {
            // Create the script tag
            this.headLoc.appendChild(this.scriptObj);
        }


        if (qs.id != undefined) {

            var fullUrl = reviewWidgetHandlerPath + 'ReviewWidget.ashx?id=' + params.id + "&output=json&callback=getReviews";
            bObj = new JSONscriptRequest(fullUrl);
            // Build the dynamic script tag
            bObj.buildScriptTag();
            // Add the script tag to the page
            bObj.addScriptTag();
        }


        //to get domain url and build handler path
        function GetHandlerPath(url) {

            if (url != undefined) {
                domainArr = url.split('js');
                return domainArr[0] + "handlers/";
            }
        }      