(function(){
/*-[ VPI.JS ]-------------------------------------------[FA]
 *
*///----------------------------------------------------[FA]


jQuery.fn.debug = function() {
	return this.each(function(){
		var verbose = false;
		var itemsPerPage = 10;
		var myHeader  = '//VPI_JS_Debug-----------------------------------------------' + "\n";
			myHeader += (this['tagName'] != null) ? 'Tag Name: ' + this['tagName'] + "\n" : '';
			myHeader += 'Type: ' + (typeof this) + "\n";

		var myFooter  = "\n\n" + '//----------------------------------------------------------------';
		var z = 0;
		var y = 0;
		var mySplit = 'Page [' + ++y + ']' + "\n" + '//----------------------------------------------------------------' + "\n\n";
		var myMessage = '';
		for(var i in this) {
			if (i == 'domConfig' || typeof this[i] == 'unknown')
				continue;
			if(!verbose && typeof this[i] == 'function')
				continue;
			myMessage += '[' + i + '] -> ' +
				((!verbose && (typeof this[i] == 'string') && (this[i].length > 200)) ?
					this[i].substr(0,200) + ' {...}' :
					this[i])
				+ "\n";
			if(z++ > itemsPerPage) {
				alert(myHeader + mySplit + myMessage + myFooter);
				z = 0;
				mySplit = 'Page [' + ++y + ']' + "\n" + '//----------------------------------------------------------------' + "\n\n";
				myMessage = '';
			}
		}
		alert(myHeader + mySplit + myMessage + myFooter);
	});
};

/*
if((window.$ == undefined) || !($() instanceof jQuery)) {
	alert('VPILibrary requires jQuery');
	return;
}

var VPILibrary = window.VPILibrary = function() {
	return this instanceof VPILibrary ?
		this.init() :
		new VPILibrary();
}

VPILibrary.prototype = {
	init: function() {
		return(this);
	},
	ver: '0.9',
	author: 'Francis Albar',

	debug: function(elm) {
		if(!$('#VPIDebug')[0]) {
			$(document.body).append('<div id="VPIDebug"></div>');
			$('#VPIDebug').css({
				position:	'absolute',
				bottom:		'5px',
				right:		'5px',
				border:		'1px solid #ff9999',
				padding:	'5px',
				background:	'#ffeeee',
				color:		'#000000',
				font:		'11px/13px normal "Tahoma"',
				height:		'50%',
				width:		'40%',
				overflow:	'auto'
			});
		}
//		$('#VPIDebug').html(elm.lang);
		$('#VPIDebug').html('<dl>');
		jQuery.each(elm, function(i, val) {
			$('#VPIDebug > dl').append('<dt>' + escape(i) + '</dt>');
			$('#VPIDebug > dl').append('<dd>' + escape(val) + '</dd>');
		});
		$('#VPIDebug > dl > dd').hide();
		$('#VPIDebug > dl > dt').toggle(function() {
			$(this).next('dd').show();
		}, function() {
			$(this).next('dd').hide();
		});
	}
}

window.vpi = new VPILibrary();
/*
//-----------------------------------------------------------
// VPI Utilities Class
vpi.Util = function() {
	var dom = new vpi.DOMParser();

	// Displays and alert box window containing properties and members of passed object
	this.debug = function(myObject) {
		var itemsPerPage = (arguments[1] != null) ? arguments[1] : 15;
		var verbose = (arguments[2] != null) ? arguments[2] : false;
		var myHeader  = '//VPI_JS_Debug-----------------------------------------------' + "\n";

			myHeader += (myObject['tagName'] != null) ? 'Tag Name: ' + myObject['tagName'] + "\n" : '';

			myHeader += 'Type: ' + (typeof myObject) + "\n";
		var myFooter  = "\n\n" + '//----------------------------------------------------------------';
		var z = 0;
		var y = 0;
		var mySplit = 'Page [' + ++y + ']' + "\n" + '//----------------------------------------------------------------' + "\n\n";
		var myMessage = '';
		for(var i in myObject) {
			if (i == 'domConfig' || typeof myObject[i] == 'unknown')
				continue;
			if(!verbose && typeof myObject[i] == 'function')
				continue;
			myMessage += '[' + i + '] -> ' +
				((!verbose && (typeof myObject[i] == 'string') && (myObject[i].length > 200)) ?
					myObject[i].substr(0,200) + ' {...}' :
					myObject[i])
				+ "\n";
			if(z++ > itemsPerPage) {
				alert(myHeader + mySplit + myMessage + myFooter);
				z = 0;
				mySplit = 'Page [' + ++y + ']' + "\n" + '//----------------------------------------------------------------' + "\n\n";
				myMessage = '';
			}
		}
		alert(myHeader + mySplit + myMessage + myFooter);
	}

	this.numberPath = function(myStart, myNumber) {
		var cur			= myStart;
		var numberDir	= myNumber;
		var dir			= [];
		for(var i=myStart.toString().length;i>2;i--) {
			var n = parseInt(numberDir/cur, 10);
			for(var j=0;j<cur.toString().length-1;j++)
				n += '0';
			dir.push(n);
			numberDir = numberDir % cur;
			cur = cur * .1;
		}
		dir.push(myNumber);
		return(dir);
	}

	this.hex = function(myString) {
		myString = parseInt(myString).toString(16);
		return(myString.length < 2 ? "0"+myString : myString);
	}

	this.rgb2hex = function(myString) {
		if(myString.indexOf(',') < 0)
			return(myString);
		var rgb = myString.replace(/[^0-9,]/g, '').split(',');
		if(rgb.length != 3)
			return(myString);
		return('#' + this.hex(rgb[0]) + this.hex(rgb[1]) + this.hex(rgb[2]));
	}



	//-----------------------------------------------------------
	// Get Bounds
	this.getBounds = function(myElement) {
		var bounds = {};
		bounds.width = myElement.offsetWidth;
		bounds.height = myElement.offsetHeight;
		bounds.left = myElement.offsetLeft;
		bounds.top = myElement.offsetTop;
		while(myElement = myElement.offsetParent) {
			bounds.left += myElement.offsetLeft;
			bounds.top += myElement.offsetTop;
		}
		bounds.right = bounds.left + bounds.width;
		bounds.bottom = bounds.top + bounds.height;
		bounds.centerX = bounds.left + parseInt(bounds.width/2, 10);
		bounds.centerY = bounds.top + parseInt(bounds.height/2, 10);
		return(bounds);
	}

	return;
}
*/


//------------------------------------------------------[FA]
})();