function Cookie()
{
   var myThis = this;

   this.init = function()
   {
      this.CreateCommunicationElement();
   }

   this.getCookie = function( CookieName )
   {
      if( !document.cookie.length ) return false;

      CookieStart = document.cookie.indexOf( CookieName + '=' );
      if( CookieStart == -1 ) return false;

      CookieStart = CookieStart + CookieName.length + 1;
      CookieEnd = document.cookie.indexOf( ';', CookieStart );
      if( CookieEnd == -1 ) CookieEnd = document.cookie.length;

      return encodeURIComponent( document.cookie.substring( CookieStart, CookieEnd ) );
   }

   this.setCookieDomain = function( name, value, expires, domain, path, secure  )
   {
      this.CommunicationElement.src =  this.getLocationCommunicationFile( name, value, expires, domain, path, secure  )
      
      if( !this.CommunicationElement.parentNode )
	      this.AppendCommunicationElement();
   }

   this.getLocationCommunicationFile = function( name, value, expires, domain, path, secure  )
   {
      var QueryString = '';
      QueryString += 'name=' + encodeURIComponent( name ) + '&';
      QueryString += 'value=' + encodeURIComponent( value ) + '&';
      QueryString += 'expires=' + encodeURIComponent( expires ) + '&';
      QueryString += 'domain=' + encodeURIComponent( '.' + domain ) + '&';
      QueryString += 'path=' + encodeURIComponent( path ) + '&';
      QueryString += 'secure=' + encodeURIComponent( secure );

      return 'http://' + domain + '/3Framework/Cookie/CommunicationCookieRequest.php?' + QueryString;
   }

   this.CreateCommunicationElement = function()
   {
      this.CommunicationElement = document.createElement( 'iframe' );
      this.CommunicationElement.width = 0;
      this.CommunicationElement.height = 0;
      this.CommunicationElement.style.display = 'none';
   }

   this.AppendCommunicationElement = function()
   {
      document.body.appendChild( this.CommunicationElement );

      if( this.CommunicationElement.readyState ) this.CommunicationElement.onreadystatechange = function(){ myThis.StateChangeCommunicationElement(); };
      else this.CommunicationElement.onload = function(){ myThis.requestFromCommunicationElement(); };
   }

   this.StateChangeCommunicationElement = function()
   {
      if( this.CommunicationElement.readyState == 'complete' )
         this.requestFromCommunicationElement();
   }

   this.requestFromCommunicationElement = function()
   {
   }

   this.init();
}
