

jQuery(document).ready(function(){
    //Navigator
    //#########################################################
    jQuery('#top').bind('click',function(){
        jQuery("html").animate({
            scrollTop:0
        },{
            duration:1000
        });
    })
    jQuery('#back').bind('click',function(){
        history.back(-1);
    })
    jQuery('#home').bind('click',function(){
        window.location.href='index.php';
    })

    //Tree Category
    //#########################################################
    jQuery('#list_html_tree .parent_cat').bind('click',function(){
        var child_list = jQuery(this).parent().children('ul');
        var child_img = jQuery(this).children('img');
        if(child_list.css('display') == 'none')
            child_img.attr('src','images/minus.gif');
        else
            child_img.attr('src','images/plus.gif');
        child_list.toggle();
    })
    //Initially Tree is Collapse
    //#########################################################
    try{
        jQuery('#list_html_tree .parent_cat:not(.active)').each(function(){
            var child_list = jQuery(this).parent().children('ul');
            var child_img = jQuery(this).children('img');
            if(child_list.css('display') == 'none')
                child_img.attr('src','images/minus.gif');
            else
                child_img.attr('src','images/plus.gif');
            child_list.toggle();
        })
    }
    catch (err) { }
});


jQuery(window).load(function(){
    //jQuery("#expand_collapse_tree_hide").css("display","");
});

/*input styling*/
//########################################################
jQuery('.input_style').bind('focus',function(){
    jQuery(this).css({
        border:'1px inset #FFC6B5'
    });
}).bind('blur',function(){
    jQuery(this).css({
        border:'1px solid #FFC6B5'
    });
})
/*Button styling*/
//########################################################
jQuery('.button_style').bind('mouseover',function(){
    jQuery(this).css({
        background:'#211D1E'
    });
}).bind('mouseout',function(){
    jQuery(this).css({
        background:'#211D1E'
    });
})



/*check mail for validation*/
/*###############################################################################*/
function checkMail(valMail){
    var ismail=true;
    var filter =/^.+@.+..{2,3}$/;
    if (!filter.test(valMail))
        ismail=false
    return ismail;
}

/*check if category is ceramic then show size in search form*/
/*###############################################################################*/
function show_hide_size(value){
    if(value==97)
        $('#cermaic_size').show();
    else
        $('#cermaic_size').hide();
}
