dojo.require("dojo._base.query");
dojo.require("dojo._base.xhr");
dojo.require("dojo.dnd.Container");
var yvonne = {
	init:function(){
		yvonne.contentNode = dojo.byId("content");
		yvonne.bodyBlock = dojo.byId("content_wrapper");
		yvonne.contentWrapper = dojo.byId("content_wrapper");
		
		/* contentHTML */
		yvonne.bodyBlockHTML = '';
		yvonne.mainContentHTML = '';
	},
	
	appendBodyBlock : function(html){
		if(typeof(html) != "undefined")
			yvonne.bodyBlock.innerHTML += html;
	},
	replaceBodyBlock : function (html){
		if(typeof(html) != "undefined")
			yvonne.bodyBlock.innerHTML = html;
		else
			yvonne.bodyBlock.innerHTML = yvonne.bodyBlockHTML;
	},
	
	appendMainContent : function(html){
		if(typeof(html) != "undefined")
			yvonne.contentNode.innerHTML += html;
	},
	
	replaceMainContent : function(html){
		if(typeof(html) != "undefined")
			yvonne.contentNode.innerHTML = html;
		else
			yvonne.contentNode.innerHTML = yvonne.mainContentHTML;
	},
	
	
	/* 
	 * images : array of images or block,
	 * func : call back function when last images is done with the animation.
	 */
	fadeOutImages : function(images,func){
		dojo.forEach(images,function(img,idx){
			dojo.fadeOut({node:img,duration:500}).play();
			// call endAnimation when the last image is done animate.
			if(idx==images.length-1)
				dojo.fadeOut({	node:img,
								duration:500,
								onEnd:func}).play();
			});
	}		
};

//call init whenever we're ready.
dojo.addOnLoad(function(){
	// Required for dojotoolkit:
	yvonne.init();
});
