﻿///<reference path="../jQuery/JQueryIntellisense.js />
(function($){
	$.fn.toggleFunction = function( options ){
	
		//Create default options
		var defaults = {
			func1: function(){alert("function 1");},
			func2: function(){alert("function 1");}
		};
	
		var opts = $.extend( defaults, options );
	
		return this.each( function(){
			if( $(this).attr("tf1") == "true" )
			{
				opts.func2();
				$(this).removeAttr("tf1");
			}
			else
			{
				opts.func1();
				$(this).attr("tf1", "true");
			}
			
		});
	}
})(jQuery);