function PostRating (varName, containerId, valueId, numberOfItems, imagesPathUrl, useHalfStars, containerStyleClass, containerOverStyleClass, containerReadOnlyStyleClass, titles, isReadOnly, allowMultipleSelections) {
	this.VariableName = varName;
	this.ValueHandle =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(valueId);
	this.ContainerHandle =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(containerId);
	this.ImagesPathUrl = imagesPathUrl;
	this.UseHalfStars = useHalfStars;
	this.Items = new (Array)(numberOfItems);
	this.IsInitialized = false;
	this.NumberOfItems = numberOfItems;
	this.ContainerStyleClass = containerStyleClass;
	this.ContainerOverStyleClass = containerOverStyleClass;
	this.ContainerReadOnlyStyleClass = containerReadOnlyStyleClass;
	this.Titles = titles;
	this.IsReadOnly = isReadOnly;
	this.AllowMultipleSelections = allowMultipleSelections;
	this.SetAnimationHandle = null;
	this.SavingValue = false;
	this.CachedImages = new (Array)();
	
	this.MouseOver = function (value) {
		if (!this.IsInitialized || this.IsReadOnly)
			return;
			
		this.ContainerHandle.className = this.ContainerOverStyleClass;
	
		this.ShowValue( _proxy_jslib_handle(null, 'value', value, 0, 0));
	}
	
	this.MouseOut = function () {
		if (!this.IsInitialized || this.IsReadOnly)
			return;
			
		this.ContainerHandle.className = this.ContainerStyleClass;
		
		this.ShowCurrentValue();
	}
	
	this.SetValue = function (value) {
		if (!this.IsInitialized || this.IsReadOnly)
			return;
		
		this.ShowValue( _proxy_jslib_handle(null, 'value', value, 0, 0));	
		 _proxy_jslib_assign('', this.ValueHandle, 'value', '=', (  _proxy_jslib_handle(null, 'value', value, 0, 0)));
		
		if (this.SetAnimationHandle)
			window.clearTimeout(this.SetAnimationHandle);
			
		if (!this.AllowMultipleSelections)
			this.IsReadOnly = true;
			
		this.SavingValue = true;
		eval(_proxy_jslib_proxify_js((this.VariableName + "_ajax"), 0, 0) ).SaveRating( _proxy_jslib_handle(null, 'value', value, 0, 0), _proxy_jslib_new_function('result', 'window.' + this.VariableName + '.ValueSaved(result);'), _proxy_jslib_new_function("alert('An error occured while saving the rating value.');"));
			
		this.SetAnimationHandle =  _proxy_jslib_handle(window, 'setTimeout', '', 1, 0)(this.VariableName + ".SetAnimation(0);", 99);
	}
	
	this.ValueSaved = function(result) {
		result = eval(_proxy_jslib_proxify_js((result), 0, 0) );
	
		 _proxy_jslib_assign('', this.ValueHandle, 'value', '=', ( result[0]));
		this.ContainerHandle.title = result[1];
		this.IsReadOnly = result[3] != 'true';
		if (result[2])
		{
			if (this.IsReadOnly)
			{
				 _proxy_jslib_assign('', this.ContainerHandle.style, 'cursor', '=', ( "pointer"));
			}
		}
			
		this.SavingValue = false;
	}
	
	this.SetAnimation = function (step) {
		if (step > 6 || !this.IsInitialized)
		{
			if (!this.AllowMultipleSelections)
				this.IsReadOnly = true;
			
			this.Initialize();
			return;
		}
			
		if (step % 2 == 0)
			this.ContainerHandle.className = this.ContainerStyleClass;
		else
			this.ContainerHandle.className = this.ContainerOverStyleClass;

		if (!this.SavingValue)
			step = step + 1;
		else
			step = (step + 1) % 2;
			
		this.SetAnimationHandle =  _proxy_jslib_handle(window, 'setTimeout', '', 1, 0)(this.VariableName + ".SetAnimation(" + step + ");", 199);
	}
	
	this.ShowValue = function (value) {
		if (!this.IsInitialized)
			return;
			
		var i;
		var j = this.NumberOfItems * 2;
		 value= _proxy_jslib_assign_rval('', 'value', '=', (  _proxy_jslib_handle(null, 'value', value, 0, 0) * 2), value);
		 value= _proxy_jslib_assign_rval('', 'value', '=', (  _proxy_jslib_handle(null, 'value', value, 0, 0) - 1), value);
			
		for (i = 0; i < j; i++)
		{
			if (i <=  _proxy_jslib_handle(null, 'value', value, 0, 0))
				 _proxy_jslib_assign('',  _proxy_jslib_handle(this.ContainerHandle.childNodes, (i), 0, 0), 'src', '=', ( this.GetItemsOnSrc(i)));
			else
				 _proxy_jslib_assign('',  _proxy_jslib_handle(this.ContainerHandle.childNodes, (i), 0, 0), 'src', '=', ( this.GetItemsOffSrc(i)));
		}
	}
	
	this.ShowCurrentValue = function() {
		if (!this.IsInitialized)
			return;
			
		this.ShowValue( _proxy_jslib_handle(this.ValueHandle, 'value', '', 0, 0));
	}
	
	this.GetValue = function() {
		if (!this.IsInitialized)
			return null;

		return  _proxy_jslib_handle(this.ValueHandle, 'value', '', 0, 0);
	}
	
	this.GetItemsOnSrc = function (index) {
		if (index % 2 == 1)
			return this.ImagesPathUrl + 'star-right-on.gif';
		else
			return this.ImagesPathUrl + 'star-left-on.gif';
	}
	
	this.GetItemsOffSrc = function (index) {
		if (index % 2 == 1)
			return this.ImagesPathUrl + 'star-right-off.gif';
		else
			return this.ImagesPathUrl + 'star-left-off.gif';
	}
	
	this.GetItemTitle = function (index, value) {
		if (typeof(this.Titles) == "object")
			return  _proxy_jslib_handle( _proxy_jslib_handle(this.Titles, (index), 0, 0), 'replace', '', 1, 0)("{0}", ( _proxy_jslib_handle(null, 'value', value, 0, 0)));
		else if (this.Titles)
			return  _proxy_jslib_handle(this.Titles, 'replace', '', 1, 0)("{0}", ( _proxy_jslib_handle(null, 'value', value, 0, 0)));
		else
			return  _proxy_jslib_handle(null, 'value', value, 0, 0);			
	}
	
	this.CacheImages = function() {
		var image;
		var url;
		var i;
		var j = 2;

		for (i = 0; i < j; i++)
		{
			url = this.GetItemsOnSrc(i);
			if (!this.IsImageCached(url))
			{
				image = new (Image)();
				 _proxy_jslib_assign('', image, 'src', '=', ( url));
				 _proxy_jslib_assign('', this.CachedImages, (this.CachedImages.length), '=', ( image));
			}
			
			url = this.GetItemsOffSrc(i);
			if (!this.IsImageCached(url))
			{
				image = new (Image)();
				 _proxy_jslib_assign('', image, 'src', '=', ( url));
				 _proxy_jslib_assign('', this.CachedImages, (this.CachedImages.length), '=', ( image));
			}
		}
	}
	
	this.IsImageCached = function (url) {
		var i;
		for (i = 0; i < this.CachedImages.length; i++)
		{
			if ( _proxy_jslib_handle( _proxy_jslib_handle(this.CachedImages, (i), 0, 0), 'src', '', 0, 0) == url)
				return true;
		}
		
		return false;
	}
	
	this.Initialize = function() {
		this.CacheImages();
	
		while (this.ContainerHandle.childNodes.length > 0)
			this.ContainerHandle.removeChild(this.ContainerHandle.childNodes[0]);
			
		if (!this.IsReadOnly)
			this.ContainerHandle.className = this.ContainerStyleClass;
		else
			this.ContainerHandle.className = this.ContainerReadOnlyStyleClass;
	
		var i, e, value;
		var j = this.NumberOfItems * 2;
		
		for (i = 0; i < j; i++)
		{
			e = document.createElement("img");
			
			 value= _proxy_jslib_assign_rval('', 'value', '=', ( (i + 1) / 2), value);

			if ( _proxy_jslib_handle(null, 'value', value, 0, 0) <=  _proxy_jslib_handle(this.ValueHandle, 'value', '', 0, 0))
				 _proxy_jslib_assign('', e, 'src', '=', ( this.GetItemsOnSrc(i)));
			else
				 _proxy_jslib_assign('', e, 'src', '=', ( this.GetItemsOffSrc(i)));
				
			if (!this.IsReadOnly)
			{
				if (!this.UseHalfStars)
				{
					 value= _proxy_jslib_assign_rval('', 'value', '=', ( Math.ceil( _proxy_jslib_handle(null, 'value', value, 0, 0))), value);
					e.title = this.GetItemTitle( _proxy_jslib_handle(null, 'value', value, 0, 0),  _proxy_jslib_handle(null, 'value', value, 0, 0));
				}
				else
					e.title = this.GetItemTitle(i,  _proxy_jslib_handle(null, 'value', value, 0, 0));

				e.onclick = _proxy_jslib_new_function("window." + this.VariableName + ".SetValue(" +  _proxy_jslib_handle(null, 'value', value, 0, 0) + ");");
				e.onmouseover = _proxy_jslib_new_function("window." + this.VariableName + ".MouseOver(" +  _proxy_jslib_handle(null, 'value', value, 0, 0) + ");");
				e.onmouseout = _proxy_jslib_new_function("window." + this.VariableName + ".MouseOut();");
			}

			e.align = "absmiddle";
			e.border = 0;		
			
			this.ContainerHandle.appendChild(e);
		}
		
		this.IsInitialized = true;
	}
	
	this.Initialize();
} ;
_proxy_jslib_flush_write_buffers() ;