/* Functions for www.hethuisvanaristoteles.nl 
 * Created by:	01.04.2008 - Tobias beuving (Parkers)
 */

	function mSubcribe() {
		var tmpNaam = $F('f_naam');
		var tmpEmail = $F('f_email');
		var Stamp = new Date();
		var tmpParameters = "e="+tmpEmail+"&n="+tmpNaam+"&time="+Stamp;
		var tmpUrl = "ajax/nieuwsbrief.php";
		var req = new Ajax.Request(
			tmpUrl,
				{
					method: "get",
					parameters: tmpParameters,
					asynchronous: "true",
					encoding: "UTF-8", 
					onComplete: mSubcribe_callback
				}
		);
	}
	function mSubcribe_callback(origReq) {
		var tmpHTML = "nothing found";
	
		var tmpResponse = origReq.responseText;
		//console.log(tmpResponse);
		
		if (tmpResponse != "null") {
			/*
			var tmpObjectList = decodeJSON(tmpResponse);
	
			for(var i=0, n=tmpObjectList.length; i<n; i++) {
				var tmpPositie = tmpObjectList[i].matrix_position;
				//alert(tmpObjectList[i].title);
				Element.update('f_pos'+tmpPositie, '<b>'+tmpObjectList[i].title+'</b>');
			}
			*/
		}
	
	}

	
	var nieuwsbriefRules = {
			'#f_subscribe' : function(el) {
					el.onclick = function() {
						//mSubcribe();
						//return false;
					}	
			}
		};
	Behaviour.register(nieuwsbriefRules);
	