document.write('<table width="780" border="0" cellspacing="0" cellpadding="0">')
document.write('  <tr> ')
document.write('    <td width="179"><a href="http://www.books.com.tw/"><img src="http://addons.books.com.tw/G/img2000/act_01.jpg" width=179 height=33 border="0" alt="回博客來"></a></td>')
var today = new Date().getDate();
//var todaytmp = new Date();
//var tmptoday = todaytmp.getFullYear()+""+(todaytmp.getMonth()+1)+""+todaytmp.getDate();
var tmptoday = new Date().getTime();
var set1 = new Date("2010/02/08").getTime();
var set2 = new Date("2010/02/21  23:59:59").getTime();
var set3 = new Date("2010/03/31  23:59:59").getTime();
var set4 = new Date("2010/03/07  23:59:59").getTime();
var set5 = new Date("2010/03/15  23:59:59").getTime();
if (today == 6) {
	//6號
	document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=mem_header&url=http://www.books.com.tw/activity/vip/"><img src="http://www.books.com.tw/activity/vip/banner/31633-0605.gif" width=316 height=33 border="0"></a></td>')
}
else if (today == 7) {
	//7號為會員日
	//下面這個連結似乎是過期的？(Norman@2010/1/7 上午 12:36:24)
	//document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=mem_header&url=http://www.books.com.tw/activity/memday/index.php"><img src="http://addons.books.com.tw/G/img2000/act_02_09mem.jpg" width=316 height=33 border="0"></a></td>')
	//document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=mem_header&url=http://www.books.com.tw/exep/activity/2010/01/2010_exhibition/expert/tibe_index.php"><img src="http://addons.books.com.tw/G/img2000/31633-0106.gif" width=316 height=33 border="0"></a></td>')
	document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=mem_header&url=http://www.books.com.tw/activity/vip/"><img src="http://www.books.com.tw/activity/vip/banner/31633-0605.gif" width=316 height=33 border="0"></a></td>')
	//document.write('    <td width="316"></td>');
}
else {
	//document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=act_header&url=http://www.books.com.tw/activity/24hr/24hr.htm"><img src="http://addons.books.com.tw/G/img2000/act_02_08gold.jpg" width=316 height=33 border="0"></a></td>')
	//黃金週
	if(tmptoday >= set1 && tmptoday <= set2){
		document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=mem_header&url=http://www.books.com.tw/activity/2010/02/red/"><img src="http://addons.books.com.tw/G/ADbanner/2010/02/red/316x33.gif" width=316 height=33 border="0"></a></td>')
	}else if(tmptoday >= set4 && tmptoday <= set5){
		document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=mem_header&url=http://www.books.com.tw/activity/2009/12/top100/p1/index_001.php"><img src="http://addons.books.com.tw/G/img2000/31633-0305.gif" width=316 height=33 border="0"></a></td>')
	}else if(tmptoday <= set3){
		document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=mem_header&url=http://www.books.com.tw/exep/activity/2010/01/2010_exhibition/expert/tibe_index.php"><img src="http://addons.books.com.tw/G/img2000/31633-0106.gif" width=316 height=33 border="0"></a></td>')
	}else{
		document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=act_header&url=http://www.books.com.tw/activity/24hr/24hr.htm"><img src="http://addons.books.com.tw/G/img2000/act_02_08gold.jpg" width=316 height=33 border="0"></a></td>')	
	}
	////2009.12.15活動(300萬會員)
	//document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=act_header&url=http://www.books.com.tw/activity/2009/11/30050-1/"><img src="http://www.books.com.tw/activity/2009/11/30050/316x33.jpg" width=316 height=33 border="0"></a></td>')
	//document.write('    <td width="316"><a href="http://www.books.com.tw/exep/ap.php?apid=books&areaid=act_header&url=http://www.books.com.tw/activity/2009/11/30050-1/"><img src="http://www.books.com.tw/activity/2009/11/30050-1/300_part2.gif" width=316 height=33 border="0"></a></td>')
}
document.write('    <td width="29"><img src="http://addons.books.com.tw/G/img2000/act_03.jpg" width=29 height=33 border="0"></td>')
document.write('    <td width="61"><a href="http://db.books.com.tw/exep/shopping/cart.php"><img src="http://addons.books.com.tw/G/img2000/act_04.jpg" width=61 height=33 border="0" alt="我的購物車"></a></td>')
document.write('    <td width="59"><a href="https://db.books.com.tw/account.php"><img src="http://addons.books.com.tw/G/img2000/act_05.jpg" width=59 height=33 border="0" alt="會員專區"></a></td>')
document.write('    <td width="62"><a href="http://www.books.com.tw/exep/qa/webform.php?source=發函至博客來"><img src="http://addons.books.com.tw/G/img2000/act_06.jpg" width=62 height=33 border="0" alt="服務信箱"></a></td>')
document.write('    <td width="74"><a href="http://www.books.com.tw/qa/index.php"><img src="http://addons.books.com.tw/G/img2000/act_07.jpg" width=74 height=33 border="0" alt="Q&amp;A詢問台"></a></td>')

//分享到社群網 modify by chi 2010.02.02
document.write(' 		<td width="74"><a href="#" onmouseout="TWAY.wop();" onmouseover="TWAY.pop();" style="display:block;	width:64px;	height:33px;	border:0;	font-size:12px;	line-height:33px;	cursor:pointer;	position:relative;" title="把這個網頁分享到社群!"><span id="span_bg" style="display:block;	width:64px;	height:33px;	border:0;	font-size:12px;	line-height:33px;	cursor:pointer;	position:absolute;left:0;z-index:2;	background:url(http://addons.books.com.tw/G/img2000/act_tway/twayicon.gif) no-repeat 0 -90px;"></span></a></td>')



document.write('  </tr>')
document.write('</table>')
//document.write('<script language="javascript" src="/js/weblog/web_log.php"></script>');

//modify by chi 2010.02.02 start
//版型
document.write('<div id="act_tway" onmouseout="TWAY.wop();" onmouseover="TWAY.pop();" style="position:absolute;z-index:999999 !important;display:none;width:110px !important;font-size:12px;line-height:18px;text-align:left;background:#404040;">')
document.write('<div style="width:110px !important;z-index:999999 !important;"><a id="facebook" style="background-position:3px 5px;display:block;text-indent:23px;line-height:24px;color:#ddd;background-repeat:no-repeat;background-image:url(http://addons.books.com.tw/G/img2000/act_tway/twayicon.gif);text-decoration:none;_width:100%;cursor:pointer;" onclick="TWAY.push(this);" onmouseout="TWAY.hout(this);" onmouseover="TWAY.hover(this);">推到facebook</a></div>')
document.write('<div style="width:110px !important;z-index:999999 !important;"><a id="plurk" style="background-position:3px -25px;display:block;text-indent:23px;line-height:24px;color:#ddd;background-repeat:no-repeat;background-image:url(http://addons.books.com.tw/G/img2000/act_tway/twayicon.gif);text-decoration:none;_width:100%;cursor:pointer;" onclick="TWAY.push(this);" onmouseout="TWAY.hout(this);" onmouseover="TWAY.hover(this);">推到噗浪</a></div>')
document.write('<div style="width:110px !important;z-index:999999 !important;"><a id="twitter" style="background-position:3px -55px;display:block;text-indent:23px;line-height:24px;color:#ddd;background-repeat:no-repeat;background-image:url(http://addons.books.com.tw/G/img2000/act_tway/twayicon.gif);text-decoration:none;_width:100%;cursor:pointer;" onclick="TWAY.push(this);" onmouseout="TWAY.hout(this);" onmouseover="TWAY.hover(this);">推到twitter</a></div>')
document.write('</div>')

var TWAY = {
	'pop' : function() {//下拉滑進
		this.position();
		document.getElementById("span_bg").style.backgroundPosition="0pt -123px";
		document.getElementById("act_tway").style.display="block";
	},
	'wop' : function() {//下拉滑出
		document.getElementById("span_bg").style.backgroundPosition="0pt -90px";
		document.getElementById("act_tway").style.display="none";
	},
	'hover' : function(obj) {//選單滑進
			obj.style.backgroundColor="#555";
			obj.style.color="#bf5";
	},
	'hout' : function(obj) {//選單滑出
		obj.style.backgroundColor="";
		obj.style.color="#ddd";
	},
	'push' : function(obj) {//推到社群網
		var u=location.href;
		var t=document.title;
		switch (obj.id){
		case "facebook":
			window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t));
			break;
		case "plurk":
			window.open("http://www.plurk.com/?qualifier=shares&status=" .concat(encodeURIComponent(u)) .concat(" ") .concat("(") .concat(encodeURIComponent(t)) .concat(")"));
			break;
		case "twitter":
			window.open("http://twitter.com/home/?status=".concat(encodeURIComponent(t)) .concat(" ") .concat(encodeURIComponent(u)));
			break;
		}
	},
	'position' : function() {//設定位置座標
			var new_left = new_top = 0;
			var origin = document.getElementById('span_bg');
			if (origin.offsetParent) {
				do {
					new_left += origin.offsetLeft;
					new_top += origin.offsetTop;
				} while (origin = origin.offsetParent);
			}
			var tway = document.getElementById('act_tway');
			tway.style.left = new_left + 'px';
			tway.style.top = new_top + 33 + 'px';
	}
};
//modify by chi 2010.02.02 end 
