if(updatesFrequencyFlag==0){
var rndUpdtTimer=setInterval("updateLevelRandomly()",5000);
var rndCopyTimer=setInterval("copyRealLevel()",900000);
}
function updateLevelRandomly(){
var _1;
var i=1;
for(i=1;i<5;i++){
var _3=getBox(i);
if(null!=_3){
_1=document.getElementById("chart"+getLSValue(getOppTRSF(_3,1,5,null,2)));
var _4=getLSValue(getOppTRSF(_3,1,5,null,5));
if(_4!=OPPORTUNITY_STATE_CREATED&&_4!=OPPORTUNITY_STATE_PAUSED&&_4!=OPPORTUNITY_STATE_SUSPENDED&&_4!=OPPORTUNITY_STATE_CLOSED&&_1==null){
setOppLevelRandomChange(_3,getRandom(_3));
updateSlipLevel(_3);
}
}else{
break;
}
}
}
function setOppLevelRandomChange(_5,_6){
var _7=getOppTRSF(_5,1,3,2,4);
var _8=getChildOfType(_7,"DIV",1);
var _9=getOppTRSF(_5,1,5,null,13);
if(null==_8||null==_9){
return;
}
if(_9.innerHTML.indexOf("img")==-1){
var _a=addCommas(addRandomValue(_9.innerHTML,parseFloat(_6)),_9.innerHTML);
_8.innerHTML=_a;
setChartTableOppLevel(_5,_a);
}
}
function addRandomValue(_b,_c){
var _d=_b;
var _e=_d.indexOf(",");
while(_e!=-1){
var _f=_d.substring(0,_e);
var end=_d.substring(_e+1);
_d=_f+end;
_e=_d.indexOf(",");
}
_d+="";
var _11=0;
var x=_d.split(".");
var x2=x[1];
var _14=x2.length;
var _15=parseFloat(_d)+parseFloat(_d)*parseFloat(_c);
_15=_15.toFixed(_14);
return _15;
}
function addCommas(_16,_17){
_16+="";
x=_16.split(".");
x1=x[0];
x2=x.length>1?"."+x[1]:"";
var rgx=/(\d+)(\d{3})/;
while(rgx.test(x1)){
x1=x1.replace(rgx,"$1"+","+"$2");
}
return x1+x2;
}
function getRandom(row){
var rnd=Math.random();
var _1b=parseFloat(getLSValue(getOppTRSF(row,1,5,null,10)));
var _1c=parseFloat(getLSValue(getOppTRSF(row,1,5,null,11)));
if(_1c==0&&_1b==0){
_1b=-0.0001;
_1c=0.0001;
}
var _1d=rnd*(_1c-(_1b))+(_1b);
return _1d;
}
function updateSlipLevel(_1e){
var _1f=getOppTRSF(_1e,1,3,2,4);
var _20=getChildOfType(_1f,"DIV",1);
if(getOppTRSF(_1e,1,5,null,7).innerHTML=="0"){
getOppTRSF(_1e,2,2,null,2).innerHTML=_20.innerHTML;
}
}
function setOppLevelAnd15MinLevel(opp,_22){
var _23=getOppTRSF(opp,1,3,2,4);
var _24=getChildOfType(_23,"DIV",1);
var _25=getOppTRSF(opp,1,5,null,13);
if(null==_24||null==_25){
return;
}
var _26=_22;
if(_22==0){
_22="<img src='../images/wait.gif' border='0' />";
_26="<img src='../images/small_wait.gif' border='0' />";
}
_24.innerHTML=_22;
_25.innerHTML=_22;
setChartTableOppLevel(opp,_26);
updateSlipLevel(opp);
}
function copyRealLevel(){
var _27;
var i=1;
for(i=1;i<5;i++){
var _29=getBox(i);
if(null!=_29){
_27=document.getElementById("chart"+getLSValue(getOppTRSF(_29,1,5,null,2)));
var _2a=getLSValue(getOppTRSF(_29,1,5,null,5));
if(_2a!=OPPORTUNITY_STATE_CREATED&&_2a!=OPPORTUNITY_STATE_PAUSED&&_2a!=OPPORTUNITY_STATE_SUSPENDED&&_2a!=OPPORTUNITY_STATE_CLOSED&&_27==null){
setOppLevelRandomChange(_29,getHiddenOppLevel(_29));
updateSlipLevel(_29);
}
}else{
break;
}
}
}
function getHiddenOppLevel(opp){
var _2c=getOppTRSF(opp,1,3,2,4);
var _2d=getOppTRSF(opp,1,5,null,12);
return _2d.innerHTML;
}

