if (typeof com == "undefined") com = {};
if (typeof com.atnext == "undefined") com.atnext = {};
if (! com.atnext.header) {
	var domain = "";
	// https site need to have a symlink "common" pointed to the header source
	if (document.location.href.match(/^https\:\/\/[^\.]*\.atnext\.com/)) {
		var	base_dir = "common/header";
	} else if (document.location.href.match(/^http\:\/\/[^\.]*\.atnext\.com/) || 
			!document.location.href.match(/^http\:\/\/10\.[^\/]+\/template/)) {
		domain = "http://appledaily.atnext.com";
		var	base_dir = "/template/common/header";
	} else {
		var	base_dir = "/template/common/header";
	}
	var image_dir = domain+base_dir+"/images/2007";
	var style_dir = domain+base_dir+"/style/2007";
} else {
	var image_dir = com.atnext.header.image_dir;
	var style_dir = com.atnext.header.style_dir;
}
com.atnext.footer = {
	image_dir: image_dir,
	style_dir: style_dir,
	time: new Date(),
	logo_image: ((/MSIE ((5\.5)|[6])/.test(navigator.userAgent) && navigator.platform == "Win32")?"blank.gif":"nextmedia.png"),
	logo_style: ((/MSIE ((5\.5)|[6])/.test(navigator.userAgent) && navigator.platform == "Win32")?("filter:progid:DXImageTransform.Microsoft." +
					"AlphaImageLoader(src='" + image_dir + "/nextmedia.png',sizingMethod='scale')"):"")
};
document.write("<table class=\"footer\" width=\"100%\" height=\"80\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n  <tr>\r\n\t<td colspan=\"2\" align=\"center\" valign=\"middle\">\r\n\t  <div id=\"footer_border\"></div>\r\n\t  <div id=\"footer_right\">\r\n\t  </div></td>\r\n  </tr>\r\n  <tr>\r\n\t<td align=\"center\" valign=\"middle\"><span id=\"footer_black\"><a href=\"http://www.atnext.com\">壹蘋果網絡(香港)</a> </span><span id=\"footer_grey\">|</span> <span id=\"footer_black\"><a href=\"http://www.1-apple.com\">壹蘋果網絡(台灣)</a></span> <span id=\"footer_grey\">|</span> <span id=\"footer_black\"><a href=\"http://www.atnextadvertising.com/\">刊登廣告</a> </span><span id=\"footer_grey\">|</span> <span id=\"footer_black\"><a href=\"http://whats-on.atnext.com/whats-on/index.cfm?event=article&iss=1&sec=5204313&art=5204421\">聯絡我們</a></span>\r\n\t\t<div id=\"footer_copyright\"><a href=\"http://whats-on.atnext.com/whats-on/index.cfm?event=article&iss=1&sec=5204250&art=5218607\">&copy; "+(new Date()).getFullYear()+" Next Media Interactive Limited. All rights reserved. 版權所有　不得轉載</a></div></td>\r\n\t<td width=\"215\" align=\"center\" valign=\"top\"><div id=\"footer_right\"> <a href=\"http://www.nextmedia.com/\"><img id=imgNM width=215 height=26 src=\"$IMAGE_DIR$/$LOGO$\" style=\"$LOGO_STYLE$\" alt=\"nextmedia\" border=\"0\" /></a><br/>\r\n\t\t\t<img src=\"$IMAGE_DIR$/nielsen.gif\" alt=\"nielsen net ratings\" /><a href=\"http://www.atnextadvertising.com/\" target=\"_blank\"><img src=\"$IMAGE_DIR$/pixelmedia.gif\" alt=\"pixel media\" border=\"0\" /></a> </div></td>\r\n  </tr>\r\n</table>"
.replace(/\$IMAGE_DIR\$/g, com.atnext.footer.image_dir)
.replace(/\$LOGO\$/g, com.atnext.footer.logo_image)
.replace(/\$LOGO_STYLE\$/g, com.atnext.footer.logo_style)
);

