function start2() { loadHistory(); } function loadHistory() { for($i=0;$i<=50;$i++) { if($.cookie("history["+$i+"]")!=null) addToHistory($i); else break; } } function addToCookie($id) { $found = false; for($i=0;$i<=50;$i++) { if($.cookie("history["+$i+"]")!=null) if($.cookie("history["+$i+"]") == $id) { $found = true; break; } else {} else break; } if(!$found) { $.cookie("history["+$i+"]",$id, { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); $.cookie("cout["+$i+"]",'1', { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); addToHistory($i); } else { $inc = ($.cookie("cout["+$i+"]")/1)+1; $.cookie("cout["+$i+"]",$inc, { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); checkCounts(); } } function checkCounts() { for($i=50;$i>0;$i--) if($.cookie("cout["+$i+"]")!=null) { $j = $i-1; if(parseInt($.cookie("cout["+$i+"]"))>parseInt($.cookie("cout["+$j+"]"))) hisReverse($i,$j); } } function hisReverse($i,$j) { $.cookie("history[tmp]", $.cookie("history["+$i+"]"), { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); $.cookie("history["+$i+"]", $.cookie("history["+$j+"]"), { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); $.cookie("history["+$j+"]", $.cookie("history[tmp]"), { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); $.cookie("history[tmp]", null, { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); $.cookie("cout[tmp]", $.cookie("cout["+$i+"]"), { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); $.cookie("cout["+$i+"]", $.cookie("cout["+$j+"]"), { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); $.cookie("cout["+$j+"]", $.cookie("cout[tmp]"), { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); $.cookie("cout[tmp]", null, { expires: 356, path: '/', domain: 'detectinvisible.ro', secure: false }); updateHistory($i); updateHistory($j); } function addToHistory($i) { $par = ($i%2)?"odd":"even"; $("#history").append("
"+$.cookie("history["+$i+"]")+"