/**
*	e-joculete.ro Main Library
*	Author: Justin Valceanu @ ODM
*	Implemented by: Justin Valceanu @ ODM  
*	www.odm.ro
*/	

$("a.maintenance").live("click", function() {
	el = $('<div id="maintenance"></div>').css('opacity', 0.5).appendTo('body').bind('click',  function() { el.hide(); message.hide(); });
	message = $('<div id="maintenance_msg">Sectiune Indisponibila. <br />Reveniti in curand !</div>').appendTo('body');
	$('body').bind('click', function() { el.hide(); message.hide(); });			
	$('a.maintenance').bind('click', function() {
				el.css({ width: document.body.offsetWidth + 'px', height: document.body.offsetHeight + 'px' }).show();
				message.show();
				window.scrollTo(0,0);
				return false;
			});
	return false;
})

function addsmilie(code) {
	document.getElementById('mesajComentariu').value += code;
}	

function vote(g, i, w) {
	if (g != '' && i != '' && w != '') {
		$.post(w, { a: 'rating', v: i, b: g }, function(data){
			if (data == 'ok') {
				alert('Va multimim pentru vot !');
				self.document.location.reload(true);
			} else {
				alert(data)
			}
		});							
	} else {
		return false;
	}
	
	return false;
}			

