(function($) {

  jQuery.fn.backgroundPosition = function() {

    var p = $(this).css('background-position');

    if(typeof(p) == 'undefined') return $(this).css('background-position-x') + ' ' + $(this).css('background-position-y');

    else return p;

  };

})(jQuery);



function swapPicture(id) {

	htm = '<img src="img/upload/' + id + '.jpg" alt="Picture">'; 

	$('div.mid-main').html(htm); 

}



function p( action, values ){

	values['Action'] = action; 

	$.ajax({

		type:"POST",

		url: "useractions.php", 

		data: values, 

		dataType: "json", 

		success: function(json){

				eval(json['Script']); 

				if( typeof(json['Error']) == "undefined" ){ 

					$.unblockUI();

				} else {

					$.blockUI({ message: json['Error'] });

				}

		}

	}); 

}



function f( formid ){

      var $inputs = $('#' + formid + ' input, #' + formid + ' textarea, #' + formid + ' select');

      var values = {};

      $inputs.each(function(i, el) {

      values[el.name] = $(el).val();

      });

	  return values; 

}



