// JavaScript Document
$.easing.bouncy = function (x, t, b, c, d) {
    var s = 1.70158;
    if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
    return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}

// create custom tooltip effect for jQuery Tooltip
$.tools.tooltip.addEffect("bouncy",

	// opening animation
	function(done) {
		this.getTip().animate({top: '-=10'}, 100, done).slideDown();
	},

	// closing animation
	function(done) {
		this.getTip().animate({top: '-=0'}, 100, function()  {
			$(this).slideUp();
			done.call();
		});
	}
);

(function($) {	
		  
		  
		  // create custom animation algorithm for jQuery called "bouncy"





		  
		  
		  
		  
		  	$(function()
				{
					
					
								$('input[type="text"]').addClass("unfocusField");
       		$('input[type="text"]').focus(function() {
       			$(this).removeClass("unfocusField").addClass("focusField");
				//alert('dsaasd');
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			
	    		}
    		});
    		$('input[type="text"]').blur(function() {
    			$(this).removeClass("focusField").addClass("unfocusField");
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
				}
    		});
					
				$('#submit').click(
						function () 
						{
							if($("#contact_form").valid()==true)
							{
							$("#contact_form").submit();	
							}
							
						
						});
					
					
					
					$("a.fancybox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true
	});

					
					
					//$("a").attr('class', 'fancybox').fancybox();
					
					
					$("#ico img[title]").tooltip({effect: 'bouncy'});
					//$("#ico li img[title]").tooltip({ effect: 'toggle'});
				
				
					$("#slider").easySlider({
				auto: true, 
				atamhak: false,
				continuous: true,
				prevId: 		'prevBtn2',
		nextId: 		'nextBtn2',
					speed: 			400
		
				

			});
				
				}
				)	
})(jQuery);




