/*FUNCTION JS*/

// Global Properties
var shadermode_op_opacity = 0.7;
var shadermode_op_bg = '#040404';
var sendallPage = false;
var sendPageClip = false;


// alternative color for MacFF2
var shadermode_neutral = 'gray';

$(document).ready(function(){


if($('.tx-editpagetools-pi1').css('display') != 'none'){
   if(($('#bel-leftmenu ul').length == 0) && (($('#bel-col-teaser-content').html().length == 11) || ($('#bel-col-teaser-content').html().length == 0))){
      $('#bel-col-main').addClass('full');
   }
   else if(($('#bel-leftmenu ul').length == 1) && (($('#bel-col-teaser-content').html().length == 11) || ($('#bel-col-teaser-content').html().length == 0))){
      $('#bel-col-main').addClass('full-no-teaser');	
   }
   else if(($('#bel-leftmenu ul').length == 0) && (($('#bel-col-teaser-content').html().length != 11) || ($('#bel-col-teaser-content').html().length != 0))){
      $('#bel-col-main').addClass('full-no-left');	
   }
}


// Position Pagetool with Filter (begin)
if($('.tx-editfiltersystem-pi1').length == 1){
    if(($('.bel-filter-search').css('display') != 'none') && ($('.bel-filter-search').length != 0)){
        $('.newPagetools').css('top','70px'); 
    }else{
	$('.newPagetools').css('top','45px'); 
    }
    
    /*else{
      if($('.tx-editfiltersystem-pi1').length == 1){
      	if($('#bel-filter-layerform').css('display') == 'block'){
           $('.newPagetools').css('top','280px'); 
      	}else{
      	   $('.newPagetools').css('top','45px');
      	}
      }else{
	$('.newPagetools').css('top','70px');
      }
    } 
    */
}
// Position Pagetool with Filter (end)




if($('.bel-paging').html() == ''){
	$('.bel-paging').css('display','none');
}
    //empty on click...
    $('#bel-search-form').emptyonclick();
    $('input[name^="tx_eapsshop_pi2[payment_"]').emptyonclick();  

    $("#bel-search-form").keypress(function (e) {
        if (e.which == 13){
            $("#ind-search").submit();
        }
    });




    $('#ind-search-form').focus(function(){
        $('#ind-search').keypress(function(key){
            alert(key);
        });
    });


	// PNG Fix
   	$(document).pngFix(); 

	// Matrix Teaser Rechts
	$('div.bel-teaser-head').each(function() {
		if($(this).attr("close") == 'true'){
			$(this).next("div.bel-smallteaser-content").hide();	
			$(this).next("div.bel-smallteaser-content").next("div.bel-smallteaser-bottom").hide();
			$(this).next("div.bel-teaser-content").hide();	
			$(this).next("div.bel-teaser-content").next("div.bel-teaser-bottom").hide();
			$(this).css("margin-bottom", "16px");
		}
	});

	$("div.bel-teaser-head").click(function(){
		if(typeof(isHomeSite) == "undefined"){
            $(this).next("div.bel-smallteaser-content").slideToggle(100);
            $(this).next("div.bel-teaser-content").slideToggle(100);

            if ($(this).find(":nth-child(2) > div.bel-teaser-head-m-content").find(":first").hasClass("bel-teaser-arrow-up")) {
                $(this).next("div.bel-smallteaser-content").next("div.bel-smallteaser-bottom").hide();
                $(this).next("div.bel-teaser-content").next("div.bel-teaser-bottom").hide();
                $(this).find(":nth-child(2) > div.bel-teaser-head-m-content").find(":first").removeClass("bel-teaser-arrow-up");
                $(this).find(":nth-child(2) > div.bel-teaser-head-m-content").find(":first").addClass("bel-teaser-arrow-down");
                $(this).css("margin-bottom", "16px");

            } else if ($(this).find(":nth-child(2) > div.bel-teaser-head-m-content").find(":first").hasClass("bel-teaser-arrow-down")) {
                $(this).next("div.bel-smallteaser-content").next("div.bel-smallteaser-bottom").show();
                $(this).next("div.bel-teaser-content").next("div.bel-teaser-bottom").show();
                $(this).find(":nth-child(2) > div.bel-teaser-head-m-content").find(":first").removeClass("bel-teaser-arrow-down");
                $(this).find(":nth-child(2) > div.bel-teaser-head-m-content").find(":first").addClass("bel-teaser-arrow-up");
                $(this).css("margin-bottom", "0px");

            }
        }
	});




loadSubmitViaAjax();

});



function startUserChange(){
    $('#bel-reg-shader').showshader_register_main('bel-reg-shader');
}

function startRegisterForm(){
    $('#bel-reg-shader').showshader_register_main('bel-reg-shader');
}

function submitRegForm(){
    userRfields = new Array(
                    'tx_beluserreg_pi1[name]',
                    'tx_beluserreg_pi1[email]'
                    );
    var userReqOk = checkUserRegFields(userRfields);
    var selected = $("select[@name='tx_beluserreg_pi1[gender]'] option:selected");

   
    if(selected.val() == 0){
       var item = $("select[@name='tx_beluserreg_pi1[gender]'] option:selected").parent().parent().parent();
       $(item).find('td').css('color','red');
       userReqOk == false;
    }

    var matchPos = $("input[name='tx_beluserreg_pi1[email]']").val().search('@');
    if(matchPos == -1){
       var matchPos = $("input[name='tx_beluserreg_pi1[email]']").parent().parent();
       $(matchPos).find('td').css('color','red');
       userReqOk == false;
    }

    if(userReqOk == true){
        $('#frm-bel-reg').submit();
    }
}

function checkUserRegFields(userRfields){
    var status = true;
    $.each(userRfields,function(key,name){
        if($("input[name='"+name+"']").val().length < 1){
             var item = $("input[name='"+name+"']").parent().parent();
             $(item).find('td').css('color','red');
             setTimeout("$('#frm-bel-reg td').css({color:'#000'});",3000);
             status = false;
        }
    })
    return status;
}

// Filter Seminare Anmelden...
function startSemRegister(semUid){
    $('#semRegister').showsem();
}

jQuery.fn.eUnblock = function(){
    $.unblockUI();
    return this;
}



// Filtersearch by Ajax...
jQuery.fn.submitViaAjax = function(){
    $('div.tx-editfiltersystem-pi1').block({
        message: '<img src="fileadmin/templates/img/ajax-loader.gif" />',
        css: {
            border: '0px solid orange',
            background: 'transparent'
        },
        overlayCSS:  {
            backgroundColor:'#fff',
            opacity:        '0.6'
        }
    });
    var detailInUrl = document.URL.search("detail");
    var postData = this.serializeAnything();
    var postDataArray = this.serializeArray();
    if(detailInUrl == '-1'){
        $.get(document.URL +'?'+ postData+'&no_cache=1&type=555&date=' +  new Date().getTime(), function(data){
            var tempData = data;
            $('div.tx-editfiltersystem-pi1').unblock();
            $('div.tx-editfiltersystem-pi1').empty();
            $('div.tx-editfiltersystem-pi1').append($(tempData).find('div.tx-editfiltersystem-pi1').html());
            loadSubmitViaAjax();
        });
    }else{
    
        //location.href = "http://"+ window.location.host + "/" + postDataArray[3]['value'] +'?'+ postData;
        location.href = "http://" + window.location.host +"/"+ postDataArray[3]['value'] +'?'+ postData;
    }
        return this;
}

function loadSubmitViaAjax(){
 
   $(".bel-teaser-search-m-content").click(function(){
		$("#bel-filter-layerform").slideToggle(100);
	});
	$('#bel-filter-layerform').each(function() {
		if($(this).attr("close") == 'true'){
			$(this).hide();	
		}
	});	
	
    $(".bel-teaser-search").click(function(){
        if ($(this).find(":nth-child(2) > div.bel-teaser-search-m-content").find(":first").hasClass("bel-teaser-search-up")) {
			$(this).find(":nth-child(2) > div.bel-teaser-search-m-content").find(":first").removeClass("bel-teaser-search-up");
			$(this).find(":nth-child(2) > div.bel-teaser-search-m-content").find(":first").addClass("bel-teaser-search-down");
			
		} else if ($(this).find(":nth-child(2) > div.bel-teaser-search-m-content").find(":first").hasClass("bel-teaser-search-down")) {
			$(this).find(":nth-child(2) > div.bel-teaser-search-m-content").find(":first").removeClass("bel-teaser-search-down");
			$(this).find(":nth-child(2) > div.bel-teaser-search-m-content").find(":first").addClass("bel-teaser-search-up");

		}	
	});

    $('a').click(function(e){
        if($(this).attr('href') == '#'){
            //Cancel the link behavior
            e.preventDefault();
        }
    });

    $("#filter_system").submit(function(){
        $('#filter_system').submitViaAjax();
        return false;
    })

    $("#filter_system input:checkbox").click(function(){
        $('#filter_system').submitViaAjax();
        return false;
    })


    $("#filter_system input:radio").click(function(){
        $('#filter_system').submitViaAjax();
        return false;
    })


    $("#filter_system select.bel-form-pulldown").change(function(){
        $('#filter_system').submitViaAjax();
        return false;
    })

    $(".bel-form-wide input select").mouseup(function(){
        setTimeout(function(){$('#filter_system').submitViaAjax();},300);
        return false;
    })


    // serach manuell ausführen...
    $("#filter_system").keypress(function (e) {
        if (e.which == 13){
            $('#filter_system').submitViaAjax();
      }
    });




}
function clearForm(){
    $('#filter_system').resetForm();
    setTimeout(function(){$('#filter_system').submit();},200);
}

$.fn.resetForm = function() {
    return this.each(function() {
    var type = this.type, tag = this.tagName.toLowerCase();
    if (tag == 'form')
        return $(':input',this).resetForm();
    if (type == 'text' || type == 'password' || tag == 'textarea')
        this.value = '';
    else if (type == 'checkbox' || type == 'radio')
        this.checked = false;
    else if (tag == 'select')
        this.selectedIndex = 0;
    });
}

$.fn.serializeAnything = function() {
    var toReturn    = [];
    var els         = $(this).find(':input').get();
    $.each(els, function() {
        if (this.name && !this.disabled && (this.checked || /select|textarea/i.test(this.nodeName) || /text|hidden|password/i.test(this.type))) {
            var val = $(this).val();
            //toReturn.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( val ) );
            toReturn.push( this.name + "=" +  val  );
        }
    });
    return toReturn.join("&").replace(/%20/g, "+");
};


/*EDIT SHADER JS*/

function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}

jQuery.fn.showshader = function(divItem) {
    //Screen Berechnung mitte
                                                var formWidthPX = $('#'+divItem).css("width");
                                                var formHeightPX = $('#'+divItem).css("height");
                                                var formWidth = formWidthPX.split('p');
                                                var formHeight = formHeightPX.split('p');
                                                
                                                var element = $(divItem) //.attr('id')
                                                
                                             //   var fhoehe = ((Fensterhoehe()/2)-(formHeight[0]/2));
                                             //   var fweite = ((Fensterweite()/2)-(formWidth[0]/2));

                                                var fhoehe = ((Fensterhoehe()/2)-(600/2));
                                                var fweite = ((Fensterweite()/2)-(850/2));

                                                $.blockUI.defaults = { 
                                                // styles for the message when blocking; if you wish to disable 
                                                // these and use an external stylesheet then do this in your code: 
                                                // $.blockUI.defaults.css = {}; 
                                                css: {  
                                                padding:        0, 
                                                margin:         0,
                                                height:         '600px',
                                                width:          '850px',
                                                top:            fhoehe,  
                                                left:           fweite,
                                                textAlign:      'center',  
                                                color:          '#000',  
                                                border:         '0px solid #aaa', 
                                                backgroundColor:'', 
                                                cursor:         'default' 
                                                }, 
                                                
                                                // styles for the overlay 
                                                overlayCSS:  {  
                                                backgroundColor:'#000',  
                                                opacity:        '0.5'  
                                                }, 
                                                
                                                // z-index for the blocking overlay 
                                                baseZ: 1000, 
                                                
                                                // set these to true to have the message automatically centered 
                                                centerX: true, // <-- only effects element blocking (page block controlled via css above) 
                                                centerY: true, 
                                                
                                                // allow body element to be stetched in ie6; this makes blocking look better 
                                                // on "short" pages.  disable if you wish to prevent changes to the body height 
                                                allowBodyStretch: true, 
                                                
                                                // be default blockUI will supress tab navigation from leaving blocking content; 
                                                constrainTabKey: true, 
                                                
                                                // fadeOut time in millis; set to 0 to disable fadeout on unblock 
                                                fadeOut:  400, 
                                                
                                                // suppresses the use of overlay styles on FF/Linux (due to significant performance issues with opacity) 
                                                applyPlatformOpacityRules: true 
                                                }; 
                                          
                                                
                                                $.blockUI({ message: $('#'+divItem), css: {  cursor: 'pointer'}});
    //--------------------------------------------------------------------------
}


jQuery.fn.showcontact = function(divItem) {
    //Screen Berechnung mitte
                                                var formWidthPX = $('#'+divItem).css("width");
                                                var formHeightPX = $('#'+divItem).css("height");
                                                var formWidth = formWidthPX.split('p');
                                                var formHeight = formHeightPX.split('p');

                                                var element = $(divItem) //.attr('id')

                                             //   var fhoehe = ((Fensterhoehe()/2)-(formHeight[0]/2));
                                             //   var fweite = ((Fensterweite()/2)-(formWidth[0]/2));

                                                var fhoehe = ((Fensterhoehe()/2)-(430/2));
                                                var fweite = ((Fensterweite()/2)-(634/2));

                                                $.blockUI.defaults = {
                                                // styles for the message when blocking; if you wish to disable
                                                // these and use an external stylesheet then do this in your code:
                                                // $.blockUI.defaults.css = {};
                                                css: {
                                                padding:        0,
                                                margin:         0,
                                                height:         '430px',
                                                width:          '634px',
                                                top:            fhoehe,
                                                left:           fweite,
                                                textAlign:      'center',
                                                color:          '#000',
                                                border:         '0px solid #aaa',
                                                backgroundColor:'',
                                                cursor:         'default',
                                                position:       'absolute'
                                                },

                                                // styles for the overlay
                                                overlayCSS:  {
                                                backgroundColor:'#000',
                                                opacity:        '0.5'
                                                },

                                                // z-index for the blocking overlay
                                                baseZ: 1000,

                                                // set these to true to have the message automatically centered
                                                centerX: true, // <-- only effects element blocking (page block controlled via css above)
                                                centerY: true,

                                                // allow body element to be stetched in ie6; this makes blocking look better
                                                // on "short" pages.  disable if you wish to prevent changes to the body height
                                                allowBodyStretch: true,

                                                // be default blockUI will supress tab navigation from leaving blocking content;
                                                constrainTabKey: true,

                                                // fadeOut time in millis; set to 0 to disable fadeout on unblock
                                                fadeOut:  400,

                                                // suppresses the use of overlay styles on FF/Linux (due to significant performance issues with opacity)
                                                applyPlatformOpacityRules: true
                                                };


                                                $.blockUI({ message: $('#'+divItem), css: {  cursor: 'pointer'}});
    //--------------------------------------------------------------------------
}

jQuery.fn.showshader_485 = function(divItem) {
                                                //Screen Berechnung mitte
                                                var formWidthPX = $('#'+divItem).css("width");
                                                var formHeightPX = $('#'+divItem).css("height");
                                                var formWidth = formWidthPX.split('p');
                                                var formHeight = formHeightPX.split('p');
                                                
                                                var element = $(divItem) //.attr('id')

                                             //   var fhoehe = ((Fensterhoehe()/2)-(formHeight[0]/2));
                                             //   var fweite = ((Fensterweite()/2)-(formWidth[0]/2));

                                                var fhoehe = ((Fensterhoehe()/2)-(325/2));
                                                var fweite = ((Fensterweite()/2)-(485/2));

                                                $.blockUI.defaults = {
                                                // styles for the message when blocking; if you wish to disable
                                                // these and use an external stylesheet then do this in your code:
                                                // $.blockUI.defaults.css = {};
                                                css: {
                                                padding:        0,
                                                margin:         0,
                                                height:         '325px',
                                                width:          '485px',
                                                top:            fhoehe,
                                                left:           fweite,
                                                textAlign:      'center',
                                                color:          '#000',
                                                border:         '0px solid #aaa',
                                                backgroundColor:'',
                                                cursor:         'default'
                                                },

                                                // styles for the overlay
                                                overlayCSS:  {
                                                backgroundColor:'#000',  
                                                opacity:        '0.5'
                                                },

                                                // z-index for the blocking overlay
                                                baseZ: 1000,

                                                // set these to true to have the message automatically centered
                                                centerX: true, // <-- only effects element blocking (page block controlled via css above)
                                                centerY: true,

                                                // allow body element to be stetched in ie6; this makes blocking look better
                                                // on "short" pages.  disable if you wish to prevent changes to the body height
                                                allowBodyStretch: true,

                                                // be default blockUI will supress tab navigation from leaving blocking content;
                                                constrainTabKey: true,

                                                // fadeOut time in millis; set to 0 to disable fadeout on unblock
                                                fadeOut:  400,

                                                // suppresses the use of overlay styles on FF/Linux (due to significant performance issues with opacity)
                                                applyPlatformOpacityRules: true
                                                };


                                                $.blockUI({ message: $('#'+divItem), css: {  cursor: 'pointer'}});
    //--------------------------------------------------------------------------
}

jQuery.fn.showshader_shop_main = function(divItem) {
                                                //Screen Berechnung mitte
                                                var formWidthPX = $('#'+divItem).css("width");
                                                var formHeightPX = $('#'+divItem).css("height");
                                                var formWidth = formWidthPX.split('p');
                                                var formHeight = formHeightPX.split('p');

                                                var element = $(divItem) //.attr('id')

                                               // var fhoehe = ((Fensterhoehe()/2)-(formHeight[0]/2));
                                               // var fweite = ((Fensterweite()/2)-(formWidth[0]/2));

                                                var fhoehe = ((Fensterhoehe()/2)-(600/2));
                                                var fweite = ((Fensterweite()/2)-(704/2));

                                                $.blockUI.defaults = {
                                                // styles for the message when blocking; if you wish to disable
                                                // these and use an external stylesheet then do this in your code:
                                                // $.blockUI.defaults.css = {};
                                                css: {
                                                padding:        0,
                                                margin:         0,
                                                height:         'auto',
                                                width:          'auto',
                                                top:            '100px',
                                                left:           fweite,
                                                textAlign:      'center',
                                                color:          '#000',
                                                border:         '0px solid #aaa',
                                                backgroundColor:'#fff',
                                                cursor:         'default',
                                                position:       'absolute'

                                                },

                                                // styles for the overlay
                                                overlayCSS:  {
                                                backgroundColor:'#000',
                                                opacity:        '0.5'
                                                },

                                                // z-index for the blocking overlay
                                                baseZ: 1000,

                                                // set these to true to have the message automatically centered
                                                centerX: true, // <-- only effects element blocking (page block controlled via css above)
                                                centerY: true,

                                                // allow body element to be stetched in ie6; this makes blocking look better
                                                // on "short" pages.  disable if you wish to prevent changes to the body height
                                                allowBodyStretch: true,

                                                // be default blockUI will supress tab navigation from leaving blocking content;
                                                constrainTabKey: true,

                                                // fadeOut time in millis; set to 0 to disable fadeout on unblock
                                                fadeOut:  400,

                                                // suppresses the use of overlay styles on FF/Linux (due to significant performance issues with opacity)
                                                applyPlatformOpacityRules: true
                                            };


                                                $.blockUI({ message: $('#'+divItem), css: {  cursor: 'pointer'}});
    //--------------------------------------------------------------------------
}

jQuery.fn.showshader_shop_reload = function(divItem) {

                                                var element = $(divItem) //.attr('id')
                                          
                                             //   var fhoehe = ((Fensterhoehe()/2)-(formHeight[0]/2));
                                             //   var fweite = ((Fensterweite()/2)-(formWidth[0]/2));

                                                var fhoehe = ((Fensterhoehe()/2)-(600/2));
                                                var fweite = ((Fensterweite()/2)-(704/2));

                                                $('#'+divItem).block({
                                                    message: '<div style="height:100px:width:100px;"><img src="fileadmin/templates/img/ajax-loader.gif" /></div>',
                                                    css: {
                                                        border: '0px solid #a00',
                                                        background: 'transparent'
                                                    },
                                                    overlayCSS:  {
                                                        backgroundColor:'#fff',
                                                        opacity:        '0.5'
                                                    }
                                                });

  //--------------------------------------------------------------------------
}

jQuery.fn.showshader_shop_terms = function(divItem) {

                                                var element = $(divItem) //.attr('id')

                                             //   var fhoehe = ((Fensterhoehe()/2)-(formHeight[0]/2));
                                             //   var fweite = ((Fensterweite()/2)-(formWidth[0]/2));

                                                var fhoehe = ((Fensterhoehe()/2)-(200/2));
                                                var fweite = ((Fensterweite()/2)-(304/2));

                                                $('#'+divItem).block({
                                                    message: $('#shopshader_noTerms'), css: {  cursor: 'pointer'}
                                                });

                                                //$.blockUI({ message: $('#'+divItem), css: {  cursor: 'pointer'}});
    //--------------------------------------------------------------------------
}

jQuery.fn.showshader_shop_putincart = function(divItem) {
                                             
                                                var fhoehe = ((Fensterhoehe()/2)-(200/2));
                                                var fweite = ((Fensterweite()/2)-(304/2));

                                                $.blockUI.defaults = {
                                                // styles for the message when blocking; if you wish to disable
                                                // these and use an external stylesheet then do this in your code:
                                                // $.blockUI.defaults.css = {};
                                                css: {
                                                padding:        0,
                                                margin:         0,
                                                height:         '200px',
                                                width:          '304px',
                                                top:            fhoehe,
                                                left:           fweite,
                                                textAlign:      'center',
                                                color:          '#000',
                                                border:         '0px solid #aaa',
                                                backgroundColor:'#fff',
                                                cursor:         'default'
                                                },

                                                // styles for the overlay
                                                overlayCSS:  {
                                                backgroundColor:'#000',
                                                opacity:        '0.5'
                                                },

                                                // z-index for the blocking overlay
                                                baseZ: 1000,

                                                // set these to true to have the message automatically centered
                                                centerX: true, // <-- only effects element blocking (page block controlled via css above)
                                                centerY: true,

                                                // allow body element to be stetched in ie6; this makes blocking look better
                                                // on "short" pages.  disable if you wish to prevent changes to the body height
                                                allowBodyStretch: true,

                                                // be default blockUI will supress tab navigation from leaving blocking content;
                                                constrainTabKey: true,

                                                // fadeOut time in millis; set to 0 to disable fadeout on unblock
                                                fadeOut:  400,

                                                // suppresses the use of overlay styles on FF/Linux (due to significant performance issues with opacity)
                                                applyPlatformOpacityRules: true
                                                };


                                                $.blockUI({ message: $('#'+divItem), css: {  cursor: 'pointer'}});
    //--------------------------------------------------------------------------
}

jQuery.fn.showsem = function() {

                                                //Screen Berechnung mitte
                                                var eleTop =  ($(window).height() - this.height() ) / 2+$(window).scrollTop();
                                                var eleLeft = (( $(window).width() - this.width() ) / 2+($(window).scrollLeft()));
                                                if($.browser.msie){
                                                    eleLeft = (( $(window).width() - this.width() ) / 2+($(window).scrollLeft()));
                                                }
                                                var element = $(this);
                                                var eleHeight = this.height() + 'px';
                                                var eleWidth = this.width() + 'px';
                                                $.blockUI.defaults = {
                                                // styles for the message when blocking; if you wish to disable
                                                // these and use an external stylesheet then do this in your code:
                                                // $.blockUI.defaults.css = {};
                                                css: {
                                                padding:        0,
                                                margin:         0,
                                                height:         eleHeight,
                                                width:          eleWidth,
                                                top:            eleTop,
                                                left:           eleLeft,
                                                textAlign:      'center',
                                                color:          '#000',
                                                border:         '0px solid #aaa',
                                                backgroundColor:'',
                                                cursor:         'default',
                                                position:       'absolute'
                                                },

                                                // styles for the overlay
                                                overlayCSS:  {
                                                backgroundColor:'#000',
                                                opacity:        '0.5'
                                                },

                                                // z-index for the blocking overlay
                                                baseZ: 1000,

                                                // set these to true to have the message automatically centered
                                                centerX: true, // <-- only effects element blocking (page block controlled via css above)
                                                centerY: true,

                                                // allow body element to be stetched in ie6; this makes blocking look better
                                                // on "short" pages.  disable if you wish to prevent changes to the body height
                                                allowBodyStretch: true,

                                                // be default blockUI will supress tab navigation from leaving blocking content;
                                                constrainTabKey: true,

                                                // fadeOut time in millis; set to 0 to disable fadeout on unblock
                                                fadeOut:  400,

                                                // suppresses the use of overlay styles on FF/Linux (due to significant performance issues with opacity)
                                                applyPlatformOpacityRules: true
                                                };


                                                $.blockUI({ message: $(element), css: {  cursor: 'pointer'}});
    //--------------------------------------------------------------------------
}

jQuery.fn.showshader_register_main = function(divItem) {
                                                //Screen Berechnung mitte
                                                var formWidthPX = $('#'+divItem).css("width");
                                                var formHeightPX = $('#'+divItem).css("height");
                                                var formWidth = formWidthPX.split('p');
                                                var formHeight = formHeightPX.split('p');

                                                var element = $(divItem) //.attr('id')

                                               // var fhoehe = ((Fensterhoehe()/2)-(formHeight[0]/2));
                                               // var fweite = ((Fensterweite()/2)-(formWidth[0]/2));

                                                var fhoehe = ((Fensterhoehe()/2)-(520/2));
                                                var fweite = ((Fensterweite()/2)-(780/2));

                                                $.blockUI.defaults = {
                                                // styles for the message when blocking; if you wish to disable
                                                // these and use an external stylesheet then do this in your code:
                                                // $.blockUI.defaults.css = {};
                                                css: {
                                                padding:        0,
                                                margin:         0,
                                                height:         'auto',
                                                width:          'auto',
                                                top:            '100px',
                                                left:           fweite,
                                                textAlign:      'left',
                                                color:          '#000',
                                                border:         '0px solid #aaa',
                                                backgroundColor:'#fff',
                                                cursor:         'default',
                                                position:       'absolute'

                                                },

                                                // styles for the overlay
                                                overlayCSS:  {
                                                backgroundColor:'#000',
                                                opacity:        '0.5'
                                                },

                                                // z-index for the blocking overlay
                                                baseZ: 1000,

                                                // set these to true to have the message automatically centered
                                                centerX: true, // <-- only effects element blocking (page block controlled via css above)
                                                centerY: true,

                                                // allow body element to be stetched in ie6; this makes blocking look better
                                                // on "short" pages.  disable if you wish to prevent changes to the body height
                                                allowBodyStretch: true,

                                                // be default blockUI will supress tab navigation from leaving blocking content;
                                                constrainTabKey: true,

                                                // fadeOut time in millis; set to 0 to disable fadeout on unblock
                                                fadeOut:  400,

                                                // suppresses the use of overlay styles on FF/Linux (due to significant performance issues with opacity)
                                                applyPlatformOpacityRules: true
                                            };


                                                $.blockUI({ message: $('#'+divItem), css: {  cursor: 'pointer'}});
    //--------------------------------------------------------------------------
}
jQuery.fn.showshader_intro = function(divItem) {
                                                //Screen Berechnung mitte
                                                var formWidthPX = $('#'+divItem).css("width");
                                                var formHeightPX = $('#'+divItem).css("height");
                                                var formWidth = formWidthPX.split('p');
                                                var formHeight = formHeightPX.split('p');

                                                var element = $(divItem) //.attr('id')

                                               // var fhoehe = ((Fensterhoehe()/2)-(formHeight[0]/2));
                                               // var fweite = ((Fensterweite()/2)-(formWidth[0]/2));

                                                var fhoehe = ((Fensterhoehe()/2)-(548/2));
                                                var fweite = ((Fensterweite()/2)-(972/2));

                                                $.blockUI.defaults = {
                                                // styles for the message when blocking; if you wish to disable
                                                // these and use an external stylesheet then do this in your code:
                                                // $.blockUI.defaults.css = {};
                                                css: {
                                                padding:        0,
                                                margin:         0,
                                                height:         'auto',
                                                width:          'auto',
                                                top:            '100px',
                                                left:           fweite,
                                                textAlign:      'center',
                                                color:          '#000',
                                                border:         '0px solid #aaa',
                                                backgroundColor:'#fff',
                                                cursor:         'default',
                                                position:       'absolute'

                                                },

                                                // styles for the overlay
                                                overlayCSS:  {
                                                backgroundColor:'#000',
                                                opacity:        '0.5'
                                                },

                                                // z-index for the blocking overlay
                                                baseZ: 1000,

                                                // set these to true to have the message automatically centered
                                                centerX: true, // <-- only effects element blocking (page block controlled via css above)
                                                centerY: true,

                                                // allow body element to be stetched in ie6; this makes blocking look better
                                                // on "short" pages.  disable if you wish to prevent changes to the body height
                                                allowBodyStretch: true,

                                                // be default blockUI will supress tab navigation from leaving blocking content;
                                                constrainTabKey: true,

                                                // fadeOut time in millis; set to 0 to disable fadeout on unblock
                                                fadeOut:  400,

                                                // suppresses the use of overlay styles on FF/Linux (due to significant performance issues with opacity)
                                                applyPlatformOpacityRules: true
                                            };


                                                $.blockUI({ message: $('#'+divItem), css: {  cursor: 'pointer'}});
    //--------------------------------------------------------------------------
}