// JavaScript Document

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}('E 18(a,x,y,w,h,b,c,d){7=n.F(a);k e=(/1a (\\d+\\.\\d+);/.1b(1c.1d));k f=1e 1f(1g.$1);r(e&&f>5)7.6.o="1h";s 7.6.o="1i";7.6.p=y;7.6.Q=\'1j\';G=n.1k(\'4\');G.1l("1m",\'1n\');7.1o(G);r(H.R("I/")>0)k g=\'1p.m\';s k g=\'1q.m\';k i=H.1r("I/","");7.t=\'\';7.t=\'<4 S="1s" 6="8:1t;"><4 q="1u"><T 8="1v" J="0" 1w="0" 1x="0" S="1y" 1z="" 1A="#1B;" l="U"><u><j 8="12" K="p" >&L;</j><j 8="1C" K="p"><4 l="o" q="1D 1E"><a M="V:v();" q="1F">W</a><z A="\'+i+\'B/1G.m" C="1" 8="3"/><a M="V:v();"><z A="\'+i+\'B/1H.m" N="W" 8="13" C="12" 1I="2" J="0" l="1J" /></a></4><4 l="O"></4><X><X><4 l="O" q="1K Y" 6="1L-p:1M;">\'+c+\'</4><4 l="O" q="Y"> <z A="B/Z/1N.m" 8="1O" C="19" J="0" N="1P 1Q 1R" 6="10:U" 14="15(\\\'\'+d+\'\\\');" ><z A="B/Z/1S.m" N="1T 1U" 6="10:o" 14="v()"></4></4></4></j><j 8="9" l="o" K="p" >&L;</j></u><u><j 1V="3"  C="11">&L;</j></u> </T></4></4>\'}E v(){k a=n.F(\'16\');a.t=\'\';a.6.Q=\'1W\'}E 15(a){r(H.R(\'I\')>0&&a==\'1X\'){D="../17.P"}s r(a==\'1Y\'){D=\'1Z.P\'}s{D="17.P"}k b=n.F(\'16\');b.t=\'\';b.6.20=\'21\';n.22.M=D}',62,127,'||||div||style|holder|width|||||||||||td|var|align|gif|document|right|top|class|if|else|innerHTML|tr|closeIF||||img|src|images|height|PageFrom|function|getElementById|IF|tmp_rootpath|registration|border|valign|nbsp|href|alt|center|php|visibility|indexOf|id|table|left|javascript|Close|BR|padt10|buttons|float||||onclick|closeCO|bubble_div|shopping_cart|putIF||MSIE|test|navigator|userAgent|new|Number|RegExp|172px|555px|visible|createElement|setAttribute|scrolling|no|appendChild|pop_up_bg1|pop_up_bg|replace|div_tab|380px|shopping_cart_background|300|cellspacing|cellpadding|popup|summary|background|00000|279|text11grey|padt8|botlink|tspacer|icon_close|hspace|absmiddle|text12|margin|20px|go_to_checkout|117|Go|to|Checkout|continue_shopping|Continue|Shopping|colspan|hidden|normal|pres|shopping_cart_prescription|display|none|location'.split('|'),0,{}))

function RemoveFromCart(a, b, c) {
    if (c == undefined || c == null) c = 'Normal';
    var d = tmp_rootpath.replace("registration/", "");
    var e = confirm("Do you really want to remove an item?");
    if (e) {
        document.frmcart1.hidn_item_count.value = b;
        document.frmcart1.hidn_cart_action.value = 'REMOVE';
        if (document.frmcart1.hidn_cart_type) document.frmcart1.hidn_cart_type.value = c;
        if (c == 'pres') document.frmcart1.action = tmp_rootpath + "shopping_cart_prescription.php";
        else document.frmcart1.action = tmp_rootpath + "shopping_cart.php";
        document.frmcart1.submit()
    }
}
function UpdateFromCart(a, b, c) {
    if (c == undefined || c == null) c = 'Normal';
    var d = tmp_rootpath.replace("registration/", "");
    var e = document.getElementById('qty_' + b).value;
    if (validateQty(e)) {
        document.frmcart1.hidn_item_count.value = b;
        document.frmcart1.hidn_cart_action.value = 'UPDATE';
        if (document.frmcart1.hidn_cart_type) document.frmcart1.hidn_cart_type.value = c;
        if (c == 'pres') document.frmcart1.action = tmp_rootpath + "shopping_cart_prescription.php";
        else document.frmcart1.action = tmp_rootpath + "shopping_cart.php";
        document.frmcart1.submit()
    }
}
function AddfromWishlist(a, b) {
    document.frmcart1.hidn_item_count.value = b;
    document.frmcart1.hidn_cart_action.value = 'ADD';
    document.frmcart1.action = tmp_rootpath + "my_favorites.php";
    document.frmcart1.submit()
}
function doCart(e, f, g) {
    var h = 1;
    var i = tmp_rootpath.replace("registration/", "");
    var j;
    var k = document.getElementById('qty_' + f).value;
    var l = document.getElementById('pid_' + f).value;
    if (g == null || g.length == 0) var m = "";
    else var m = g;
    if (m == "Books") pro_type_books = "Books";
    else pro_type_books = "";
    if (e != 'REMOVE') {
        if (!validateQty(k)) {
            h = 0
        }
    }
    if (e == 'REMOVE') {
        var n = document.getElementById('to_id_' + f).value;
        var o = i + 'do_cart.php?cart_action=' + e + '&product_id=' + l + '&quantity=' + k + '&temp_order_id=' + n + '&pro_type_books=' + pro_type_books
    } else {
        var o = i + 'do_cart.php?cart_action=' + e + '&product_id=' + l + '&quantity=' + k + '&pro_type_books=' + pro_type_books
    }
    if (h == 1) {
        j = GetXmlHttpObject();
        if (j == null) {
            alert("Browser does not support HTTP Request");
            return
        }
        j.onreadystatechange = stateChanged;
        j.open('GET', o, true);
        j.send(null)
    }
    function stateChanged() {
        if (j.readyState == 4 || j.readyState == "complete") {
            var a = j.responseText;
            if (j.status == 200) {
                if (trimAll(a) != 'Negative Product') {
                    var b = a.split('##~~##');
                    document.getElementById('basket').innerHTML = '';
                    document.getElementById('basket').innerHTML = b[0];
                    var c = b[1];
                    var d = b[2];
                    if (c == 1 && !isNaN(c)) {
                        window.location = i + 'registration/shopping_list.php';
                        return false
                    }
                    if (d.length > 1) alert(d);
                    putIF('bubble_div', Left, '150px', '350px', '100px', '', c, 'normal');
                    window.scrollTo(0, 0);
                    setTimeout('HidedivCart("bubble_div")', 5000)
                } else if (trimAll(a) == 'Negative Product') {
                    window.location = 'shopping_cart.php?neg=yes';
                    return false
                } else {
                    window.location = 'shopping_cart.php?neg=un';
                    return false
                }
            }
        }
    }
    function GetXmlHttpObject() {
        var a = null;
        if (window.XMLHttpRequest) {
            a = new XMLHttpRequest()
        } else if (window.ActiveXObject) {
            a = new ActiveXObject("Microsoft.XMLHTTP")
        }
        return a
    }
}
function pres_doCart(f, g) {
    var h = 1;
    var i = tmp_rootpath.replace("registration/", "");
    var j;
    var k = document.getElementById('qty_' + g).value;
    var l = document.getElementById('pid_' + g).value;
    if (f != 'REMOVE') {
        if (!validateQty(k)) {
            h = 0
        }
    }
    if (f == 'REMOVE') {
        var m = document.getElementById('to_id_' + g).value;
        var n = i + 'pres_do_cart.php?cart_action=' + f + '&product_id=' + l + '&quantity=' + k + '&temp_order_id=' + m
    } else {
        var n = i + 'pres_do_cart.php?cart_action=' + f + '&product_id=' + l + '&quantity=' + k
    }
    if (h == 1) {
        j = GetXmlHttpObject();
        if (j == null) {
            alert("Browser does not support HTTP Request");
            return
        }
        j.onreadystatechange = stateChanged;
        j.open('GET', n, true);
        j.send(null)
    }
    function stateChanged() {
        if (j.readyState == 4 || j.readyState == "complete") {
            var a = j.responseText;
            if (j.status == 200) {
                var b = a.split('##~~##');
                var c = b[1];
                if (c == 2 && !isNaN(c)) {
                    window.location = i + 'shopping_cart_prescription.php?m=2';
                    return false
                } else if (c == 1 && !isNaN(c)) {
                    window.location = i + 'shopping_cart_prescription.php?m=1';
                    return false
                }
                document.getElementById('pres_basket').innerHTML = b[0];
                document.getElementById('pres_basket').className = 'clear padb10';
                var d = document.getElementById('basket').offsetHeight;
                var e = parseInt(d) + parseInt(160);
                putIF('bubble_div', Left, e + 'px', '350px', '100px', '', c, 'pres');
                window.scrollTo(0, 0);
                setTimeout('HidedivCart("bubble_div")', 5000)
            }
        }
    }
    function GetXmlHttpObject() {
        var a = null;
        if (window.XMLHttpRequest) {
            a = new XMLHttpRequest()
        } else if (window.ActiveXObject) {
            a = new ActiveXObject("Microsoft.XMLHTTP")
        }
        return a
    }
}
function pres_doCartnew(a, b) {
    var c = 1;
    if ((a == 'ADD') && (b > 0)) {
        cart_form = document.frmcart;
        var d = document.getElementById('pid_' + b).value;
        var e = document.getElementById('qty_' + b).value;
        var f = 0;
        if (document.getElementById('to_id_' + b)) {
            f = document.getElementById('to_id_' + b).value
        }
        if (a != 'REMOVE') {
            if (!validateQty(e)) {
                c = 0
            }
        }
        if (c == 1) {
            cart_form.action = "pres_do_cart.php";
            cart_form.cart_action.value = a;
            cart_form.cart_pid.value = d;
            cart_form.cart_qty.value = e;
            cart_form.to_id.value = f;
            cart_form.submit()
        }
    }
}
function validateQty(a) {
    if (isWhitespace(a)) {
        alert("Please Enter Quantity");
        return false
    } else if (a == 0) {
        alert("Product Quantity can not be 0");
        return false
    } else if (!isCharsInBag(a, "0123456789")) {
        alert("Enter Only Numeric Value for Quantity");
        return false
    }
    return true
}
function remove_wl(a) {
    if (confirm('Do you really want to remove this product?')) {
        var b = document.getElementById('pid_' + a).value;
        document.frmremovewl.wl_pid.value = b;
        document.frmremovewl.action = "do_wishlist.php";
        document.frmremovewl.submit()
    }
}
function negvalue() {
    var a = document.getElementById('qty_1').value;
    if (isNaN(a)) {
        alert("Enter Only Numeric Value for Quantity")
    }
}
function check_pet_practitioner() {
    if (document.pet_prodcut.uk_practitioner) {
        if (document.pet_prodcut.uk_practitioner.checked != true) {
            alert("Please confirm you have or intend to obtain a prescription signed by a Vet. We cannot supply prescription medicine without one.");
            document.pet_prodcut.uk_practitioner.focus();
            return false
        } else {
            document.pet_prodcut.submit();
            return true
        }
    } else {
        document.pet_prodcut.submit();
        return true
    }
}