

    jQuery(document).ready(function(){
        //Right Menu
        //#########################################################
        jQuery('#menu li').bind('click',function(){
            jQuery(this).children('ul').toggle('200');
        });
        jQuery(document).ready(function(){
            jQuery('#menu li').children('ul').show();
        });
        //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';
        })
        //Comments Text Area
        
    });

/*Put Limit For Text Area*/
/*###############################################################################*/
function limitChars(textid, limit, infodiv)
{
    var text = jQuery('#'+textid);
    var counter =jQuery('#' + infodiv);
    //we put try & catchsince above we call it at document ready so if we are in
    //a page that don't conatiuns the text area it will give js error
    try{
        if(text.val().length > limit)
        {
            text.val(text.val().substr(0,limit));
            counter.html((limit - text.val().length)+'/'+limit);
            return false;
        }
        else
        {
            counter.html((limit - text.val().length)+'/'+limit);
            return true;
        }
    }
    catch(err){}
}

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

