/*Put Limit For Text Area*/
/*###############################################################################*/
function limitChars(textid, limit, infodiv)
{
    var text = jQuery('#'+textid);
    var counter =jQuery('#' + infodiv);
    //we put try & catch since 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;
}
/*check day light saving add*/
//you can get time Zone for Client by: time_zone=-(Now_Date.getTimezoneOffset()/60);
/*###############################################################################*/
function GetDateTimeLightSaving (){
    var adjust=0;

    var today = new Date();
    var year = today.getFullYear();
    var month = today.getMonth()+1;
    var date = today.getDate();
    var day = today.getDay();
    var hour = today.getHours();
    var minute = today.getMinutes();
    var second = today.getSeconds();

    //this next tidbit gets the last saturday in the month of Oct, for daylightsavings times purposes
    var lastSat
    lastSat=date-(day+1)
    while (lastSat<32){
        lastSat+=7
    }

    if (lastSat>31) lastSat+=-7
    // this bit grabs the first saturday in march for the start of daylight time
    var firstSat
    firstSat=date-(day+1)
    while (firstSat>0){
        firstSat+=-7
    }
    if (firstSat<1) firstSat+=7

    //adjust for windows95 daylight savings time changes
    if ((((month==3) && (date>=firstSat)) || month>3)  && (month<11 || ((month==10) && day<=lastSat))){adjust+=60}
    adjust =(adjust/60);
    return adjust;
}