/* Gallery */
function gallery(_obj) {
	
	// defaults options
	this.options = {
		hold: 'div.gallery-slide',
		duration: 700,
		slideElement: 1,
		autoRotation: false,
		effect: false,
		fadeEl: 'ul',
		switcher: 'ul > li',
		disableBtn: false,
		nextBtn: 'a.link-next, a.btn-next, a.next',
		prevBtn: 'a.link-prev, a.btn-prev, a.prev',
		circle: true,
		direction: false
	};
	for(key in _obj) this.options[key] = _obj[key];
	
	var _this = this;
	var _hold = $(_this.options.hold);
	var _speed = $.browser.msie ? 0 : _this.options.duration;
	var _timer = _this.options.autoRotation;
	var _wrap = _hold.find(_this.options.fadeEl);
	var _el = _hold.find(_this.options.switcher);
	var _next = _hold.find(_this.options.nextBtn);
	var _prev = _hold.find(_this.options.prevBtn);
	var _count = _el.index(_el.filter(':last'));
	var _w = _el.outerWidth(true);
	var _h = _el.outerHeight(true);
	if (!_this.options.direction) {
		var _wrapHolderW = Math.ceil(_wrap.parent().width() / _w);
		if (((_wrapHolderW - 1) * _w + _w / 2) > _wrap.parent().width()) _wrapHolderW--;
	}
	else{
		var _wrapHolderW = Math.ceil(_wrap.parent().height()/_h);
		if (((_wrapHolderW-1)*_h + _h/2) > _wrap.parent().height()) _wrapHolderW--;
	}
	if (_timer) var _t;
	var _active = _el.index(_el.filter('.active:eq(0)'));
	if (_active < 0) _active = 0;
	var _last = _active;
	if (!_this.options.effect) var rew = _count - _wrapHolderW + 1;
	else var rew = _count;
	
	if (!_this.options.effect) {
		if (!_this.options.direction) _wrap.css({marginLeft: -(_w * _active)})
		else _wrap.css({marginTop: -(_h * _active)})
	}
	else {
		_wrap.css({
			opacity: 0
		}).removeClass('active').eq(_active).addClass('active').css({
			opacity: 1
		}).css('opacity', 'auto');
		_el.removeClass('active').eq(_active).addClass('active');
	}
	if (_this.options.disableBtn) {
		if (_count < _wrapHolderW) _next.addClass(_this.options.disableBtn);
		_prev.addClass(_this.options.disableBtn);
	}
	
	function fadeElement(){
		_wrap.eq(_last).animate({opacity:0}, {queue:false, duration: _speed});
		_wrap.removeClass('active').eq(_active).addClass('active').animate({
			opacity:1
		}, {queue:false, duration: _speed, complete: function(){
			$(this).css('opacity','auto');
		}});
		_el.removeClass('active').eq(_active).addClass('active');
		_last = _active;
	}
	function scrollEl(){
		if (!_this.options.direction) _wrap.animate({marginLeft: -(_w * _active)}, {queue:false, duration: _speed})
		else _wrap.animate({marginTop: -(_h * _active)}, {queue:false, duration: _speed})
	}
	function toPrepare(){
		if ((_active == rew) && _this.options.circle) _active = -_this.options.slideElement;
		for (var i = 0; i < _this.options.slideElement; i++){
			_active++;
			if (_active > rew) {
				_active--;
				if (_this.options.disableBtn &&(_count > _wrapHolderW)) _next.addClass(_this.options.disableBtn);
			}
		};
		if (_active == rew) if (_this.options.disableBtn &&(_count > _wrapHolderW)) _next.addClass(_this.options.disableBtn);
		if (!_this.options.effect) scrollEl();
		else fadeElement();
	}
	function runTimer(){
		_t = setInterval(function(){
			toPrepare();
		}, _timer);
	}
	_next.click(function(){
		flag=true;
		if(_t) clearTimeout(_t);
		if (_this.options.disableBtn &&(_count > _wrapHolderW)) _prev.removeClass(_this.options.disableBtn);
		toPrepare();
		if (_timer) runTimer();
		return false;
	});
	_prev.click(function(){
		flag=true;
		if(_t) clearTimeout(_t);
		if (_this.options.disableBtn &&(_count > _wrapHolderW)) _next.removeClass(_this.options.disableBtn);
		if ((_active == 0) && _this.options.circle) _active = rew + _this.options.slideElement;
		for (var i = 0; i < _this.options.slideElement; i++){
			_active--;
			if (_active < 0) {
				_active++;
				if (_this.options.disableBtn &&(_count > _wrapHolderW)) _prev.addClass(_this.options.disableBtn);
			}
		};
		if (_active == 0) if (_this.options.disableBtn &&(_count > _wrapHolderW)) _prev.addClass(_this.options.disableBtn);
		if (!_this.options.effect) scrollEl();
		else fadeElement();
		if (_timer) runTimer();
		return false;
	});
	if (_this.options.effect) _el.click(function(){
		_active = _el.index($(this));
		if(_t) clearTimeout(_t);
		fadeElement();
		if (_timer) runTimer();
		if(_this.options.fadeEl != _this.options.switcher ){
			return false;
		}
	});
	if (_timer) runTimer();
	
	this.stop = function(){
		if (_t) clearTimeout(_t);
	}
	this.play = function(){
		if (_t) clearTimeout(_t);
		if (_timer) runTimer();
	}
}

jQuery.fn.animationNav = function(_options){
    // defaults options	
    var _options = jQuery.extend({
	    duration:200,
	    addBG:'<li class="bg"><a href="#">&nbsp;</a></li>',
	    bgClass :'bg',
		animEffect: 'linear'
    },_options);
	var menu_span = $('#menu ul li span').each(function(){
		$(this).css({
			'opacity': 0,
			'display': 'block'
		});
		if ($(this).parents('li:eq(0)').hasClass('active')){
			$(this).css({
			'opacity': 1
		});
		}
	});
	var active_span = $('#menu ul li.active span');
	var menu_li = $('#menu ul li').each(function(){
		$(this).mouseenter(function(){
			if(!$(this).hasClass('active')){
				active_span.animate({
					opacity:0
				}, {queue:false, duration:_options.duration, easing:_options.animEffect});
			}
			$(this).find('span').animate({
				opacity:1
			},{queue:false,duration:_options.duration, easing:_options.animEffect});
		}).mouseleave(function(){
			if(!$(this).hasClass('active')){
				$(this).find('span').animate({
					opacity:0
				},{queue:false,duration:_options.duration, easing:_options.animEffect});
			}
		});
	});

    return this.each(function(){
	    var _obg = jQuery(this);
	    var _liWidth = [];
	    var _aWidth = [];
	    var _lis = jQuery(_obg).find('>li');
	    var _links = jQuery(_obg).find('>li>a');
	    var _linkIndex = _links.index(_links.filter('.active'));
	    var _timer = false;
	    var _pLeft = parseInt(jQuery(_obg).css('paddingLeft'));
	    var _visible = false;
	    
	    _lis.each(function(i, el){
			_liWidth[i] = jQuery(el).outerWidth(true);
			_aWidth[i] = jQuery(el).width();
	    });
	    if (jQuery.browser.msie) jQuery(_options.addBG).insertBefore(jQuery(_obg).find('li:first-child'));
	    else jQuery(_obg).append(_options.addBG);
	    		
	    jQuery.fn.animationNav.animateThis = function(_activeIndex, _obg){
			var _activeLiWidth = _liWidth[_activeIndex];
			var _activeAWidth = _aWidth[_activeIndex];
			var _left = _pLeft;
			for (var j = _activeIndex-1; j >= 0; j--) {
				_left += _liWidth[j];
			}
			$('li.bg', _obg)
				.stop()
				.animate({width:_activeAWidth +'px'},{queue:false,duration:150, easing:'linear'})
				.animate({
					left:_left+'px'
				},{queue:false,duration:_options.duration, easing:_options.animEffect});
			_left = _pLeft;
	    }
	    jQuery.fn.animationNav.showThis = function(_activeIndex, _obg){
			var _activeLiWidth = _liWidth[_activeIndex];
			var _activeAWidth = _aWidth[_activeIndex];
			var _left = _pLeft;
			for (var j = _activeIndex-1; j >= 0; j--) {
				_left += _liWidth[j];
			}
			$('li.bg', _obg)
				.css({
					left:(_left+(_activeAWidth/2))+'px',
					width:0,
					opacity:0,
					display: 'block'
				})
				.animate({
					width:_activeAWidth +'px',
					opacity:1,
					left:_left+'px'
				},{queue:false,duration:_options.duration, easing:_options.animEffect});
			_left = _pLeft;
	    }
	    jQuery.fn.animationNav.hideThis = function(_activeIndex, _obg){
			var _activeAWidth = _aWidth[_activeIndex];
			var _left = parseInt($('li.bg', _obg).css('left'));
			$('li.bg', _obg).fadeOut(200);
	    }
	    
	    if (_lis.filter('.active').length) {
	    	var _lisIndex = _lis.index(_lis.filter('.active'));
			jQuery.fn.animationNav.animateThis(_lisIndex, _obg);
	    } else {
			jQuery(_obg).children('.'+_options.bgClass).css('display','none');
	    }
    
	    _links.hover(function(){
			_linkIndex = _links.index(jQuery(this));
			if (_timer) clearTimeout(_timer);
			if (_lis.filter('.active').length || _visible) {
				jQuery.fn.animationNav.animateThis(_linkIndex, _obg);
			} else {
				jQuery.fn.animationNav.showThis(_linkIndex, _obg);
				_visible = true;
			}
	    }, function() {
			var _this = this;
			_timer = setInterval(function() {
				if (_lis.filter('.hover').length) {
					var _lisIndex = _lis.index(_lis.filter('.hover'));
					jQuery.fn.animationNav.animateThis(_lisIndex, _obg);
				} else {
					var _linksIndex = 0;
					_linkIndex = _lis.index(_lis.filter('.active'));
					var _activeLiWidth = _liWidth[_linkIndex];
					var _activeAWidth = _aWidth[_linkIndex];
					var _left_active=0;
					for (var l = 0; l < _linkIndex; l++){						_left_active+= _liWidth[l];					};
					$('li.bg', _obg)
						.animate({
							width:_activeLiWidth +'px',
							left:_left_active+'px'
						},{queue:false,duration:_options.duration, easing:_options.animEffect});
					_visible = false;
					active_span.animate({
						opacity:1
					}, {queue:false, duration:_options.duration, easing:_options.animEffect});
				}
			}, 200);
	    });
	    
    });
}

function initTooltip(){
	$('.has-tooltips .row>ul>li').has('.tooltip').each(function(){
	var _t;
	var hold = $(this);
	var tooltip_wrapper = hold.find('.tooltip-wrapper');
		hold.mouseenter(function(){
			if(_t) clearTimeout(_t);
			$('body').append(tooltip_wrapper.html());
			if(hold.offset().left-10+ $('body>.tooltip').outerWidth(true) > $('#wrapper').offset().left + $('#wrapper').outerWidth(true) ){
				$('body>.tooltip').css({
					'left':hold.offset().left - $('body>.tooltip').outerWidth(true) + 130,
					'top': hold.offset().top-35
				});
				$('body>.tooltip').addClass('invert');
			}else{
				$('body>.tooltip').css({
					'left':hold.offset().left-10,
					'top': hold.offset().top-35
				});
			}
		}).mouseleave(function(){
			if(_t) clearTimeout(_t);
			_t = setTimeout(function(){
				$('body>.tooltip').remove();
			}, 20);
			$('body>.tooltip').mouseenter(function(){
				if(_t) clearTimeout(_t);
			}).mouseleave(function(){
				if(_t) clearTimeout(_t);
				_t = setTimeout(function(){
					$('body>.tooltip').remove();
				}, 20);
			});
			$('body>.tooltip .close').click(function(){
				$('body>.tooltip').remove();
				return false;
			});
		});
	});
}

jQuery.fn.NavDropDown = function (j)
{
    var j = jQuery.extend(
    {
        duration : 300, hoverElement : '>li', dropHolder : '>div', hoverClass : 'hovers', showEffect : 'slide'
    }, j);
    return this.each(function ()
    {
		var f = jQuery(this);
        var g = jQuery(j.hoverElement + ':has(' + j.dropHolder + ')', f);
        var h = j.duration;
        g.each(function (i, a)
        {
            a = jQuery(a);
            var b = $(j.dropHolder + ' :first', a);
            var c = $(j.dropHolder, a);
            a.h = b.outerHeight();
            var d = {};
            var e = {};
            if (j.showEffect == 'slide')
            {
                c.css({
                    'height' : 0, 'overflow' : 'hidden'
                });
                b.css({
                    'marginTop' :- a.h, 'overflow' : 'hidden'
                });
                d.SE = {
                    height : a.h
                };
                d.ME = {
                    marginTop : 0
                };
                e.SE = {
                    height : 0
                };
                e.ME = {
                    marginTop :- a.h
                }
            }
            if (j.showEffect == 'fade') {
                c.css({
                    'opacity' : 0
                });
                d.SE = {
                    opacity : 1
                };
                e.SE = {
                    opacity : 0
                };
                d.ME = {};
                e.ME = {}
            }
            if (j.showEffect == 'slidefade')
            {
                c.css({
                    'height' : 0, 'overflow' : 'hidden', 'opacity' : 0
                });
                b.css({
                    'marginTop' :- a.h, 'overflow' : 'hidden'
                });
                d.SE = {
                    height : a.h, opacity : 1
                };
                d.ME = {
                    marginTop : 0
                };
                e.SE = {
                    height : 0, opacity : 0
                };
                e.ME = {
                    marginTop :- a.h
                }
            }
            a.hoverEl = false;
            a.hover(function ()
            {
                if (this.timer) {
                    clearTimeout(this.timer);
                }
                a.hoverEl = true;
                $(this).addClass(j.hoverClass);
                c.animate(d.SE, {
                    queue : false, duration : h
                });
                b.animate(d.ME, {
                    queue : false, duration : h
                })
            },
            function ()
            {
                this.timer = setTimeout(function ()
                {
                    a.hoverEl = false;
                    b.animate(e.ME, {
                        queue : false, duration : h
                    });
                    c.animate(e.SE, 
                    {
                        queue : false, duration : h,
                        complete : function ()
                        {
                            if (!a.hoverEl) {
                                $(a).removeClass(j.hoverClass);
                            }
                        }
                    })
                }, 100)
            })
        })
    })
};

function initIE6hover(){
	if($.browser.msie && $.browser.version < 7){
		var hover_class = 'hover'
		$('#nav li').mouseenter(function(){
			$(this).addClass(hover_class);
		}).mouseleave(function(){
			$(this).removeClass(hover_class);
		});
	}
}

/* Gallery */
jQuery.fn.gallery_fade_hover = function(_options){
	// defaults options	
	var _options = jQuery.extend({
		duration: 700,
		autoSlide: false,
		slideElement: 1,
		effect: false,
		fadeEl: 'ul',
		switcher: 'ul > li',
		disableBtn: false,
		next: 'a.link-next, a.btn-next, a.next',
		prev: 'a.link-prev, a.btn-prev, a.prev',
		circle: true
	},_options);

	return this.each(function(){
		var _hold = $(this);
		if (!_options.effect) var _speed = _options.duration;
		else var _speed = $.browser.msie ? 0 : _options.duration;
		var _timer = _options.autoSlide;
		var _sliderEl = _options.slideElement;
		var _wrap = _hold.find(_options.fadeEl);
		var _el = _hold.find(_options.switcher);
		var _next = _hold.find(_options.next);
		var _prev = _hold.find(_options.prev);
		var _count = _el.index(_el.filter(':last'));
		var _w = _el.outerWidth(true);
		var _wrapHolderW = Math.ceil(_wrap.parent().width()/_w);
		if (((_wrapHolderW-1)*_w + _w/2) > _wrap.parent().width()) _wrapHolderW--;
		if (_timer) var _t;
		var _active = _el.index(_el.filter('.active:eq(0)'));
		if (_active < 0) _active = 0;
		var _last = _active;
		if (!_options.effect) var rew = _count - _wrapHolderW + 1;
		else var rew = _count;
		
		if (!_options.effect) _wrap.css({marginLeft: -(_w * _active)});
		else {
			_wrap.css({opacity: 0}).removeClass('active').eq(_active).addClass('active').css({opacity: 1}).css('opacity', 'auto');
			_el.removeClass('active').eq(_active).addClass('active');
		}
		if (_options.disableBtn) {
			if (_count < _wrapHolderW) _next.addClass(_options.disableBtn);
			_prev.addClass(_options.disableBtn);
		}
		
		function fadeElement(){
			_wrap.eq(_last).animate({opacity:0}, {queue:false, duration: _speed});
			_wrap.removeClass('active').eq(_active).addClass('active').animate({
				opacity:1
			}, {queue:false, duration: _speed, complete: function(){
				$(this).css('opacity','auto');
			}});
			_el.removeClass('active').eq(_active).addClass('active');
			_last = _active;
		}
		function scrollEl(){
			_wrap.animate({marginLeft: -(_w * _active)}, {queue:false, duration: _speed});
		}
		function toPrepare(){
			if ((_active == rew) && _options.circle) _active = -_sliderEl;
			for (var i = 0; i < _sliderEl; i++){
				_active++;
				if (_active > rew) {
					_active--;
					if (_options.disableBtn &&(_count > _wrapHolderW)) _next.addClass(_options.disableBtn);
				}
			};
			if (_active == rew) if (_options.disableBtn &&(_count > _wrapHolderW)) _next.addClass(_options.disableBtn);
			if (!_options.effect) scrollEl();
			else fadeElement();
		}
		function runTimer(){
			_t = setInterval(function(){
				toPrepare();
			}, _timer);
		}
		_next.click(function(){
			if(_t) clearTimeout(_t);
			if (_options.disableBtn &&(_count > _wrapHolderW)) _prev.removeClass(_options.disableBtn);
			toPrepare();
			if (_timer) runTimer();
			return false;
		});
		_prev.click(function(){
			if(_t) clearTimeout(_t);
			if (_options.disableBtn &&(_count > _wrapHolderW)) _next.removeClass(_options.disableBtn);
			if ((_active == 0) && _options.circle) _active = rew + _sliderEl;
			for (var i = 0; i < _sliderEl; i++){
				_active--;
				if (_active < 0) {
					_active++;
					if (_options.disableBtn &&(_count > _wrapHolderW)) _prev.addClass(_options.disableBtn);
				}
			};
			if (_active == 0) if (_options.disableBtn &&(_count > _wrapHolderW)) _prev.addClass(_options.disableBtn);
			if (!_options.effect) scrollEl();
			else fadeElement();
			if (_timer) runTimer();
			return false;
		});
		if (_options.effect) _el.mouseover(function(){
			_active = _el.index($(this));
			if(_t) clearTimeout(_t);
			fadeElement();
			if (_timer) runTimer();
		});
		if (_timer) runTimer();
	});
}

jQuery.fn.gallSlide = function(_options){
	// defaults options	
	var _options = jQuery.extend({
		duration: 700,
		autoSlide: false
	},_options);

	return this.each(function(){
		var _hold = $(this);
		var _speed = _options.duration;
		var _timer = _options.autoSlide;
		var _wrap = _hold.find('.switcher-overvlow ul');
		var _el = _hold.find('.switcher-overvlow ul > li');
		var _next = _hold.find('a.btn-down');
		var _prev = _hold.find('a.btn-up');
		var _count = _el.index(_el.filter(':last'));
		var _h = _el.outerHeight();
		var _wrapHolderH = Math.ceil(_wrap.parent().height()/_h);
		var _t;
		var _disableClass = 'disable';
		var _active = 0;
		if (_wrapHolderH*_h > _count*_h ){
			_prev.hide();
			_next.hide();
		}
		function scrollEl(){
			_wrap.eq(0).animate({
				marginTop: -(_h * _active) + "px"
			}, {queue:false, duration: _speed});
		}
		function runTimer(){
			_t = setInterval(function(){
				_active++;
				if (_active > (_count - _wrapHolderW + 1)) _active = 0;
				scrollEl();
			}, _timer);
		}
		if (_active == 0){
			_prev.parent().addClass(_disableClass);
		}
		if (_active == (_count - _wrapHolderH+1)){
			_next.parent().addClass(_disableClass);
		}
		_next.click(function(){
			if (_active <= (_count - _wrapHolderH)){
				_active++;
				scrollEl();
				if (_active == (_count - _wrapHolderH+1)){
					_next.parent().addClass(_disableClass);
				}
				_prev.parent().removeClass(_disableClass);
			}else{
				_next.parent().addClass(_disableClass);
			}
			return false;
		});
		_prev.click(function(){
			if (_active > 0){
				_active--;
				scrollEl();
				if (_active == 0){
					_prev.parent().addClass(_disableClass);
				}
				_next.parent().removeClass(_disableClass);
			}else{
				_prev.parent().addClass(_disableClass);
			}
			return false;
		});
			var wait_time = 5000; // in ms
			var change_speed = 1000; // in ms
			var _holder = _hold;
			if(_holder.length){
				var _f = true;
				var _list = _holder.find('.nav-gallery > .img-holder');
				var _btn = $('<ul class="paging"></ul>');
				_list.each(function(_i){
					_btn.append('<li><a href="#">'+(_i+1)+'</a></li>');
				});
				_btn = _hold.find('.switcher-overvlow ul').find('a');
				var _a = _list.index(_list.filter('.active:eq(0)'));
				if(_a == -1) _a = 0;
				
				if($.browser.msie){
					_list.removeClass('active').css('display', 'none').eq(_a).addClass('active').css('display', 'block');
				}else{
					_list.removeClass('active').css('opacity', 0).eq(_a).addClass('active').css('opacity', 1);
				}
				_btn.eq(_a).parent().addClass('active');
				_btn.eq(_a).css({'backgroundColor': "#224E8E"});
				_btn.mouseenter(function(){
					changeEl(_btn.index(this));
					return false;
				});
				function changeEl(_ind){
					if(_ind != _a){
						if($.browser.msie){
							_list.eq(_a).removeClass('active').css('display', 'none');
							_list.eq(_ind).addClass('active').css('display', 'block');
							
						}else{
							_list.eq(_a).removeClass('active').animate({opacity: 0}, {queue:false, duration:change_speed});
							_list.eq(_ind).addClass('active').animate({opacity: 1}, {queue:false, duration:change_speed});
						}
						_list.eq(_ind).find('img').css({'marginLeft': _list.eq(_ind).find('img').outerWidth()});
						_list.eq(_ind).find('img').animate({marginLeft: 0}, {queue:false, duration:change_speed});
						_btn.eq(_a).parent().removeClass('active');
						_btn.eq(_a).animate({'backgroundColor': "white"}, {queue:false, duration:change_speed});
						_btn.eq(_ind).parent().addClass('active');
						_btn.eq(_ind).animate({'backgroundColor': "#224E8E"}, {queue:false, duration:change_speed});
						_a = _ind;
					}
				}
			}
	});
}

$(document).ready(function(){
	initIE6hover();
	if($('ul.accordion').length){
		$('ul.accordion').accordion({
			active: ".selected",
			autoHeight: false,
			header: ".opener",
			collapsible: true,
			event: "click"
		});
	}
	gal = new gallery({
		hold: '.gallery1',
		duration: 1000,
		autoRotation: 4000,
		fadeEl: '.carusel ul > li',
		switcher: '.carusel ul > li',
		effect: 'fade'
	});
	$('.gallery1 .carusel ul').mouseenter(function(){
		gal.stop();
	}).mouseleave(function(){
		gal.play();
	});
	gal2 = new gallery({
		hold: '.gallery2',
		duration: 1000,
		autoRotation: 4000,
		fadeEl: '.content > .item',
		switcher: '.content > .item',
		effect: 'fade'
	});
	$('.gallery2 .content > .item').mouseenter(function(){
		gal2.stop();
	}).mouseleave(function(){
		gal2.play();
	});
	gal3 = new gallery({
		hold: '.gallery3',
		duration: 1000,
		autoRotation: 4000,
		fadeEl: '.content > .item',
		switcher: '.content > .item',
		effect: 'fade'
	});
	$('.gallery3 .content > .item').mouseenter(function(){
		gal3.stop();
	}).mouseleave(function(){
		gal3.play();
	});
	gal4 = new gallery({
		hold: '.gallery4',
		duration: 1000,
		autoRotation: 4000,
		fadeEl: '.content > .item',
		switcher: '.content > .item',
		effect: 'fade'
	});
	$('.gallery4 .content > .item').mouseenter(function(){
		gal4.stop();
	}).mouseleave(function(){
		gal4.play();
	});
	gal5 = new gallery({
		hold: '.slider',
		duration: 1000,
		autoRotation: 10000,
		fadeEl: '> .item',
		switcher: '> .item',
		effect: 'fade'
	});
	$('#menu ul').animationNav();
	initTooltip();
	if($.browser.msie){
		$('ul#nav').NavDropDown({
			showEffect:'slide',
			duration:800
		});	
	}else{
		$('ul#nav').NavDropDown({
			showEffect:'slidefade',
			duration:800
		});	
	}
	$('#nav > li').gallery_fade_hover({
		duration: 1000,
		effect: 'fade',
		fadeEl: '.center-gallery > .center-gallery-item',
		switcher: '.left-gallery > li'
	});
	$('div.center-gallery-item').gallSlide({
		duration: 700
	});
});
