﻿// JScript File
var a0 =  new Array('Igra', '1', 'x', '2', 'dc 1x', 'dc 12', 'dc x2', 't0-1', 't0-2', 't2-3', 't3+', 't4+', 't4-6', 't5+', 't7+', 'h 1', 'h x', 'h 2', 'k 1-1', 'k 1-x', 'k 1-2', 'k x-1', 'k x-x', 'k x-2', 'k 2-1', 'k 2-x', 'k 2-2', 'ch 1', 'ch x', 'ch 2', 'et 1', 'et X', 'et 2', 'gl 1', 'gl x', 'gl 2', 'IIp 1', 'IIp x', 'IIp 2', 'f 1', 'f 1-3', 'f pp', 'duel1', 'duel2', 'w1>', 'w1=2', 'w2>', '4t1+', '4t2+', '4t3+', '4t4+', '4t0-1', '4t2-3', '9t1+', '9t2+', '9t3+', '9t4+', '9t0-1', '2p9t', 't0-3', 't2-6', 't2', 't3', 't6+');
var a1 =  new Array('1', '2', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '0', '0', '1', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a2 =  new Array('2', '0', '0', '2', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '0', '0', '1', '0', '0', '1', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a3 =  new Array('4t0-1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '0', '2', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a4 =  new Array('4t1+', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a5 =  new Array('4t2+', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a6 =  new Array('4t2-3', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a7 =  new Array('4t3+', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1');
var a8 =  new Array('4t4+', '1', '1', '1', '1', '1', '1', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '0', '0', '1', '1', '1', '1', '1', '1', '0', '1', '0', '0', '1');
var a9 =  new Array('9t0-1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '0', '2', '0', '1', '1', '1', '1', '1');
var a10 =  new Array('9t1+', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a11 =  new Array('9t2+', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '0', '1', '1', '1', '1', '1', '1');
var a12 =  new Array('9t2-3', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '2', '1', '1', '1', '1', '1');
var a13 =  new Array('9t3+', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '0', '1', '1', '1', '0', '1', '1');
var a14 =  new Array('9t4+', '1', '1', '1', '1', '1', '1', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '0', '0', '0', '1', '0', '0', '1');
var a15 =  new Array('ch 1', '1', '0', '0', '1', '1', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '0', '0', '1', '0', '0', '2', '0', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a16 =  new Array('ch 2', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '0', '1', '1', '0', '1', '1', '0', '0', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a17 =  new Array('ch x', '1', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '0', '0', '1', '0', '0', '0', '2', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a18 =  new Array('dc 12', '1', '0', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '0', '1', '1', '0', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a19 =  new Array('dc 1x', '1', '1', '0', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a20 =  new Array('dc x2', '0', '1', '1', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '0', '1', '1', '0', '1', '1', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a21 =  new Array('duel1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a22 =  new Array('duel2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a23 =  new Array('et 1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a24 =  new Array('et 2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a25 =  new Array('et X', '0', '1', '0', '1', '0', '1', '1', '1', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '1', '0', '2', '0', '1', '1', '1', '0', '0', '0', '1', '1', '1', '1', '1', '0', '1', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '1', '0', '1', '0', '0', '0', '0');
var a26 =  new Array('f 1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a27 =  new Array('f 1-3', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a28 =  new Array('f pp', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a29 =  new Array('gl 1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a30 =  new Array('gl 2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a31 =  new Array('gl x', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '2', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a32 =  new Array('h 1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '0', '0', '1', '1', '1', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a33 =  new Array('h 2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '2', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a34 =  new Array('h x', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '2', '0', '0', '0', '0', '1', '1', '1', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a35 =  new Array('IIp 1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '2', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a36 =  new Array('IIp 2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '0', '0', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a37 =  new Array('IIp x', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '0', '2', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a38 =  new Array('k 1-1', '1', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '2', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a39 =  new Array('k 1-2', '0', '0', '1', '0', '1', '1', '0', '0', '1', '1', '1', '1', '1', '1', '1', '0', '0', '0', '0', '2', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a40 =  new Array('k 1-x', '0', '1', '0', '1', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '0', '2', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a41 =  new Array('k 2-1', '1', '0', '0', '1', '1', '0', '0', '0', '1', '1', '1', '1', '1', '1', '0', '0', '1', '0', '0', '0', '0', '0', '0', '2', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a42 =  new Array('k 2-2', '0', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '2', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a43 =  new Array('k 2-x', '0', '1', '0', '1', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '2', '0', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a44 =  new Array('k x-1', '1', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '0', '0', '0', '0', '2', '0', '0', '0', '0', '0', '1', '1', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a45 =  new Array('k x-2', '0', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '0', '0', '0', '0', '0', '0', '2', '0', '0', '0', '0', '0', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a46 =  new Array('k x-x', '0', '1', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '0', '0', '0', '0', '0', '2', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a47 =  new Array('t0-1', '1', '1', '1', '1', '1', '1', '2', '1', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '0', '0', '1', '1', '1', '0', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '0', '1', '0', '1', '0', '0', '0', '1', '0', '1', '0', '0', '0', '0');
var a48 =  new Array('t0-2', '1', '1', '1', '1', '1', '1', '1', '2', '1', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '0', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '1', '0', '0');
var a49 =  new Array('t0-3', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '0', '1', '1', '2', '1', '1', '1', '0');
var a50 =  new Array('t2', '1', '1', '1', '1', '1', '1', '0', '1', '1', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '2', '0', '0');
var a51 =  new Array('t2-3', '1', '1', '1', '1', '1', '1', '0', '1', '2', '1', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '1', '0');
var a52 =  new Array('t3', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '0', '2', '0');
var a53 =  new Array('t3+', '1', '1', '1', '1', '1', '1', '0', '0', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '0', '1', '1', '1', '0', '1', '1');
var a54 =  new Array('t4+', '1', '1', '1', '1', '1', '1', '0', '0', '0', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '0', '0', '0', '1', '0', '0', '1');
var a55 =  new Array('t4-6', '1', '1', '1', '1', '1', '1', '0', '0', '0', '1', '1', '2', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '0', '0', '0', '1', '0', '0', '1');
var a56 =  new Array('t5+', '1', '1', '1', '1', '1', '1', '0', '0', '0', '1', '1', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '0', '0', '0', '1', '0', '0', '1');
var a57 =  new Array('t6+', '1', '1', '1', '1', '1', '1', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '0', '0', '2');
var a58 =  new Array('t7+', '1', '1', '1', '1', '1', '1', '0', '0', '0', '1', '1', '0', '1', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '1', '1', '1', '1', '0', '0', '0', '0', '0', '0', '1');
var a59 =  new Array('u2-6', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '1', '1', '1');
var a60 =  new Array('w1=2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '2', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a61 =  new Array('w1>', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a62 =  new Array('w2>', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '0', '2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var a63 =  new Array('x', '0', '2', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '0', '0', '1', '0', '0', '1', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
var par = "";


		var gTop = "15";
		var gBrojPoena = 10;
		var gbolIsIE4;
		var gbolIsIE5;
		var gbolIsNS4;
		var gbolIsNS6;
		var gobjSBText;
		var gobjCBSBText;
		var gobjGeneralText;
		var garrBets=new Array();
		var gobjCustomer=new Customer(0,"",0,0);
		var gobjSBProp=new SBProperty(0,0,0,0,0,0);
		var gbolDelAll=false;
		var gstrPlaceBetLink=new String("");
		var glngLastBet = 0;
		var garrSystem=new Array();
		var gSistem = 0;
		var gSistemUkupno = 0;
		gstrPlaceBetLink="betslip/upisitiket.aspx";
		var gstrReturnLink="";
		var gstrRedirectLink="";
		var PosaljiOK = false;
		PodesiJezik("");
		
		function OsveziTop()
		{
		    gstrRedirectLink="";
		    var toploc = top.top1.location.href;
		    
		}
		function OsveziMain()
		{
		    if (gstrRedirectLink != "")
		    {
		        if((gstrRedirectLink.indexOf("tips/") > -1) && (gstrRedirectLink.indexOf("default.aspx") < 0) && (gstrRedirectLink.indexOf("tips/top.aspx") < 0))
		            top.main.location = gstrRedirectLink;
		    }
		}
		function VratiNazad()
		{
		    if (gstrReturnLink != "")
		        top.main.location = gstrReturnLink;
		    else
		        top.main.location = 'ActualRatios.aspx';
		}
		
		function PodesiJezik(strJezik)
		{
			if (strJezik == "")
			{
				gobjSBText=new SBText();
				gobjCBSBText=new CBSBText();
				gobjGeneralText=new GeneralText();
			}
			else if (strJezik == "Jez2")
			{
				gobjSBText=new SBTextJez2();
				gobjCBSBText=new CBSBTextJez2();
				gobjGeneralText=new GeneralTextJez2();
			}
			else if (strJezik == "Jez3")
			{
				gobjSBText=new SBTextJez3();
				gobjCBSBText=new CBSBTextJez3();
				gobjGeneralText=new GeneralTextJez3();
			}
			else if (strJezik == "Jez4")
			{
				gobjSBText=new SBTextJez4();
				gobjCBSBText=new CBSBTextJez4();
				gobjGeneralText=new GeneralTextJez4();
			}
			else if (strJezik == "Jez5")
			{
				gobjSBText=new SBTextJez5();
				gobjCBSBText=new CBSBTextJez5();
				gobjGeneralText=new GeneralTextJez5();
			}
			else
			{
				gobjSBText=new SBTextJez1();
				gobjCBSBText=new CBSBTextJez1();
				gobjGeneralText=new GeneralTextJez1();
			}
		}
		function RefreshMain()
		{
			var rtLocation = "" + top.main.location.href + "";
			var re = /ActualRatios1/i;
			var rtForum = rtLocation.search(re);
			if (rtForum > -1)
			{
				re = /#/g;
				rtLocation = rtLocation.replace(re, "");
			}
			top.main.location.href = rtLocation;
		}

		
		function SBProperty(NumberOfBets,Stake,PossibleWin,Sistem,SistemOd,MaxKvota)
		{
			this.NumberOfBets=NumberOfBets;
			this.Stake=Stake;
			this.PossibleWin=PossibleWin;
			this.Sistem=Sistem;
			this.SistemOd=SistemOd;
			this.MaxKvota=MaxKvota;
		}
		function Customer(CustomerID,Currency,Balance,Limit)
		{
			this.CustomerID=Number(CustomerID);
			this.Currency=Currency;
			this.Balance=Number(Balance);
			this.Limit=Number(Limit);
		}
		
		function Bet(RbPara,Domacin,Gost,VrstaKladjenja,NazivKladjenja,Tip,Kvota,VrstaIgre,Lista,Oznaka,RbPolja,BettingOfferIDIgre,LigaID,Polje)
		{
			this.KindOfSportID=VrstaIgre;
			this.ListaID=Lista;
			this.OfferTypeID=VrstaKladjenja;
			this.NazivKladjenja=NazivKladjenja;
			this.EventID=RbPolja;
			this.BettingOfferID=RbPara;
			this.BettingOfferIDIgre=BettingOfferIDIgre;
			this.Quota=Kvota.toString().replace(/\,/g,".");
			this.Tip=Tip;
			this.BetText=Domacin + " - " + Gost;
			this.Stake=0.00;
			this.Active=true;
			this.AddLine="";
			this.Oznaka=Oznaka;
			this.Sistem=1;
			this.LigaID=LigaID;
			this.Polje=Polje;
			
			this.Dvoznak = 0;
			this.OfferTypeID1=0;
			this.NazivKladjenja1="";
			this.EventID1=0;
			this.BettingOfferIDIgre1=0;
			this.Quota1=0;
			this.Tip1="";
			this.Oznaka1="";
			this.Polje1="";
			
		}
		function addBet(RbPara,Domacin,Gost,VrstaKladjenja,NazivKladjenja,Tip,Kvota,VrstaIgre,Lista,Oznaka,RbPolja,BettingOfferIDIgre,LigaID,Polje)
		{
			var bolOK=true;
			var bolBrisi=false;
			var bolDvoznakOut=false;
			var bolDvoznakIn=false;
			var bolLT;
			var dblLimit=new Number(0);
			var dblStakeLimit=new Number(0);
			if (gBrojPoena == 0)
			{
				bolOK=false;
				alert(top.gobjGeneralText.NemaPoena);
			}

			for(i=0;i<garrBets.length;i++)
			{
				if(garrBets[i].BettingOfferIDIgre==BettingOfferIDIgre)
				{
				    if (garrBets[i].Dvoznak == 0)
				    {
		                deleteBet(i);
    			        
			            bolBrisi = true;
			            
			        }
			        else
			        {
			            bolDvoznakOut = true;
			            garrBets[i].Dvoznak = 0;
			            garrBets[i].Sistem = 1;
			            gSistemUkupno++;
				        if (top.gobjSBProp.Sistem < gSistemUkupno)
				            top.gobjSBProp.Sistem = gSistemUkupno;
			            var tdTip = top.gdocTarget.getElementById(garrBets[i].BettingOfferIDIgre + "");
                        if (tdTip != "undefined" && tdTip != null)
                        {
                            tdTip.style.display = "";
                            tdTip.style.backgroundColor="";
                        }
			            garrBets[i].OfferTypeID=garrBets[i].OfferTypeID1;
			            garrBets[i].NazivKladjenja=garrBets[i].NazivKladjenja1;
			            garrBets[i].EventID=garrBets[i].EventID1;
			            garrBets[i].BettingOfferIDIgre=garrBets[i].BettingOfferIDIgre1;
			            garrBets[i].Quota=garrBets[i].Quota1;
			            garrBets[i].Tip=garrBets[i].Tip1;
			            garrBets[i].Oznaka=garrBets[i].Oznaka1;
			            garrBets[i].Polje=garrBets[i].Polje1;
			            var tdTip = top.gdocTarget.getElementById(garrBets[i].BettingOfferIDIgre + "");
                        if (tdTip != "undefined" && tdTip != null)
                        {
                            tdTip.style.display = "";
                            tdTip.style.backgroundColor="";
                        }
			        }
			        break;
				}
				if (garrBets[i].BettingOfferIDIgre1==BettingOfferIDIgre)
				{
			        bolDvoznakOut = true;
		            var tdTip = top.gdocTarget.getElementById(garrBets[i].BettingOfferIDIgre1 + "");
                    if (tdTip != "undefined" && tdTip != null)
                    {
                        tdTip.style.display = "";
                        tdTip.style.backgroundColor="";
                    }
			        garrBets[i].Dvoznak = 0;
			        garrBets[i].Sistem = 1;
			        gSistemUkupno++;
			        if (top.gobjSBProp.Sistem < gSistemUkupno)
			            top.gobjSBProp.Sistem = gSistemUkupno;
			        garrBets[i].OfferTypeID1=0;
			        garrBets[i].NazivKladjenja1="";
			        garrBets[i].EventID1=0;
			        garrBets[i].BettingOfferIDIgre1=0;
			        garrBets[i].Quota1=0;
			        garrBets[i].Tip1="";
			        garrBets[i].Oznaka1="";
			        garrBets[i].Polje1="";
			        break;
				}
			}
			if (bolBrisi == false && bolDvoznakOut == false)
			{
			    for(i=0;i<garrBets.length;i++)
			    {
				    if(garrBets[i].BettingOfferID==RbPara)
				    {
				        if (garrBets[i].Dvoznak == 1)
				        {
					        alert(top.gobjGeneralText.Tipovano);
					        bolOK=false;
			                break;
					    }
					    else
					    {
			                bolDvoznakIn = true;
			                garrBets[i].Dvoznak = 1;
			                garrBets[i].OfferTypeID1=VrstaKladjenja;
			                garrBets[i].NazivKladjenja1=NazivKladjenja;
			                garrBets[i].EventID1=RbPolja;
			                garrBets[i].BettingOfferIDIgre1=BettingOfferIDIgre;
			                garrBets[i].Quota1=Kvota.toString().replace(/\,/g,".");
			                garrBets[i].Tip1=Tip;
			                garrBets[i].Oznaka1=Oznaka;
			                garrBets[i].Polje1=Polje;
			                if (garrBets[i].Sistem == 1)
			                {
			                    garrBets[i].Sistem = 0;
			                    gSistemUkupno--;
			                }
				            if (top.gobjSBProp.Sistem > gSistemUkupno)
				                top.gobjSBProp.Sistem = gSistemUkupno;
			                break;
			            }
				    }
			    }
            }
			if (gBrojPoena == 0)
			{
				bolOK=false;
				alert(top.gobjGeneralText.NemaPoena);
			}
			if(bolOK==true)
			{
			    if (bolBrisi == false)
			    {
			        if (bolDvoznakIn == false && bolDvoznakOut == false)
			        {
				        garrBets[glngLastBet]=new Bet(RbPara,Domacin,Gost,VrstaKladjenja,NazivKladjenja,Tip,Kvota,VrstaIgre,Lista,Oznaka,RbPolja,BettingOfferIDIgre,LigaID,Polje);
				        glngLastBet++;
				        gSistemUkupno++;
				        if (top.gobjSBProp.Sistem < gSistemUkupno)
				            top.gobjSBProp.Sistem = gSistemUkupno;
				    }
				}
//				calcBetProperties();
				drawBettingSlip();
				calcBetProperties();
			    drawBettingSummary();
				return glngLastBet;
			}
		}
		
		function ObeleziIzabrane()
		{
		    var tdTip;
			for(i=0;i<garrBets.length;i++)
			{
		        tdTip = top.gdocTarget.getElementById(garrBets[i].BettingOfferIDIgre + "");
                if (tdTip != "undefined" && tdTip != null)
                {
                    tdTip.style.display = "block";
                    tdTip.style.backgroundColor="#fdfab1";
                }
                if (garrBets[i].Dvoznak == 1)
                {
		            tdTip = top.gdocTarget.getElementById(garrBets[i].BettingOfferIDIgre1 + "");
                    if (tdTip != "undefined" && tdTip != null)
                    {
                        tdTip.style.display = "block";
                        tdTip.style.backgroundColor="#fdfab1";
                    }
                }
			}
		}
		
		function calcBetProperties()
		{
			top.gobjSBProp.NumberOfBets=0;
			top.gobjSBProp.Stake=Number(top.gdocTarget.frmBettingSlip.txtSBStake.value.replace(/\,/g,"."));
			top.gobjSBProp.PossibleWin=0;
			top.gobjSBProp.MaxKvota=0;
			

			top.gobjSBProp.Sistem = Number(top.gdocTarget.frmBettingSlip.cbSBStake.value);
			if (top.gobjSBProp.Sistem < 1)
			    top.gobjSBProp.Sistem = 1;
			if (gSistemUkupno == 0)
			{
			    top.gobjSBProp.SistemOd = top.gobjSBProp.Sistem;
			}
			else
			{
			    top.gobjSBProp.SistemOd = gSistemUkupno;
			}
			if (top.gobjSBProp.SistemOd > 0)
			{
			    var iDvoznak = 1;
			    for(var i=0;i<garrBets.length;i++)
			    {
			        if (garrBets[i].Dvoznak == 1)
			        {
				        iDvoznak = iDvoznak*2;
				    }
			    }
				var iGore = 1;
				var iDole = 1;
				for(var i = top.gobjSBProp.SistemOd; i > top.gobjSBProp.SistemOd - top.gobjSBProp.Sistem; i--)
					iGore = iGore * i;
				for(var i = top.gobjSBProp.Sistem; i > 0; i--)
					iDole = iDole * i;
				top.gobjSBProp.NumberOfBets = (iGore/iDole)*iDvoznak;
				var UkupnaKvota = calcSystemBetQuota(top.gobjSBProp.Sistem);
				LigeBezUslova();
    			top.gobjSBProp.MaxKvota=UkupnaKvota;
    			if (top.gobjSBProp.Stake > 0)
    			{
				    var UlogPoTiketu = top.gobjSBProp.Stake/top.gobjSBProp.NumberOfBets;
				    top.gobjSBProp.PossibleWin = UlogPoTiketu*UkupnaKvota;
    			}
    			else
    			    top.gobjSBProp.PossibleWin = 0;
			}
		}
		function LigeBezUslova()
		{
		    if (!PosaljiOK)
		    {
		        var lbuCount = 0;
		        var tdTip = "";
		        for(var i=0;i<garrBets.length;i++)
		        {
		            tdTip = "|" + garrBets[i].BettingOfferID + "|";
		            if (par.indexOf(tdTip) > -1 && tdTip != "")
		            {
			            lbuCount++;
			        }
		        }
		        if (lbuCount == garrBets.length)
		        {
		            PosaljiOK = true;
		        }
		    }
		}
		function GetActiveBets()
		{
			var arrBB=new Array();
			var lngCount=new Number(-1);
			for(var i=0;i<garrBets.length;i++)
			{
			    if (garrBets[i].Sistem == 1)
			    {
				    lngCount++;
				    arrBB[lngCount]=i;
				}
			}
			return arrBB;
		}
		
		function calcSystemBetQuota(lngSystem)
		{
		    var KIX2=new Number(0);
		    var KIl=new Number(0);
		    var UG=new Number(0);
		    var PK=new Number(0);
		    
		    var KIX2Temp=new Number(0);
		    var KIlTemp=new Number(0);
		    var UGTemp=new Number(0);
		    var PKTemp=new Number(0);

		    var KvotaUslov = new Number(1);
		    var BrojParova = lngSystem;
			var dblResult=new Number(0);
			var dblTemp=new Number(0);
			garrSystem=new Array();
			var arrBB=new Array();
			arrBB=GetActiveBets();
			for(var i=1;i<=lngSystem;i++)
				garrSystem[i]=i;
			garrSystem[lngSystem]=lngSystem-1;
			while(incSys(lngSystem,arrBB)==true)
			{
				dblTemp=1;
				for(var i=1;i<garrSystem.length;i++)
				{
					dblTemp*=garrBets[arrBB[garrSystem[i]-1]].Quota;
					if (garrBets[arrBB[garrSystem[i]-1]].OfferTypeID == 1)
					{
					    if(garrBets[arrBB[garrSystem[i]-1]].Tip == 'X' || garrBets[arrBB[garrSystem[i]-1]].Tip == '2')
					        KIX2Temp++;
					}
					else if (garrBets[arrBB[garrSystem[i]-1]].OfferTypeID == 3 || garrBets[arrBB[garrSystem[i]-1]].OfferTypeID == 4 || 
					            garrBets[arrBB[garrSystem[i]-1]].OfferTypeID == 26 || garrBets[arrBB[garrSystem[i]-1]].OfferTypeID == 27 || 
					            garrBets[arrBB[garrSystem[i]-1]].OfferTypeID == 28)
					{
					    UGTemp++;
					}
					else if (garrBets[arrBB[garrSystem[i]-1]].OfferTypeID == 6)
					{
					   PKTemp++; 
					}
				}
				dblResult+=dblTemp;
				if (dblTemp > KvotaUslov)
				    KvotaUslov = dblTemp;
				if(PKTemp > PK)
				    PK = PKTemp;
				if(UGTemp > UG)
				    UG = UGTemp;
				if(KIX2Temp > KIX2)
				    KIX2 = KIX2Temp;
			}
			if (dblResult == 0)
			{
			    dblResult = 1;
			}
			for(var j=0;j<garrBets.length;j++)
			{
			    if (garrBets[j].Sistem == 0)
			    {
			        if (garrBets[j].Dvoznak == 1)
			        {
			            if (VratiDvoznak(garrBets[j].Polje, garrBets[j].Polje1) == '1')
			            {
			                dblResult*=(new Number(garrBets[j].Quota) + new Number(garrBets[j].Quota1));
			            }
			            else
			            {
			                if(garrBets[j].Quota > garrBets[j].Quota1)
				                dblResult*=garrBets[j].Quota;
				            else
				                dblResult*=garrBets[j].Quota1;
			            }
		                if(garrBets[j].Quota > garrBets[j].Quota1)
			                KvotaUslov*=garrBets[j].Quota;
			            else
			                KvotaUslov*=garrBets[j].Quota1;
			                
					    if (garrBets[j].OfferTypeID == 1 || garrBets[j].OfferTypeID1 == 1)
					    {
					        if(garrBets[j].Tip == 'X' || garrBets[j].Tip == '2' || 
					            garrBets[j].Tip1 == 'X' || garrBets[j].Tip1 == '2')
					            KIX2++;
					    }
					    else if (garrBets[j].OfferTypeID == 3 || garrBets[j].OfferTypeID == 4 || 
					                garrBets[j].OfferTypeID == 26 || garrBets[j].OfferTypeID == 27 || 
					                garrBets[j].OfferTypeID == 28 || 
					                garrBets[j].OfferTypeID1 == 3 || garrBets[j].OfferTypeID1 == 4 || 
					                garrBets[j].OfferTypeID1 == 26 || garrBets[j].OfferTypeID1 == 27 || 
					                garrBets[j].OfferTypeID1 == 28)
					    {
					        UG++;
					    }
					    else if (garrBets[j].OfferTypeID == 6 || garrBets[j].OfferTypeID1 == 6)
					    {
					       PK++; 
					    }

			        }
			        else
			        {
				        dblResult*=garrBets[j].Quota;
				        KvotaUslov*=garrBets[j].Quota;
				        
					    if (garrBets[j].OfferTypeID == 1)
					    {
					        if(garrBets[j].Tip == 'X' || garrBets[j].Tip == '2')
					            KIX2++;
					    }
					    else if (garrBets[j].OfferTypeID == 3 || garrBets[j].OfferTypeID == 4 || 
					                garrBets[j].OfferTypeID == 26 || garrBets[j].OfferTypeID == 27 || 
					                garrBets[j].OfferTypeID == 28)
					    {
					        UG++;
					    }
					    else if (garrBets[j].OfferTypeID == 6)
					    {
					       PK++; 
					    }
				        
			        }
				    BrojParova++;
				}
			}
			PosaljiOK = false;
			if (BrojParova == 1 && KvotaUslov >= 1.1)
			    PosaljiOK = true;
			else if (BrojParova > 3)
			    PosaljiOK = true;
			else if (KvotaUslov > 10)
			    PosaljiOK = true;
			else if (KIX2 > 2 || UG > 1 || PK > 1)
			    PosaljiOK = true;
			else if (BrojParova > 2)
			{
    			var arrLige=new Array();
    			var arrLigeCount=new Array();
			    var ligCount=new Number(-1);
			    for(var z=0;z<garrBets.length;z++)
			    {
			        var blRacunaj = false;
			        if (garrBets[z].OfferTypeID == 1)
			        {
			            blRacunaj = true;
			        }
			        else if (garrBets[z].Dvoznak == 1)
			        {
			            if (garrBets[z].OfferTypeID1 == 1)
			            {
			                blRacunaj = true;
			            }			            
			        }
			        if (blRacunaj)
			        {
			            if (ligCount == -1)
			            {
				            ligCount++;
				            arrLigeCount[ligCount]=1;
				            arrLige[ligCount]=garrBets[z].LigaID;
				        }
				        else
				        {
				            var blLigaFound = false;
				            for(var w=0;w<arrLige.length;w++)
				            {
				                if (arrLige[w] == garrBets[z].LigaID)
				                {
				                    arrLigeCount[w] += 1;
				                    blLigaFound = true;
				                }
				            }
				            if (!blLigaFound)
				            {
				                ligCount++;
				                arrLigeCount[ligCount]=1;
				                arrLige[ligCount]=garrBets[z].LigaID;
				            }
				        }
				    }
			    }
			    for(var q=0;q<arrLigeCount.length;q++)
			    {
			        if (arrLigeCount[q] > 2)
			            PosaljiOK = true;
			    }
			}
			    
			    
			return dblResult;
		}
		function VratiDvoznak(Polje, Polje1)
		{
		    var Poz = 0;
		    var Uslov = '2';
		    for(i=0;i<a0.length;i++)
		    {
		        if (a0[i] == Polje)
		        {
		            Poz = i;
		            break;
		        }
		    }
		    var Polj = '';
		    for(i=1;i<64;i++)
		    {
		        eval("Polj = a" + i + "[0];");
		        if (Polj == Polje1)
		        {
		            eval("Uslov = a" + i + "[" + Poz + "];");
		            break;
		        }
		    }
		    return Uslov;
		}
		function incSys(lngPos,arrBB)
		{
			if(garrSystem[lngPos]+1<=(arrBB.length-(garrSystem.length-lngPos-1)))
			{
				garrSystem[lngPos]++;
				return true;
			}
			else
			{
				if(lngPos-1>0)
					if(incSys(lngPos-1,arrBB)==true)
					{
						garrSystem[lngPos]=garrSystem[lngPos-1]+1;
						return true;
					}
					else
						return false;
				else
					return false;
			}
		}	

		function browserCheck()
		{
			if(top.gdocTarget.all&&!top.gdocTarget.getElementById)
			{
				gbolIsIE4=true;
				gbolIsIE5=false;
				gbolIsNS4=false;
				gbolIsNS6=false;
				initBettingSlipIE();
			}
			else if(top.gdocTarget.all&&top.gdocTarget.getElementById)
			{
				gbolIsIE4=false;
				gbolIsIE5=true;
				gbolIsNS4=false;
				gbolIsNS6=false;
				initBettingSlipDOM();
			}
			else if(!top.gdocTarget.all&&!top.gdocTarget.getElementById)
			{
				gbolIsIE4=false;
				gbolIsIE5=false;
				gbolIsNS4=true;
				gbolIsNS6=false;
				initBettingSlipNS();
			}
			else if(!top.gdocTarget.all&&top.gdocTarget.getElementById)
			{
				gbolIsIE4=false;
				gbolIsIE5=false;
				gbolIsNS4=false;
				gbolIsNS6=true;
				initBettingSlipDOM();
			}
		}
		function initBettingSlip(docTarget)
		{
			top.gdocTarget=docTarget;
			browserCheck();
		}
		function initBettingSlipIE()
		{
			var lngPosX=new Number(0);
			if(screen.width>800)
				lngPosX=470;
			else
				lngPosX=380;
			top.gdocTarget.open();
			top.gdocTarget.write("<div id=\"divBettingSlipContainer\" style=\"position:absolute;top:" + gTop + ";left:"+lngPosX+";width:240;height:100;\"><table id=\"tabBS\" align=\"center\"><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></table></div>");
			top.gdocTarget.close();
			top.gobjBS=top.gdocTarget.all["divBettingSlipContainer"];
		}
		function initBettingSlipNS()
		{
			var lngPosX=new Number(0);
			if(screen.width>800)
				lngPosX=470;
			else
				lngPosX=380;
			top.gdocTarget.open();
			top.gdocTarget.write("<layer name=\"layBettingSlip\" left=\""+lngPosX+"\" top=\"" + gTop + "\" width=\"240\" height=\"100\">&nbsp;</layer>");
			top.gdocTarget.close();
			top.gobjBS=top.gdocTarget.layers["layBettingSlip"];
		}
		function initBettingSlipDOM()
		{
			var lngPosX=new Number(0);
			var strOut=new String("");
			if(screen.width>800)
				lngPosX=590;
			else
				lngPosX=500;
			strOut="<div id=\"divBettingSlipContainer\" ";
			strOut+="style=\"position:absolute;top:" + gTop + ";left:"+lngPosX;
			strOut+=";width:240;height:100;\">";
			strOut+="<table><tr><td>.</td></tr></table>";
			strOut+="</div>";
			top.gdocTarget.open();
			top.gdocTarget.write(strOut);
			top.gdocTarget.close();
			top.gobjBS=top.gdocTarget.getElementById("divBettingSlipContainer");
		}
		function drawBettingSlip()
		{
			var strOut=new String();
			strOut="";

			strOut+=getSBHeader();
			strOut+=getSBSingleBetData();

			//if (garrBets.length > 0)
				strOut+=getSBStake();

			strOut+=getSBSendButton();


			if(top.gbolIsNS6||top.gbolIsIE5)
			{
				top.gobjBS.innerHTML=strOut;
			}
			else
			{
				top.gobjBS.document.open();
				top.gobjBS.document.write(strOut);
				top.gobjBS.document.close();
			}
			ObeleziIzabrane();
		}
		function getSBHeader()
		{
			strOut=new String("");
			strOut+="<form name=\"frmBettingSlip\" action=\"javascript:top.drawBettingSlip();\">";
			strOut+="<table id=\"myTable\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"320\">";
			strOut+="<tr>";
			strOut+="<td colspan=\"12\">";
			strOut+="<table width=\"320\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
			strOut+="<tr>";
			strOut+="<td width=\"260\" class=\"T63\">";
			strOut+="<span class=\"X4\">";
			strOut+="&nbsp;"+gobjSBText.BSName+"</span>";
			strOut+="</td><td width=\"60\" class=\"T63\">";
			strOut+="<img src=\"Images/SeparatorTipTop2.gif\"  width=\"60\" height=\"15\" border=\"0\"></td>";
			strOut+="</tr></table>";
			strOut+="</td></tr>";
			strOut+="<tr><td colspan=\"12\"><img src=\"images/p.gif\"  width=\"1\" height=\"2\" border=\"0\"></td></tr>";
			strOut+="<tr>";
			strOut+="<td width=\"1\"><img src=\"images/p.gif\" width=\"1\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"23\"><img src=\"images/p.gif\" width=\"23\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"95\"><img src=\"images/p.gif\" width=\"95\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"1\"><img src=\"images/p.gif\" width=\"1\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"35\"><img src=\"images/p.gif\" width=\"35\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"1\"><img src=\"images/p.gif\" width=\"1\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"35\"><img src=\"images/p.gif\" width=\"35\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"1\"><img src=\"images/p.gif\" width=\"1\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"40\"><img src=\"images/p.gif\" width=\"40\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"1\"><img src=\"images/p.gif\" width=\"1\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"70\"><img src=\"images/p.gif\" width=\"70\" height=\"2\" border=\"0\"></td>";
			strOut+="<td width=\"17\"><img src=\"images/p.gif\" width=\"17\" height=\"2\" border=\"0\"></td>";
			strOut+="</tr>";
			strOut+="<tr>";
			strOut+="<td colspan=\"11\" height=\"17\" class=\"T23\"><span class=\"X7\">";
			strOut+="<a href=\"#\" class=\"L1\" onclick=\"top.deleteAllBets()\">";
			strOut+="&nbsp;"+gobjSBText.DelAllBets+"</a></span></td>";
			strOut+="<td class=\"T33\">";
			strOut+="<a href=\"#\" onclick=\"top.deleteAllBets()\">";
			strOut+="<img src=\"images/common_icon_cancel.gif\" width=\"17\" height=\"17\" border=\"0\"></a></td>";
			strOut+="</tr>";
			strOut+="<tr><td colspan=\"12\"><img src=\"images/p.gif\"  width=\"1\" height=\"2\" border=\"0\"></td></tr>";
			return strOut;
		}
		function getSBSingleBetData()
		{
			var strOut=new String();
			strOut="";
			for(i=0;i<garrBets.length;i++)
			{
				strOut+="<tr>\n";
				strOut+="<td class=\"T23\"><img src=\"images/p.gif\"  width=\"1\" height=\"17\"  border=\"0\">";
				strOut+="</td>\n";
				
				strOut+="<td class=\"T23\">";
                strOut+="<input id=\"" + i +"\" type=\"checkbox\" onclick=\"top.SrediSistem(this)\" ";
                if (garrBets[i].Dvoznak == 1)
                {
                    strOut+="disabled='true'";
                }
                else if (garrBets[i].Sistem == 1)
                        strOut+="checked"

                strOut+=" />";
				strOut+="</td>\n";
				
				strOut+="<td class=\"T33\" colspan=\"3\"><span class=\"X13\">";
				strOut+=garrBets[i].BetText+"</span></td>\n";

				strOut+="<td colspan=\"5\" class=\"T22\"><span class=\"X5\">";
				strOut+=garrBets[i].Oznaka + " " + garrBets[i].Tip;
				
				if (garrBets[i].Dvoznak == 1)
				    strOut+=", "+garrBets[i].Oznaka1 + " " + garrBets[i].Tip1;
				    
				strOut+="</span></td>\n";

				strOut+="<td class=\"T35\"><span class=\"X13\">";
				strOut+=formatNumber(garrBets[i].Quota,2,",",".");
				
				if (garrBets[i].Dvoznak == 1)
				    strOut+=" - "+formatNumber(garrBets[i].Quota1,2,",",".");
				    
				strOut+="</span></td>\n";

				strOut+="<td class=\"T33\"><img src=\"images/p.gif\" width=\"1\" height=\"1\" border=\"0\">";
				strOut+="<a href=\"#\" onclick=\"top.deleteBet("+i+")\">";
				strOut+="<img src=\"images/common_icon_cancel.gif\"  width=\"17\"  height=\"17\"  border=\"0\"></a></td>\n";
				strOut+="</tr>\n";
				if(garrBets[i].AddLine!="")
				{
					strOut+="<tr><td colspan=\"12\"><img src=\"images/p.gif\" width=\"1\" height=\"1\" border=\"0\"></td></tr>";
					strOut+="<tr><td colspan=\"12\">";
					strOut+="<table width=\"320\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
					strOut+="<tr>";
					strOut+="<td width=\"260\" class=\"T33\"><span class=\"X13\">&nbsp;";
					strOut+=garrBets[i].AddLine+"</span></td>";
					strOut+="<td width=\"60\" class=\"T33\"><img src=\"images/common_rounding_wettereignis.gif\" width=\"65\" height=\"13\" border=\"0\"></td>";
					strOut+="</tr></table></td></tr>";
				}
				strOut+="<tr><td colspan=\"12\"><img src=\"images/p.gif\" width=\"1\" height=\"2\" border=\"0\"></td></tr>";
			}
			return strOut;
		}
		function SrediSistem(p)
		{
		    if (p.checked == true)
		    {
		        garrBets[p.id].Sistem = 1;
		        gSistemUkupno++;
		    }
		    else
		    {
		        garrBets[p.id].Sistem = 0;
		        gSistemUkupno--;
		    }
		    if (top.gobjSBProp.Sistem != gSistemUkupno)
		        top.gobjSBProp.Sistem = gSistemUkupno;
    	    drawBettingSlip();
		    calcBetProperties();
		    drawBettingSummary();
		}
		function deleteAllBets()
		{
			gbolDelAll=true;
			while(garrBets.length!=0)
				deleteBet(0);
			gbolDelAll=false;
			top.gobjSBProp.Sistem = 0;
			drawBettingSlip();
			calcBetProperties();
			drawBettingSummary();
		}
		function ObrisiTiket()
		{
			while(garrBets.length!=0)
			{
				if (garrBets[0].Sistem == 1)
                    gSistemUkupno--;
			    garrBets=removeArrayEntry(0,garrBets);
			    glngLastBet--;

			}
			top.gobjSBProp.Sistem = 0;
			top.gobjSBProp.NumberOfBets=0;
			top.gobjSBProp.Stake=0;
			top.gobjSBProp.PossibleWin=0;
			top.gobjSBProp.MaxKvota=0;
		}		
		function deleteBet(indexOfBet)
		{
            var tdTip = top.gdocTarget.getElementById(garrBets[indexOfBet].BettingOfferIDIgre + "");
            if (tdTip != "undefined" && tdTip != null)
            {
                tdTip.style.display = "";
                tdTip.style.backgroundColor="";
            }
            var tdTip = top.gdocTarget.getElementById(garrBets[indexOfBet].BettingOfferIDIgre1 + "");
            if (tdTip != "undefined" && tdTip != null)
            {
                tdTip.style.display = "";
                tdTip.style.backgroundColor="";
            }
            if (garrBets[indexOfBet].Sistem == 1)
                gSistemUkupno--;
			garrBets=removeArrayEntry(indexOfBet,garrBets);
			glngLastBet--;
			if (gbolDelAll==false)
			{
			    if (top.gobjSBProp.Sistem > gSistemUkupno)
				    top.gobjSBProp.Sistem = gSistemUkupno;
				drawBettingSlip();
				calcBetProperties();
				drawBettingSummary();
			}
		}
		
		function removeArrayEntry(lngIndex,arrSource)
		{
			var arrTemp=new Array();
			var lngCount=new Number();
			$lngCount=-1;
			for(i=0;i<arrSource.length;i++)
				if(i!=lngIndex)
				{
					$lngCount++;
					arrTemp[$lngCount]=arrSource[i];
				}
			return arrTemp;
		}				
		function getSBStake()
		{
			var strOut=new String();
			strOut="";
			
			strOut+="<tr><td colspan=\"12\">";
			strOut+="<table width=\"320\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
			strOut+="<tr>";
			strOut+="<td height=\"17\"  class=\"T23\"><span class=\"X7\">&nbsp;";
			strOut+=gobjSBText.Sistem+"</span></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td>";
			strOut+="<td class=\"T26\">";
			strOut+="<SELECT class='selbre' name=\"cbSBStake\" onchange=\"top.changeStakeSystem()\">";
			for(j=1;j<gSistemUkupno+1;j++)
			{
				strOut+="<OPTION value=\"" + j + "\"";
				if (top.gobjSBProp.Sistem == j)
					strOut+=" selected";
				strOut+=">";
				if (j == gSistemUkupno)
				    strOut+=top.gobjGeneralText.Fiks;
				else
				    strOut+=j + "/" + gSistemUkupno; 
				strOut+="</OPTION>";						
			}
			strOut+="</SELECT></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td></tr>";
			
			strOut+="<tr><td colspan=4><img src=\"images/p.gif\"  width=\"1\" height=\"2\" border=\"0\"></td></tr>";

			strOut+="<tr>";
			strOut+="<td height=\"17\"  class=\"T24\"><span class=\"X7\">&nbsp;";
			strOut+=gobjSBText.Stake+"</span></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td>";
			strOut+="<td class=\"T25\">";
			strOut+="<span class=\"X7\">";
			
			strOut+="<SELECT class='selbre' name=\"txtSBStake\" onchange=\"top.changeStakeSystem()\">";

			for(j=1;j<gBrojPoena+1;j++)
			{
				strOut+="<OPTION value=\"" + j + "\"";
				if (parseInt(top.gobjSBProp.Stake) == j)
					strOut+=" selected";
				strOut+=">" + j + "</OPTION>";						
			}
			strOut+="</SELECT>";
			

			strOut+="</span></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td></tr>";
			
			strOut+="<tr><td colspan=4><img src=\"images/p.gif\"  width=\"1\" height=\"2\" border=\"0\"></td></tr>";
			
			strOut+="<tr>";
			strOut+="<td height=\"17\"  class=\"T23\"><span class=\"X7\">&nbsp;";
			strOut+=gobjSBText.MaxKvota+"</span></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td>";
			strOut+="<td class=\"T26\">";
			if(top.gbolIsIE4||top.gbolIsIE5||top.gbolIsNS6)
				strOut+="<div id=\"divMaxKvota\" class=\"X7\">";//
			else
				strOut+="<layer name=\"layMaxKvota\" left=\"200\" top=\"125\">";
			strOut+=formatNumber(gobjSBProp.MaxKvota,2,",",".")+"&nbsp;";
			if(top.gbolIsIE4||top.gbolIsIE5||top.gbolIsNS6)
				strOut+="</div></td>";
			else
				strOut+="</layer></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td></tr>";			
			
			strOut+="<tr><td colspan=4><img src=\"images/p.gif\"  width=\"1\" height=\"2\" border=\"0\"></td></tr>";
			
			strOut+="<tr>";
			strOut+="<td height=\"17\"  class=\"T24\"><span class=\"X7\">&nbsp;";
			strOut+=gobjSBText.PossibleWin+"</span></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td>";
			strOut+="<td class=\"T25\">";
			if(top.gbolIsIE4||top.gbolIsIE5||top.gbolIsNS6)
				strOut+="<div id=\"divWin\" class=\"X7\">";//
			else
				strOut+="<layer name=\"layWin\" left=\"200\" top=\"125\">";
			strOut+=formatNumber(gobjSBProp.PossibleWin,1,",",".")+"&nbsp;"+gobjCustomer.Currency+"";
			if(top.gbolIsIE4||top.gbolIsIE5||top.gbolIsNS6)
				strOut+="</div></td>";
			else
				strOut+="</layer></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td></tr>";			
			
			strOut+="<tr><td colspan=4><img src=\"images/p.gif\"  width=\"1\" height=\"2\" border=\"0\"></td></tr>";
			
			strOut+="<tr>";
			strOut+="<td height=\"17\"  class=\"T23\"><span class=\"X7\">&nbsp;";
			strOut+=gobjSBText.NumberOfBets+"</span></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td>";
			strOut+="<td class=\"T26\">";
			if(top.gbolIsIE4||top.gbolIsIE5||top.gbolIsNS6)
				strOut+="<div id=\"divBets\" class=\"X7\">";
			else
				strOut+="<layer name=\"layBets\" left=\"200\" top=\"125\">";
			strOut+=gobjSBProp.NumberOfBets + "&nbsp;";
			if(top.gbolIsIE4||top.gbolIsIE5||top.gbolIsNS6)
				strOut+="</div></td>";
			else
				strOut+="</layer></td>";
			strOut+="<td><img src=\"images/p.gif\"  width=\"1\" height=\"1\"  border=\"0\"></td></tr>";
			strOut+="</table></td></tr>";
			return strOut;
		}
		function getSBSendButton()
		{
			var strOut=new String("");
			var strBOID=new String("");
			var strBOIDCombi=new String("");
			for(var i=0;i<garrBets.length;i++)
			{
				if(strBOID.length>0)
					strBOID+=",";
					
					
				strBOID+=garrBets[i].ListaID+"|"+garrBets[i].BettingOfferID+"|"+garrBets[i].OfferTypeID+"|"+garrBets[i].EventID+"|"+garrBets[i].Stake+"|"+garrBets[i].Quota+"|"+garrBets[i].KindOfSportID+"|"+garrBets[i].Oznaka+"|"+garrBets[i].Sistem;
			}
			for(var i=0;i<garrBets.length;i++)
			{
				if(garrBets[i].Active==true)
				{
					if(strBOIDCombi.length>0)
						strBOIDCombi+=",";
					strBOIDCombi+=garrBets[i].BettingOfferID;
				}
			}
			
		
			
			strOut+="<tr><td colspan=\"12\"><img src=\"images/p.gif\" width=\"1\" height=\"4\" border=\"0\"></td></tr>";
			strOut+="<tr><td colspan=\"12\">";
			
			strOut+="<table width=\"320\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
			strOut+="<tr>";
			strOut+="<td width=\"260\" class=\"T63\"><span class=\"X4\">&nbsp;";
			if(top.gbolIsIE5&&top.gbolIsIE5V!=-1)
				strOut+="<a style=\"cursor:hand\" class=\"L1\" onClick=\"top.placeBet('"+strBOID+"','"+strBOIDCombi+"')\">";
			else
				strOut+="<a class=\"L1\" href=\"#\" onClick=\"top.placeBet('"+strBOID+"','"+strBOIDCombi+"')\">";
			strOut+=gobjSBText.SendButtonText;
			strOut+="&nbsp;&nbsp;&nbsp;<img src=\"images/common_arrow_button.gif\" width=\"12\" height=\"10\" border=\"0\">";
			strOut+="</a></span></td>";
			strOut+="<td width=\"60\" class=\"T63\">";
			strOut+="<img src=\"Images/SeparatorTipBot2.gif\" width=\"60\" height=\"15\" border=\"0\"></td>";
			strOut+="</tr></table>";
			strOut+="</td></tr></table></form>";
			return strOut;
		}
		function formatNumber(dblNumber,intDec,strDecSign,strTSSign)
		{
			dblNumber=dblNumber.toString().replace(/\,/g,'');
			if(isNaN(dblNumber))
				dblNumber="0";
			sign=(dblNumber==(dblNumber=Math.abs(dblNumber)));
			dblNumber=Math.floor((dblNumber*Math.pow(10,intDec))+0.50000000001);
			cents=dblNumber%Math.pow(10,intDec);
			dblNumber=Math.floor(dblNumber/Math.pow(10,intDec)).toString();
			cents=String(cents);
			if (intDec == 1)
			{
			    if(cents.length==1)
				    cents=cents+"0";
			}
			else
			{
			    if(cents.length==1)
				    cents="0"+cents;
			}
			var Zeros=intDec-cents.length;
			for(i=1;i<=Zeros;i++)
				cents+="0";
			for(var i=0;i<Math.floor((dblNumber.length-(1+i))/3);i++)
				dblNumber=dblNumber.substring(0,dblNumber.length-(4*i+3))+strTSSign+dblNumber.substring(dblNumber.length-(4*i+3));
			var strResult=(sign?'':'-')+dblNumber;
			if(intDec>0)
				strResult+=strDecSign+cents;
			return strResult;
		}

		function changeStakeSystem()
		{
			calcBetProperties();
			drawBettingSummary();
		}
		function drawBettingSummary()
		{
			if(top.gbolIsIE4||top.gbolIsIE5)
			{
				top.gdocTarget.all.divBets.innerHTML=top.formatNumber(top.gobjSBProp.NumberOfBets,0,",",".")+"&nbsp;";
				top.gdocTarget.all.divMaxKvota.innerHTML=top.formatNumber(top.gobjSBProp.MaxKvota,2,",",".")+"&nbsp;";
				top.gdocTarget.all.divWin.innerHTML=top.formatNumber(top.gobjSBProp.PossibleWin,1,",",".")+"&nbsp;"+top.gobjCustomer.Currency+"";
			}
			else if(top.gbolIsNS6)
			{
				top.gdocTarget.getElementById("divBets").innerHTML=top.formatNumber(top.gobjSBProp.NumberOfBets,0,",",".")+"&nbsp;";
				top.gdocTarget.getElementById("divWin").innerHTML=top.formatNumber(top.gobjSBProp.PossibleWin,1,",",".")+"&nbsp;"+top.gobjCustomer.Currency+"";
				top.gdocTarget.getElementById("divMaxKvota").innerHTML=top.formatNumber(top.gobjSBProp.MaxKvota,2,",",".")+"&nbsp;";
			}
			else
			{
				top.gdocTarget.layers["layBets"].open();
				top.gdocTarget.layers["layBets"].write(top.formatNumber(top.gobjSBProp.NumberOfBets,0,",",".")+"&nbsp;");
				top.gdocTarget.layers["layBets"].close();
				top.gdocTarget.layers["layWin"].open();
				top.gdocTarget.layers["layWin"].write(top.formatNumber(top.gobjSBProp.PossibleWin,1,",",".")+"&nbsp;"+gobjCustomer.Currency+"");
				top.gdocTarget.layers["layWin"].close();
				top.gdocTarget.layers["layMaxKvota"].open();
				top.gdocTarget.layers["layMaxKvota"].write(top.formatNumber(top.gobjSBProp.MaxKvota,2,",",".")+"&nbsp;");
				top.gdocTarget.layers["layMaxKvota"].close();
			}
		}
		
		function placeBet(strBOID,strBOIDCombi)
		{
			if(top.gobjCustomer.CustomerID==0)
			{
				alert(top.gobjGeneralText.LoginMessage);
			}
			else if(garrBets.length==0)
			{
				alert(top.gobjGeneralText.NoTip);
			}
			else if(!(top.gobjSBProp.Stake > 0))
			{
				alert(top.gobjGeneralText.NoMoney);
			}
			else if(top.gobjSBProp.Stake > gBrojPoena)
			{
				alert(top.gobjGeneralText.NemaDovoljno);
			}
			else if(gobjCustomer.Limit > 0 && top.gobjSBProp.Stake > gobjCustomer.Limit)
			{
				alert(top.gobjGeneralText.MaxLimit + gobjCustomer.Limit + "!");
			}
			else if(!PosaljiOK)
			{
				alert(top.gobjGeneralText.NemaUslov);
			}
			else
			{
				strBOID="";
				for(var i=0;i<garrBets.length;i++)
				{
					if(strBOID.length>0)
						strBOID+=",";
					strBOID+=garrBets[i].ListaID+"|"+garrBets[i].BettingOfferID+"|"+garrBets[i].OfferTypeID+"|"+garrBets[i].EventID+"|"+garrBets[i].Stake+"|"+garrBets[i].Quota+"|"+garrBets[i].KindOfSportID+"|"+garrBets[i].Oznaka+"|"+garrBets[i].Sistem+"|"+garrBets[i].Tip+"|"+garrBets[i].BetText+"|"+garrBets[i].LigaID+"|"+garrBets[i].OfferTypeID1+"|"+garrBets[i].EventID1+"|"+garrBets[i].Quota1+"|"+garrBets[i].Tip1+"|"+garrBets[i].Oznaka1+"|"+garrBets[i].Dvoznak+"|"+garrBets[i].Polje+"|"+garrBets[i].Polje1;
				}
			
			    strBOID = encodeURIComponent(strBOID);

				var strLink=new String(top.gstrPlaceBetLink+"?ID="+strBOID+"&REF=BS"+"&IDCOMBI="+top.gobjSBProp.Sistem + "&STAKE=" + top.gobjSBProp.Stake);
				if(navigator.platform.search("Mac")!=-1&&navigator.userAgent.search("MSIE")==-1)
				{
					top.gdocTarget.frmMacbet.action=strLink;
					top.gdocTarget.frmMacbet.submit();
				}
				else
				{
					top.gdocTarget.location.href=strLink;
				}
			}
		}
		function checkKey(e)
		{
			var keyCode=(e.which)?e.which:e.keyCode;
//			window.alert(keyCode);
			if ((keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105) || keyCode == 46 || keyCode == 8)// || keyCode == 188
				e.returnValue = true;
//			else if (keyCode == 110)
//			{
//				e.keyCode = 188;
//				e.returnValue = true;
//			}
			else
			{
				e.keyCode = 0;
				e.returnValue = false;
			}
		}
		
		function Potvrda()
		{
		    if (window.confirm(gobjGeneralText.Potvrda))
		        return true;
		    else
		        return false;
		}