Click here to Skip to main content
15,885,278 members
Articles / Web Development / HTML

Dialog with HTML skin using CDHtmlDialog and SetWindowRgn

Rate me:
Please Sign up or sign in to vote.
4.83/5 (15 votes)
27 Oct 20043 min read 195.3K   5.8K   82  
Describes how to use an external HTML page as a non-rectangular skin of a dialog.
/* 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 (window.pathToRoot == null)
	pathToRoot = "/";

if (ie)
	document.write('<script type="text/javascript" src="' + pathToRoot + 'dhtml/cssexpr/cssexpr.js"><\/script>');
document.write('<link type="text/css" rel="StyleSheet" href="' + pathToRoot + 'webfxlayout.css">');
document.write('<link type="text/css" rel="StyleSheet" href="' + pathToRoot + 'dhtml/xmenu/xmenu.css"><\/script>');
document.write('<script type="text/javascript" src="' + pathToRoot + 'dhtml/xmenu/xmenu.js"><\/script>');
document.write('<script type="text/javascript" src="' + pathToRoot + 'index.cgi?action=menu"><\/script>');

// later
// webfxMenuImagePath = pathToRoot + "images/";


/* 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 = "WebFX - What you never thought possible!";
		
		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 () {
		this.writeTitle("WebFX", "What you never thought possible!");	
	},
	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 = pathToRoot + "images/";
			this.writeTopMenuBar();
			document.write(webfxMenuBar);
			this.writeBottomMenuBar();
		}
		else {
			document.write(
				"<div id='webfx-menu-bar'>&nbsp;" +
				"<a href='/'>Home</a> " +
				"<a href='" + pathToRoot + "?action=sitemap'>Site Map</a> " +
				"<a href='/webboard'>WebFX Webboard</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'>Page designed and maintained by " +
					"<a href='/contact.html#erik'>Erik Arvidsson</a> &amp; " +
					"<a href='/contact.html#emil'>Emil A Eklund</a>.</div>");
	}
};


if (ie && window.attachEvent) {
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions