function swapArea(ObjectID)
{
	if (document.getElementById(ObjectID).style.display == "none" ||document.getElementById(ObjectID).style.display == "")
	{
		document.getElementById(ObjectID).style.display = "block";
	}
	else
	{
		document.getElementById(ObjectID).style.display = "none";
	}
	return true;
}

/**
 * Ajax Menu in Session speichern
 */
function ajaxAction(id)
{	
	//alert(baseUrl);
	new Ajax.Request( baseUrl+ '/ajax', {
		parameters: 'id='+id,
		onSuccess: function(transport) {
			if (transport.responseText == "1") {
				//alert("Menu "+id+" gespeichert");
			}
			else {
				//alert("Menu "+id+" nicht gespeichert");
			}
		}
	});
	return false;
}

/**
 * Validierung
 */
function valid(form) {
	var valid2 = new Validation(form, {
								immediate : true,
								onSubmit:false,
								stopOnFirst:true,
								useTitles:true});
    var result = valid2.validate();
    //alert(result);
    return result;
}

function bewerteWappen(rating,typ,id)  {

	var url = baseUrl+ '/bewertung';
	//var url = 'bewertung.inc.php?rating='+rating+'&typ='+typ+'&id='+id;
	
	new Ajax.Updater("bewertung", url, {
		method: 'POST',
		parameters: { 'typ':typ, 'id':id, 'rating':rating },
		asynchronous:true, 
		evalScripts:true,
		onSuccess: function (transport) {
			//alert("ok");
		}
	});
}
