function memberFavorite(action, model, location) {
	if (action != 'add' && action != 'remove') {
		return false;
	}
	// itt kell kitenni a kisviragot
    $.ajax({
		url: '/favorite/' + action + '/' + model,
		type: "GET",
		dataType: "html",
		success: function(msg) {
			// kisviragot leszedni
			if (action == 'add') {
				$('#' + location).html('<a href="javascript:void(0);" onclick="memberFavorite(\'remove\', \''+ model + '\', \'fav' + model + '\'); return false;" title="Remove ' + model + ' from Favorites">Remove from Favorites</a>');
			}
			if (action == 'remove') {
				if (location == 'favlist' + model) {
					$('#' + location).fadeTo(0.1, 0.25);
					$('#' + location + ' a').attr('href', '');
					$('#' + location + ' a').attr('onclick', '');
				} else {
					$('#' + location).html('<a href="javascript:void(0);" onclick="memberFavorite(\'add\', \''+ model + '\', \'fav' + model + '\'); return false;" title="Add ' + model + ' to Favorites">Add to Favorites</a>');
				}
			}
    	}
    });
}

function showSearch(show) {
	if (!show) {
		$('#quicksearch').css('display', 'none');
	} else {
		$('#quicksearch').css('display', 'block');
		document.getElementById('quicksearchinput').focus();
	}
}

function showInvite(modelname) {
	var cnf = confirm(modelname+ " invited you to join a Private Sex Show!");
	if (cnf) {
		document.location.href = "/model/privatechat/"+modelname;
	}
}
