function isIE8()
{
	//return navigator.userAgent.search("MSIE 8") > -1;
	return (window.navigator.userAgent && window.navigator.userAgent.indexOf('Trident/4.0') > -1);
}

function addAccelerator(serviceURL)
{
	if(serviceURL!='')
	{
    	if(isIE8())
	    {
			window.external.addService(serviceURL);
		}
	    else
	    {
			alert('抱歉，這個功能需要安裝IE8才能使用囉!');
		}
	}
	else
	{
		alert('尚未設定!');
	}
}


function addWebSlice(serviceURL, webSliceName)
{
	if(serviceURL!='')
	{
    	if(isIE8())
	    {
			window.external.addToFavoritesBar(serviceURL, webSliceName, 'slice');
		}
	    else
	    {
			alert('抱歉，這個功能需要安裝IE8才能使用囉!');
		}
	}
	else
	{
		alert('尚未設定!');
	}
}

function addSearchSuggestion(serviceURL)
{
	if(serviceURL!='')
	{
    	if(isIE8())
	    {
			window.external.AddSearchProvider(serviceURL);
		}
	    else
	    {
			alert('抱歉，這個功能需要安裝IE8才能使用囉!');
		}
	}
	else
	{
		alert('尚未設定!');
	}
}

function copySerialCode(serial)
{
    alert('本抽獎活動已於4/30截止，謝謝您的參與。');
    /*
	if (serial == '')
	{
		alert('oops!');
	}
	else
	{
		var wording = '你的好友邀請你一起體驗Internet Explorer 8的無限樂趣! http://www.microsoft.com/taiwan/promo/ie8/code/?c=' +serial;
		$.copy(wording);
		alert('複製完成！\n\n趕快轉貼給好友，待好友點回之後你就能抽獎囉～');
	}*/
}

function checkForm()
{
    alert('本抽獎活動已於4/30截止，謝謝您的參與。');
    return false;
	
	/*var username = $('#username').val();
	var email = $('#email').val();
	var tel = $('#tel').val();
	if($().isEmpty(username))
	{
		alert('請填寫您的姓名，謝謝!');
		$('#username').focus();
		return false;
	}
	else if($().isEmpty(email))
	{
		alert('請填寫您的Email，謝謝!');
		$('#email').focus();
		return false;
	}
	else if(!$().isEmail(email))
	{
		alert('您填寫的Email格式有誤\n麻煩請確認，謝謝!');
		$('#email').focus();
		return false;
	}
	else if($().isEmpty(tel))
	{
		alert('請填寫您的聯絡電話，謝謝!');
		$('#tel').focus();
		return false;
	}
	else
	{
		return confirm('確認送出?');
	}*/
}