
//====== logo 切换 ====== 

	$(function() {
		var fadeSpeed = ($.browser.safari ? 600 : 450);
		$('#logo').append('<span class="hover"></span>');
		$('.hover').css('opacity', 0);
		$('.hover').parent().hover(function() {
			$('.hover', this).stop().animate({
				'opacity': 1
			},
			fadeSpeed)
		},
		function() {
			$('.hover', this).stop().animate({
				'opacity': 0
			},
			fadeSpeed)
		});
	});

//====== snsico 切换 ====== 
	var snsico = function() {
		var me = this;
		var args = arguments;
		var self = {
			c: {
				navItems: '.link, .sina, .email, .qq, .github, .tqq, .map, .wang',
				navSpeed: ($.browser.safari ? 600 : 350)
			},
			init: function() {
				$('.snsmain').append('<span class="hover"></span>');
				$('.hover').css('opacity', 0);
				$('.snsmain').hover(function() {
					self.fadeNavIn.apply(this)
				},
				function() {
					self.fadeNavOut.apply(this)
				})
			},
			fadeNavIn: function() {
				$('.hover', this).stop().animate({
					'opacity': 1
				},
				self.c.navSpeed)
			},
			fadeNavOut: function() {
				$('.hover', this).stop().animate({
					'opacity': 0
				},
				self.c.navSpeed)
			}
		};
		self.init();
		return self
	};
	$(function() {
		new snsico()
	});

//====== platformico 切换 ====== 
	var platformico = function() {
		var me = this;
		var args = arguments;
		var self = {
			c: {
				navItems: '.apple, .windows, .android',
				navSpeed: ($.browser.safari ? 600 : 350)
			},
			init: function() {
				$('.pfmain').append('<span class="hover"></span>');
				$('.hover').css('opacity', 0);
				$('.pfmain').hover(function() {
					self.fadeNavIn.apply(this)
				},
				function() {
					self.fadeNavOut.apply(this)
				})
			},
			fadeNavIn: function() {
				$('.hover', this).stop().animate({
					'opacity': 1
				},
				self.c.navSpeed)
			},
			fadeNavOut: function() {
				$('.hover', this).stop().animate({
					'opacity': 0
				},
				self.c.navSpeed)
			}
		};
		self.init();
		return self
	};
	$(function() {
		new platformico()
	});

//====== skilllist 切换 ====== 
	var skilllist = function() {
		var me = this;
		var args = arguments;
		var self = {
			c: {
				navItems: '.crossplatform, .design, .time724',
				navSpeed: ($.browser.safari ? 600 : 350)
			},
			init: function() {
				$('.skmain').append('<span class="hover"></span>');
				$('.hover').css('opacity', 0);
				$('.skmain').hover(function() {
					self.fadeNavIn.apply(this)
				},
				function() {
					self.fadeNavOut.apply(this)
				})
			},
			fadeNavIn: function() {
				$('.hover', this).stop().animate({
					'opacity': 1
				},
				self.c.navSpeed)
			},
			fadeNavOut: function() {
				$('.hover', this).stop().animate({
					'opacity': 0
				},
				self.c.navSpeed)
			}
		};
		self.init();
		return self
	};
	$(function() {
		new skilllist()
	});
	
	
//====== teamlist 切换 ====== 
	var teamlist = function() {
		var me = this;
		var args = arguments;
		var self = {
			c: {
				navItems: '.member1, .member2, .member3, .member4',
				navSpeed: ($.browser.safari ? 600 : 350)
			},
			init: function() {
				$('.mbmain').append('<span class="hover"></span>');
				$('.hover').css('opacity', 0);
				$('.mbmain').hover(function() {
					self.fadeNavIn.apply(this)
				},
				function() {
					self.fadeNavOut.apply(this)
				})
			},
			fadeNavIn: function() {
				$('.hover', this).stop().animate({
					'opacity': 1
				},
				self.c.navSpeed)
			},
			fadeNavOut: function() {
				$('.hover', this).stop().animate({
					'opacity': 0
				},
				self.c.navSpeed)
			}
		};
		self.init();
		return self
	};
	$(function() {
		new teamlist()
	});
	
	
//====== pricelist 切换 ====== 
	var pricelist = function() {
		var me = this;
		var args = arguments;
		var self = {
			c: {
				navItems: '.price1, .price2, .price3, .price4',
				navSpeed: ($.browser.safari ? 600 : 350)
			},
			init: function() {
				$('.prmain').append('<span class="hover"></span>');
				$('.hover').css('opacity', 0);
				$('.prmain').hover(function() {
					self.fadeNavIn.apply(this)
				},
				function() {
					self.fadeNavOut.apply(this)
				})
			},
			fadeNavIn: function() {
				$('.hover', this).stop().animate({
					'opacity': 1
				},
				self.c.navSpeed)
			},
			fadeNavOut: function() {
				$('.hover', this).stop().animate({
					'opacity': 0
				},
				self.c.navSpeed)
			}
		};
		self.init();
		return self
	};
	$(function() {
		new pricelist()
	});


 
$(document).ready(function(){
		
//====== 页面滚动 ======
    $('a[href*=#]').bind("click", function(e){
        var anchor = $(this);
        var locate =  $.attr(this, 'href').substr($.attr(this, 'href').indexOf('#')+1);
        $('html, body').stop().animate({
            scrollTop: $('[id="' + locate + '"]').offset().top
        }, 800, "swing");

        $(this).delay(800).queue(function(){ window.location.hash = locate; });
        e.preventDefault();
    });

   

});
