$(document).ready(function() 
{
    $('#menu_heilmethoden').click(
    function() {
        $('#menu_heilmethoden_dropdown').css('display' , 'inline-block');
    });
    $('#cssdropdown li.headlink').hover(
			function() { $('ul', this).css('display', 'block'); },
			function() { $('ul', this).css('display', 'none'); });
     

    $('.table_info_stern1.on').html('*');
    //$('.table_info_stern1.on').attr('alt' ,'Sie benotigen einen Premiumakkaunt um diese eigenschaft zu veroffentlichen');
    $('.table_info_stern1.on').click(function() {
        window.location.replace('#info_stern1'); 
    });
  


}
);
function common_ajax( source , ausgabe_element_id , form_id_or_data , json )
{
    $('#'+ausgabe_element_id).append('<img src="'+site_url+'images/ajax_loader.gif" class="ajax_loader" title="loading" />');
    if ( typeof( form_id_or_data ) == "object" ) { var post_data = form_id_or_data.join('&'); } else { var post_data = $('#'+form_id_or_data).serialize(); }
      
    jQuery.ajax({
    	url: site_url + source, 
    	data: post_data,
    	type: "POST",
    	timeout: 4000,
    	error: function(){ console.log("25:Fehler"); },
    	success: function(ausgabe){
    	   $('.ajax_loader').remove();    
    	    if (json){ 
    	       responseJSON = jQuery.parseJSON(ausgabe);               
               if ( responseJSON.message ) { $( '#' + ausgabe_element_id ).html( responseJSON.message ); }
               if ( responseJSON.sys_message ) { show_status_message( responseJSON.sys_message ); }
               if ( responseJSON.redirect) { window.location.replace( responseJSON.redirect );   }
                
            }
            else
            {
                $( '#' + ausgabe_element_id ).html( ausgabe );
            }
   		}
    });
    
    if (json) { return responseJSON; }
    else
    { return false; }
}
function refresh_captcha_ajax()
{
	jQuery.ajax({		
		url: site_url+'ajax_function/refresh_captcha/',
		type: "POST",
		timeout: 5000,
		error: function(){ console.log("25:Fehler"); },
		success: function(ret){ 
				$('#captchaImage').html(ret);	
			}
	});		
}
function rate( data )
{    
    jQuery.ajax({
		data: data,
		url: site_url+'ajax_function/rate/',
		type: "POST",
		timeout: 5000,
		error: function(){ console.log("25:Fehler"); },
		success: function(ret){ 
				var responseJSON = $.evalJSON(ret);
                if ( !responseJSON.captcha_check) {alert('Sicherheitscode Falsch!');}
                else
                {
                  alert('Ihre Bewertung wurde erfolgreich geschpeichert!');
                  $('#user_bewertungs_forumlar').css('display' , 'none');  
                }
                
			}
	});		
}
function search_new_action( myform )
{
	//alert(myformid);
	//$('#'+myformid).attr( 'action' , site_url+'suche/nach/'+$('#search_request').val();
	//var plz= document.getElementById('plz_search').value; 
	//if (plz=='') plz = 'PLZ'; var name =document.getElementById('name_search').value; 
	//if (name =='') name='Name';	
	
	myform.action = '/suche/nach/'+	$("input[name='search_user_typ']:checked").val();
	//document.getElementsById('search_request')
	//window.location.replace('/suche/nach/'+document.getElementById('search_request').value );
}
function manage_schwerpunkt( user_id , schwerp_id , action )
{
	jQuery.ajax({
		data: 'user_id='+user_id+'&schwerp_id='+schwerp_id+'&action='+action,
		url: site_url+'ajax_function/manage_schwerpunkt/',
		type: "POST",
		timeout: 5000,
		error: function(){ console.log("25:Fehler"); },
		success: function(ret){ 
				$('#user_schwerpunkte').html(ret);	
			}
	});		
}

