function fav(id) {
	if($("star_" + id).src.indexOf("/img/fav.png") > 0)
	{
		var aj = new Ajax.Request("/ajax.php?a=rf&id=" + id);
		$("star_" + id).src = "/img/adfav.png";
	}
	else
	{
		var aj = new Ajax.Request("/ajax.php?a=af&id=" + id);
		$("star_" + id).src = "/img/fav.png";
	}
	return false;
}
function spam(id) {
	if (confirm("Вы уверены, что хотите пометить этот снип как спам? Вы не сможете отменить свое действие."))
	{
		var aj = new Ajax.Request("/ajax.php?a=spam&id=" + id);
		$("spam").update("<em>Спасибо! Ваш запрос был передан на рассмотрение.</em>");
	}
	return false;
}
function versionjump(a,b) { window.location="/view/" + a + "." + b + "/"; }
function wraplines() {
	if ($("innersource").className=="nowrap")
		$("innersource").className = "wrap";
	else
		$("innersource").className = "nowrap";
	//if(el.checked == true) $("innersource").className = "wrap";
	//else $("innersource").className = "nowrap";
}
function expand() {
	if ($("maincol").className=="expand") {
		$("sidecol").show();
		$("maincol").className = "";
		$("toggleexpand").update("Развернуть");
	}
	else {
		$("sidecol").hide();
		$("maincol").className = "expand";
		$("toggleexpand").update("Свернуть");
	}
}
var searchCleared = 0;
function clearOnce() {
	if (searchCleared) { return; }
	searchCleared = 1;
	document.search.q.value="";
}
// For searching with the WordPress blog which uses an input value of 's' instead of 'q'.
function blogClearOnce() {
	if (searchCleared) { return; }
	searchCleared = 1;
	document.search.s.value="";
}

// --- [ Experimental jQuery code ] --- //
/*
jQuery(document).ready(function() {
	jQuery('.drag').draggable({helper: 'clone'});

	jQuery("#yourtabs, #langtabs").droppable({ 
		accept: ".drag", 
		drop: function(ev, ui) { 
			ui.draggable.fadeOut("fast", 
			function() { jQuery(this).fadeIn("fast")}).appendTo(jQuery(this)); 
			//jQuery('#contents').append(ui.draggable);
			console.log(ui.draggable);
		} 
	});
});
*/


