if (typeof OurModulesClicks === 'undefined') { var OurModulesClicks = new Array(); } if (typeof OurModulesConfig === 'undefined') { var OurModulesConfig = new Array(); } var WrkUpdatedMods = new Array(); for (var WrkMyModule in OurModulesConfig) { if (OurModulesConfig[WrkMyModule]['dbase_flag'] == 1) { var WrkSelectedMods = new Array(); var WrkModTags=OurModulesAll[WrkMyModule]; for (i = 0; i < WrkModTags.length; i++) { WrkModCounter=i + ''; for (i2 = 0; i2 < 10 && WrkModCounter.length < 10; i2++) { WrkModCounter='0' + WrkModCounter; } var WrkClearTag=WrkModTags[i]; WrkModTags[i]=WrkModCounter + WrkModTags[i]; var WrkDirtyTag=WrkModTags[i]; if (!(WrkClearTag in OurModulesClicks)) { OurModulesClicks[WrkClearTag]=0; } var WrkDirtyTag2=OurModulesClicks[WrkClearTag] + ''; for (i2 = 0; i2 < 10 && WrkDirtyTag2.length < 10; i2++) { WrkDirtyTag2='0' + WrkDirtyTag2; } WrkDirtyTag=WrkDirtyTag2 + WrkDirtyTag; WrkSelectedMods.push(WrkDirtyTag); } WrkSelectedMods.sort(); if (WrkSelectedMods.length > 0) { OurModules[WrkMyModule] = new Array(); WrkModPointer=0; for (i2 = 0; i2 < OurModulesConfig[WrkMyModule]['ads_num']; i2++) { var WrkModTag=WrkSelectedMods[WrkModPointer]; WrkModTag=WrkModTag.substr(20,(WrkModTag.length-20)); WrkModPointer++; if (WrkModPointer>=WrkSelectedMods) { WrkModPointer=0; } OurModulesClicks[WrkModTag]++; WrkUpdatedMods[WrkModTag]=WrkMyModule; OurModules[WrkMyModule][i2]=OurModulesAllCodes[WrkMyModule][WrkModTag]; } } } } var WrkNewCookieString=''; for (var WrkModTag in WrkUpdatedMods) { if (WrkNewCookieString.length > 0) { WrkNewCookieString=WrkNewCookieString + '!'; } WrkNewCookieString=WrkNewCookieString + WrkModTag + ':' + OurModulesClicks[WrkModTag]; } if (WrkNewCookieString.length > 0) { element=document.createElement('script'); element.src='http://mods.traffic-gate.com/set_cookie.pl?' + WrkNewCookieString + ''; element.type='text/javascript'; element.id='puscriptid'; document.getElementsByTagName('head')[0].appendChild(element); }