jQuery.fn.stripTags = function() { return this.replaceWith( this.html().replace(/<\/?[^>]+>/gi, '') ); };

$(document).ready(function(){   
	if ($("#loadingDiv") != null) {
		$('#loadingDiv')
		    .hide()  // hide it initially
		    .ajaxStart(function() {
			        $(this).show();
			    })
		    .ajaxStop(function() {
			        $(this).hide();
			    });
	}
    //animation for the info panel
	if ($(".info-tip") != null) {
		$(".info-tip").fadeOut(800).fadeIn(1000);
	}
	
	if ($("a.close") != null) {
		$("a.close").click(function() {
			$(this).parent().parent().animate({opacity: 0.7}, 500).fadeOut(1000);
			return false;
		});
	}
	
	function toggleBlindEffect(elt){
		var selectedEffect = 'blind';
		//most effect types need no options passed by default
		var options = {};
		//check if it's scale, transfer, or size - they need options explicitly set
		//run the effect
		$(elt).toggle(selectedEffect,options,500);
	};

	if ($(".toggle-disactivated") != null) {
		$(".toggle-disactivated").focus(function() {
			$(this).removeClass("disabled");
			$(this).css("color: black");
			$(this).val("");
		});
	}
	if ($('.btn_hover_paypal, .btn_hover_form_50') != null) {
		$('.btn_hover_paypal, .btn_hover_form_50').css({  'backgroundPosition': '0 0' })
	 	.hover(function () {
	     	$(this).css({  'backgroundPosition': '0 -50px' });
	 	},
	      function(){
	 		$(this).css({  'backgroundPosition': '0 0px' });
	 	});
	}
	if ($('.btn_hover_paypal_25, .btn_hover_form_25') != null) {
		$('.btn_hover_paypal_25, .btn_hover_form_25').css({  'backgroundPosition': '0 0' })
	 	.hover(function () {
	     	$(this).css({  'backgroundPosition': '0 -25px' });
	 	},
	      function(){
	 		$(this).css({  'backgroundPosition': '0 0px' });
	 	});
	}
	
	if ($('.btn_hover a')) {
		$('.btn_hover a')
		    .css({  'backgroundPosition': '0 0' })
		    .hover(
		      function(){
		        $(this)
		          .stop()
		          .animate({
		            'opacity': 0
		          }, 650);
		      },
		      function(){
		        $(this)
		          .stop()
		          .animate({
		            'opacity': 1
		          }, 650);
		      }
		    );
	}
});
/* empties textarea upon focus on a textarea that had a default value */
function textareaFocus(obj)
{
	obj.className = "textareaFocus";
	obj.value = "";
}

function highlightOn(obj)
{
	obj.style.background = "#ebf3fb";
}

function highlightOff(obj)
{
	obj.style.background = "white";
}

