function AddFavorite () { window.external.AddFavorite('http://www.coffeemania.com.tw/', '咖啡狂人'); }

function showHTML (URL) {
	showModalDialog(URL, '', 'dialogHeight: 400px; dialogWidth: 600px;center:1;dialogHide:1;edge:sunken;help:0;resizable:0;scroll:0;status:0;unadorned:0;');
}

function spopup (url) {
	newwindow = window.open(url, 'name', 'WIDTH=450,HEIGHT=500,FRAMEBORDER=0,MARGINWIDTH=0,MARGINHEIGHT=0,SCROLLING=no,allowtransparency=true');
	if (window.focus){ newwindow.focus(); }
}

function showsecurity () {
	var surl = 'https://secure.comodo.net/ttb_searcher/trustlogo?v_querytype=W&v_shortname=SCAS&v_search=www.coffeemania.com.tw&x=6&y=5';
	spopup(surl);
}

try { focus(); } catch(a) {}

(function () {
	var a, i, j;
	try {
		a = document.all('rolling');
		if ('length' in a) {
			for (i = 0, j = a.length; i < j; i++) { rollit(a[i]); }
		} else { rollit(a); }
	} catch(a) {}
})();

setTimeout(function () { window.location.href = 'http://www.coffeemania.com.tw/'; }, 90 * 60 * 1000);

(function () {
	var a;
	try { alert(document.getElementById('alertmessage').innerHTML.replace(/[\r\n]*\<br\>[\r\n]*/gi, '\r\n').replace(/(^[\r\n]+)|([\r\n]+$)/, '')); } catch(a) {}
})();

function rollit(a) {
	if (a.children.length < 1) { a.style.display = 'none'; return; }
	if (-1 < a.timer) { return; }

	a.change = function () { a.appendChild(a.firstChild); };
	a.roll = function () {
		if (0 < a.timer) { return; } a.timer = setInterval(a.change, 800);
	};
	a.stop = function () {
		var b; if (0 < a.timer) { try { clearInterval(a.timer); } catch(b) {} a.timer = 0; }
	};

	a.attachEvent('onmouseover', a.stop);
	a.attachEvent('onmouseout', a.roll);
	setInterval(function () { a.style.borderRightWidth = (a.style.borderRightWidth == '0px' ? '2px' : '0px'); }, 200);

	a.roll();
}

