
window.addEvent('domready', function(){


	$$('a.login').addEvent('click', function(e){
		e.stop(); //don't follow the link
		slidein('/pop/login.php','Wer bist denn Du?');
	});
	$$('a.taf').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var url = this.href;
		var title = this.title;
		//document.URL
		slidein('/pop/taf.php?url=' + url + '&title=' + title,'Erzähl es weiter ...');
	});
	$$('a.bildmelden').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var url = this.href;
		var title = this.title;
		//document.URL
		slidein('/pop/bildmelden.php?url=' + url,'Bild melden ...');
	});
	$$('a.alert').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var url = this.href;
		var title = this.title;
		//document.URL
		slidein('/pop/alert.php?url=' + url,title);
	});
	$$('a.writemsg').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var to = this.href;
		//document.URL
		slidein('/pop/writemsg.php?to=' + to,'Nachricht schreiben');
	});
	$$('a.ccompic').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var to = this.rel;
		//document.URL
		slidein('/pop/ccomppic.php?pic=' + to,'Bild kommentieren');
	});
	$$('a.drinkinvitation').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var to = this.href;
		//document.URL
		slidein('/pop/drinkinvitation.php?to=' + to,'Einladung auf einen Drink');
	});
	$$('a.letsbefriends').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var to = this.href;
		//document.URL
		slidein('/pop/letsbefriends.php?to=' + to,'Freundschaft anbieten');
	});
	$$('a.usermelden').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var to = this.href;
		//document.URL
		slidein('/pop/usermelden.php?url=' + to,'User melden');
	});
	$$('img.del').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var id = this.alt;
		//document.URL
		senddata(id,'/ajax/del_item.php?id=' + id);
	});
	$$('a.delme').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var id = this.rel;
		var href = this.href;
		//document.URL
		senddata(href,'/ajax/del_mefrom.php?id=' + id);
	});
	$$('a.endfriendship').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var ID = this.href.split('/community/',3);
		var url = '/ajax/endfriendship.php?with=' + ID[1];
		senddata(ID,url);
	});
	$$('a.gotdrink').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var ID = this.href.split('/community/',3);
		var div = this.rel;
		var url = '/ajax/do_gotdrink.php?to=' + ID[1];
		senddata(div,url);
	});
	$$('a.gotfriend').addEvent('click', function(e){
		e.stop(); //don't follow the link
		var ID = this.href.split('/community/',3);
		var div = this.rel;
		var url = '/ajax/do_gotfriend.php?to=' + ID[1];
		senddata(div,url);
	});
	//loginPopup contains loginForm
	//$$('a.send').addEvent('click', function(e){
	//	e.stop(); //don't follow the link
	//	$('loginPopup').hide();
	//});
	
/*	$('loginPopForm').addEvent('submit', function(e) {
		//Prevents the default submit event from loading a new page.
		e.stop();
		//Empty the log and show the spinning indicator.
		//var log = $('log_res').empty().addClass('ajax-loading');
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		this.set('send', {onComplete: function(response) { 
		//	log.removeClass('ajax-loading');
			$('loginPopup').set('html', response);
		}});
		//Send the form.
		this.send();
	});
	*/
	
	
	$$('#popper a.close').addEvent('click', function(e){
		e.stop(); //don't follow the link
//		$('popper').hide();
		var myFx = new Fx.Morph(popper).set('.pophide');

	});

});