document.oncontextmenu = function (ev) {rDomLite.stopEvent(ev)}




Number.prototype.NaN0 = function() {
	
	return (isNaN(this)) ? 0 : this;
}

var Global = {
	news : null,
	init : function(ev) {
		
		rDomLite.addEvent(rDomLite.$('bookmarkPage'), 'click', this.onBookmark, this);
		rDomLite.addEvent(rDomLite.$('printPage'), 'click', this.onPrint, this);
		this.news = rDomLite.$('news');
		
		if (this.news) {
			this.news.style.marginTop = (this.news.offsetHeight - 10)  + 'px';
			setInterval(this.tickNews, 85);
		}
		
		if (document.all) {
			
			document.body.ondrag = function() {return false};
			document.body.onselectstart = function() {return false};
		}
		
		if (navigator.userAgent.indexOf('Gecko') > -1) {

			document.body.style.MozUserSelect = 'none';
			if (rDomLite.$('contentText')) {
				rDomLite.$('contentText').style.MozUserSelect = 'none';
			}
			rDomLite.$('footer').style.MozUserSelect = 'none';
			if (rDomLite.$('subNav')) {
				rDomLite.$('subNav').style.MozUserSelect = 'none';
			}
			if (rDomLite.$('thumbs')) {
				rDomLite.$('thumbs').style.MozUserSelect = 'none';
			}
			if (rDomLite.$('news')) {
				rDomLite.$('news').style.MozUserSelect = 'none';
			}
			document.getElementsByTagName('h2')[0].style.MozUserSelect = 'none';

	
		}
		
	},
	
	tickNews : function() {
		//alert(parseInt(Global.news.style.marginTop).NaN0() + 10);
		if (parseInt(Global.news.style.marginTop).NaN0() <= -(Global.news.offsetHeight)) {
			Global.news.style.marginTop = (Global.news.offsetHeight)  + 'px';
		}
		Global.news.style.marginTop = parseInt(Global.news.style.marginTop).NaN0() - 1 + 'px';
	},
	
	onPrint : function(ev) {
		window.print();
		rDomLite.stopEvent(ev);
	},
	
	onBookmark : function(ev) {
		var url = window.location, title = 'קופי טיים';
		if (window.sidebar) { // FF/Moz
			window.sidebar.addPanel(title, url, "");
		} else if( window.external ) { // MSIE
			window.external.AddFavorite( url, title);
		} else if(window.opera && window.print) { // Opera Hotlist
			alert('Please press Ctrl+D to bookmark');
		}
		rDomLite.stopEvent(ev);
	}
};
rDomLite.setDOMLoadHandler(Global.init, Global);
