/**
 * PHPTimeToJSTime (BETA)
 * @author		Jerome Coloma
 * @email 		jeromecoloma@gmail.com
 * @version 	0.9
 * @update 		2006-12-13
 *
**/

if( typeof com == "undefined" ) { var com = {}; }
if( typeof com.frozynart == "undefined" ) { com.frozynart = {}; }
com.frozynart.toString = function( ) { return 'Package: com.frozynart'; };
com.frozynart.PHPTimeToJSTime = function( ) {
	this.initTime = '';
};
com.frozynart.PHPTimeToJSTime.toString = function( ) {
	return 'Frozynart { PHPTimeToJSTime ver. 0.9 }';
};
com.frozynart.PHPTimeToJSTime.prototype.setInitTime = function( $timeStr ) {
	this.initTime = new Date( $timeStr );
};
com.frozynart.PHPTimeToJSTime.prototype.getFullYear = function( ) {
	return this.initTime.getFullYear( );
};
com.frozynart.PHPTimeToJSTime.prototype.getMonth = function( ) {
	return this.initTime.getMonth( );
};
com.frozynart.PHPTimeToJSTime.prototype.getDate = function( ) {
	return this.leadingZero( this.initTime.getDate( ) );
};
com.frozynart.PHPTimeToJSTime.prototype.getHours = function( ) {
	return this.leadingZero( this.initTime.getHours( ) );
};
com.frozynart.PHPTimeToJSTime.prototype.getMinutes = function( ) {
	return this.leadingZero( this.initTime.getMinutes( ) );
};
com.frozynart.PHPTimeToJSTime.prototype.getSeconds = function( ) {
	this.initTime.setSeconds( this.initTime.getSeconds( )+1 );
	return this.leadingZero( this.initTime.getSeconds( ) );
};
com.frozynart.PHPTimeToJSTime.prototype.leadingZero = function( $str ) {
	return ( $str.toString().length == 1 ) ? '0' + $str : $str;
};
com.frozynart.PHPTimeToJSTime.prototype.trace    = function( $str ) { alert( $str ); };