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();
	$.ajax({
		type: "POST",
		url: "/ajax/action_rating.php",
		data: "id=" + scene_id + "&rating=" + rating,
		dataType: "text",
		success: function (msg) {
			msg = jQuery.trim(msg);
			if (msg == "already_voted")
				message = "You have already voted!";
			else
				message = "Your vote has been recorded, thanks!";
			$("#rating_" + scene_id + " .filled").
				css("width", Math.round(parseInt(msg)) + "%").
				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(message);
		}
	});
}