function createBookmark(title) {
	var title = title;
	var url = document.location;
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	}
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
}


function rate(rating, scene_id) {
	$("#rating_" + scene_id + " a").remove();
	$.post("/ajax/action_rating.php", "type_id=5&item_id=" + scene_id + "&rating=" + rating, function (data) {
		$("#rating_" + scene_id + " .filled").
			css("width", Math.round(data.avg_vote * 20) + "%").
			removeClass("filled").
			addClass("voted");
		
		var text = $("#rating_" + scene_id).next();
		var numb = text.html().match(/\d+/);
		if (text.html() == "(Not Rated)")
			text.html("(1 Vote)");
		else
			text.html("(" + (parseInt(numb) + 1) + " Votes)");
		alert(data.message);
	}, "json");
}
