/*     * partner_product_details_soap_client.js  Version 2.0    * All functions, classes related to product pricing.    * Copyright HRB Digital LLC*/ document.write('<s'+'cript type="text/javascript" src="//www.hrblock.com/includes/js/commons.js">'+'</s'+'cript');//document.write('<s'+'cript type="text/javascript" src="/includes/js/commons.js">'+'</s'+'cript');//default pricing for onlinevar g_online_def_price= '{status:{tco:0,tcs:0},partner:{cid:"otpPartnerID=0&pgm=13534200",partnerName:"-",partnerType:"normal",partnerWelcome:"na",otpPartnerID:"0",partnerTunnel:0,partnerID:"0",partnerActive:1},'+'prodList:['+//Extension'{pid:"188",pn:"-",sn:"/loginRedirect.html?TaxType=TCL&FV=T&HT=F&OtpExt=1&TaxYear=2008",lm:"188.html",bpr:"19.95",ppr:"19.95",sk:"EXT",pl:"O",on:"Extension"},'+//Signature State -- 193'{pid:"193",pn:"-",sn:"/loginRedirect.html?TaxType=SIG&FV=T&HT=F&TaxYear=2008",lm:"193.html",bpr:"34.95",ppr:"34.95",sk:"SIGSTA",pl:"O",on:"Extension"},'+//Ask a tax advisor -- 44'{pid:"44",pn:"-",sn:"/loginRedirect.html?TaxType=TCL&FV=T&HT=F&Target=ATA&TaxYear=2008",lm:"44.html",bpr:"19.95",ppr:"19.95",sk:"ATAEMAILBILL",pl:"O",on:"ata"},'+//Office service -- 65'{pid:"65",pn:"-",sn:"/universal/office_locator.html?&otpPartnerID=0&pgm=13534200&otpPartnerId=0",lm:"65.html",bpr:"0.00",ppr:"0.00",sk:"NA",pl:"R",on:"-"},'+//Office service -- 64'{pid:"64",pn:"-",sn:"-",lm:"64.html",bpr:"0.00",ppr:"0.00",sk:"NA",pl:"R",on:"-"},'+//Online office state -- 191'{pid:"191",pn:"-",sn:"/loginRedirect.html?TaxType=PTS&FV=T&HT=F&TaxYear=2008",lm:"191.html",bpr:"34.95",ppr:"34.95",sk:"PTSSTA",pl:"O",on:"ptssta online office state"},'+//FREE -- Fed 201'{pid:"201",pn:"-",sn:"/loginRedirect.html?TaxType=TCF&FV=T&HT=F&TaxYear=2008",lm:"201.html",bpr:"0.00",ppr:"-1",sk:"TCFFED",pl:"O",on:"free edition federal"},'+//FREE -- State'{pid:"202",pn:"-",sn:"/loginRedirect.html?TaxType=TCF&FV=T&HT=F&TaxYear=2008",lm:"202.html",bpr:"34.95",ppr:"34.95",sk:"TCFSTA",pl:"O",on:"free edition state"},'+//Online Office -- 62'{pid:"62",pn:"-",sn:"/loginRedirect.html?TaxType=PTS&FV=T&HT=F&TaxYear=2008",lm:"62.html",bpr:"109.95",ppr:"109.95",sk:"PTSFED",pl:"O",on:"online office default"},'+//TCO Split page -- 31'{pid:"31",pn:"-",sn:"-",lm:"31.html",bpr:"0.00",ppr:"0.00",sk:"NA",pl:"O",on:"parent"},'+//Basic State -- 194'{pid:"194",pn:"-",sn:"/loginRedirect.html?TaxType=TCL&FV=T&HT=F&TaxYear=2008",lm:"194.html",bpr:"34.95",ppr:"34.95",sk:"TCLSTA",pl:"O",on:"basic state"},'+//Extension Filing split page -- 69'{pid:"69",pn:"-",sn:"-",lm:"69.html",bpr:"0.00",ppr:"0.00",sk:"NA",pl:"O",on:"extension"},'+//Signature -- 33'{pid:"33",pn:"-",sn:"/loginRedirect.html?TaxType=SIG&FV=T&HT=F&TaxYear=2008",lm:"33.html",bpr:"99.95",ppr:"99.95",sk:"SIGFED",pl:"O",on:"signature"},'+//Premium State -- 192'{pid:"192",pn:"-",sn:"/loginRedirect.html?TaxType=OPP&FV=T&HT=F&TaxYear=2008",lm:"192.html",bpr:"34.95",ppr:"34.95",sk:"PAID1040STA",pl:"O",on:"paid1040sta state"},'+//Basic -- 30'{pid:"30",pn:"-",sn:"/loginRedirect.html?TaxType=TCL&FV=T&HT=F&TaxYear=2008",lm:"30.html",bpr:"29.95",ppr:"29.95",sk:"TCLFED",pl:"O",on:"basic"},'+//Premium -- 32'{pid:"32",pn:"-",sn:"/loginRedirect.html?TaxType=OPP&FV=T&HT=F&TaxYear=2008",lm:"32.html",bpr:"49.95",ppr:"49.95",sk:"PAID1040FED",pl:"O",on:"premium"},'+//MapPoint Office Locator -- 203'{pid:"203",pn:"-",sn:"-",lm:"203.html",bpr:"0.00",ppr:"0.00",sk:"NA",pl:"R",on:"-"}]}';//default pricing for softwarevar g_soft_def_price ='[{'+//premium + State + E-file --36 preorder --134571300'pid:"36",pn:"-",sn:"-",lm:"36.html",bpr:"49.95",ppr:"49.95",sk:"134571300",pl:"S",on:"premium + state + efile"},'+//Home and business -- 38 ( new name : premium and business)'{pid:"38",pn:"-",sn:"-",lm:"38.html",bpr:"79.95",ppr:"79.95",sk:"156618300",pl:"S",on:"home and business"},'+//Deduction pro -- 40'{pid:"40",pn:"-",sn:"-",lm:"40.html",bpr:"19.95",ppr:"19.95",sk:"134573800",pl:"S",on:"deduction pro"},'+//Deluxe  -- 206'{pid:"206",pn:"-",sn:"-",lm:"206.html",bpr:"29.95",ppr:"29.95",sk:"156615000",pl:"S",on:"Delux + E-file"},'+//Delux + State  -- 207'{pid:"207",pn:"-",sn:"-",lm:"207.html",bpr:"44.95",ppr:"44.95",sk:"156615900",pl:"S",on:"Delux +state"},'+//Basic + E-file -- 199'{pid:"199",pn:"-",sn:"-",lm:"199.html",bpr:"19.95",ppr:"19.95",sk:"156613200",pl:"S",on:"basic + e-file"},'+//Premium + E-file -- 200//'{pid:"200",pn:"-",sn:"-",lm:"200.html",bpr:"44.95",ppr:"44.95",sk:"108091600",pl:"S",on:"premium + e-file"},'+//main software prod -- 34'{pid:"34",pn:"-",sn:"-",lm:"34.html",bpr:"-",ppr:"-",sk:"-",pl:"S",on:"main"},'+//State -- 39'{pid:"39",pn:"-",sn:"-",lm:"39.html",bpr:"29.95",ppr:"29.95",sk:"164066100",pl:"S",on:"state"}]';/*The products are retired as of 10/26/2009	Real Estate Attorney -- 195	'{pid:"195",pn:"-",sn:"-",lm:"195.html",bpr:"19.95",ppr:"19.95",sk:"107118000",pl:"S",on:"real estate attorney"},'+	Business Attorney -- 196	'{pid:"196",pn:"-",sn:"-",lm:"196.html",bpr:"19.95",ppr:"19.95",sk:"107118100",pl:"S",on:"business attorney"},'+	Home and Business Attorney -- 83	'{pid:"83",pn:"-",sn:"-",lm:"83.html",bpr:"39.95",ppr:"39.95",sk:"107118600",pl:"S",on:"home and business attorney"},'+	Willpower -- 82	'{pid:"82",pn:"-",sn:"-",lm:"82.html",bpr:"19.95",ppr:"19.95",sk:"107118900",pl:"S",on:"willpower"},'+*//*    An instance of PartnerProduct() represents a partner and its software, office and online product information.        Methods of the PartnerProduct() object are:    getObj()    getStatusTCO()    getStatusTCS()    getPartnerInfo()    getPartnerCID()    getPartnerName()    getPartnerType()    getPartnerWelcome()    getPartnerOtpPartnerId()    getPartnerTunnel()    getPartnerID()    getPartnerActive()    getProductInfo()    getProductId()    getProductBasePrice()    getProductPartnerPrice()    getProductName()    getProductStartNow()    getProductLearnMore()    getProductSKU()    getProductPlatform()    getProductOmnitureName()    getProductsByPlatform()    getCompressedStr()    updatePartnerProduct()    toString()*/function PartnerProduct() {        this._partner_product;        this.getObj =function()        {            return this._partner_product;        }                this.setObj =function(prodlist)        {   // prodList also includes partner information also such as name, cid, etc.            this._partner_product=prodlist;        }        // **********************************************************        // ************** BEGIN STATUS GETTER METHODS **************        // **********************************************************        /*Fetch the status for TCO requests*/        this.getStatusTCO=function () {            return this._partner_product.status.tco;        }        /*Fetch the status for TCS requests*/        this.getStatusTCS=function () {            return this._partner_product.status.tcs;        }        // **********************************************************        // ************** BEGIN PARTNER GETTER METHODS **************        // **********************************************************                /*Fetch the partner info object*/        this.getPartnerInfo=function () {            return this._partner_product.partner;        }        /*Fetch the partnerCID for this partner*/        this.getPartnerCID=function () {            return this._partner_product.partner.cid;        }        /*Fetch the partnerName for this partner*/        this.getPartnerName=function () {            return this._partner_product.partner.partnerName;        }        /*Fetch the for partnerType this partner*/        this.getPartnerType=function () {            return this._partner_product.partner.partnerType;        }        /*Fetch the partnerWelcome text for this partner*/        this.getPartnerWelcome=function () {            return this._partner_product.partner.partnerWelcome;        }        /*Fetch the otpPartnerID for this partner*/        this.getPartnerOtpPartnerId=function () {            return this._partner_product.partner.otpPartnerID;        }        /*Fetch the partnerTunnel indicator for this partner*/        this.getPartnerTunnel=function () {            return this._partner_product.partner.partnerTunnel;        }        /*Fetch the yearly CMS partner Id (NOT the otp partner id) for this partner*/        this.getPartnerID=function () {            return this._partner_product.partner.partnerID;        }        /*Fetch the partnerActive indicator for this partner*/        this.getPartnerActive=function () {            return this._partner_product.partner.partnerActive;        }        // **********************************************************        // ************** BEGIN PRODUCT GETTER METHODS **************        // **********************************************************                /*get the product info for a given product*/        this.getProductInfo=function (prodID){            var t_prodlist=this._partner_product.prodList;            for (var i=0; i<t_prodlist.length;i++ ){                if (t_prodlist[i].pid==prodID){                    return t_prodlist[i];                }            }            return null;        }        /*get the product id for a product*/        this.getProductId=function (prodID){            return this.getProductInfo(prodID).pid;        }                /*get the base price for a product*/        this.getProductBasePrice=function (prodID){           return this.getProductInfo(prodID).bpr;        }        /*get the partner price for a product*/        this.getProductPartnerPrice=function (prodID){            return this.getProductInfo(prodID).ppr;        }        /*get the Name for a product*/        this.getProductName=function (prodID){            return this.getProductInfo(prodID).pn;        }        /*get the Start Now for a product*/        this.getProductStartNow=function (prodID){            return this.getProductInfo(prodID).sn;        }        /*get the Learn More for a product*/        this.getProductLearnMore=function (prodID){            return this.getProductInfo(prodID).lm;        }        /*get the SKU for a product*/        this.getProductSKU=function (prodID){            return this.getProductInfo(prodID).sk;        }        /*get the Platform for a product*/        this.getProductPlatform=function (prodID){            return this.getProductInfo(prodID).pl;        }        /*get the Omniture Name for a product*/        this.getProductOmnitureName=function (prodID){            return this.getProductInfo(prodID).on;        }                        // **********************************************************        // **************     BEGIN OTHER FUNCTIONS    **************        // **********************************************************                /*  fetch list of products by a given platform            Platform type 'O':online 'S':software 'R':retail            returns an array of product objects        */        this.getProductsByPlatform=function (platform){            var prodarr= new Array();            var t_prodlist=this._partner_product.prodList;            for (var i=0; i<t_prodlist.length;i++ )            {                if (t_prodlist[i].pl==platform)                {                    prodarr[prodarr.length]=t_prodlist[i];                }            }            return prodarr;        }                /*  compresses the complete product list object            returns a JSON string which is compressed            used to store the data in the cookies        */        this.getCompressedStr=function()        {                              //remove the product name and SK text to compress            for (var k=0;k< this._partner_product.prodList.length;k++ ){               this._partner_product.prodList[k].pn='-';               this._partner_product.prodList[k].sk='-';               this._partner_product.prodList[k].on='-';            }            var str=this.toString();			            str = str.replace(/partner/g,"^a");            str = str.replace(/TaxYear=20/g, "^b");            str = str.replace(/TaxType=/g, "^c");            str = str.replace(/Target=/g, "^d");            str = str.replace(/\/loginRedirect.html/g, "^e");            str = str.replace(/product.jsp/g, "^f");            str = str.replace(/\/universal\/office_locator.html/g, "^g");            str = str.replace(/office/g, "^h");            str = str.replace(/NOT_APPLICABLE/g, "^i");            str = str.replace(/.html/g, "^j");            str = str.replace(/productId=/g, "^1");            str = str.replace(/otpPartnerId=/g, "^2");            str = str.replace(/&FV=T&HT=F/g, "^3");            str = str.replace(/state/g, "^4");            str = str.replace(/taxcut/g, "^5");            str = str.replace(/premium/g, "^6");            str = str.replace(/software/g, "^7");            str = str.replace(/online/g, "^8");            str = str.replace(/\/taxes\/doing_my_taxes\/products\/popup\/otp_compare_popup.html/g, "^9");                        return str;        }        /*  Passes a string representation of the product info            to be converted into JSON object form            Normally updated from the cookie value        */        this.setPartnerProduct=function(str,decompress)        {               if (decompress)            {                str = str.replace(/\^a/g, "partner");                str = str.replace(/\^b/g, "TaxYear=20");                str = str.replace(/\^c/g, "TaxType=");                str = str.replace(/\^d/g, "Target=");                str = str.replace(/\^e/g, "/loginRedirect.html");                str = str.replace(/\^f/g, "product.jsp");                str = str.replace(/\^g/g, "/universal/office_locator.html");                str = str.replace(/\^h/g, "office");                str = str.replace(/\^i/g, "NOT_APPLICABLE");                str = str.replace(/\^j/g, ".html");                str = str.replace(/\^1/g, "productId=");                str = str.replace(/\^2/g, "otpPartnerId=");                str = str.replace(/\^3/g, "&FV=T&HT=F");                str = str.replace(/\^4/g, "State");                str = str.replace(/\^5/g, "taxcut");                str = str.replace(/\^6/g, "premium");                str = str.replace(/\^7/g, "software");                str = str.replace(/\^8/g, "online");                str = str.replace(/\^9/g, "/taxes/doing_my_taxes/products/popup/otp_compare_popup.html");            }            try            {                this._partner_product=eval('('+str+')');                var _defresp =  g_online_def_price;                //strip starting and ending square brackets off the software pricing                var _tmpSoft=g_soft_def_price.replace(/\[/,'').replace(/\]/,'');                _defresp=_defresp.replace(/\]}/g, ','+_tmpSoft+']}');                var _tmp_ppobj=eval('('+_defresp+')');                //since the object from the cookie does not have sk and on info, add it back from                 //default obj                for (var k=0;k< _tmp_ppobj.prodList.length;k++ )                {                        this._partner_product.prodList[k].sk= _tmp_ppobj.prodList[k].sk;                        this._partner_product.prodList[k].on= _tmp_ppobj.prodList[k].on;                }                _tmp_ppobj=null;            }            catch (e)            {                setCookie("wsc", "", null, "/");                document.location = document.location.href;            }                    }        var $ = {"boolean":function(){return Boolean},            "function":function(){return Function},            "number":function(){return Number},            "object":function(o){return o instanceof o.constructor?o.constructor:null},            "string":function(){return String},            "undefined":function(){return null}            }        /*            converts the object JSON object to string        */        this.toString = function(){            var self = arguments.length ? arguments[0] : this._partner_product,                result, tmp;            if(self === null){                result = "null";            }            else if(self !== undefined && (tmp = $[typeof self](self))) {                switch(tmp){                    case    Array:                        result = [];                        for(var i = 0, j = 0, k = self.length; j < k; j++) {                            if(self[j] !== undefined && (tmp = this.toString(self[j]))){                                result[i++] = tmp;                            }                        };                        result = "[".concat(result.join(","), "]");                        break;                    case    Boolean:                        result = String(self);                        break;                    case    Date:                        break;                    case    Function:                        break;                    case    Number:                        result = isFinite(self) ? String(self) : "null";                        break;                    case    String:                        result = '"'.concat(self, '"');                        break;                    default:                        var i = 0, key;                        result = [];                        for(key in self) {                            if(self[key] !== undefined && (tmp = this.toString(self[key]))){                                result[i++] = ''.concat(key, ':', tmp);                            }                        };                        result = "{".concat(result.join(","), "}");                        break;                }            };            return result;        };        }    function checkRespIntegrity(keywords, txt)    {                var chkformat_reg= /[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/;        try{            var rc=new RegExp(keywords)            if (chkformat_reg.test(txt) && rc.test(txt) ){                return true;            }             else{                g_log.error('E21:'+txt.length+':'+keywords);            }        }        catch (e){            g_log.error('E22')            return true;        }        return false;    }    function partnerProductSuccess(resp)    {        g_log.debug('<b>Inside partnerProductSuccess.</b>');        if (resp==''){            g_log.error('E13');        }        /*if the response looks valid, copy required attributes to template obj*/        if (checkRespIntegrity('{partner:', resp)){            g_log.debug('partnerProductSuccess partnerinfo from webservice is ok.');            var _ppobj= g_hrb_partner_product.getObj();            _ppobj.status.tco=1;            var _json_partner_prod = eval('('+resp+')');                        var tmppartner=g_hrb_partner_product.getPartnerInfo();            tmppartner.cid=_json_partner_prod.partner.cid;            tmppartner.partnerName  =_json_partner_prod.partner.partnerName;            tmppartner.partnerType  =_json_partner_prod.partner.partnerType;            tmppartner.otpPartnerID =_json_partner_prod.partner.otpPartnerID;            tmppartner.partnerTunnel=_json_partner_prod.partner.partnerTunnel;            tmppartner.partnerID    =_json_partner_prod.partner.partnerID;            tmppartner.partnerActive=_json_partner_prod.partner.partnerActive;            var _add_prod=new Array();//store the products not found in the default list            for (var j=0;j<_json_partner_prod.prodList.length ;j++ ){                var tmpprodobj= g_hrb_partner_product.getProductInfo(_json_partner_prod.prodList[j].pid);                                if (tmpprodobj!=null)                {                    g_log.debug('partnerProductSuccess WS response::(for products in def) bpr:'+_json_partner_prod.prodList[j].bpr+' | ppr:'+_json_partner_prod.prodList[j].ppr + ' | pid:'+_json_partner_prod.prodList[j].pid);                    tmpprodobj.bpr=_json_partner_prod.prodList[j].bpr;                    tmpprodobj.ppr=_json_partner_prod.prodList[j].ppr;                    tmpprodobj.sn=_json_partner_prod.prodList[j].sn;                    tmpprodobj.lm=_json_partner_prod.prodList[j].lm;                    tmpprodobj.sk=_json_partner_prod.prodList[j].sk;                }                else{//find products not in the default list                    g_log.debug('partnerProductSuccess WS response::<b>(products not in def)</b> bpr:'+_json_partner_prod.prodList[j].bpr+' | ppr:'+_json_partner_prod.prodList[j].ppr + ' | pid:'+_json_partner_prod.prodList[j].pid);                    _add_prod[_add_prod.length]={pid:_json_partner_prod.prodList[j].pid,pn:"-",sn:_json_partner_prod.prodList[j].sn,lm:_json_partner_prod.prodList[j].lm,bpr:_json_partner_prod.prodList[j].bpr,ppr:_json_partner_prod.prodList[j].ppr,sk:"-",pl:_json_partner_prod.prodList[j].pl,on:"-"};                }            }            //add products to the default object            for (var k=0; k<_add_prod.length ;k++ ){                _ppobj.prodList.push(_add_prod[k]);                                    }            //_json_partner_prod=null;            //_add_prod=null;        }else{            g_log.error("E12");            g_hrb_partner_product.getObj().status.tco=0;        }        webServiceCallSuccess();        }    function partnerProductFailure(errorcode)    {        g_log.debug('<b>Inside partnerProductFailure</b>');        g_log.error("E11:"+errorcode);        webServiceCallFailed();    }     function callpartnerJSON(partnerid){        g_log.debug('<b>Inside callpartnerJSON</b>');        /************** START ONLY for testing **************/        var failpartner= queryString('forcefail_partner');        if (failpartner!= null && (failpartner=="true" || failpartner==true))        {            partnerProductFailure("404");            return;        }        /************** END   ONLY for testing **************/        var url='/HrbWebservices/services/servlet/JsonProductInfo';        postData="otpPartnerID="+partnerid;        new ajaxreq(url,postData,"partnerProductSuccess","partnerProductFailure","");    }    function callsoftwarepricing(offer,pgm)    {        g_log.debug('<b>Inside callsoftwarepricing</b>::offer::'+offer+' pgm::'+pgm);                /************** START ONLY for testing **************/        /****************************************************/        var failsoft= queryString('forcefail_software');        if (failsoft!= null && (failsoft=="true" || failsoft==true))        {            softwareFailure("error");            return;        }        /************** END   ONLY for testing **************/        /****************************************************/        var softobj=eval('('+g_soft_def_price+')');        var prod_params="";        for (var j=0;j<softobj.length ;j++ )        {            if (softobj[j].sk=="-" || softobj[j].sk=="")            {                continue;            }            prod_params+= (softobj[j].sk+ ""+ ( (j==(softobj.length-1))?"":":"));        }        softobj=null;        var postdata=null;        var url1="/json/JSONProxyServlet";        if (offer=='' || offer==null ||offer=='0'){                postdata="pid_list="+prod_params;        }        else{            var add_args="";            if (offer!=null && offer!='' ){                add_args+="&off_id="+offer;            }                        if (pgm!=null && pgm!='' ){                add_args+="&pgm_id="+pgm;            }            else  {                add_args+="&pgm_id="+14166300;            }            postdata="pid_list="+prod_params+add_args;        }        g_log.debug('callsoftwarepricing ::postdata'+postdata);        new ajaxreq(url1,postdata,"softwareSuccess","softwareFailure","");    }     function softwareSuccess(resp)    {        g_log.debug('<b>Inside softwareSuccess</b>');        if (resp==''){            g_log.error('E18');        }        resp=resp.substring(resp.indexOf('[{'),resp.indexOf('}}]')+3);        if (checkRespIntegrity('productID',resp)) {            g_log.debug('Software info from DR is ok.');            g_hrb_partner_product.getObj().status.tcs=1;            var _softprod_dr = eval('('+resp+')');            g_log.debug('softwareSuccess DR resp total products '+_softprod_dr.length);            var _softprod_def= g_hrb_partner_product.getProductsByPlatform('S');            for (var j=0;j<_softprod_def.length ;j++ ){                 // remove the dollar sign since online pricing does not have $                 var  priceobj='-';                 //if the product is not found in the DR response                 try{                        priceobj=_softprod_dr[j].price;                        g_log.debug('softwareSuccess bpr:'+priceobj.unitPrice+' | ppr:'+priceobj.unitPriceWithDiscount+' | sk:'+_softprod_def[j].sk+ ' | pid:'+_softprod_def[j].pid);                        _softprod_def[j].bpr=(priceobj.unitPrice!=null || typeof priceobj.unitPrice != 'undefined')?(priceobj.unitPrice.substring(1)):priceobj.unitPrice ;                        _softprod_def[j].ppr=(priceobj.unitPriceWithDiscount !=null || typeof priceobj.unitPriceWithDiscount != 'undefined')?(priceobj.unitPriceWithDiscount.substring(1)):priceobj.unitPriceWithDiscount ;                }catch(e){                    if( (typeof _softprod_dr[j]!='undefined') && _softprod_dr[j].pid!=null && _softprod_dr[j].pid!='34')                    g_log.error("E19:"+_softprod_dr[j].pid);                }            }        }        else{            g_log.error('E17');            g_hrb_partner_product.getObj().status.tcs=0;        }       remoteDataProcessComplete();        }    function softwareFailure(errorcode)    {        g_log.error('E17');        g_log.debug('<b>Inside softwareFailure</b>');        remoteDataProcessComplete();    }    function getPartnerProduct(partnerid)    {           g_log.debug('<b>Inside getProductInfo</b> :partnerid::'+partnerid);        //Initialize the final JSON str with onlinepricig        var finalresp =  g_online_def_price;        //strip starting and ending square brackets off the software pricing        var tmpSoftStr=g_soft_def_price.replace(/\[/,'').replace(/\]/,'');        finalresp=finalresp.replace(/\]}/g, ','+tmpSoftStr+']}');        g_hrb_partner_product.setObj(eval('('+finalresp+')'));        if (getWebServiceCookie(partnerid))        {            g_log.debug('getProductInfo webService call is NOT needed ');            webServiceCallNotNeeded();   // shares much logic with the webServiceCallSuccess()        }        else        {            callpartnerJSON(partnerid);        }    }    //initialize the product info objectvar g_hrb_partner_product= new PartnerProduct();