﻿sb.dt = {
    dn: [sb.lang.mstr.date.dy0[site.thm.lang], sb.lang.mstr.date.dy1[site.thm.lang], sb.lang.mstr.date.dy2[site.thm.lang], sb.lang.mstr.date.dy3[site.thm.lang], sb.lang.mstr.date.dy4[site.thm.lang], sb.lang.mstr.date.dy5[site.thm.lang], sb.lang.mstr.date.dy6[site.thm.lang]],
    mn: [sb.lang.mstr.date.mont1[site.thm.lang], sb.lang.mstr.date.mont2[site.thm.lang], sb.lang.mstr.date.mont3[site.thm.lang], sb.lang.mstr.date.mont4[site.thm.lang], sb.lang.mstr.date.mont5[site.thm.lang], sb.lang.mstr.date.mont6[site.thm.lang], sb.lang.mstr.date.mont7[site.thm.lang], sb.lang.mstr.date.mont8[site.thm.lang], sb.lang.mstr.date.mont9[site.thm.lang], sb.lang.mstr.date.mont10[site.thm.lang], sb.lang.mstr.date.mont11[site.thm.lang], sb.lang.mstr.date.mont12[site.thm.lang]],
    sh: function (d) {
        var a = d.split('.');
        b = a[3];
        switch (a[7]) {
            case '1': return sb.dt.dn[parseInt(a[4]) - 1] + ' ' + a[0] + b + a[1] + b + a[2];
            case '2': return a[0] + b + a[1] + b + a[2];
            case '3': return sb.dt.dn[parseInt(a[4]) - 1] + ' ' + a[0] + b + sb.dt.mn[parseInt(a[1]) - 1] + b + a[2];
            case '4': return a[0] + b + sb.dt.mn[parseInt(a[1]) - 1] + b + a[2]; ;
            case '5': return sb.dt.dn[parseInt(a[4]) - 1] + ' ' + a[0] + b + a[1] + b + a[2] + ' ' + a[5] + ':' + a[6];
            case '6': return a[0] + b + a[1] + b + a[2] + ' ' + a[5] + ':' + a[6];
            case '7': return a[0] + b + sb.dt.mn[parseInt(a[1]) - 1] + b + a[2] + ' ' + a[5] + ':' + a[6];
            case '8': return sb.dt.dn[parseInt(a[4]) - 1] + ' ' + a[0] + b + sb.dt.mn[parseInt(a[1]) - 1] + b + a[2] + ' ' + a[5] + ':' + a[6];
        }
    }
}

sb.ic = {
    thm: { _0: '-0', _1: '-20', _2: '-40', _3: '-60', _4: '-80', _5: '-100', _6: '-120', _7: '-140', _8: '-160', _9: '-180', _10: '-200', _11: '-220', _12: '-240' },
    prnt: '0', home: '-20', moni: '-40', tel: '-60', mob: '-80', cmp: '-100', Eml: '-120', Web: '-140', Pic: '-160', FN: '-180', Rss: '-200', Dat: '-220', Fax: '-240', add: '-260', pdf: '-280',
    rss: [
    '1w5e554rtew~78~73~69~260~10~20',
    'er5se8wew9~90~95~50~250~20~20',
    'weweser589~93~94~30~250~20~20',
    '987sdf45fer432~132~126~10~210~20~20',
    'd4kas443fsdew9~118~105~30~230~20~15',
    '08ds7gfds89rwe~131~129~20~-10~20~100',
    'hg76y66ffd554f~100~99~25~240~25~20',
    'pm345p43ij34~129~122~20~0~25~90',
    'sdf243gj89990~140~82~30~210~20~-10',
    '1rs2a3sdf243gj80~137~82~30~210~20~-10',
    'sf2gj8a9pa6qnh~93~110~30~250~20~20',
    'sd9dpdls9c8v323fg~103~124~10~240~20~15',
    '98er87j78ioiumj~117~107~25~230~20~15',
    '2rs2a3sdf243gj80~137~82~30~210~20~-10',
    '9s9sddd53hj9km~105~118~20~230~25~10',
    'kkjg5gh84d9s8ad4s~94~106~30~240~20~10',
    '2sf2gj8a9pa6qnh~94~106~30~240~25~20',
    '2sd9dpdls9c8v323fg~103~120~10~240~20~15',
    'lk3o3pd887dsp~112~125~15~235~20~10'
    ],
    rssHtm: function (team) {
        var a = new Array(sb.lang.mstr.news[site.thm.lang], sb.lang.mstr.arti[site.thm.lang], sb.lang.mstr.gall[site.thm.lang], sb.lang.mstr.prd[site.thm.lang]);
        var p = new Array('News', 'Article', 'Gallery', 'Product');
        var d = String(team).split('~');
        var c = sb.lang.mstr.rss.lastFEED[site.thm.lang];
        var outer = '<div class="flo rel" style="width: 350px; height: 145px;">';
        outer += '<div class="abs" style="width:{1}px;height:{2}px;left:{4}px;top:{3}px;background-image:url(http://pcocdn.net/img/sb/rss/{0}.png);"></div>';
        outer += '<div class="abs" style="width:210px;height:105px;left:{6}px;top:{5}px;">';
        for (var i = 0; i < 4; i++) { outer += '<div class="txt_al_r" style="height:25px;line-height:25px;"><a href="../../../' + p[i] + '.rss" class="lnk" onclick="fout();" target="_blank">•' + c + a[i] + '</a></div>'; }
        outer += '</div></div>';
        return outer.replace('{0}', d[0]).replace('{1}', d[1]).replace('{2}', d[2]).replace('{3}', d[3]).replace('{4}', d[4]).replace('{5}', d[5]).replace('{6}', d[6]);
    }
}
sb.com = {
    ord: ['creationdate', 'updatetime', 'id', 'counter', 'desc', 'asc', '-'],
    srt: function (we) {
        var a = sb.com.ord;
        switch (we) {
            case '2b7q8': return a[0] + a[6] + a[4];
            case 'q2b78': return a[0] + a[6] + a[5];
            case '78bq2': return a[1] + a[6] + a[4];
            case '72bg8': return a[1] + a[6] + a[5];
            case '827gb': return a[2] + a[6] + a[4];
            case 'b872g': return a[2] + a[6] + a[5];
            case 'g827b': return a[3] + a[6] + a[4];
            case 'g82b7': return a[3] + a[6] + a[5];
            default: return a[0] + a[6] + a[4];
        }
    },
    fiximg: function () {
        if ($('col2') != null) {
            var w = String($('col2').offsetWidth);
            var a = $('col2').getElementsByTagName('img');
            for (var i = 0; i < a.length; i++) {
                var b = new Array(a[i].width, a[i].height);
                if (b[0] != '0' || b[1] != '0') {
                    if (b[0] > w) {
                        a[i].style.width = p(String(parseInt(w) - 10));
                    }
                }
            }
        }
    },
    drwplg: function () {
        var outer = '';
        var loc = '';
        var srv = new Array((window.location.pathname.substring(1, window.location.pathname.length).replace('/', '-')).split('-')[0], (window.location.pathname.substring(1, window.location.pathname.length).replace('/', '-')).split('-')[2]);
        switch (srv[0]) {
            case 'News':
                loc = 'nws';
                break;
            case 'Articles':
                loc = 'arti';
                break;
            case 'Gallery':
                loc = 'gal';
                break;
        }
        var pdftem = '<a style="width: 20px; float: left; height: 20px; background-image:url(http://pcocdn.net/img/sb/IconPack/001%2820%2D20%29.png);background-position:_0_px ' + eval(site.inf.ico[0]) + 'px;margin:3px;" href="http://pdfmyurl.com/?url=_1_&-O=Portrait&--header-left=_3_&--filename=' + srv[0] + '-' + srv[1] + '.pdf" target="_blank" title="_2_"></a>';
        var ictem = '<a style="width: 20px; float: left; height: 20px; background-image:url(http://pcocdn.net/img/sb/IconPack/001%2820%2D20%29.png);background-position:_0_px ' + eval(site.inf.ico[0]) + 'px;margin:3px;" href="../../../__page?what=_1_&Witch=' + srv[1] + '&Where=' + loc + '" target="_blank" title="_2_"></a>';
        outer += ictem.replace('_0_', sb.ic.prnt).replace('_1_', 'print').replace('_2_', 'print');
        outer += ictem.replace('_0_', sb.ic.Rss).replace('_1_', 'xml').replace('_2_', 'Rss') ;
        outer += pdftem.replace('_0_', sb.ic.pdf).replace('_1_', encodeURIComponent(window.location.hostname + '/__page?what=print&Witch=' + srv[1] + '&Where=' + loc)).replace('_2_', 'Pdf').replace('_3_', window.location.hostname);
        return outer;
    }

}
sb.conus = {
    snt: { _1: 'img/sb/com/sendOk.png' },
    drwConUs: function (icoP) {
        var outer = '';
        var ictem = '<div class="flo txt_al_r ico wh" style="background-position:{0}px ' + icoP + 'px;"></div>';
        var ictx = '<div class="flo txt_al_r whitx">&nbsp;<b>{1}&nbsp;:&nbsp;&nbsp;</b>{0}</div>';
        var diiv = '<div class="flo whyrt">';
        var d_c = '</div>';
        if (site.inf.bool == 'dfy') {
            outer += (site.inf.cmpny[1] == 'dfy' && site.inf.cmpny[0] != '') ? diiv + ictem.replace('{0}', sb.ic.cmp) + ictx.replace('{0}', site.inf.cmpny[0]).replace('{1}', sb.lang.conus.cmpny[site.thm.lang]) + d_c : '';
            outer += (site.inf.tel[1] == 'dfy' && site.inf.tel[0] != '') ? diiv + ictem.replace('{0}', sb.ic.tel) + ictx.replace('{0}', site.inf.tel[0].replace('+', ' , ')).replace('{1}', sb.lang.conus.tel[site.thm.lang]) + d_c : '';
            outer += (site.inf.mob[1] == 'dfy' && site.inf.mob[0] != '') ? diiv + ictem.replace('{0}', sb.ic.mob) + ictx.replace('{0}', site.inf.mob[0].replace('+', ' , ')).replace('{1}', sb.lang.conus.mob[site.thm.lang]) + d_c : '';
            outer += (site.inf.fx[1] == 'dfy' && site.inf.fx[0] != '') ? diiv + ictem.replace('{0}', sb.ic.Fax) + ictx.replace('{0}', site.inf.fx[0].replace('+', ' , ')).replace('{1}', sb.lang.conus.fax[site.thm.lang]) + d_c : '';
            outer += (site.inf.st[1] == 'dfy' && site.inf.st[0] != '') ? diiv + ictem.replace('{0}', sb.ic.home) + ictx.replace('{0}', site.inf.st[0]).replace('{1}', sb.lang.conus.posz[site.thm.lang]) + d_c : '';
            outer += (site.inf.em[1] == 'dfy' && site.inf.em[0] != '') ? diiv + ictem.replace('{0}', sb.ic.Eml) + ictx.replace('{0}', '<a href="mailto:' + site.inf.em[0] + '">' + site.inf.em[0] + '</a>').replace('{1}', sb.lang.conus.email[site.thm.lang]) + d_c : '';
            outer += (site.inf.web[1] == 'dfy' && site.inf.web[0] != '') ? diiv + ictem.replace('{0}', sb.ic.Web) + ictx.replace('{0}', '<a href="http://' + site.inf.web[0] + '">' + site.inf.web[0] + '</a>').replace('{1}', sb.lang.conus.web[site.thm.lang]) + d_c : '';
            var regi = new RegExp('~_~', '\g');
            outer += (site.inf.ad[1] == 'dfy' && site.inf.ad[0] != '') ? diiv + ictem.replace('{0}', sb.ic.Dat) + ictx.replace('{0}', (String(site.inf.ad[0].replace(RegExp("&nbsp;", "g"), ' ').replace(RegExp("~_~", "g"), '<br/>').replace(RegExp("&lt;", "g"), '<').replace(RegExp("&amp;", "g"), '&').replace(RegExp("&quot;", "g"), "'").replace(RegExp("&gt;", "g"), '>')))).replace('{1}', sb.lang.conus.addrs[site.thm.lang]) + '</div>' : '';
        }
        return outer;
    },
    drwconusfo: function (icoP) {
        var outer = '';
        var lse = '<div class="flo inp_row_f"><div class="flo wh ico" style="background-position:{0}px ' + icoP + 'px;"></div><div class="flo inp_row_name">{1} :</div><div class="flo inp_row_txt"><input type="text" id="conus_{2}" class="inp_dres"/></div></div>';
        var d_c = '</div>';
        if (site.cts.bool == 'dfy') {
            outer += '<div class="flo txt_al_r" style="width:90%;margin:3% 5%;">';
            outer += (site.cts.fn == 'dfy') ? lse.replace('{2}', 'FN').replace('{0}', sb.ic.FN).replace('{1}', sb.lang.conus.fname[site.thm.lang]) : '';
            outer += (site.cts.em == 'dfy') ? lse.replace('{2}', 'Eml').replace('{0}', sb.ic.Eml).replace('{1}', sb.lang.conus.email[site.thm.lang]).replace('inp_dres', 'inp_dres txt_al_l') : '';
            outer += (site.cts.web == 'dfy') ? lse.replace('{2}', 'Web').replace('{0}', sb.ic.Web).replace('{1}', sb.lang.conus.web[site.thm.lang]).replace('inp_dres', 'inp_dres txt_al_l') : '';
            outer += (site.cts.tel == 'dfy') ? lse.replace('{2}', 'tel').replace('{0}', sb.ic.tel).replace('{1}', sb.lang.conus.tel[site.thm.lang]).replace('inp_dres', 'inp_dres txt_al_l') : '';
            outer += (site.cts.tit == 'dfy') ? lse.replace('{2}', 'cmp').replace('{0}', sb.ic.cmp).replace('{1}', sb.lang.conus.tit[site.thm.lang]) : '';
            outer += '<div class="flo inp_row_f" style="height:auto;margin-top:5px;"><div style="width: 100%; font-size: 12px; height: 20px; line-height: 18px;">' + sb.lang.conus.txt[site.thm.lang] + ' :</div><div><textarea id="conus_cont" class="flo txt_al_r inp_dres" style="height:150px;"></textarea></div></div>';
            outer += '<div class="flo">';
            outer += '<div class="flo"><input id="conus_sub" style="font-size:11px;width:100px;height:25px;" onclick="conus_sub();" type="button" value="' + sb.lang.mstr.valid.submit[site.thm.lang] + '"/></div>';
            outer += d_c;
            outer += '<div class="flo" id="inp_row_er">' + d_c;
            outer += d_c;
        }
        return outer;
    }
}
