function opencomment() {
	var $jcom = jQuery.noConflict();
		if($jcom('div#recomment').length == 0) {
			$jcom('div#cmenu').append('<div id="recomment" class="fancybox"></div>');
		}
	
		$jcom("#recomment").load(
			"index.php?eID=rsn_recomment",{method: "getBox", url:document.location.href, doctitle: document.title}, function(response) {
			$jcom.getScript('fileadmin/templates/js/jquery.idTabs.min.js');
			exitReComment();
		});
		
}
function exitReComment() {
	var $jcom = jQuery.noConflict();
		$jcom('#rsn_recomment_exit').click(function() {
			$jcom('div#recomment').remove();
		});
}
function sendReComment() {
	var $jcom = jQuery.noConflict();
	var send = false;
	var txt = '';
	if($jcom('#tab-email #name').val() == '') {
		txt += '"Ihr Name" ist ein Pflichtfeld! \n';
	}
	
	if($jcom('#tab-email #email').val() == '') {
		txt += '"Ihre E-Mail Adresse" ist ein Pflichtfeld! \n';
	}
	
	if($jcom('#tab-email #receiveremail').val() == '') {
		txt += '"Empfänger E-Mail Adresse" ist ein Pflichtfeld! \n';
	}
	
	if($jcom('#tab-email #msg').val() == '') {
		txt += '"Ihre Nachricht" ist ein Pflichtfeld! \n';
	}
	
	if(txt.length > 0) {
		alert(txt);
		return false;
	} else {
		send = true;
	}
		
	if(send) {
		$jcom.ajax({
		  type: 'POST',
		  url: "index.php?eID=rsn_recomment",
		  data: {
		  	method:"sendComment",
		  	name:$jcom('#tab-email #name').val(),
		  	email:$jcom('#tab-email #email').val(),
		  	remail:$jcom('#tab-email #receiveremail').val(),
		  	msg:$jcom('#tab-email #msg').val(),
		  	url:document.location.href,
		  	captcha:$jcom('#tab-email #captcha').val(),
		  	doctitle: document.title
		  	},
		  success: function(response) {
		  	var txt = "";
		  	if(response.count > 0) {
		  		for(var k in response.errors) {
		  			txt += response.errors[k] + "\n";
		  		}
		  		alert(txt);
		  	} else {
		  		$jcom('#rsn_recomment_exit').click();
		  	}
		  	
		  }, 
		  dataType: "json"
		});
	}
}
			
