jQuery(function( $ ){
			//borrowed from jQuery easing plugin
			//http://gsgd.co.uk/sandbox/jquery.easing.php
			$.easing.elasout = function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
			};
					
			//by default, the scroll is only done vertically ('y'), change it to both.
			$.scrollTo.defaults.axis = 'xy'; 			
			//this one is important, many browsers don't reset scroll on refreshes
			$('div.pane').scrollTo( 0 );//reset all scrollable panes to (0,0)
			$.scrollTo( 0 );//reset the screen to (0,0)
			
			//TOC, shows how to scroll the whole window
			$('#main #top p a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
				$.scrollTo( this.hash, 1500, { easing:'elasout' });
				return false;
			});
			
			
		});
		
		
		
		
		
		
		// jqpanles examples
$(document).ready(function(){
	
	// ajaxContent Examples
		$('.ajax').ajaxContent({
			loaderType:'img',
			loadingMsg:'img/loading.gif',
			target:'#ajaxContent'
		});
	
	
});			
(function($) {
	//call teh method with options arguments
	$.fn.ajaxContent = function(options) {
		//extend to defaults
		var defaults = $.extend({}, $.fn.ajaxContent.defaults, options);
			// debug if required		
			if(defaults.debug == 'true'){
				debug(this);
			};
			//Initilaize any instance looping on the match element
			return this.each(function(){
				//set local variables and extend to the metadata plugin if loaded
				var $obj = $(this);
				var o = $.metadata ? $.extend({}, defaults, $obj.metadata()) : defaults;
				//make defaults local variables to prevent to be overwrite from next plugin calls
				var url = $obj.attr('href');
				var $target = $(o.target);

			//bind the event
			$obj.bind(o.event, function(){
				// add loader if required
				if(o.loader == 'true'){
					if(o.loaderType == 'img'){
							$target.html('<img src="' + o.loadingMsg + '"/>');
						}else{
							$target.html(o.loadingMsg);	
						}
				}	
					//remove add current class
					$('a.' + o.currentClass).removeClass(o.currentClass);								
					$obj.addClass(o.currentClass);
					// make the call
					$.ajax({ 
  						type: o.type, 
  						url: url,
  						success: function(msg){ 
    						$target.html(msg);
    						//if a callback exist pass arguments ( object,target and receive message)
    						if(typeof o.success == 'function'){
    							o.success($obj,$target,msg);
    							}  						
    						},
						error: function(){
							$target.html("<p>" + o.errorMsg + "</p>");
							if(typeof o.error == 'function'){
    							o.error($target);
    							}  						
    					 
						}
					});
				return false;
			});
		});
	};	
  	function debug($obj) {
    if (window.console && window.console.log)
     window.console.log('selection count: ' + $obj.size() + '  with class:' + $obj.attr('class'));
  };
		
})(jQuery);

$.fn.ajaxContent.defaults = {
		target: '#ajaxContent',
		type:'get',
		event:'click',
		loader:'true',
		loaderType:'text',
		loadingMsg:'Loading...',
		errorMsg:'An error occured durign the page requesting process!',
		currentClass:'selected',
		success:'',
		error:'',
		debug:'false'
};	





$().ready(function() {
	// validate the comment form when it is submitted
	$("#question-block").validate();
	
	// validate signup form on keyup and submit
});