$(function(){
	$(".encryptmail").each(function(){
		$(this).html(decryptMail($(this).html()));
	});
	slideHanlerMenu();
        removeAddressInputValues();
	
});

function decryptMail($s_mail){
	$s_mail = $s_mail.replace(' ( at ) ','@');
	$s_mail = $s_mail.replace(' ( d o t ) ','.');
	$s_mail = $s_mail.replace(' ( d o t ) ','.');
	$s_mail = $s_mail.replace(' ( at ) ','@');
	$s_mail = $s_mail.replace(' ( d o t ) ','.');
	$s_mail = $s_mail.replace(' ( d o t ) ','.');
	$s_mail = '<a href="mailto:'+$s_mail+'">'+$s_mail+'</a>';
	return $s_mail;
};

function slideHanlerMenu(){
	$("#menu_left ul").each(function(){
		$(this).removeClass("parent");
	});
	$("#menu_left ul li").mouseover(function(){
		$(this).children('ul').slideDown('fast');
	});
        $("#menu_left .active").parent().parent().show();
};

function check_agb_privacy(){
	
	if(!($("#accept_agb").attr("checked") && $("#accept_privacy").attr("checked"))){
		if (document.URL.indexOf('?') != '-1'){
			window.location.href=location.href + "&error=agb";	
		} else {
			window.location.href=location.href + "?error=agb";	
		}
		
		return false;
	}
	
	return true;
};

function save_comment(){
	
	
	
	var comments = $("#comments").val();
	
	$.get(AJAX_DIR+"ajax.save_comment.php","comment="+escape(comments), function(data){
		return true;
	});			
		
	
	
	return false;
};

function removeAddressInputValues(){
    $("#address_box p input").click(function(){
        this.value = '';
    });
}
