var setupConfiguration = {
	showExternalLinkNotice: true,
	enableSortableTables: true
};

Toolbar = {
	init: function () {
		 	Ext.fly("divToolbar").on("mouseover", this.fnOver, this, {});
			Ext.fly("divToolbar").on("mouseout", this.fnOut, this, {});
		 	Ext.fly("divToolbarLanguage").on("click", this.fnShow, this, {});
		 	Ext.fly("divToolbarDropDownLink").on("click", this.fnHide, this, {stopEvent: true, stopPropagation: false});
	},

	fnShow: function () {
		Ext.fly("divToolbarDropdown").show();
 		Ext.fly("divToolbar").un("mouseover", this.fnOver);
 		Ext.fly("divToolbar").un("mouseout", this.fnOut);
	},
	
	fnHide: function () {
		Ext.fly("divToolbarDropdown").hide();
 		Ext.fly("divToolbar").on("mouseover", this.fnOver);
 		Ext.fly("divToolbar").on("mouseout", this.fnOut);	
 	},
 	
 	fnOver: function () {
 		Ext.fly("divToolbar").addClass("Hover");	
 	},
 	
 	fnOut: function () {
		Ext.fly("divToolbar").removeClass("Hover"); 		
 	}
};

Ext.onReady(function(){
	//init toolbarbehavior
 	Toolbar.init();
})

/* This should all be removed in the html-code by now. It not we will see it and fix it.
Ext.onReady(function(){
	//init toolbarbehavior
 	Toolbar.init();
 			
	//remove the style="margin: 0px" that is added to all tags generated by the WCM
	var contentParagraphs = Ext.query("p,h1,h2,h3", "divMiddlePane");
	Ext.each(contentParagraphs, 
		function (el) {
			el.removeAttribute("style");
		})
	
		
	//remove all empty p, ul and a tags
	var contentParagraphs = Ext.query("p,a,ul", "divMiddlePane");
	Ext.each(contentParagraphs,
		function (el) {
			var text = el.innerHTML;
			
			if(text !== undefined) {
				text = text.replace(/^\s+/, '').replace(/\s+$/, '');
			}
			
			if (text == "" || text == "&nbsp;") {
				Ext.fly(el).remove();
			}
		})
	
		
	//remove the well known <XMP> tags added for no purpose what so ever... 
	var strangeXmpElements = Ext.query("xmp", "divMiddlePane");
	Ext.each(strangeXmpElements, 
		function (el) {
			Ext.fly(el).remove();
		})
		
	var aTags = Ext.query("a", "divMiddlePane");
	Ext.each(aTags, 
		function (el) {
			if(el.odc !== null) {
				el.removeAttribute("odc");
			}
		})
		
	//if a <div> that was supposed to contain an image doesn't, then remove it
	var imageDivs = Ext.query("div.AlignImageLeft, div.AlignImageRight", "divMiddlePane");
	Ext.each(imageDivs,
		function (el) {
			el = Ext.fly(el);
			if(el.down("img") === null) {
				el.remove();					
			}
		}
	)
	
	//remove empty file links 
	var file = Ext.query("div.BottomMargin", "divMiddlePane");
	Ext.each(file, 
		function (el) {
			el = Ext.fly(el);
			var a = el.child("a");
			
			if(a !== null && a.dom.text == "") {
				el.remove();
			}
		}
	)
	
	//look through all informationbox elements and and if they doesn't contain a <p> then add the class topmargin to the ul element
	var infoBox = Ext.query(".InformationBox, .SkinAdditionalInformationContent", "divMiddlePane");
	Ext.each(infoBox, 
		function (el) {
			el = Ext.fly(el);
			
			if(el.child("p") === null && el.child("ul") !== null) {
				el.child("ul").addClass("TopMargin");
			}
		}
	)	
})

*/

function showCustomWindow(title, message) {
	new CustomWindow({
		title: title,
		html: "<p>" + message + "</p>",
		confirmDialog: true,
		disableCancel: true
	});
}
