(function($) { // Making $ accessible even in noConflict
  $(document).ready(function(){
    
    // Adding placeholders for form fields
    if($.fn.placeholder)
    {
      $("input[type='text'], textarea").filter('[placeholder]').placeholder();
			$(".placeholder").placeholder();
    }
    
    // Setting up contact form
    /*
		if($.fn.TFAskForm)
    {
      $('#ask-form').TFAskForm();
    }*/
    
    if ($.fn.cycle) 
    {
      $('.experts').cycle();  
    }
		
		$('#ask-form').attr('action', '/expert/index.php/frontend/ask');
		$('#contactForm').attr('action', 'cmail.php');
  });
})(jQuery);

	function checkForm(){		
		if(document.getElementById('txtexpert').value=='false')
		{
			alert("You haven't choosen an expert"); 
			return false;
		}
		if(document.getElementById('txtComents').value.length < 400)
		{
			alert("Your question is too short (under 400 letters long). Please extend your question and elaborate on your problem to give our experts enough information to effectively answer your question."); 
			return false;
		}
		if(!document.getElementById('agree').checked)
		{ 
			alert('You must agree to the terms in order to proceed.'); 
			return false;		
		}
		document.getElementById('ask-form').submit();
	}
	function checkValue (a) {
	if(a.value==a.defaultValue)
		a.value="";
	else if(a.value=="")
		a.value=a.defaultValue;
		} // a
