﻿    var hash;
    var back = '';
    if (window.location.hash == '') { hash = 'Home'; } else { hash = window.location.hash; }
    if (hash.indexOf('#') != -1) { hash = hash.substring(1); }
    function home(e) {
        page('Home');
        setTimeout("$('#divHome').fadeIn(250)", 250);
        return false;
    }
    function samples(e) {
        page('Samples');
        setTimeout("$('#divSamples').fadeIn(250)", 250);
        document.getElementById('imgSamples').src = 'http://alpha-usb.com/images/samples/1.jpg';
        return false;
    }
    function quote(model)
        {
        page('Quote');
        setTimeout("$('#divQuote').fadeIn(250)",250);
        if (model == 'undefined'){model='';}
        document.getElementById('txtStyle').value = model;
        quote_helper();
        return false;
        }
    function services()
        {
        page('Services');
        setTimeout("$('#divServices').fadeIn(250)",250);
        return false;
        }
    function contact()
        {
            page('Contact');
            setTimeout("$('#divContact').fadeIn(250)", 250);
        return false;
        }
//Scripts for Left Buttons
    function allProducts() {
        //google ajax page tracking
        _gaq.push(['_setAccount', 'UA-25647872-1']); _gaq.push(['_trackPageview']);
        // ochistka big product frame
        document.getElementById('imgProduct').src = 'http://alpha-usb.com/images/big/product_frame.jpg';
        // nahodim P
        var p = hash;
        if (p.indexOf('1') != -1){p = '1'};
        if (p.indexOf('2') != -1){p = '2'};
        if (p.indexOf('3') != -1){p = '3'};
        if (p.indexOf('4') != -1){p = '4'};
        if (p.indexOf('5') != -1){p = '5'};
        if (p!=1 && p!=2 && p!=3 && p!=4 && p!=5)
            {if(p!='Product'){document.getElementById('ib' + p).src = 'http://alpha-usb.com/images/buttons/btn_' + p + '.jpg';}}
        $('#div' + p).fadeOut(250);
        // Pagers set --------------------------------------------------
        $('#topPrev').fadeOut(250);
        $('#btmPrev').fadeOut(250);
        //product page ibPic visibility fix
        document.getElementById('ibPic2').style.visibility = 'visible';
        document.getElementById('ibPic3').style.visibility = 'visible';
        document.getElementById('ibPic4').style.visibility = 'visible';
        document.getElementById('ibPic5').style.visibility = 'visible';
        document.getElementById('ibPic6').style.visibility = 'visible';
        document.getElementById('ibPic7').style.visibility = 'visible';
        // ---- vklyuchaem
        setTimeout("$('#topNext').fadeIn(250)",250);
        setTimeout("$('#btmNext').fadeIn(250)",250);
        setTimeout("$('#divProducts').fadeIn(250)",250);
        setTimeout("$('#div1').fadeIn(250)",250);
        document.getElementById('ibAll_products').src = 'http://alpha-usb.com/images/buttons/btn_All_Products2.jpg';
        document.getElementById('ibProducts').src = 'http://alpha-usb.com/images/buttons/btn_Products2.jpg';
        // Hash set ----------------------------------------------------
        window.location.hash = '#!products.page1'
        hash = "products.page1"
        return false;           
        }
    function topSellers()
        {
        page('Topsellers');
        setTimeout("$('#divTopsellers').fadeIn(250)",250);
        // extra stuff
        setTimeout("$('#divProducts').fadeIn(250)",250);
        return false;        
        }
    function plastic()
        {
        page('Plastic');
        setTimeout("$('#divPlastic').fadeIn(250)",250);
        // extra stuff
        setTimeout("$('#divProducts').fadeIn(250)",250);
        return false;        
        }
    function metal()
        {
        page('Metal');
        setTimeout("$('#divMetal').fadeIn(250)",250);
        // extra stuff
        setTimeout("$('#divProducts').fadeIn(250)",250);
        return false;        
        }
    function pens()
        {
        page('Pens');
        setTimeout("$('#divPens').fadeIn(250)",250);
        // extra stuff
        setTimeout("$('#divProducts').fadeIn(250)",250);
        return false;        
        }
    function swivel()
        {
        page('Swivel');
        setTimeout("$('#divSwivel').fadeIn(250)",250);
        // extra stuff
        setTimeout("$('#divProducts').fadeIn(250)",250);
        return false;        
        }
    function leather()
        {
        page('Leather');
        setTimeout("$('#divLeather').fadeIn(250)",250);
        // extra stuff
        setTimeout("$('#divProducts').fadeIn(250)",250);
        return false;        
        }
    function compact()
        {
        page('Compact');
        setTimeout("$('#divCompact').fadeIn(250)",250);
        // extra stuff
        setTimeout("$('#divProducts').fadeIn(250)",250);
        return false;        
        }
    function product(model)
        {
        // nahodim P
        var p = hash;
        back = hash;
        if (p.indexOf('1') != -1){p = '1'};
        if (p.indexOf('2') != -1){p = '2'};
        if (p.indexOf('3') != -1){p = '3'};
        if (p.indexOf('4') != -1){p = '4'};
        if (p.indexOf('5') != -1){p = '5'};
        // ----- rabochaya chast
        if (p=='1' || p=='2' || p=='3' || p=='4' || p=='5')
            {
            document.getElementById('ibAll_products').src = 'http://alpha-usb.com/images/buttons/btn_All_Products.jpg';
            // Pagers set --------------------------------------------------
            $('#topPrev').fadeOut(250)
            $('#btmPrev').fadeOut(250)
            $('#topNext').fadeOut(250)
            $('#btmNext').fadeOut(250)
            }
        else // с других продуктов
            {
            document.getElementById('ib' + p).src = 'http://alpha-usb.com/images/buttons/btn_' + p + '.jpg';
            }
        document.getElementById('ibProducts').src = 'http://alpha-usb.com/images/buttons/btn_Products.jpg';
        $('#div' + p).fadeOut(250);
        $('#divProducts').fadeOut(250);
        // ---- vklyuchaem
        document.getElementById('ibProducts').src = 'http://alpha-usb.com/images/buttons/btn_Products2.jpg';
        document.getElementById('imgProduct').src = 'http://alpha-usb.com/images/big/product_frame.jpg'; 
        document.getElementById('ibPic1').src = 'http://alpha-usb.com/images/loader.gif'; 
        document.getElementById('ibPic2').src = 'http://alpha-usb.com/images/loader.gif'; 
        document.getElementById('ibPic3').src = 'http://alpha-usb.com/images/loader.gif'; 
        document.getElementById('ibPic4').src = 'http://alpha-usb.com/images/loader.gif'; 
        document.getElementById('ibPic5').src = 'http://alpha-usb.com/images/loader.gif'; 
        document.getElementById('ibPic6').src = 'http://alpha-usb.com/images/loader.gif'; 
        document.getElementById('ibPic7').src = 'http://alpha-usb.com/images/loader.gif'; 
        window.location.hash = '#!Product';
        hash = "Product";
        // - PRODUCT PAGE SETTINGS -------------------------------------
        document.getElementById("imgProduct").src = "http://alpha-usb.com/images/big/" + model + "_1.jpg";
        // materials
        if (model.indexOf('PL') != -1)
            {document.getElementById('lblMaterials').innerHTML = 'Plastic';}
        else
            {document.getElementById('lblMaterials').innerHTML = 'Metal, Plastic';}
        // dimentions
        if (model=='PL-01')
            {document.getElementById('lblDimentions').innerHTML = '72mm x 20mm x 7mm';}
        if (model=='PL-02')
            {document.getElementById('lblDimentions').innerHTML = '67mm x 20mm x 7mm';}
        if (model=='PL-03')
            {document.getElementById('lblDimentions').innerHTML = '45mm x 45mm x 15mm';}
        if (model=='SM-01')
            {document.getElementById('lblDimentions').innerHTML = '57mm x 20mm x 10mm';}
        // imprinting
        if (model=='PL-01' || model=='PL-02' || model=='SM-01' || model=='PL-11')
            {document.getElementById('lblImprinting').innerHTML = '4 Color, Full Color';}
        if (model.indexOf('ME') != -1)
            {document.getElementById('lblImprinting').innerHTML = '4 Color, Laser Engraving';}
        // product pictures
        document.getElementById('ibPic1').src = 'http://alpha-usb.com/images/big/' + model + '_1.jpg';
        document.getElementById('ibPic2').src = 'http://alpha-usb.com/images/big/' + model + '_2.jpg';
        document.getElementById('ibPic3').src = 'http://alpha-usb.com/images/big/' + model + '_3.jpg';
        document.getElementById('ibPic4').src = 'http://alpha-usb.com/images/big/' + model + '_4.jpg';
        document.getElementById('ibPic5').src = 'http://alpha-usb.com/images/big/' + model + '_5.jpg';
        document.getElementById('ibPic6').src = 'http://alpha-usb.com/images/big/' + model + '_6.jpg';
        document.getElementById('ibPic7').src = 'http://alpha-usb.com/images/big/' + model + '_7.jpg';
        // onclientclicks set
        document.getElementById('ibPic1').onclick = function(){document.getElementById('imgProduct').src='http://alpha-usb.com/images/big/' + model + '_1.jpg';return false;}
        document.getElementById('ibPic2').onclick = function(){document.getElementById('imgProduct').src='http://alpha-usb.com/images/big/' + model + '_2.jpg';return false;}
        document.getElementById('ibPic3').onclick = function(){document.getElementById('imgProduct').src='http://alpha-usb.com/images/big/' + model + '_3.jpg';return false;}
        document.getElementById('ibPic4').onclick = function(){document.getElementById('imgProduct').src='http://alpha-usb.com/images/big/' + model + '_4.jpg';return false;}
        document.getElementById('ibPic5').onclick = function(){document.getElementById('imgProduct').src='http://alpha-usb.com/images/big/' + model + '_5.jpg';return false;}
        document.getElementById('ibPic6').onclick = function(){document.getElementById('imgProduct').src='http://alpha-usb.com/images/big/' + model + '_6.jpg';return false;}
        document.getElementById('ibPic7').onclick = function(){document.getElementById('imgProduct').src='http://alpha-usb.com/images/big/' + model + '_7.jpg';return false;}
        //--
        document.getElementById('ibGoQuote1').onclick = function () { quote(model); return false; }
        // product colors
        if (model.indexOf('PL') != -1){colorer(1)}
        if (model.indexOf('ME') != -1){colorer(2)}
        if (model.indexOf('SWM') != -1){colorer(2)}
        if (model.indexOf('Pen') != -1){colorer(3)}
        if (model.indexOf('LR') != -1){colorer(3)}
        if (model.indexOf('CT') != -1){colorer(1)}
        // specs set
        if (model.indexOf('CT') != -1){document.getElementById('lblSpecs1').innerHTML = '1GB, 2GB, 4GB, 8GB, 16GB';}
        else {document.getElementById('lblSpecs1').innerHTML = '64MB, 128MB, 256MB, 512MB, 1GB, 2GB, 4GB, 8GB, 16GB';}
        setTimeout("$('#divProduct').fadeIn(250)",250);
        return false;
        }
    function goBack()
        {
        if (back.indexOf('page') != -1){allProducts();return false;}
        if (back=='Topsellers'){topSellers();return false;}
        if (back=='Plastic'){plastic();return false;}
        if (back=='Metal'){metal();return false;}
        if (back=='Pens'){pens();return false;}
        if (back=='Swivel'){swivel();return false;}
        if (back=='Leather'){leather();return false;}
        if (back=='Compact'){compact();return false;}
        }
//Pager Scripts
    function next()
        {
        if (hash == 'products.page4')
            {
            hash = 'products.page5'
            window.location.hash = '#!products.page5'
            $('#div4').fadeOut(250);
            setTimeout("$('#div5').fadeIn(250)",250);
            }
        if (hash == 'products.page5')
            {
            $("#topNext").fadeOut(250);
            $("#btmNext").fadeOut(250);
            }
        if (hash == 'products.page3')
            {
            hash = 'products.page4'
            window.location.hash = '#!products.page4'
            $("#div3").fadeOut(250);
            setTimeout("$('#div4').fadeIn(250)",250);
            }
        if (hash == 'products.page2')
            {
            hash = 'products.page3'
            window.location.hash = '#!products.page3'
            $("#div2").fadeOut(250);
            setTimeout("$('#div3').fadeIn(250)",250);
            }
        if (hash == 'products.page1')
            {
            hash = 'products.page2'
            window.location.hash = '#!products.page2'
            $("#div1").fadeOut(250);
            setTimeout("$('#div2').fadeIn(250)",250);
            $("#topPrev").fadeOut(0);
            $("#btmPrev").fadeOut(0);          
            $("#topPrev").fadeIn(250);
            $("#btmPrev").fadeIn(250);
            }
        // too fast click protection
        document.getElementById('topNext').onclick = '';
        setTimeout("document.getElementById('topNext').onclick = next",400);
        document.getElementById('btmNext').onclick = '';
        setTimeout("document.getElementById('btmNext').onclick = next",400);
        }
    function prev()
        {
        if (hash == 'products.page2')
            {
            hash = 'products.page1'
            window.location.hash = '#!products.page1'
            $("#div2").fadeOut(250);
            setTimeout("$('#div1').fadeIn(250)",250);
            $("#topPrev").fadeOut(250);
            $("#btmPrev").fadeOut(250);
            }
        if (hash == 'products.page3')
            {
            hash = 'products.page2'
            window.location.hash = '#!products.page2'
            $("#div3").fadeOut(250);
            setTimeout("$('#div2').fadeIn(250)",250);
            }
        if (hash == 'products.page4')
            {
            hash = 'products.page3'
            window.location.hash = '#!products.page3'
            $("#div4").fadeOut(250);
            setTimeout("$('#div3').fadeIn(250)",250);
            }
        if (hash == 'products.page5')
            {
            hash = 'products.page4'
            window.location.hash = '#!products.page4'
            $("#div5").fadeOut(250);
            setTimeout("$('#div4').fadeIn(250)",250);
            $("#topNext").fadeIn(250);
            $("#btmNext").fadeIn(250);
            }
        // too fast click protection
        document.getElementById('topPrev').onclick = '';
        setTimeout("document.getElementById('topPrev').onclick = prev",600);
        document.getElementById('btmPrev').onclick = '';
        setTimeout("document.getElementById('btmPrev').onclick = prev",600);
        }
// Scripts for quote page
    function capacity_helper() {
        if (document.getElementById('txtCapacity').value == 'minimum' || document.getElementById('txtCapacity').value == 'Minimum') {
            document.getElementById('txtCapacity').value = '64MB'
        }
        if (document.getElementById('txtCapacity').value == '32MB') {
            document.getElementById('txtCapacity').value = '64MB'
        }
    }
    function quantity_helper() {
        var i;
        for (i = 1; i < 100; i++){
            if (document.getElementById('txtQuantity').value == i) {
                document.getElementById('lblReport').innerHTML = 'Minimum order quantity is 100 Drives'; return false;
                }
            }
        if (document.getElementById('txtQuantity').value == 'minimum' || document.getElementById('txtQuantity').value == 'Minimum') { 
            document.getElementById('txtQuantity').value = '100' }
    }
    function quote_helper() 
        {
        // show product preview and name in preview
        document.getElementById('imgHelper').src = 'http://alpha-usb.com/images/small/' + document.getElementById('txtStyle').value + '.png';
        setTimeout("document.getElementById('lblHelper').innerHTML = document.getElementById('imgHelper').src.substr(34,5);", 1000);
        setTimeout("if (document.getElementById('imgHelper').src.substr(34,5) == 'PL-00' || document.getElementById('lblHelper').innerHTML == 'undef') {document.getElementById('lblHelper').innerHTML = '';}", 1100)
        }
    flag2 = false
    function quote_submit(e) {
        if (e != 'call') {
            // cleaning label
            document.getElementById('lblReport').innerHTML = '';
            // нет контактных данных
            if ((document.getElementById('txtEmail').value == '') && (document.getElementById('txtPhone').value == '')) {
                document.getElementById('lblReport').innerHTML = 'Please provide your contact info';
                return false;
            }
            else // есть контактные данные
            {
                // неверный формат имэйла
                if (document.getElementById('txtEmail').value != '') {
                    if (document.getElementById('txtEmail').value.indexOf('@') == -1 || document.getElementById('txtEmail').value.indexOf('.') == -1) {
                        document.getElementById('lblReport').innerHTML = 'Invalid E-mail address';
                        return false;
                    }
                }
        // Quantity too low
        for (i = 1; i < 100; i++){
            if (document.getElementById('txtQuantity').value == i) {alert('Request Failed. Minimum order quantity is 100 Drives'); return false;}
            }
            // -------------------------
                document.getElementById('imgLoader').style.visibility = 'visible';
                document.getElementById('ibSubmit').src = 'http://alpha-usb.com/images/buttons/ibSubmit2_.png';
            }
            //script
            var xmlhttp;
            name = document.getElementById('txtName').value
            style = document.getElementById('txtStyle').value
            capacity = document.getElementById('txtCapacity').value
            quantity = document.getElementById('txtQuantity').value
            email = document.getElementById('txtEmail').value
            phone = document.getElementById('txtPhone').value
            comments = document.getElementById('txtComments').value
            imprint = document.getElementById('cbImprint').checked
            lanyard = document.getElementById('cbLanyard').checked
            keyring = document.getElementById('cbKeyring').checked
            giftbox = document.getElementById('cbGiftbox').checked
            preload = document.getElementById('cbPreload').checked
            callme = document.getElementById('cbCallme').checked
            ip = document.getElementById('lblIP').innerHTML
            host = document.getElementById('lblHOST').innerHTML
            keyword = document.getElementById('lblKEYWORD').innerHTML
            if (window.XMLHttpRequest) {
                // code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp = new XMLHttpRequest();
            }
            else {
                // code for IE6, IE5
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4) {
                    document.getElementById('lblReport').innerHTML = xmlhttp.responseText;
                    document.getElementById('imgLoader').style.visibility = 'hidden'
                    document.getElementById('ibSubmit').src = 'http://alpha-usb.com/images/buttons/ibSubmit_.png'
                }
            }
            xmlhttp.open('GET', 'quoteprocessor.aspx?name=' + name + '&style=' + style + '&capacity=' + capacity + '&quantity=' + quantity + '&email=' + email + '&phone=' + phone + '&comments=' + comments + '&imprint=' + imprint + '&lanyard=' + lanyard + '&keyring=' + keyring + '&giftbox=' + giftbox + '&preload=' + preload + '&callme=' + callme + '&IP=' + ip + '&HOST=' + host + '&KEYWORD=' + keyword, true);
            xmlhttp.send(null);
        }
        // call submit ---------------------------------
        if (e == 'call') {
            flag2 = true
            document.getElementById('callSubmit').innerHTML = "<font color='#60dd60'>Request Sent!<font>";
            setTimeout("document.getElementById('txtCallme').value = '';", 1000)
            var xmlhttp;
            name = "Call_Request"
            phone = document.getElementById('txtCallme').value
            ip = document.getElementById('lblIP').innerHTML
            host = document.getElementById('lblHOST').innerHTML
            keyword = document.getElementById('lblKEYWORD').innerHTML
            if (window.XMLHttpRequest) {
                // code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp = new XMLHttpRequest();
            }
            else {
                // code for IE6, IE5
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4) {
                }
            }
            xmlhttp.open('GET', 'quoteprocessor.aspx?name=' + name + '&phone=' + phone + '&IP=' + ip + '&HOST=' + host + '&KEYWORD=' + keyword, true);
            xmlhttp.send(null);
        }
        return false;
        }
// other functions -----------------
        // google ajax tracking pre-script (avoiding first page)
        var flag = false;
        setTimeout("flag=true", 2000);
        function page(e) {
        //google ajax page tracking
        if (flag == true) { _gaq.push(['_setAccount', 'UA-25647872-1']); _gaq.push(['_trackPageview']); flag = true; }
        // ochistka big product frame
        document.getElementById('imgProduct').src = 'http://alpha-usb.com/images/big/product_frame.jpg';
        // nahodim P
        var p = hash;
        p = p.replace('!','')
        if (p.indexOf('1') != -1){p = '1'};
        if (p.indexOf('2') != -1){p = '2'};
        if (p.indexOf('3') != -1){p = '3'};
        if (p.indexOf('4') != -1){p = '4'};
        if (p.indexOf('5') != -1){p = '5'};
        // ----- rabochaya chast
        if (p=='1' || p=='2' || p=='3' || p=='4' || p=='5')
            {
            document.getElementById('ibAll_products').src = 'http://alpha-usb.com/images/buttons/btn_All_Products.jpg';
            // Pagers set --------------------------------------------------
            $('#topPrev').fadeOut(250)
            $('#btmPrev').fadeOut(250)
            $('#topNext').fadeOut(250)
            $('#btmNext').fadeOut(250)
            }
        else // с других продуктов
            {if (p!='Product'){document.getElementById('ib' + p).src = 'http://alpha-usb.com/images/buttons/btn_' + p + '.jpg';}}
        document.getElementById('ibProducts').src = 'http://alpha-usb.com/images/buttons/btn_Products.jpg';
        $('#div' + p).fadeOut(250);
        //product page ibPic visibility fix
        document.getElementById('ibPic2').style.visibility = 'visible';
        document.getElementById('ibPic3').style.visibility = 'visible';
        document.getElementById('ibPic4').style.visibility = 'visible';
        document.getElementById('ibPic5').style.visibility = 'visible';
        document.getElementById('ibPic6').style.visibility = 'visible';
        document.getElementById('ibPic7').style.visibility = 'visible';
        // ---- vklyuchaem
        document.getElementById('ib' + e).src = 'http://alpha-usb.com/images/buttons/btn_' + e + '2.jpg';
        if (e == 'Home' || e == 'Quote' || e == 'Services' || e == 'Contact' || e == 'Samples')
            {
            $('#divProducts').fadeOut(250);
            }
        else
            {
            document.getElementById('ibProducts').src = 'http://alpha-usb.com/images/buttons/btn_Products2.jpg';
            }
        // Hash set ----------------------------------------------------
        window.location.hash = '#!' + e;
        hash = e;
        return false;
        }
    function colorer(mode)
        {
        if (mode==1)
            {
            document.getElementById('imgColor1').style.visibility = 'visible';
            document.getElementById('imgColor2').style.visibility = 'visible';
            document.getElementById('imgColor3').style.visibility = 'visible';
            document.getElementById('imgColor4').style.visibility = 'visible';
            document.getElementById('imgColor5').style.visibility = 'visible';
            document.getElementById('imgColor6').style.visibility = 'visible';
            document.getElementById('imgColor7').style.visibility = 'visible';
            }
        if (mode==2)
            {
            document.getElementById('imgColor1').style.visibility = 'visible';
            document.getElementById('imgColor2').style.visibility = 'visible';
            document.getElementById('imgColor3').style.visibility = 'visible';
            document.getElementById('imgColor4').style.visibility = 'visible';
            document.getElementById('imgColor5').style.visibility = 'visible';
            document.getElementById('imgColor6').style.visibility = 'hidden';
            document.getElementById('imgColor7').style.visibility = 'hidden';
            }
        if (mode==3)
            {
            document.getElementById('imgColor1').style.visibility = 'visible';
            document.getElementById('imgColor2').style.visibility = 'visible';
            document.getElementById('imgColor3').style.visibility = 'visible';
            document.getElementById('imgColor4').style.visibility = 'hidden';
            document.getElementById('imgColor5').style.visibility = 'hidden';
            document.getElementById('imgColor6').style.visibility = 'hidden';
            document.getElementById('imgColor7').style.visibility = 'hidden';
            }
        }
        function info(x) {
            if (x == 'close') {
                $('#divInfo').fadeOut(250)
            }
            if (x == 110) {
                $('#divInfo').html("<img src='http://alpha-usb.com/images/110.jpg' /><p style='position:absolute; left:150px; top:0px; width:300px;'>If another promotional company offers the same product at a lower price, we will instantly beat their price by 10% of the difference!\
                With our 110% Lowest Price Guarantee, we promise that you will not pay a penny more than you have to. We work directly with all our suppliers to secure the best pricing available and pass the savings directly on to you.</p>");
                document.getElementById('divInfo').style.top = '385px';
                document.getElementById('divInfo').style.left = '360px'; ;
                document.getElementById('divInfo').style.height = '130px'; ;
                document.getElementById('divInfo').style.width = '440px'; ;
                $('#divInfo').fadeIn(250);
            }
        }
        function gallery(e) {
            var x = document.getElementById('imgSamples').src;
            x = x.substring(x.lastIndexOf('/') + 1)
            x = x.substring(0, x.indexOf('.'))
            var current = document.getElementById('lblImgCount').innerHTML.substring(0, document.getElementById('lblImgCount').innerHTML.indexOf('/'))
            var limit = document.getElementById('lblImgCount').innerHTML.substring(document.getElementById('lblImgCount').innerHTML.indexOf('/') +1)
            if (e == "n") {
                x = parseInt(x) + 1
                document.getElementById('imgSamples').src = 'http://alpha-usb.com/images/samples/' + x + '.jpg'
                document.getElementById('lblImgCount').innerHTML = x + '/' + limit;
            }
            if (e == "p") {
                x = parseInt(x) - 1
                document.getElementById('imgSamples').src = 'http://alpha-usb.com/images/samples/' + x + '.jpg'
                document.getElementById('lblImgCount').innerHTML = x + '/' + limit;
            }
            if (x == '1' || x == 1) { document.getElementById('imgBack').style.visibility = 'hidden'; } else { document.getElementById('imgBack').style.visibility = 'visible'; }
            if (x == limit) { document.getElementById('imgForward').style.visibility = 'hidden' } else { document.getElementById('imgForward').style.visibility = 'visible' }

        }
