jQuery.fn.clear = function() {
	return this.focus(function() {
		$(this).addClass('inputHover');
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		$(this).removeClass('inputHover');
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	}); 
};

$(document).ready(function(){   
	$('.slideshow').cycle({
		timeout: 5000,
    	speed: 1000,
    	pause: 1
	})
	
	$("dd").fadeTo(500, 0.5);
	$("dd").hover(function(){
		$(this).fadeTo(200, 1.0);
	},function(){
   		$(this).fadeTo(200, 0.5);
	});
	
	$("#s_banner .slides").click(function () { 
      location.href = '/businessplus/';
    });
	
	$("input").clear();
	$("textarea").clear();
	
	$("textarea").autoResize();
	
	$("#anik_khan span").fadeTo("medium", 0.5);
	$("#anik_khan").hover(function() {
			$("#anik_khan span").fadeTo("medium", 1);
		},function() {
			$("#anik_khan span").fadeTo("medium", 0.5);
		});
	
	$("#anik_khan").toggle(
		function() {
			$(this).animate({
			    width: '100%',
			    backgroundPosition: '0px 0px',
			    marginLeft: '0px'
			  });
			$("#anik_khan span").text("contract");
  		return false;
		},function() {
			$(this).animate({
			    width: '200px',
			    backgroundPosition: '-70px 0px',
			    marginLeft: '20px'
			  });
			$("#anik_khan span").text("expand");
  		return false;
		}
	);
	
	$(".tooltip").simpletooltip();
	
	$(".slides").kwicks({  
        max : 500,  
        spacing : 4
    });
		
	$("#navigation ul").superfish();
	$("#services").tabs({selected: 6, fx: {opacity: 'toggle', duration: 200 }});
	
	$(".submit").hover(
      function () {
        $(this).fadeTo('medium', .75)
      }, 
      function () {
        $(this).fadeTo('medium', 1)
      }
	).mousedown(
	  function () {
        $(this).fadeTo('medium', .8, function() {
        	$(this).attr({src: "/images/submit3.gif"});
        })
      }
	).mouseup(
	  function () {
        $(this).fadeTo('medium', 1, function() {
        	$(this).attr({src: "/images/submit.gif"});
        })
      }
	);
});