$.fn.fingering = function(opaque, tempo){
	$(this).css('opacity', opaque).hover(function(){
		$(this).animate({ 'opacity' : 1.0 }, { 'duration' : tempo, 'easin' : 'easeOut' });
	},function(){
		$(this).animate({ 'opacity' : opaque }, { 'duration' : tempo, 'easin' : 'easeOut' });
	});
	
	return this;
};


jQuery(function($){
				
		var userAgent = window.navigator.userAgent.toLowerCase();
 
		$.browser.msie8 = $.browser.msie && /msie 8\.0/i.test(userAgent);
		$.browser.msie7 = $.browser.msie && /msie 7\.0/i.test(userAgent);
		$.browser.msie6 = !$.browser.msie8 && !$.browser.msie7 && $.browser.msie && /msie 6\.0/i.test(userAgent);

	if($.browser.msie6){
		$('#manual').css('margin-left', 20);
	}
	
	if(!$.browser.msie){
		$('.overture').css('margin-left', 30);
	}
	
	$('.emu').click(function(){
		alert('此為模擬圖像物件！');
	});
	
	$('.package-list').find('li').each(function(ref){
			var leading = $('<span>').text(ref+1 + '. ');
			$(this).find('a').prepend(leading);
	});
	
	/*
	function toggletel(){
		$('#tel').find('img').each(function(){
			if( $(this).is('.concealed') ){
				$(this).toggleClass('concealed', false).fadeOut('slow');
			}
			else if( !$(this).is('.concealed') ){
				$(this).toggleClass('concealed', true).fadeIn('slow');
			}
		});
	};
	sway = setInterval(toggletel, 4000);
	*/
	
	var key = 0;
	function switchTel(){
		var hun = 'templates/default/images/tel_hun.png';
		var tpe = 'templates/default/images/tel_tpe.png';
		if(key%2==0){
			$('.phone').attr('src', tpe).hide().fadeIn();
		}else{
			$('.phone').attr('src', hun).hide().fadeIn();
		}
		key = key + 1;
	}
	
	sway = setInterval(switchTel, 4000);
	
	
	$('#upper-links').each(function(){
		var _split = $('<li>').text('|').addClass('link-split');
		$(this).find('li:not(:last)').after(_split);
	});
})
