$(document).ready(function(){
	//Testimonials Fader
	var fader2;
	$('.testimonials .container .item').simpleFade({
		speed   : 700,
		duration: 7000,
		init: function () {
			fader2 = this;
		}
	});
	
	//External Controls for Testimonials Fader
	$('.testimonials .prev').click(function () {
		fader2.prev();
		return false;
	});
	
	$('.testimonials .next').click(function () { 
		fader2.next();
		return false;
	});
  
  
	//Fader
	var fader;
	$('#featured-content .item').simpleFade({
		speed   : 900,
		duration: 7000,
		init : function () {
			fader = this;
		},
		onFade : function (index) {
			$('#featured-content .nav a').removeClass('active').eq(index).addClass('active');
		}
	});
	
	
	$('#featured-content .nav a').click(function () {
		fader.fadeTo($('#featured-content .nav a').index(this));
		return false;
	});
	
	$('#featured-content .prev').click(function () {
		fader.prev();
		return false;
	});
	
	$('#featured-content .next').click(function () {
		fader.next();
		return false;
	});
	
	// Blinking Fields
	$('.blink').
	    focus(function() {
	        if(this.title==this.value) {
	            this.value = '';
	        }
	    }).
	    blur(function(){
	        if(this.value=='') {
	            this.value = this.title;
	        }
	});
	
	if ($.browser.msie && $.browser.version == 6) {
		DD_belatedPNG.fix('h1#logo a img')
	};
	
	
	$('.map .pin .trigger, .map .small-states li a').click(function(){ return false; });
	
	$('.our-clients .map .pin').mouseover(function(){
		$(this).css('z-index',9999);
		$('.tooltip', this).show();
	});
	
	
	$('.our-clients .map .pin .tooltip').mouseout(function(){
		$(this).hide();
	});
	
	$('.our-clients .map .pin').mouseout(function(){
		$(this).css('z-index',2);
	});
	
	$('.our-clients .map').mouseout(function(){
		$('.tooltip').hide();
	});
	
	$('.our-clients .map .small-states li').hover(function(){
		$(this).css('z-index',9999);
		}, function(){
		$(this).css('z-index',1);
	});
	
	$('.our-clients .map .small-states li a').mouseover(function(){
		$(this).parent().find('.pin').mouseover();
	})
	
});
