code: function(name) {
  		var cookie = document.cookie, e, p = name + "=", b;
  
  		if ( !cookie )
  			return;
  
  		b = cookie.indexOf("; " + p);
  
  		if ( b == -1 ) {
  			b = cookie.indexOf(p);
  
  			if ( b != 0 )
  				return null;
  
  		} else {
  			b += 2;
  		}
  
  		e = cookie.indexOf(";", b);
  
  		if ( e == -1 )
  			e = cookie.length;
  
  		return decodeURIComponent( cookie.substring(b + p.length, e) );
  	}
docs: The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL. 
  Get a cookie.