/**
 * @author 
 */


$(document).ready(function(){
	
	Cufon.replace('.phone span', { fontFamily : 'Myriad Pro'});
	Cufon.replace('.phone i', { fontFamily : 'Myriad Pro'});
	Cufon.replace('.phone b', { fontFamily : 'Myriad Pro'});
	
	$('.search .find').bind('blur',function(){
		if ($(this).attr('value') == '')
		{
			$('.search span').fadeIn(300);
		};
	})
	
	$('.search .find').focus(function(){
		$('.search span').fadeOut(10);
	});
	
	$('.search span').click(function()
	{
		$(this).fadeOut(10);
		$('.seacrh .find').focus();
	})

	
	$('.question-form .update_captcha').click(function(){
		
		$.post($(this).attr('href'), function (data, textStatus) 
		{
			$('.question-form .captcha').find('img').replaceWith(data);
		});
		return false;
	});
	
	$('.thickbox').fancybox({ 
		'zoomSpeedIn': 200, 
		'zoomSpeedOut': 200,
		'frameWidth': 100,
		'frameHeight': 100,
		'overlayShow': true,
		'hideOnContentClick' :false,
		'centerOnScroll' : false
	});
	
	 

	$('.faq .ask').click(function(){
		
		$(this).hide();
		
		$(this).ajaxStart(function(){
				$('.ask-form').show();
				$('.ask-form').find('.loader').show();
		});
		
		$(this).ajaxStop(function(){
			$('.ask-form').find('.loader').hide();
		});
		
		$.post($(this).attr('href'), function(data){
			 $('.ask-form #ask_form').html(data);
			 var faq_options = 
			 {
		 		 target: '.ask-form #ask_form', 
		  		 url:     $('#faq').attr('action'), 
				     success: function(data) { 
					         $('#ask_form').html(data);
							 
							 $('#faq').ajaxForm(faq_options);	         
			              }
			 }
	
			 $('#faq').ajaxForm(faq_options);
			
		});

		
	 return false;	
	})
});
