/**
 * Тип браузера
 *
*/
var browser = {
    isIE:     !!(window.attachEvent && !window.opera),
    isOpera:  !!window.opera,
    isWebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
    isGecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
    isMobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
};


Array.prototype.Each = function ( handler ) {
		
	for( var i = 0, count = this.length; i < count; i++ ) {
		
		handler( this[i], i );

	}

};
	
Array.prototype.EachHash = function ( handler ) {
		
	for ( var item in this ) {
	
		if ( typeof ( this[item] ) == "string" &&  typeof ( item ) == "string" ) {
			handler( this[item], item );
		}
			
	}

};



var timer = function( ) {

	this.timers = new Array();
	
	this.Start = function ( func, seconds, name ) {
		
		this.timers[name] = setInterval( func, seconds * 1000 );
		
	};
	
	this.Stop = function ( name ) {

		clearInterval( this.timers[name] );
		this.timers[name] = null;

	};
	
};


Timer = new timer();


Function.prototype.bind = function (object) {

	var _method = this;
	return function( ) {
		return _method.apply( object, arguments );
	}

}
