$(document).ready(function(){
	$('.editLink').click(function(){
		$("#request").load(
			prf + "/frames/links.php",
			{
				eID: $(this).attr('id'),
				action: 'edit'
			}
		);
	});
	
	
	$(".editEventRequest").click(function(){
		$("#request").load(
			prf + "/frames/editEvent.php",
			{
				eID: $(this).attr('id')
			}
		);
	});
	
	$('#saveEditEvent').live('click', function(){
		var eID = $('input[name=eID]').val();
		var manager = $('input[name=title]').val();
		var ort = $('input[name=ort]').val();
		var desc = $('input[name=desc]').val();
		var fb = $('input[name=fb]').val();
		var link = $('input[name=link]').val();
		var typ = $('select[name=typ] option:selected').val();
		var Day = $('select[name=eDay] option:selected').val();
		var Month = $('select[name=eMonth] option:selected').val();
		var Year = $('select[name=eYear] option:selected').val();
		
		$("#request").load(
			prf + "/frames/editEvent.php",
			{
				action: 'update',
				peID: eID,
				ptitle: manager,
				port: ort,
				pfb: fb,
				plink: link,
				ptyp: typ,
				pDay: Day,
				pMonth: Month,
				pYear: Year
			}
		);
	});
	
	$('#cancelEditEvent').live('click', function(){
		window.location.reload();
	
	});
	
	$('#deleteEditEvent').live('click', function(){
		var eID = $('input[name=eID]').val();
		
		$("#request").load(
			prf + "/frames/editEvent.php",
			{
				action: 'delete',
				peID: eID
			}
		);
	
	});
});
