//******************************************************************************
//                      Stuff Controlled With Cookie Use
//******************************************************************************

function enableShareet(value) {
  var currentValue = get_cookie("displayMarqueeContent");
  if ( (currentValue == value) || (currentValue == "" && value == 'TRUE') ) {
     return;
  }

  document.cookie="displayMarqueeContent=" + value;
  if ( cookiesEnabledCheck("displayMarqueeContent") ) {
     document.location.reload();
  }
  return;
}

//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

function setStyle(style) {
  var currentStyle = get_cookie("style");
  if ( (currentStyle == style) || (currentStyle == "" && style == "rokhamiFrame") ) {
     return;
  }

  document.cookie="style="+style;
  if ( cookiesEnabledCheck("style") ) {
     document.location.reload();
     warningMessage();
  }
}

//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

function showLeftSide(value) {  // value: auto, show, hide
alert(value);
  var currentValue = get_cookie("showLeftSide");
  if ( (currentValue == value) || (currentValue == "" && value == "auto") ) {
     return;
  }

  document.cookie="showLeftSide="+value;
  if ( cookiesEnabledCheck("showLeftSide") ) {
     // var sURL = unescape(window.location.pathname);
     // window.location.href = sURL;
     document.location.reload();
     warningMessage();
  }
}

//==============================================================================

function showLeftSide_2() {

  // remove: var leftSideShown = get_cookie("leftSideShown"); alert(leftSideShown);
  var leftSideShown = get_cookie("showLeftSide");
  if ( leftSideShown == "hide" ) {
     document.cookie="showLeftSide=show";
  } else {
     document.cookie="showLeftSide=hide";
  }

  if ( cookiesEnabledCheck("showLeftSide") ) {
     // var sURL = unescape(window.location.pathname);
     // window.location.href = sURL;
     document.location.reload();
     warningMessage();
  }
}

//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

function cookiesEnabledCheck(testCookie) {
  var cookieValue = get_cookie(testCookie);
  if ( cookieValue == "" ) {
     alert('معذرة، الكوكيز غير مفعلة على هذا الكمبيوتر ومن ثم هذه الخاصية لن تعمل');
     return false;
  }
  return true;
}

//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

function warningMessage() {
  var wasWarningMessageShown = get_cookie("wasWarningMessageShown");
  if ( wasWarningMessageShown == 'TRUE' ) return;
  document.cookie="wasWarningMessageShown ="+'TRUE';
  alert('الصفحات التي سبق تصفحها قد لا تعكس التغيير المطلوب. في مثل هذه الحالة، كل ما عليك عمله هو اختيار الزر الأيمن للماوس على تلك الصفحة ثم ريفريش. لن تظهر هذه الرسالة مرة اخرى أثناء جلسة التصفح هذه');
  return;
}

//******************************************************************************
