Ape.Element.kvideo = function(){
	var that = this,
		signaturcode,
		videos,
		videoslist,
		videos_sortiert_latestvideo = [],
		videos_sortiert_meistgesehen = [],
		videos_sortiert_bestebewertung = [],
		
		latestvideo_page = 0,
		meistgesehen_page = 0,
		bestebewertung_page = 0,
		
		latestvideo_aktiv = 1, 
		meistgesehen_aktiv = 0,
		bestebewertung_aktiv = 0,
		
		meistgesehen_inserted = 0,
		bestebewertung_inserted = 0;
		
	var ladeimage = '<img src="img/bar_3.gif"  />';	
	
	this.start = function(action){
		signaturcode = $.getURLParam('sig');
		
		
		switch(action){
			case 'player':
				start_player(signaturcode);
			break;
			case 'list':
				start_list(signaturcode);
			break;
			case 'teaser':
				start_teaser(signaturcode);
			break;
			case 'spa':
				start_spa(signaturcode);
			break;
			case 'mkl':
				start_mkl(signaturcode);
			break;
		}
		return false;
	};

	function start_player(signaturcode){
		get_player_code(signaturcode);
	}
	function start_list(signaturcode){

		get_videos(signaturcode);
		
		$('.tab__videoteaser').bind('click', function(){
			switch($(this).attr('id').split('_').pop()){
				case 'latestvideo':
					latestvideo_aktiv = 1;
					meistgesehen_aktiv = 0;
					bestebewertung_aktiv = 0;
					
					videos_sortiert_latestvideo 	= sortVideos_latestvideo(videoslist);
					show_videoItemList(videos_sortiert_latestvideo, '#tabcontent__videoteaser_latestvideo', latestvideo_page);
					
					createPagerForVideoteaser(videos_sortiert_latestvideo, latestvideo_page);
				break;
				case 'meistgesehen':
					latestvideo_aktiv = 0;
					meistgesehen_aktiv = 1;
					bestebewertung_aktiv = 0;
					
					videos_sortiert_meistgesehen 	= sortVideos_meistgesehen(videoslist);
					show_videoItemList(videos_sortiert_meistgesehen, '#tabcontent__videoteaser_meistgesehen', meistgesehen_page);
						
					createPagerForVideoteaser(videos_sortiert_meistgesehen, meistgesehen_page);
				break;
				case 'bestebewertung':
					latestvideo_aktiv = 0;
					meistgesehen_aktiv = 0;
					bestebewertung_aktiv = 1;
					
					videos_sortiert_bestebewertung 	= sortVideos_bestebewertung(videoslist);
					show_videoItemList(videos_sortiert_bestebewertung, '#tabcontent__videoteaser_bestebewertung', bestebewertung_page);
					
					createPagerForVideoteaser(videos_sortiert_bestebewertung, bestebewertung_page);
				break;
			}
		});
	}
	function start_teaser(signaturcode){
		
		$('#videosucheform .submit').unbind('click.search').bind('click.search', function(){
			
			if(typeof globalAgofCode != 'undefined'){
				content_click(globalAgofCode, prod, wm_page_name, wm_group_name);
			}
				
			$('.tab__teaser').removeClass('aktiv');
			$('#tab__teaser_search').addClass('aktiv').show();
			$('.tabcontent__teaser').hide();
			$('#tabcontent__teaser_search').show();
			$('#tabcontent__teaser_search').html(ladeimage);
			$.ajax({
				type: "POST",
				url: "?module=kvideo&ajax=1&task=get_search_video",
				data: {
					query: $('#videosucheform .query').val()
				},
				dataType:"json",
				success: function(json){
					if(json.length > 0){
						$('#tabcontent__teaser_search').html('');
						for(var i in json){
							$('#tabcontent__teaser_search').append(generateTeaserVideoItem(json[i], i));
						}
						
						$('#tabcontent__teaser_search div.eintrag a').unbind('click.loadvideo').bind('click.loadvideo', function(){
							
							if(typeof globalAgofCode != 'undefined'){
								content_click(globalAgofCode, prod, wm_page_name, wm_group_name);
							}
							get_player_code($(this).attr('id').split('__').pop());
						});
					}
				}
			});
			return false;
		});
		
		if(typeof signaturcode != 'undefined' && signaturcode != '' && signaturcode != null){
			$.ajax({
				type: "GET",
				url: "?module=kvideo&ajax=1&task=get_teaser_videos&sig="+signaturcode+"&cid="+$.getURLParam('cid'),
				dataType:"json",
				success: function(json){
					
					if(json.related.length > 0){
						var tabcontent__teaser_aehnliche = '';
						for(var i in json.related){
							tabcontent__teaser_aehnliche += generateTeaserVideoItem(json.related[i], i);
						}
						$('#tabcontent__teaser_aehnliche').html(''+tabcontent__teaser_aehnliche);
					}else{
						$('#tabcontent__teaser_aehnliche').remove();
						$('#tabcontent__teaser_top20').show();
						$('#tab__teaser_aehnliche').remove();
						$('#tab__teaser_top20').addClass('aktiv');
					}
					if(json.top.length > 0){
						var tabcontent__teaser_top20 = '';
						
						for(var i in json.top){
							tabcontent__teaser_top20 += generateTeaserVideoItem(json.top[i], i);
						}
						$('#tabcontent__teaser_top20').html(''+tabcontent__teaser_top20);
					}else{
						$('#tabcontent__teaser_top20').remove();
						$('#tab__teaser_top20').remove();
					}
					
					if(json.related.length == 0 && json.top.length == 0 ){
						$('#aehnliche_top_tabs').remove();
						$('#toolbar_container').remove();
					}
					
					
					$('#tabcontent__teaser_top20 div.eintrag a, #tabcontent__teaser_aehnliche div.eintrag a').unbind('click.loadvideo').bind('click.loadvideo', function(){
						if(typeof globalAgofCode != 'undefined'){
							content_click(globalAgofCode, prod, wm_page_name, wm_group_name);
						}
						get_player_code($(this).attr('id').split('__').pop());
					});
				}
			});
		}
	}
	function generateTeaserVideoItem(data, row){
		
		var item = '<div class="eintrag';
		if(row == 0){
			item += ' first';
		}
		item += '">';
			item += '<div class="links">';
				item += '<a id="signatur_bild__'+data.sig+'" href="javascript:;"><img alt="Image" src="'+data.thumbnail+'"/></a>';
			item += '</div>';
			item += '<div class="rechts">';
				item += '<strong class="pubdate">'+data.pubdate+'</strong>';
				
				item += '<h2 class="categories">';
				for(var c in data.categories){
					item += data.categories[c]+' ';
				}
				item += '</h2>';
				
				item += '<strong class="itemlink"><a id="signatur_link__'+data.sig+'" href="javascript:;">'+data.title+'</a></strong>';
				item += '<p class="duration">Länge: '+data.duration+'</p>';
			item += '</div>';
		item += '<div class="clear"/></div>';
		
		return item;
	}
	function start_spa(signaturcode){
		$('#teaser__sport_auto').html(''+ladeimage);
		$.ajax({
			type: "POST",
			url: "?module=kvideo&ajax=1&task=get_videobycategory&category=Sportwagen",
			dataType:"json",
			success: function(json){
				//console.debug(json);
				if(json.length > 0){
					var teaser__sport_auto = '';
					for(var i in json){
						teaser__sport_auto += generateTeaserVideoItem(json[i], i);
					}
					$('#teaser__sport_auto').html(teaser__sport_auto);
					
					
					$('#teaser__sport_auto div.eintrag a').unbind('click.loadvideo').bind('click.loadvideo', function(){
						if(typeof globalAgofCode != 'undefined'){
							content_click(globalAgofCode, prod, wm_page_name, wm_group_name);
						}
						get_player_code($(this).attr('id').split('__').pop());
					});
				}else{
					
					$('#teaser__sport_auto').remove();
				}
				
			}
		});
	}
	function start_mkl(signaturcode){
		$('#teaser__motor_klassik').html(''+ladeimage);
		$.ajax({
			type: "POST",
			url: "?module=kvideo&ajax=1&task=get_videobycategory&category=Oldtimer",
			dataType:"json",
			success: function(json){
				//console.debug(json);
				if(json.length > 0){
					
					var teaser__motor_klassik = '';
					for(var i in json){
						teaser__motor_klassik += generateTeaserVideoItem(json[i], i);
					}
					$('#teaser__motor_klassik').html(teaser__motor_klassik);
					
					$('#teaser__motor_klassik div.eintrag a').unbind('click.loadvideo').bind('click.loadvideo', function(){
						if(typeof globalAgofCode != 'undefined'){
							content_click(globalAgofCode, prod, wm_page_name, wm_group_name);
						}
						get_player_code($(this).attr('id').split('__').pop());
					});
				}else{
					
					$('#teaser__motor_klassik').remove();
				}
				
			}
		});
	}
	function get_videos(signaturcode){
		
		$.ajax({
			type: "POST",
			url: "?module=kvideo&ajax=1&task=get_latest_video&cid="+$.getURLParam('cid'),
			dataType:"json",
			success: function(json){
				//console.debug(json);
				videoslist = json;
				
				if(typeof signaturcode == 'undefined' || signaturcode == '' || signaturcode == null){
					//wenn auf der startseite kein signaturcode übergeben wurde wird das erste element aus der videoliste angezeigt
					if(typeof json[0] !== 'undefined'){
						get_player_code(json[0].sig);
						start_teaser(json[0].sig);
					}
				}
				videos_sortiert_latestvideo 	= sortVideos_latestvideo(json);
				show_videoItemList(videos_sortiert_latestvideo, '#tabcontent__videoteaser_latestvideo', 0);
			}
		});
	}
	function sortVideos_latestvideo(latestvideo){
		if(typeof latestvideo == 'object' || typeof latestvideo == 'array'){
			latestvideo.sort(function(a, b) {
				
				var aText = a.sortable_pubdate;
				var	bText = b.sortable_pubdate;
				
				if (aText < bText) {
					return 1;
				} else if (aText > bText) {
					return -1;
				} else {
					return 0;
				}
			});
			return latestvideo;
		}
		return false;
	}
	function sortVideos_meistgesehen(meistgesehen){
		
		//HIER VIDEOS NACH MEIST GESEHEN SORTIEREN
		meistgesehen.sort(function(a, b) {
			var aText = a.views;
			var	bText = b.views;
			if (aText < bText) {
				return 1;
			} else if (aText > bText) {
				return -1;
			} else {
				return 0;
			}
		});
		
		return meistgesehen;
	}
	function sortVideos_bestebewertung(bestebewertung){
		
		//HIER VIDEOS NACH BEWERTUNG SORTIEREN
		bestebewertung.sort(function(a, b) {
			var aText = a.rating;
			var	bText = b.rating;
			if (aText < bText) {
				return 1;
			} else if (aText > bText) {
				return -1;
			} else {
				return 0;
			}
		});
		
		return bestebewertung;
	}
	function show_videoItemList(items, target, page){
		
		//console.debug(videos);
		
		$(target).html('');
		var i = page*5;
		var count = 0;
		
		if(items.length > 0){
		
			while(count < 5){
				var newViewoInList = '<div class="eintrag">';
				newViewoInList += '<div class="links">';
				//newViewoInList += '<b class=""><a id="video_iLyROoafM4rT" class="loadvideo" href="javascript:;"/></b>';
				newViewoInList += '<a href="javascript:;" id="signatur_bild__' + items[i].sig + '" class="loadvideo"><img alt="Image" src="' + items[i].thumbnail + '"/></a>';
				newViewoInList += '</div>';
				
				newViewoInList += '<div class="rechts">';
				
				newViewoInList += '<h2 class="rating_'+items[i].rating+'">'+items[i].pubdate+'</h2>';
				newViewoInList += '<h3><a href="javascript:;" id="signatur_link__' + items[i].sig + '" class="loadvideo">' + items[i].title + '</a></h3>';
				newViewoInList += '<p>' + items[i].description + '</p>';
				newViewoInList += '</div>';
				newViewoInList += '<div class="clear"/>';
				newViewoInList += '</div>';
				
				$(target).append(newViewoInList);	
				count++;
				i++;
			}
		}
		$('.loadvideo').unbind('click.loadvideo').bind('click.loadvideo', function(){
			if(typeof globalAgofCode != 'undefined'){
				content_click(globalAgofCode, prod, wm_page_name, wm_group_name);
			}
			get_player_code($(this).attr('id').split('__').pop());
		});
		$('#pagination').show();
		createPagerForVideoteaser(items, page);
		return false;
	}
	function createPagerForVideoteaser(videos, page){
		var seiten = Math.ceil(videos.length/5);
		$('#pagination .zurueck').css('textIndent', '0px');
		$('#pagination .weiter').css('textIndent', '0px');
		if(latestvideo_aktiv == 1){
			if(latestvideo_page == 0 ){
				$('#pagination .zurueck').css('textIndent', '-10000px');
			}else if(latestvideo_page == seiten-1){
				$('#pagination .weiter').css('textIndent', '10000px');
			}
		}
		if(meistgesehen_aktiv == 1){
			if(meistgesehen_page == 0 ){
				$('#pagination .zurueck').css('textIndent', '-10000px');
			}else if(meistgesehen_page == seiten-1){
				$('#pagination .weiter').css('textIndent', '10000px');
			}
		}
		if(bestebewertung_aktiv == 1){
			if(bestebewertung_page == 0){
				$('#pagination .zurueck').css('textIndent', '-10000px');
			}else if(bestebewertung_page == seiten-1){
				$('#pagination .weiter').css('textIndent', '10000px');
			}
		}
		
		if(seiten == 1 || seiten == 0){
			$('#pagination .zurueck').css('textIndent', '-10000px');
			$('#pagination .weiter').css('textIndent', '10000px');
			return ;
		}
			
		var linklimit = 5;
		var dotted = false;
		var count = Math.ceil(videos.length/5);
		
		$('#pagination .seiten').html('');
		
		for(var i = 0; i < page; i++){
			if(i < page -linklimit){
				if(dotted === false){
					dotted = true;
					$('#pagination .seiten').append('<span class="dots">...</span>');
					$('#pagination .seiten').append('<span>&nbsp;</span>');
				}else{
					
				}
			}else{
				$('#pagination .seiten').append('<a href="javascript:;">'+(i+1)+'</a>');
				$('#pagination .seiten').append('<span>&nbsp;</span>');
			}
		}
		
		if(dotted == true){
			$('#pagination .seiten').prepend('<a href="javascript:;">1</a>');
		}
		
		$('#pagination .seiten').append('<span>'+(page+1)+'</span><span>&nbsp;</span>');
		dotted = false
		
		for(var i = (page+1); i < count; i++){
			if(i > page+linklimit){
				if(dotted === false){
					dotted = true;
					$('#pagination .seiten').append('<span class="dots">...</span>');
					$('#pagination .seiten').append('<span>&nbsp;</span>');
				}else{
					
				}
			}else{
				$('#pagination .seiten').append('<a href="javascript:;">'+(i+1)+'</a>');
				$('#pagination .seiten').append('<span>&nbsp;</span>');
			}
			
		}
		if(dotted == true){
			$('#pagination .seiten').append('<a href="javascript:;">'+count+'</a>');
		}
		
		$('#pagination .seiten a').unbind('click.pager').bind('click.pager', function(){
			
			if(typeof globalAgofCode != 'undefined'){
				content_click(globalAgofCode, prod, wm_page_name, wm_group_name);
			}
				
			var page = parseInt($(this).html())-1;
			
			if(latestvideo_aktiv == 1){
				latestvideo_page = page;
				show_videoItemList(videos_sortiert_latestvideo, '#tabcontent__videoteaser_latestvideo', page);
			}
			if(meistgesehen_aktiv == 1){
				meistgesehen_page = page;
				show_videoItemList(videos_sortiert_meistgesehen, '#tabcontent__videoteaser_meistgesehen', page);
			}
			if(bestebewertung_aktiv == 1){
				bestebewertung_page = page;
				show_videoItemList(videos_sortiert_bestebewertung, '#tabcontent__videoteaser_bestebewertung', page);
			}
			
			
		});
		
		
		$('#pagination .seiten').prepend('<strong>Seite:</strong><span>   </span>');
		
		$('#pagination .zurueck').unbind('click.paging').bind('click.paging', function(){
			if(typeof globalAgofCode != 'undefined'){
				content_click(globalAgofCode, prod, wm_page_name, wm_group_name);
			}
			if(latestvideo_aktiv == 1){
				latestvideo_page = latestvideo_page-1;
				show_videoItemList(videos_sortiert_latestvideo, '#tabcontent__videoteaser_latestvideo', latestvideo_page);
			}
			if(meistgesehen_aktiv == 1){
				meistgesehen_page = meistgesehen_page-1;
				show_videoItemList(videos_sortiert_meistgesehen, '#tabcontent__videoteaser_meistgesehen', meistgesehen_page);
			}
			if(bestebewertung_aktiv == 1){
				bestebewertung_page = bestebewertung_page-1;
				show_videoItemList(videos_sortiert_bestebewertung, '#tabcontent__videoteaser_bestebewertung', bestebewertung_page);
			}
			
		});
		$('#pagination .weiter').unbind('click.paging').bind('click.paging', function(){
			if(typeof globalAgofCode != 'undefined'){
				content_click(globalAgofCode, prod, wm_page_name, wm_group_name);
			}
			if(latestvideo_aktiv == 1){
				latestvideo_page = latestvideo_page+1;
				show_videoItemList(videos_sortiert_latestvideo, '#tabcontent__videoteaser_latestvideo', latestvideo_page);
			}
			if(meistgesehen_aktiv == 1){
				meistgesehen_page = meistgesehen_page+1;
				show_videoItemList(videos_sortiert_meistgesehen, '#tabcontent__videoteaser_meistgesehen', meistgesehen_page);
			}
			if(bestebewertung_aktiv == 1){
				bestebewertung_page = bestebewertung_page+1;
				show_videoItemList(videos_sortiert_bestebewertung, '#tabcontent__videoteaser_bestebewertung', bestebewertung_page);
			}
		});
	}
	
	function get_player_code (signaturcode){
		
		if(typeof signaturcode != 'undefined' && signaturcode != '' && signaturcode != null){
			$('#play_category').html('');
			$('#play_title').html(ladeimage);
			$('#play_description').html(ladeimage);
			$('#tabcontent__videoinfo_weiterempfehlen').html(ladeimage);
			$('#tabcontent__videoinfo_bookmark').html(ladeimage);		
			
			$('#tabcontent__videoinfo_schlagworte').html(ladeimage);
			$('#embed_code_field').val('Loading...');
			$('#tabcontent__videoinfo_weiterempfehlen').html(ladeimage);
			$('#tabcontent__videoinfo_bookmark').html(ladeimage);
			$('#other_info_Eingestellt_1').html(ladeimage);
			$('#other_info_Eingestellt_2').html(ladeimage);
			$('#other_info_Bewertungen').html(ladeimage);
			$('#embed_video').html('<div id="flashvideo">'+ladeimage+'</div>');
			
			get_video_details(signaturcode);
			
			$.ajax({
				type: "POST",
				url: "?module=kvideo&ajax=1&task=get_player_code&sig="+signaturcode,
				dataType:"json",
				success: function(json){
					
					
					
					var flashvars = {};
					flashvars.projektStage 	= that.projektStage; 
					flashvars.projektName   = that.project;
					flashvars.spot_low 		= (typeof spot_low != 'undefined') ? spot_low : false ;
					flashvars.spot_high		= (typeof spot_high != 'undefined') ? spot_high : false ;
					flashvars.sek			= (typeof sek != 'undefined') ? sek : false;
					flashvars.TargetURL		= (typeof TargetURL != 'undefined') ? TargetURL : false;
					flashvars.spotscale		= (typeof spotscale != 'undefined') ? spotscale : false;
					flashvars.clickTag		= (typeof clickTag != 'undefined') ? clickTag : false;
					flashvars.imageBg		= escape(json.thumbnailURL);
					flashvars.flvMain		= escape(json.videoStreamURL);
					flashvars.titelMain		= escape(json.videoTitle);
					flashvars.targetLink	= escape('http://www.vonaffenfels.de');
					flashvars.relatedXml    = escape(json.relatedVideosURL);

					var params = {};
					params.menu = "true";
					params.allowscriptaccess = "always";
					params.allowfullscreen = "true";
					params.wmode = "window";
				
					var attributes = {};
					attributes.id = "videoplayer";
					attributes.name = "videoplayer";
					swfobject.embedSWF("?file=resources/swf/webtv/videoplayer.swf", "flashvideo", "520", "390", "9.0.0", "?file=resources/swf/webtv/playerProductInstall.swf", flashvars, params, attributes);
					//console.debug(flashvars);
					
					
				}
			});
		}
	}
	
	this.get_player_code_article = function(signaturcode) {
		if(typeof signaturcode != 'undefined' && signaturcode != '' && signaturcode != null){
			$.ajax({
				type: "POST",
				url: "?module=kvideo&ajax=1&task=get_player_code&sig="+signaturcode,
				dataType:"json",
				success: function(json) {
					var flashvars = {};
					flashvars.projektStage 	= that.projektStage; 
					flashvars.projektName   = that.project;
					flashvars.spot_low 		= (typeof spot_low != 'undefined') ? spot_low : false ;
					flashvars.spot_high		= (typeof spot_high != 'undefined') ? spot_high : false ;
					flashvars.sek			= (typeof sek != 'undefined') ? sek : false;
					flashvars.TargetURL		= (typeof TargetURL != 'undefined') ? TargetURL : false;
					flashvars.spotscale		= (typeof spotscale != 'undefined') ? spotscale : false;
					flashvars.clickTag		= (typeof clickTag != 'undefined') ? clickTag : false;
					flashvars.imageBg		= escape(json.thumbnailURL);
					flashvars.flvMain		= escape(json.videoStreamURL);
					flashvars.titelMain		= escape(json.videoTitle);
					flashvars.targetLink	= escape('http://www.vonaffenfels.de');
					flashvars.relatedXml    = escape(json.relatedVideosURL);

					var params = {};
					params.menu = "true";
					params.allowscriptaccess = "always";
					params.allowfullscreen = "true";
					params.wmode = "window";
				
					var attributes = {};
					attributes.id = "videoplayer";
					attributes.name = "videoplayer";
					swfobject.embedSWF("?file=resources/swf/webtv/videoplayer.swf", "article_video_content", "498", "333", "9.0.0", "?file=resources/swf/webtv/playerProductInstall.swf", flashvars, params, attributes);
					//console.debug(flashvars);
				}
			});
		}
	}
	
	function get_video_details(signaturcode){
		that.signaturcode = signaturcode;
		$.ajax({
			type: "POST",
			url: "?module=kvideo&ajax=1&sig="+signaturcode+"&task=get_video_details",
			dataType:"json",
			success: function(json){
				
				if(typeof json == 'object'){

					var play_category = '';
					for (var i in json.categories){
						play_category += json.categories[i];
					}
					$('#play_category').html(''+play_category);
					
					$('#play_title').html(json.title);
					$('#play_description').html(json.description);

					//schlagworte füllen
					var schlagworte = '';
					for(var i in json.keywords){
						schlagworte += '<a href="?task=search_video&query='+json.keywords[i]+'">'+json.keywords[i]+'</a>, &nbsp;';
					}
					$('#tabcontent__videoinfo_schlagworte').html(''+schlagworte.substr(0, schlagworte.length-8));

					//video einbetten füllen
					$('#embed_code_field').val(json.embed);

					//weiterempfehlen formular laden
					$('#tabcontent__videoinfo_weiterempfehlen').html(json.weiterempfehlen);
					
					$('#tabcontent__videoinfo_weiterempfehlen form input.submit').unbind('click.submitempfehlung').bind('click.submitempfehlung', send_mail_formular);
					
					//bookmarks laden
					$('#tabcontent__videoinfo_bookmark').html(json.bookmark);
					
					//infos laden
					$('#other_info_Eingestellt_1').html(json.publication_date+" Uhr");
					$('#other_info_Eingestellt_2').html(json.author);
					$('#other_info_Bewertungen').html(json.rating_count);
					
					$('#play_views').html('<img id="eye_img" src="img/eye.png"/>'+json.views+' Aufrufe');
					
				
					/*
					$('#vote_video_rating').html(json.votingStars).children('a').each(function(){
						
						$(this).unbind('mouseover.rating').bind('mouseover.rating', function(){
							var wert = $(this).attr('id').split('_').pop();
							console.debug(wert);
						});
					});
					*/
					
					
					/* //kann derzeit nicht geprüft werden da es scheinbar nur von der richtigen ams url aus funktionieren kann
					$('#rating').html('').rater('?task=set_video_rating&sig='+signaturcode,{
					style: 'small', 
					curvalue: json.rate, 
					maxvalue: 5 });
					*/
				}
			}
		});
	}
	function send_mail_formular(){
		$.ajax({
			type: "POST",
			url: "?module=kvideo&ajax=1&task=send_mail_form",
			data: {
				cur_sig:		that.signaturcode,
				your_name: 		$('#your_name_field').val(),
				your_mail:		$('#your_mail_field').val(),
				message:		$('#message_field').val(),
				email_list:		$('#email_list_field').val()
			},
			dataType:"json",
			success: function(json){
				
				if(json.error == false){
					
					$('#your_name_field').val('');
					$('#your_mail_field').val('');
					$('#message_field').val('');
					$('#email_list_field').val('');
					
					$('#error_mes').html(json.result);
				}else{
					alert('Die Empfehlung ist fehlgeschlagen');
				}
			}
		});
		
		return false;
	}
};
