/* set up browser checks */

// check browsers
var ua		= navigator.userAgent;
var opera	= /opera [56789]|opera\/[56789]/i.test(ua);
var ie		= !opera && /msie [56789]/i.test(ua);		// preventing opera to be identified as ie
var moz		= !opera && /mozilla\/[56789]/i.test(ua);	// preventing opera to be identified as mz
/* end browser checks */
/* Do includes */

if (ie)	document.write('<script type="text/javascript" src="/dion/design_code/cssexpr.js"><\/script>');
/* end includes */


webfxLayout = {
	writeTitle: function (s, s2) {
		document.write("<div id='webfx-title-background'></div>");
		if (opera) {
			document.write("<h1 id='webfx-title' style='top:9px;'>" + s + "</h1>");
		}
		else {
			document.write("<h1 id='webfx-title'>" + s + "</h1>");
		}

		if (s2 == null)
			s2 = "Welcome to my home page!";
		
		if (opera) {
			document.write("<span id='webfx-sub-title' style='top:46px;'>" + s2 + "</span>");
		}
		else {
			document.write("<span id='webfx-sub-title'>" + s2 + "</span>");
		}
	},
	
	writeMainTitle:	function (subTitle) {
		this.writeTitle("Dion Almaer", subTitle);
	},
	
	writeTopMenuBar: function () {
		document.write("<div id='webfx-menu-bar-1'></div>");
		if (opera) {
			document.write("<style>.webfx-menu-bar a {padding-top:3px;}</style>");
			document.write("<div id='webfx-menu-bar-2' style='height:2px;'></div>");
		}
		else
			document.write("<div id='webfx-menu-bar-2'></div>");
		document.write("<div id='webfx-menu-bar'>");// div is closed in writeBottomMenuBar
	},
	
	writeBottomMenuBar: function () {
		document.write("</div>");
		if (opera)
			document.write("<div id='webfx-menu-bar-3' style='height:0px;'></div>");
		else
			document.write("<div id='webfx-menu-bar-3'></div>");
		document.write("<div id='webfx-menu-bar-4'></div>");
		document.write("<div id='webfx-menu-bar-5'></div>");
	},
	
	writeMenu: function () {
		if (ie || moz || opera) {
			if (ie)
				simplifyCSSExpression();
			webfxMenuImagePath = "/dion/images/";
			this.writeTopMenuBar();
			document.write(webfxMenuBar);
			this.writeBottomMenuBar();
		}
		else {
			document.write("<div id='webfx-menu-bar'>&nbsp;" +
				"<a href='/'>Home</a> " +
				"</div>" + "<p class='warning' style='width: 500px'>" +
				"This site will look much better in a browser that supports " +
				"<a href='http://www.webstandards.org/upgrade/' " +
				"title='Download a browser that complies with Web standards.'>" +
				"web standards</a>, " +
				"but it is accessible to any browser or Internet device." + "</p>"
			);
		}
	},
	
	writeDesignedByEdger: function () {
		if (ie && document.body.currentStyle && document.body.currentStyle.writingMode != null)
			// IE55+
			document.write("<div id='webfx-about'><a href='mailto:dion@almaer.com'>Dion Almaer</a></div>");
	}
};

if (ie && window.attachEvent) {
	window.attachEvent("onload", function () {
		var scrollBorderColor	=	"rgb(120,172,255)";
		var scrollFaceColor		=	"rgb(234,242,255)";
		with (document.body.style) {
			scrollbarDarkShadowColor	=	scrollBorderColor;
			scrollbar3dLightColor		=	scrollBorderColor;
			scrollbarArrowColor			=	"black";
			scrollbarBaseColor			=	scrollFaceColor;
			scrollbarFaceColor			=	scrollFaceColor;
			scrollbarHighlightColor		=	scrollFaceColor;
			scrollbarShadowColor		=	scrollFaceColor;
			scrollbarTrackColor			=	"white";
		}
	});
}
