var Netsol={'AdAgent':{'util':{},'conf':{},'classes':{'lib':{}},'modules':{'SubModules':{},'util':{},'conf':{}},'client':{}},'temp':{},'modules':{},'classes':{},'util':{'Array':{},'Object':{},'String':{}},'SysVars':{}};Netsol.util.Array.isEmpty=function(a){return(!a||(a.length===0));};Netsol.util.Array.map=function(a,f){var newArray=[];for(var i=0,l=a.length;i=0){cookieStart+=name.length+1;endIndex=document.cookie.indexOf(';',cookieStart);if(endIndex<0){return unescape(document.cookie.substr(cookieStart));} else{return unescape(document.cookie.substr(cookieStart,endIndex-cookieStart));}} return null;};Netsol.util.resetCookie=function(name){if(Netsol.util.getCookie(name)!==null){Netsol.util.setCookie(name,'',-1);}};Netsol.util.resetCookies=function(names){var i=0,l=0;for(i=0,l=names.length;i0){uri.directoryPath=uri.directoryPath.replace(/\/?$/,'/');} return uri;},parsedUri=null,scheme=null,hostName=null,path=null,semicolonIndex=0,queryString=null,params=new Netsol.classes.Parameters(),paramsArray=null,i=0,l=0,temp=null;parsedUri=parseUri(uri);scheme=parsedUri.protocol||'http';hostName=parsedUri.domain;if(!hostName){hostName='';} path=parsedUri.path;if(path){semicolonIndex=path.indexOf(';');if(semicolonIndex>=0){path=path.substring(0,semicolonIndex);}} else{path='';} queryString=parsedUri.query;if(queryString){paramsArray=queryString.split(/[&;]/);if(!Netsol.util.Array.isEmpty(paramsArray)){for(i=0,l=paramsArray.length;i0){Netsol.util.setCookie('_nsz4',vaid,3);} Netsol.util.setCookie('_nsz5',nsagid,3);if(vkwid>0){Netsol.util.setCookie('_nsz6',vkwid,3);} if(vkwmt){Netsol.util.setCookie('_nsz10',vkwmt,3);} Netsol.util.setCookie('_nsParams',escape(limitParamIds.join(",")),3);type='1';Netsol.util.resetCookies(['_nsz7','_nsz8']);if(searchEngineHit){Netsol.util.setCookie('_nsz7',seid,3);if(sekw){Netsol.util.setCookie('_nsz8',sekw,3);}} lastHit=new Netsol.AdAgent.classes.Hit(false,vid,vkw,vaid,nsagid,vkwid,vkwmt,seid,sekw,sessid);} else{if(nsagid>0){Netsol.util.setCookie('_nsz11',nsagid);} lastHit=Netsol.AdAgent.util.getLastHit();} if((lastHit===null)||((lastHit.getVendorId()<=0)&&searchEngineHit)){if(searchEngineHit){Netsol.util.resetCookies(['_nsz1','_nsz7','_nsz8']);Netsol.util.setCookie('_nsz7',seid,3);if(sekw){Netsol.util.setCookie('_nsz8',sekw,3);} parameters.add('seid',seid);parameters.add('sekw',sekw);} if(sessid){parameters.add('sessid',sessid);}} else{parameters.add('ppcvid',lastHit.getVendorId());parameters.add('ppckw',lastHit.getVendorKeyword());parameters.add('ppcvaid',lastHit.getVendorAdId());parameters.add('ppcnsagid',lastHit.getNSAdGroupId());parameters.add('ppcvkwid',lastHit.getVendorKeywordId());parameters.add('ppcvkwmt',lastHit.getVendorKeywordMatchType());parameters.add('seid',lastHit.getSearchEngineId());parameters.add('sekw',lastHit.getSearchEngineKeyword());parameters.add('sessid',lastHit.getSessionId());} if(type!==null){parameters.add('pce',type);} return parameters;};};Netsol.AdAgent.modules.SubModules.HighValuePageLead=function(){this.exec=function(doc){var parameters=new Netsol.classes.Parameters(),lastHit=null;if(!Netsol.util.Array.isEmpty(Netsol.AdAgent.conf.aliases)&&Netsol.util.Array.contains(Netsol.AdAgent.conf.aliases,Netsol.SysVars.uri.getHostName())){return parameters;} if(!Netsol.util.isLeadPage(Netsol.SysVars.uri,Netsol.AdAgent.modules.conf.Stats.highValuePages)){return parameters;} lastHit=Netsol.AdAgent.util.getLastHit();if(!lastHit){return parameters;} if(!lastHit.isConverted()){if((lastHit.getVendorId()<=0)&&!Netsol.util.isLeadSearchKeyword(lastHit.getSearchEngineKeyword())){return parameters;}} parameters.add('leadType','HIGH_VALUE_PAGE');lastHit.convert();return parameters;};};Netsol.AdAgent.modules.SubModules.ShoppingCartLead=function(){var CSVToArray=function(strData,strDelimiter,strQuote){strDelimiter=(strDelimiter||',');strQuote=(strQuote||'"');var objPattern=new RegExp(('(\\'+strDelimiter+'|\\r?\\n|\\r|^)'+'(?:'+'\\'+strQuote+'([^'+'\\'+strQuote+']*(?:'+'\\'+strQuote+'\\'+strQuote+'[^'+'\\'+strQuote+']*)*)'+'\\'+strQuote+'|'+'([^'+'\\'+strQuote+'\\'+strDelimiter+'\\r\\n]*))'),'gi'),arrData=[[]],arrMatches=null,strMatchedDelimiter=null,strMatchedValue=null;while((arrMatches=objPattern.exec(strData))!==null){strMatchedDelimiter=arrMatches[1];if(strMatchedDelimiter.length&&(strMatchedDelimiter!==strDelimiter)){arrData.push([]);} if(arrMatches[2]){strMatchedValue=arrMatches[2].replace(new RegExp('\\'+strQuote+'\\'+strQuote,'g'),'\\'+strQuote);} else{strMatchedValue=arrMatches[3];} arrData[arrData.length-1].push(strMatchedValue);} return arrData;};this.exec=function(doc){var parameters=new Netsol.classes.Parameters(),lastHit=null,documentHtml=null,extractShoppingCart=function(pattern){var match=documentHtml.match(pattern),cartData=null,fields=null;if(!Netsol.util.Array.isEmpty(match)){cartData=match[1];if(cartData){cartData=cartData.replace(/\s*\/\/.*/g,'');cartData=cartData.replace(/\r|\n/g,'');cartData=cartData.replace(/,\s*/g,',');cartData=cartData.replace(/^\s+|\s+$/g,'');if(cartData){fields=CSVToArray(cartData,',',cartData.charAt(0));if(!Netsol.util.Array.isEmpty(fields)){fields=fields[0];if(!Netsol.util.Array.isEmpty(fields)&&(fields.length>=8)){if(fields[2]){parameters.add('leadType','SHOPPING_CART');parameters.add('af',fields[1]);parameters.add('am',fields[2]);parameters.add('ci',fields[5]);parameters.add('co',fields[7]);parameters.add('oi',fields[0]);parameters.add('sh',fields[4]);parameters.add('st',fields[6]);parameters.add('ta',fields[3]);lastHit.convert();} else{}}}}}}};if(!Netsol.util.Array.isEmpty(Netsol.AdAgent.conf.aliases)&&Netsol.util.Array.contains(Netsol.AdAgent.conf.aliases,Netsol.SysVars.uri.getHostName())){return parameters;} if(!Netsol.util.Array.isEmpty(Netsol.AdAgent.modules.conf.Stats.shoppingCartPages)&&!Netsol.util.isLeadPage(Netsol.SysVars.uri,Netsol.AdAgent.modules.conf.Stats.shoppingCartPages)){return parameters;} lastHit=Netsol.AdAgent.util.getLastHit();if(!lastHit){return parameters;} if(!lastHit.isConverted()){if((lastHit.getVendorId()<=0)&&!Netsol.util.isLeadSearchKeyword(lastHit.getSearchEngineKeyword())){return parameters;}} try{documentHtml=document.getElementsByTagName('html')[0].innerHTML;if(documentHtml){if(documentHtml.indexOf('._addTrans')>-1){extractShoppingCart(/\._addTrans\(([\s\S]*?)\);/i);} else if((documentHtml.indexOf('"_addTrans')>-1)||(documentHtml.indexOf('\'_addTrans')>-1)){extractShoppingCart(/\[\s*['"]_addTrans['"]\s*,([\s\S]*?)\]/i);}}} catch(ex){} return parameters;};};Netsol.modules.Stats=function(){var subModules=[];this.addSubmodule=function(subModule){subModules.push(subModule);};this.exec=function(doc){var params=new Netsol.classes.Parameters(),r='NULL',s_n=navigator,s_u=s_n.userAgent,s_w=s_n.appVersion,s_apn=s_n.appName,s_ie=s_w.indexOf('MSIE '),s_ns6=s_u.indexOf('Netscape6/'),s_ios=0,r_d=0,s_apv,s_i,cookiesEnabled;if(!Netsol.util.Array.isEmpty(Netsol.AdAgent.conf.aliases)&&Netsol.util.Array.contains(Netsol.AdAgent.conf.aliases,Netsol.SysVars.uri.getHostName())){return;} if(s_w.indexOf('Opera')>=0||s_u.indexOf('Opera')>=0){s_apn='Opera';} if(s_ie>0){s_i=s_w.substring(s_ie+5);s_apv=parseInt(s_i,10);if(s_apv>3){s_apv=parseFloat(s_i);}} else if(s_ns6>0){s_apv=parseFloat(s_u.substring(s_ns6+10));} else{s_apv=parseFloat(s_w);} if(s_apv>=4&&s_apn!=='Opera'&&(s_ns6<0||s_apv>=6.1)){s_ios=1;} if(!r_d){if(s_u.indexOf('Mac')>=0&&s_u.indexOf('MSIE 4')>=0){r=document.referrer;} else{r=parent.document.referrer;}} Netsol.util.setCookie('s_cc','true',1);cookiesEnabled=Netsol.util.getCookie('s_cc')?'1':'0';Netsol.util.resetCookie('s_cc');Netsol.util.resetCookie('nsvz');var t=-new Date().getTimezoneOffset(),s='',c='',v='',p='',bw='',bh='',j='1.0';if(s_apv>=4){s=screen.width+'x'+screen.height;} if(s_apn==='Netscape'||s_apn==='Opera'){if(s_apv>=3){j='1.1';var i1=0;var i2=0;var sta;while(i2<30&&i1100){sta=sta.substring(0,100);} sta+=';';if(p.indexOf(sta)<0){p+=sta;} i1++;i2++;} v=navigator.javaEnabled()?'Y':'N';} if(s_apv>=4){j='1.2';c=screen.pixelDepth;bw=window.innerWidth;bh=window.innerHeight;} if(s_apv>=4.06){j='1.3';}} else if(s_apn==='Microsoft Internet Explorer'){if(s_apv<4){r='NULL';} if(s_apv>=4){v=navigator.javaEnabled()?'Y':'N';j='1.2';c=screen.colorDepth;} if(s_apv===5){bw=document.documentElement.offsetWidth;bh=document.documentElement.offsetHeight;j='1.3';if(s_u.indexOf('Mac')<0){document.body.addBehavior("#default#homePage");document.body.addBehavior("#default#clientCaps");}}} params.add('k',cookiesEnabled);params.add('t',t);params.add('c',c);params.add('j',j);params.add('bw',bw);params.add('bh',bh);params.add('r',r);params.add('s',s);params.add('p',p);params.add('v',v);params.add('g',location.href);try{if(pageName){params.add('pn',pageName);}} catch(e){} var adder=function(k,v){params.add(k,v);},i=0,l=0,subModuleParameters=null;for(i=0,l=subModules.length;i0){urlInfo=Netsol.util.getURLInfo(toAddress.substring(queryIndex));subject=urlInfo.get('subject');bodyText=urlInfo.get('body');toAddress=toAddress.substring(0,queryIndex);} nodes[i].setAttribute('href','javascript:;');nodes[i].onclick=Netsol.AdAgent.modules.util.EmailLead.onclickDef(toAddress,pid,ppcvid,ppckw,ppcvaid,ppcvkwid,ppcnsagid,sessid,seid,sekw,referrer,ppcvkwmt,subject,bodyText);}}}};}; Netsol.AdAgent.modules.conf.Form={};Netsol.AdAgent.classes.FormLead=function(actionUrl,httpMethod,parameters,successCallback){var params=new Netsol.classes.Parameters(),lastHit=null;parameters.map(function(k,v){params.add('li_'+k,v);});params.add('leadType','FORM');params.add('uri',actionUrl);params.add('r',location.href);params.add('m',httpMethod);lastHit=Netsol.AdAgent.util.getLastHit();if(lastHit!==null){params.add('ppckw',lastHit.getVendorKeyword());params.add('ppcvid',lastHit.getVendorId());params.add('ppcvaid',lastHit.getVendorAdId());params.add('ppcnsagid',lastHit.getNSAdGroupId());params.add('ppcvkwid',lastHit.getVendorKeywordId());params.add('ppcvkwmt',lastHit.getVendorKeywordMatchType());params.add('seid',lastHit.getSearchEngineId());params.add('sekw',lastHit.getSearchEngineKeyword());params.add('sessid',lastHit.getSessionId());lastHit.convert();} this.exec=function(){new Netsol.AdAgent.util.HTTPRequest('GET',true,Netsol.SysVars.uri.getScheme()+'://stats.netsolads.com/PostLead',params,false,successCallback,null).exec();};};Netsol.AdAgent.modules.FormLead=function(){var hookForm=function(f){var eventHandler=f.onsubmit,originalOnSubmit=!eventHandler?function(e){return true;}:function(e){return eventHandler.call(f,e);},recursiveCall=false,submitted=false;f.onsubmit=function(e){var parameters=new Netsol.classes.Parameters(),i=0,j=0,element=null,name=null,excludeParameters=Netsol.util.Array.isEmpty(Netsol.AdAgent.modules.conf.Form.excludeParameters)?null:Netsol.AdAgent.modules.conf.Form.excludeParameters,doSubmit=null;if(recursiveCall){recursiveCall=false;return originalOnSubmit(e);} nextElement:for(i=0;i0){addReplacements(interceptorReplacements.adGroup[nsagid]);} addReplacements(interceptorReplacements.adGroup[0]);} if(interceptorReplacements.searchEngine){var seid,sekw;if(lastHit){seid=parseInt(lastHit.getSearchEngineId(),10);if(isNaN(seid)){seid=-1;} sekw=lastHit.getSearchEngineKeyword();} else{seid=Netsol.AdAgent.modules.conf.Replacement.searchEngine.allowAnyHit?0:-1;} if(seid>=0){var setupSearchEngineReplacements=function(searchEngineId,searchEngineKeyword){var key=searchEngineId+'/'+(searchEngineKeyword||'');var searchEngineReplacements=interceptorReplacements.searchEngine[key];addReplacements(searchEngineReplacements);};if(seid>0){setupSearchEngineReplacements(seid,sekw);} setupSearchEngineReplacements(0,null);}} var limitParamReplacements=interceptorReplacements.limitParam;if(lastHit&&limitParamReplacements){var limitParamIds=lastHit.getLimitParamIds()||[];for(var i=0,len=limitParamIds.length;i0){this.execReplacements(allReplacements);}};this.execReplacements=function(replacements){var replace=function(str,replacement){try{return str.replace(replacement.regex,replacement.t);} catch(ex){return str;}};var replaceEl=function(el){if(!el.childNodes){return;} for(var i=0,l=el.childNodes.length;i