function writeSessionCookie (cookieName, cookieValue) {
  if (testSessionCookie()) {
    document.cookie = escape(cookieName) + "=" + escape(cookieValue) + "; path=/";
    return true;
  }
  else return false;
}

function getCookieValue (cookieName) {
  var exp = new RegExp (escape(cookieName) + "=([^;]+)");
  if (exp.test (document.cookie + ";")) {
    exp.exec (document.cookie + ";");
    return unescape(RegExp.$1);
  }
  else return false;
}

function testSessionCookie () {
  document.cookie ="testSessionCookie=Enabled";
  if (getCookieValue ("testSessionCookie")=="Enabled")
    return true 
  else
    return false;
}

window.onload = function() {
	var b = document.getElementsByTagName('body')[0];
    var c = get_random();

    if (c<10) {
        b.className = "body0"+c;
    } else {
        b.className = "body"+c;
    }

/*	if (testSessionCookie()) {
	
		if (!getCookieValue("class")) {
			var c = get_random();
			b.className = "body0"+c;
			
			if (!writeSessionCookie("class","body0"+c)) {
				b.className = 'body01';
			}
        } else {
  	         b.className = getCookieValue("class");
		}
	} else {
		b.className = 'body01';
	} 
	
*/	
}

function get_random()
{
    var ranNum= Math.floor(Math.random()*8);
    return ranNum+1;
}
