    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-12809619-1']);
    _gaq.push(['_setDomainName', '.ibuy.co.th']);
    _gaq.push(['_trackPageview']);

    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

$(function(){

    $("#txtsearch").click(function(){
        $(this).val("");
    });

    $("#frmsearch").submit(function(){
        $("#txtsearch").css({"color":"#0166FE","text-align":"left"});
        timer_loading(".",$("#txtsearch").val());

    });

    $("ul#navi_containTab > li").click(function(event){
            var menuIndex=$(this).index();
            $("ul#detail_containTab > li:visible").hide();            
            $("ul#detail_containTab > li").eq(menuIndex).show();

            var tab = $(this).attr("class");
                        
            if(tab == "tabNavi2_blur")
            {
                $(".tabNavi1").attr({"class":"tabNavi1_blur"});
                $(".tabNavi2_blur").attr({"class":"tabNavi2"});
            }
            
            if(tab == "tabNavi1_blur")
            {
                $(".tabNavi2").attr({"class":"tabNavi2_blur"});
                $(".tabNavi1_blur").attr({"class":"tabNavi1"});
            }
            
            
            
    });

});

var cal = 0;
function timer_loading(text,word){

    if(cal >9){
        cal =0;
        text = ".";
    }

    var dot = ".";
    $("#texts").html("<span style='font-size:13px;font-weight:bolder'>&nbsp;&nbsp;i<span style='color:#FD0B2F'>Buy</span> <span style=\"color:#4B4B4B;font-weight: normal;\">"+word+text+"</span></span>");
    text += dot;
    cal++;
    setTimeout("timer_loading('"+text+"','"+word+"');",300);

}

