function DojoWrapper ()
{
	/**
	 * public functions
	 */
	
	this.getById = function ( aId )
	{
		var result = dojo.byId ( aId );
		
		if ( result != undefined )
		{
			return result;
		}
		else
		{
			return null;
		}
	}
	
	this.getWidgetById = function ( aId )
	{
		dojo.require("dojo.parser");
		dojo.require ( "dijit.dijit" );
		return dijit.byId ( aId );
	}	
	
	
	this.getByQuery = function ( aSelector )
	{
		return dojo.query ( aSelector );
	}
	
	this.getCookie = function ( aId )
	{
		return dojo.cookie ( aId );
	}
	
	this.setCookie = function ( aId, aFirstArgument, aSecondArgument, aThirdArgument, aFourthArgument )
	{
		if ( !aId && !aFirstArgument )
		{
			console.error ( "DojoWrapper.setCookie: Wrong arguments supplied.");
		}
		else if ( !aSecondArgument )
		{
			dojo.cookie ( aId, aFirstArgument );
		}
		else if ( !aThirdArgument )
		{
			dojo.cookie ( aId, aFirstArgument, aSecondArgument );
		}
		else if ( ! aFourthArgument )
		{
			dojo.cookie ( aId, aFirstArgument, aSecondArgument, aThirdArgument );
		}
		else
		{
			dojo.cookie ( aId, aFirstArgument, aSecondArgument, aThirdArgument, aFourthArgument );
		}
	}
	
	this.ajaxRequestPost = function ( aUrl, aContent, aAgent, aHandleAs )
	{
		var handleAs =  "text";
		
		if ( aHandleAs )
		{
			handleAs = aHandleAs;
		}
		
		
		
		dojo.xhrPost(
			{
				url: aUrl,
				content: aContent,
				handleAs: handleAs,
				sync: true,
				handle: function(aData, aArgs)
				{
					aAgent(aData, aArgs);
				}
			});	
			
		
	}
	
	this.connect = function ( aNode, aEvent, aAgent )
	{
		dojo.connect ( aNode, aEvent, aAgent );
	}
	
	this.serializeToJson = function ( aList )
	{
		return dojo.toJson ( aList );
	}
	
	this.evalFromJson = function ( aObject )
	{
		return dojo.fromJson ( aObject );
	}
	
	this.createTooltip = function ( aOptions, aOriginalNode )
	{
		var result = new dijit.Tooltip ( aOptions, aOriginalNode );  
		
		return result;
	}
	
	this.createCalendar = function ( aOptions, aOriginalNode )
	{
		
		return new dijit._Calendar ( aOptions, aOriginalNode );
	}
	
	this.animateProperty = function ( aNode, aDuration, aProperties, aOnEndAgent)
	{
		return dojo.animateProperty(
		{
			node: aNode,
			duration: aDuration,
			properties: aProperties,
			onEnd: aOnEndAgent
		});
	}
	
	this.fadeOut = function ( aNode, aFadeTime )
	{
		
		var result = dojo.fadeOut ( {
			node: aNode,
			duration: aFadeTime
		} );
		
		dojo.style ( aNode, "display", "none");
		
		return result;

		
		
	}
	
	this.fadeIn = function ( aNode, aFadeTime )
	{
		
		dojo.style ( aNode, "opacity", "0");
		dojo.style ( aNode, "display", "block");
		return dojo.fadeIn ( {
			node: aNode,
			duration: aFadeTime
		} );
	}
	
	this.chain = function ( aFirstAnimation, aSecondAnimation )
	{
		dojo.require ( "dojo.fx" );
		return dojo.fx.chain ( aFirstAnimation, aSecondAnimation );
	}
	
	this.removeNode = function ( aNode )
	{
		aNode.parentNode.removeChild ( aNode );
	}
	
	this.addClass = function ( aNode, aClass )
	{
		dojo.addClass ( aNode, aClass );
	}
	
	this.addClassToArray = function ( aArray, aClass )
	{
		aArray.addClass ( aClass);
	}
	
	this.removeClass = function ( aNode, aClass )
	{
		dojo.removeClass ( aNode, aClass );
	}
	
	this.RemoveClassFromArray = function ( aArray, aClass )
	{
		aArray.removeClass ( aArray, aClass);
	}
	
	this.getElementsByClass = function ( aClass )
	{
		return dojo.query ( "." + aClass );
	}
	
	this.setStyle = function ( aNode, aProperty, aValue )
	{
		dojo.style ( aNode, aProperty, aValue );
	}
	
	this.setStyleToArray = function ( aArray, aProperty, aValue)
	{
		aArray.style ( aProperty, aValue );
	}
	
	this.getStyle = function ( aNode, aProperty )
	{
		return dojo.style ( aNode, aProperty );
	}
	
	this.getBrowserWidth = function ()
	{
		return dijit.getViewport ().w;
	}
	
	this.addOnLoad = function ( aAgent )
	{
		dojo.addOnLoad ( aAgent );
	}
	
	this.isIE = function ()
	{
		return dojo.isIE;
	}
	
	this.createElement = function ( aTagName )
	{
		return dojo.doc.createElement ( aTagName );
	}
}
