﻿function extractCookieVal(val) {
  if ((endOfCookie = document.cookie.indexOf(";", val)) == -1) {
     endOfCookie = document.cookie.length;
  }
  return unescape(document.cookie.substring(val,endOfCookie));
}
function check_lang(){
  var cookiename = 'uiculture1'
  var numOfCookies = document.cookie.length;
  var nameOfCookie = cookiename + "=";
  var cookieLen = nameOfCookie.length;
  var x = 0;
  while (x <= numOfCookies) {
        var y = (x + cookieLen);
        if (document.cookie.substring(x, y) == nameOfCookie)
           var cookie_value = (extractCookieVal(y));
            if (cookie_value == "ar"){
              $("#lang_change_options").addClass('arabic_alt');
              $("#lang_current_lang").addClass('arabic_text'); 
            }
           x = document.cookie.indexOf(" ", x) + 1;
           if (x == 0){
              break;
           }
  }
}
