﻿eval(function (p, a, c, k, e, r) { e = function (c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[e] } ]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('9 u=k(){9 g=/^([^#.>`]*)(#|\\.|\\>|\\`)(.+)$/;k u(a,b){9 c=a.J(/\\s*\\,\\s*/);9 d=[];n(9 i=0;i<c.l;i++){d=d.v(o(c[i],b))};6 d};k o(a,b,c){a=a.z(" ","`");9 d=a.r(g);9 e,5,m,7,i,h;9 f=[];4(d==8){d=[a,a]};4(d[1]==""){d[1]="*"};4(c==8){c="`"};4(b==8){b=E};K(d[2]){w"#":7=d[3].r(g);4(7==8){7=[8,d[3]]};e=E.L(7[1]);4(e==8||(d[1]!="*"&&!x(e,d[1]))){6 f};4(7.l==2){f.A(e);6 f};6 o(7[3],e,7[2]);w".":4(c!=">"){5=p(b,d[1])}y{5=b.B};n(i=0,h=5.l;i<h;i++){e=5[i];4(e.C!=1){q};7=d[3].r(g);4(7!=8){4(e.j==8||e.j.r("(\\\\s|^)"+7[1]+"(\\\\s|$)")==8){q};m=o(7[3],e,7[2]);f=f.v(m)}y 4(e.j!=8&&e.j.r("(\\\\s|^)"+d[3]+"(\\\\s|$)")!=8){f.A(e)}};6 f;w">":4(c!=">"){5=p(b,d[1])}y{5=b.B};n(i=0,h=5.l;i<h;i++){e=5[i];4(e.C!=1){q};4(!x(e,d[1])){q};m=o(d[3],e,">");f=f.v(m)};6 f;w"`":5=p(b,d[1]);n(i=0,h=5.l;i<h;i++){e=5[i];m=o(d[3],e,"`");f=f.v(m)};6 f;M:4(c!=">"){5=p(b,d[1])}y{5=b.B};n(i=0,h=5.l;i<h;i++){e=5[i];4(e.C!=1){q};4(!x(e,d[1])){q};f.A(e)};6 f}};k p(a,b){4(b=="*"&&a.F!=8){6 a.F};6 a.p(b)};k x(a,b){4(b=="*"){6 N};6 a.O.G().z("P:","")==b.G()};6 u}();k Q(a,b){9 c=u(a);n(9 i=0;i<c.l;i++){c[i].R=k(){4(t.j.H(b)==-1){t.j+=" "+b}};c[i].S=k(){4(t.j.H(b)!=-1){t.j=t.j.z(b,"")}}}}4(D.I&&!D.T){D.I("U",V)}', 58, 58, '||||if|listNodes|return|subselector|null|var||||||||limit||className|function|length|listSubNodes|for|doParse|getElementsByTagName|continue|match||this|parseSelector|concat|case|matchNodeNames|else|replace|push|childNodes|nodeType|window|document|all|toLowerCase|indexOf|attachEvent|split|switch|getElementById|default|true|nodeName|html|hoverForIE6|onmouseover|onmouseout|opera|onload|ieHover'.split('|'), 0, {}))
/*parametrs [selector, hover_class]*/
function ieHover() {
    hoverForIE6("#nav li", "hover");
}

$(document).ready(function () {

    /* serachbox */
    $('.form-search').each(function () {

        var thisVal = $(this).val();

        $(this).focus(function () {
            var newVal = $(this).val();
            if (newVal == thisVal) {
                $(this).val('');
            }
        });


        $(this).blur(function () {
            var newVal = $(this).val();
            if (newVal == 0) {
                $(this).val(thisVal);
            }
        });

        /* tabs function */
        // initialtize
        var index = 0;

        $('#tab1').css('display', 'block');
        $('ul.prodTabsList li:first').addClass('prodTabsActive');
        $('div.tabData table tr:even').addClass('prodTrEven');
        $('div.tabData table tr td:even').addClass('prodTdFirst');



        $('ul.prodTabsList li').click(function () { return false; });

        $('ul.prodTabsList li').click(function () {

            var clickIndex = $("ul.prodTabsList li").index(this);
            if (index != clickIndex) {
                $('ul.prodTabsList li').removeClass('prodTabsActive');
                $('ul.prodTabsList li:eq(' + clickIndex + ')').addClass('prodTabsActive');
                $('#tab' + (clickIndex + 1)).show();
                $('#tab' + (index + 1)).hide();
                index = clickIndex;
            }

        });

        $('#DistributorSelect').change(function () {
            location.href = "Locate_Distributor.aspx";
        });

        $('select#ctl00_ContentPlaceHolder1_dropDistributors').change(function () {
            if ($(this).val() != "0") {
                location.href = $(this).val();
            }

        });
    });

    

    $('.butFormSend').hover(
    function () {
        $(this).css('background-position', 'center bottom');
    },
    function () {
        $(this).css('background-position', 'center top');
    });

    $(".butFormSend").click(function () {
        var form = checkForm();
        return form;
    });

    function checkForm() {
        check = true;
        $("span.asterisk").each(function () {
            $(this).parent('label').removeClass('fieldhover');
            // label
            var inputVal = $(this).parent('label').next('input');
            if (inputVal.val() != null) {
                if (inputVal.val() == "") {
                    $(this).parent('label').addClass('fieldhover');
                    if (check)
                        inputVal.focus();
                    check = false;

                }
                //check for email option
                if (inputVal.is('.mail')) {

                    if (!(emailChek(inputVal.val()))) {
                        $(this).parent('label').addClass('fieldhover');
                        if (check)
                            inputVal.focus();
                        check = false;
                    }
                }
                else if (inputVal.is('.num')) {
                    if (!(IsNumeric(inputVal.val()))) {
                        $(this).parent('label').addClass('fieldhover');
                        if (check)
                            inputVal.focus();
                        check = false;
                    }
                }

            }
            else {

                var selectVal = $(this).parent('label').next('select');
                if (selectVal.is('.drop')) {
                    if (selectVal.val() == "0") {
                        $(this).parent('label').addClass('fieldhover');
                        if (check)
                            selectVal.focus();
                        check = false;

                    }
                }
            }




        });
        return check;
    }

    function emailChek(str) {

        var at = "@"
        var dot = "."
        var lat = str.indexOf(at)
        var lstr = str.length
        var ldot = str.indexOf(dot)
        if (str.indexOf(at) == -1) {

            return false
        }

        if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) {

            return false
        }

        if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) {

            return false
        }

        if (str.indexOf(at, (lat + 1)) != -1) {

            return false
        }

        if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {

            return false
        }

        if (str.indexOf(dot, (lat + 2)) == -1) {

            return false
        }

        if (str.indexOf(" ") != -1) {

            return false
        }

        return true
    }

    function IsNumeric(inputVal) {
        if (isNaN(parseFloat(inputVal))) {
            return false;
        }
        else {
            return true;
        }
    }

});


