$(document).ready(function () {    
    $.getJSON('http://www.waizmanntabelle.de/waizicrossdomain/getinfo.php?id='+waizmanntabelle_user_id+'&jsoncallback=?', parseInfo);
});
jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() - 150 + "px");
    this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
    return this;
}


function mehr_tarife(wieviel)
{
    $.getJSON('http://www.waizmanntabelle.de/waizicrossdomain/getinfo.php?id=7&jsoncallback=?&wieviel='+wieviel, parseInfo);  
}


function parseInfo(data)
{
    //$('#waizmanntabellecrossdomain').html(data.name +', '+ data.email);
    $('#waizmanntabellecrossdomain').html(data.waizmann_tabelle);
    $("#waizmann_tabelle_submit").click(function(){
        var inputs = [];
        inputs.push('id='+waizmanntabelle_user_id);
        $('#rechner_loader_img').css('display' , 'block');
    	$(':input', $('#waizmann_tabelle_form')).each(function(){ if (this.name!='absenden') inputs.push(this.name + '=' + encodeURIComponent(this.value)); })
        inputs.push('jsoncallback=?');
        $.getJSON('http://www.waizmanntabelle.de/waizicrossdomain/update_table.php?'+inputs.join('&'), parseInfo);
    	
		return false;
	});
}
function parse_leistung_Info(data)
{
    if ( $('#waizmanntabelleleistung_window').length == 0 )
    {
        waizi_gesamt_window_top = $(window).scrollTop();
        $('body').append('<div id="waizitabelle_leistung_blende"></div>');
        $('body').append('<div id="waizitabelle_leistung_container"><div id="waizmanntabelleleistung_window"></div></div>');        
        $('#waizitabelle_leistung_blende').css( 'height' ,  $(document).height() );       
        //$('#waizitabelle_leistung_container').css( 'top' , Math.floor($(window).height()/2) - 50 + waizi_gesamt_window_top);        
        $('#waizitabelle_leistung_container').center();

     }
    
    $('#waizmanntabelleleistung_window').html('');
    $('#waizmanntabelleleistung_window').append( data.leistung_view );  
}
function get_leistung_info( leistung_id )
{
    $.getJSON('http://www.waizmanntabelle.de/waizicrossdomain/get_leistung_info.php?leistung_id='+leistung_id+'&jsoncallback=?', parse_leistung_Info);
}
function close_waizi_leistung_info()
{
    $('#waizitabelle_leistung_blende').remove();
    $('#waizitabelle_leistung_container').remove()
}
/*
function css_obj()
{
    
}
function s_popupwindow(win_options) {
    this.cssprop = new css_obj();
	this.cssprop.id = win_options.id?win_options.id:'';
    this.cssprop.width = win_options.width?win_options.width:400;
    this.cssprop.height = win_options.height?win_options.height:300;
    this.cssprop.position = 'absolute';
    this.cssprop.top = '200';
	this.show = function() {
		if ( $('#'+this.cssprop.id).length == 0 )
        {
            $('body').append('<div id="#'+this.cssprop.id+'"></div>');
            //alert(this.css.id);
            $.each( this.cssprop , function(index, value) { $('#'+this.cssprop.id).css( index , value);  }  );
 

        }
	}
} 
function win_options_obj()
{
    this.height = 300;
    this.width = 400;
    this.id = 'test';
}
win_options = new win_options_obj();

popwindow = new s_popupwindow(win_options);
$(document).ready(function () {    
    popwindow.show();
});

*/