Date.prototype.daysInMonth = function() {
	return (32 - new Date(this.getYear(), this.getMonth(), 32).getDate());
}

String.prototype.trim = function () {
  var s = this.replace(/^\s*/, "");
  return s.replace(/\s*$/, "");
}

window.addEvent('domready', function() {
	if ($('rememberMeLink')) {
		$('rememberMeLink').addEvent('click', function() {
			if ($('rememberMe').value == 0) {
				$('rememberMeImg').src = "/pics/rememberMe_on.png";
				$('rememberMe').value = 1;
			} else {
				$('rememberMeImg').src = "/pics/rememberMe.png";
				$('rememberMe').value = 0;
			}
			$('rememberMeLink').blur();
		});
	}
	
	if (Cookie.read('notFirstVisit')) {
	}
	else {
		var myHorizontalSlide = new Fx.Slide('glava7menu', {
			mode: 'vertical',
			duration: '1000',
			transition: Fx.Transitions.Bounce.easeOut
		});
	
		myHorizontalSlide.hide().toggle();
		
		Cookie.write('notFirstVisit', 'true');					
	}
	
	// initialize menu hover
	$('glava7menu').getElements('img').addEvents({
		mouseover: function() { if (this.id) $(this).src = '/pics/'+this.id+'u.png'; },
		mouseout: function() { if (this.id) $(this).src = '/pics/'+this.id+'d.png'; }
	});
	
	// initialize news categories hover
	if ($('kategorije')) {
		$('kategorije').getElements('img').addEvents({
			mouseover: function() { if (this.id) $(this).src = '/pics/'+this.id+'u.png'; },
			mouseout: function() { if (this.id) $(this).src = '/pics/'+this.id+'d.png'; }
		});
	}

	// initialize news categories hover
	if ($('kategorije')) {
		$('kategorije').getElements('img').addEvents({
			mouseover: function() { if (this.id) $(this).src = '/pics/'+this.id+'u.png'; },
			mouseout: function() { if (this.id) $(this).src = '/pics/'+this.id+'d.png'; }
		});
	}

	if ($('banbig')) {
		$('banbig').getElements('img').addEvents({
			mouseover: function() { if (this.id) $(this).src = '/pics/'+this.id+'u.png'; },
			mouseout: function() { if (this.id) $(this).src = '/pics/'+this.id+'d.png'; }
		});
	}
});