﻿/*
* Superfish v1.4.8 - jQuery menu widget
* Copyright (c) 2008 Joel Birch
*
* Dual licensed under the MIT and GPL licenses:
* 	http://www.opensource.org/licenses/mit-license.php
* 	http://www.gnu.org/licenses/gpl.html
*
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
*/

; (function ($) {
    $.fn.superfish = function (op) {

        var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="', c.arrowClass, '"> &#187;</span>'].join('')),
			over = function () {
			    var $$ = $(this), menu = getMenu($$);
			    clearTimeout(menu.sfTimer);
			    $$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function () {
			    var $$ = $(this), menu = getMenu($$), o = sf.op;
			    clearTimeout(menu.sfTimer);
			    menu.sfTimer = setTimeout(function () {
			        o.retainPath = ($.inArray($$[0], o.$path) > -1);
			        $$.hideSuperfishUl();
			        if (o.$path.length && $$.parents(['li.', o.hoverClass].join('')).length < 1) { over.call(o.$path); }
			    }, o.delay);
			},
			getMenu = function ($menu) {
			    var menu = $menu.parents(['ul.', c.menuClass, ':first'].join(''))[0];
			    sf.op = sf.o[menu.serial];
			    return menu;
			},
			addArrow = function ($a) { $a.addClass(c.anchorClass).append($arrow.clone()); };

        return this.each(function () {
            var s = this.serial = sf.o.length;
            var o = $.extend({}, sf.defaults, op);
            o.$path = $('li.' + o.pathClass, this).slice(0, o.pathLevels).each(function () {
                $(this).addClass([o.hoverClass, c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
            });
            sf.o[s] = sf.op = o;

            $('li:has(ul)', this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over, out).each(function () {
                if (o.autoArrows) addArrow($('>a:first-child', this));
            })
			.not('.' + c.bcClass)
				.hideSuperfishUl();

            var $a = $('a', this);
            $a.each(function (i) {
                var $li = $a.eq(i).parents('li');
                $a.eq(i).focus(function () { over.call($li); }).blur(function () { out.call($li); });
            });
            o.onInit.call(this);

        }).each(function () {
            var menuClasses = [c.menuClass];
            if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
            $(this).addClass(menuClasses.join(' '));
        });
    };

    var sf = $.fn.superfish;
    sf.o = [];
    sf.op = {};
    sf.IE7fix = function () {
        var o = sf.op;
        if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity != undefined)
            this.toggleClass(sf.c.shadowClass + '-off');
    };
    sf.c = {
        bcClass: 'sf-breadcrumb',
        menuClass: 'sf-js-enabled',
        anchorClass: 'sf-with-ul',
        arrowClass: 'sf-sub-indicator',
        shadowClass: 'sf-shadow'
    };
    sf.defaults = {
        hoverClass: 'sfHover',
        pathClass: 'overideThisToUse',
        pathLevels: 1,
        delay: 800,
        animation: { opacity: 'show' },
        speed: 'normal',
        autoArrows: true,
        dropShadows: true,
        disableHI: false, 	// true disables hoverIntent detection
        onInit: function () { }, // callback functions
        onBeforeShow: function () { },
        onShow: function () { },
        onHide: function () { }

    };
    $.fn.extend({
        hideSuperfishUl: function () {
            var o = sf.op,
				not = (o.retainPath === true) ? o.$path : '';
            o.retainPath = false;
            var $ul = $(['li.', o.hoverClass].join(''), this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility', 'hidden');
            o.onHide.call($ul);
            return this;
        },
        showSuperfishUl: function () {
            var o = sf.op,
				sh = sf.c.shadowClass + '-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility', 'visible');
            sf.IE7fix.call($ul);
            o.onBeforeShow.call($ul);
            $ul.animate(o.animation, o.speed, function () { sf.IE7fix.call($ul); o.onShow.call($ul); });
            return this;
        }
    });

})(jQuery);

/*****************************************initialization*****************************************/

$(document).ready(function () {
    $('ul.sf-menu').superfish({
        delay: 800,
        animation: { opacity: 'show', height: 'show' },
        speed: 'normal',
        autoArrows: false,
        dropShadows: false
    });

});

/*
* Author:      Marco Kuiper (http://www.marcofolio.net/)
*/

$(document).ready(function () {
    // Hide all the tooltips
    $(".list-services li").each(function () {
        $("a strong", this).css("opacity", "0");
    });

    $(".list-services li").hover(function () { // Mouse over
        $(this)
			.stop().fadeTo(500, 1)
			.siblings().stop().fadeTo(500, 0.2);

        $("a strong", this)
			.stop()
			.show()
			.animate({
			    opacity: 1,
			    top: "-30px"
			}, 300);

    }, function () { // Mouse out
        $(this)
			.stop().fadeTo(500, 1)
			.siblings().stop().fadeTo(500, 1);

        $("a strong", this)
			.stop()
			.animate({
			    opacity: 0,
			    top: "-30px"
			}, 300);
    });

});


//jQuery(document).ready(function () {
//    $(".slideDown dt").click(function () {
//        $(this).toggleClass("active").parent(".slideDown").find("dd").slideToggle();
//    })
//});

/*
*	faded 0.3.1 - jQuery plugin
*	written by Nathan Searles	
*	http://nathansearles.com/faded/
*
*	Copyright (c) 2009 Nathan Searles (http://nathansearles.com/)
*	Dual licensed under the MIT (MIT-LICENSE.txt)
*	and GPL (GPL-LICENSE.txt) licenses.
*
*	Built for jQuery library
*	http://jquery.com
*	Compatible with jQuery 1.3.2+
*
*/
if (typeof jQuery != "undefined") {
    jQuery(function ($) {
        $.fn.extend({
            faded: function (options) {
                var settings = $.extend({}, $.fn.faded.defaults, options);
                return this.each(
					function () {
					    if ($.fn.jquery < "1.3.1") { return; }
					    var $t = $(this);
					    var $c = $t.children(":nth-child(1)");
					    var o = $.metadata ? $.extend({}, settings, $t.metadata()) : settings;
					    var total = $c.children().size();
					    var next = 0, prev = 0, number = 0, currentitem = 0, restart = 0, restartinterval = 0;
					    var loaded, active, imgSrc, clicked, current;
					    if (o.random) {
					        $.fn.reorder = function (callback) {
					            function randOrd() { return (Math.round(Math.random()) - 0.5); }
					            return ($(this).each(function () {
					                var $this = $(this);
					                var $children = $this.children();
					                var childCount = $children.length;
					                if (childCount > 1) {
					                    $children.hide();
					                    var indices = new Array();
					                    for (i = 0; i < childCount; i++) { indices[indices.length] = i; }
					                    indices = indices.sort(randOrd);
					                    $.each(indices, function (j, k) {
					                        var $child = $children.eq(k);
					                        var $clone = $child.clone(true);
					                        $clone.show().appendTo($this);
					                        if (callback !== undefined) {
					                            callback($child, $clone);
					                        }
					                        $child.remove();
					                    });
					                }
					            }));
					        };
					        $c.reorder();
					    }
					    function pause() {
					        clearInterval(autoplay);
					        clearTimeout(restart);
					        restart = setTimeout(function () {
					            autoplay = setInterval(function () {
					                animate("next");
					            }, o.autoplay);
					        }, o.autorestart);
					    }
					    $c.css({ position: "relative" });
					    $c.children().css({
					        position: "absolute",
					        top: 0,
					        left: 0,
					        zIndex: 0,
					        display: "none"
					    });
					    if (o.autoheight) {
					        $c.animate({ height: $c.children(":eq(0)").outerHeight() }, o.autoheight);
					    }
					    if (o.pagination) {
					        if (o.autopagination) {
					            $t.append("<ul class=" + o.pagination + "></ul>");
					            $c.children().each(function () {
					                $("." + o.pagination + "", $t).append("<li><a rel=" + number + " href=\"#\" >" + (number + 1) + "</a></li>");
					                number++;
					            });
					        }
					        $("." + o.pagination + " li a:eq(0)", $t).parent().addClass("current");
					        $("." + o.pagination + " li a", $t).click(function () {
					            current = $("." + o.pagination + " li.current a", $t).attr("rel");
					            clicked = $(this).attr("rel");
					            if (current != clicked) { animate("pagination", clicked, current); }
					            if (o.autoplay) { pause(); }
					            return false;
					        });
					    }
					    if (o.sequentialloading && $c.children()[0].tagName == "IMG") {
					        $c.css({ background: "url(" + o.loadingimg + ") no-repeat 50% 50%" });
					        imgSrc = $("img:eq(0)", $c).attr("src");
					        $("img:eq(0)", $c).attr("src", imgSrc).load(function () {
					            $(this).fadeIn(o.speed, function () {
					                loaded = true;
					            });
					        });
					    } else {
					        $c.find(":eq(0)").fadeIn(o.speed, function () {
					            loaded = true;
					        });
					    }
					    if (o.bigtarget) {
					        $c.css({ "cursor": "pointer" });
					        $c.click(function () {
					            animate("next");
					            if (o.autoplay) {
					                if (o.autorestart) {
					                    pause();
					                } else {
					                    clearInterval(autoplay);
					                }
					            }
					            return false;
					        });
					    }
					    if (o.autoplay) {
					        autoplay = setInterval(function () {
					            animate("next");
					        }, o.autoplay);
					        pause();
					    }
					    $("." + o.nextbtn, $t).click(function () {


					        animate("next");
					        if (o.autoplay) {
					            if (o.autorestart) {
					                pause();
					            } else {
					                clearInterval(autoplay);
					            }
					        }
					        return false;
					    });
					    $("." + o.prevbtn, $t).click(function () {
					        animate("prev");
					        if (o.autoplay) {
					            if (o.autorestart) {
					                pause();
					            } else {
					                clearInterval(autoplay);
					            }
					        }
					        return false;
					    });
					    function animate(dir, clicked, current) {
					        if (!active && loaded) {
					            active = true;
					            switch (dir) {
					                case "next":
					                    prev = next;
					                    next = currentitem * 1 + 1;
					                    if (total === next) { next = 0; }
					                    break;
					                case "prev":
					                    prev = next;
					                    next = currentitem * 1 - 1;
					                    if (next === -1) { next = total - 1; }
					                    break;
					                case "pagination":
					                    next = clicked;
					                    prev = current;
					                    break;
					            }
					            if (o.pagination) {
					                $(".pagination li.current", $t).removeClass("current");
					                $(".pagination li a:eq(" + next + ")", $t).parent().addClass("current");
					            }
					            if (o.crossfade) {
					                $c.children(":eq(" + next + ")").css({ zIndex: 10 }).fadeIn(o.speed, function () {
					                    $c.children(":eq(" + prev + ")").css({ display: "none", zIndex: 0 });
					                    $(this).css({ zIndex: 0 });
					                    currentitem = next;
					                    active = false;
					                });
					            } else {
					                $c.children(":eq(" + prev + ")").fadeOut(o.speed, function () {
					                    if (o.autoheight) {
					                        $c.animate({ height: $c.children(":eq(" + next + ")").outerHeight() }, o.autoheight, function () {
					                            $c.children(":eq(" + next + ")").fadeIn(o.speed);
					                        });
					                    } else {
					                        $c.children(":eq(" + next + ")").fadeIn(o.speed);
					                    }
					                    currentitem = next;
					                    active = false;
					                });
					            }
					        }
					    }
					}
				);
            }
        });
        $.fn.faded.defaults = {
            speed: 300,
            crossfade: false,
            bigtarget: false,
            sequentialloading: false,
            autoheight: false,
            pagination: "pagination",
            autopagination: false,
            nextbtn: "next",
            prevbtn: "prev",
            loadingimg: false,
            autoplay: 7000,
            autorestart: true,
            random: false
        };
    });
}

/*****************************************initialization*****************************************/

$(function () {
    $("#faded").faded({
        speed: 400,
        crossfade: false,
        sequentialloading: true,
        autopagination: true,
        autoplay: 7000
    });
});

/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 */

(function(jQuery){

	// We override the animation for all of these color styles
	jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
		jQuery.fx.step[attr] = function(fx){
			if ( fx.state == 0 ) {
				fx.start = getColor( fx.elem, attr );
				fx.end = getRGB( fx.end );
			}

			fx.elem.style[attr] = "rgb(" + [
				Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
			].join(",") + ")";
		}
	});

	// Color Conversion functions from highlightFade
	// By Blair Mitchelmore
	// http://jquery.offput.ca/highlightFade/

	// Parse strings looking for color tuples [255,255,255]
	function getRGB(color) {
		var result;

		// Check if we're already dealing with an array of colors
		if ( color && color.constructor == Array && color.length == 3 )
			return color;

		// Look for rgb(num,num,num)
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
			return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

		// Look for rgb(num%,num%,num%)
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
			return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

		// Look for #a0b1c2
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
			return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

		// Look for #fff
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
			return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

		// Otherwise, we're most likely dealing with a named color
		return colors[jQuery.trim(color).toLowerCase()];
	}
	
	function getColor(elem, attr) {
		var color;

		do {
			color = jQuery.curCSS(elem, attr);

			// Keep going until we find an element that has color, or we hit the body
			if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
				break; 

			attr = "backgroundColor";
		} while ( elem = elem.parentNode );

		return getRGB(color);
	};
	
	// Some named colors to work with
	// From Interface by Stefan Petre
	// http://interface.eyecon.ro/

	var colors = {
		aqua:[0,255,255],
		azure:[240,255,255],
		beige:[245,245,220],
		black:[0,0,0],
		blue:[0,0,255],
		brown:[165,42,42],
		cyan:[0,255,255],
		darkblue:[0,0,139],
		darkcyan:[0,139,139],
		darkgrey:[169,169,169],
		darkgreen:[0,100,0],
		darkkhaki:[189,183,107],
		darkmagenta:[139,0,139],
		darkolivegreen:[85,107,47],
		darkorange:[255,140,0],
		darkorchid:[153,50,204],
		darkred:[139,0,0],
		darksalmon:[233,150,122],
		darkviolet:[148,0,211],
		fuchsia:[255,0,255],
		gold:[255,215,0],
		green:[0,128,0],
		indigo:[75,0,130],
		khaki:[240,230,140],
		lightblue:[173,216,230],
		lightcyan:[224,255,255],
		lightgreen:[144,238,144],
		lightgrey:[211,211,211],
		lightpink:[255,182,193],
		lightyellow:[255,255,224],
		lime:[0,255,0],
		magenta:[255,0,255],
		maroon:[128,0,0],
		navy:[0,0,128],
		olive:[128,128,0],
		orange:[255,165,0],
		pink:[255,192,203],
		purple:[128,0,128],
		violet:[128,0,128],
		red:[255,0,0],
		silver:[192,192,192],
		white:[255,255,255],
		yellow:[255,255,0]
	};
	
})(jQuery);



/*****************************************initialization*****************************************/

jQuery(document).ready(function(){

jQuery(".list-1 li a").mouseenter(
  function () {
	jQuery(this).animate({
		color:'#000',
    }, 150 );
});

jQuery(".list-1 li a").mouseleave(function() {
	jQuery(this).animate({
		color:'#b9d130',
    }, 150 );
});

});

$(document).ready(function(){
	$(".img-box").hover(function(){
		$(this).addClass("alt");
	}, function(){
		$(this).removeClass("alt");
	});
	
		$(".box-fade").hover(function(){
		$(this).addClass("alt");
	}, function(){
		$(this).removeClass("alt");
	});
});

if($.browser.mozilla||$.browser.opera)
	(function(){
	window.addEventListener('pageshow', PageShowHandler, false);
	window.addEventListener('unload', UnloadHandler, false);
		function PageShowHandler() {
				window.addEventListener('unload', UnloadHandler, false);
		}
		function UnloadHandler() {
				window.removeEventListener('beforeunload', UnloadHandler, false);
		}
})()



