/**
 * Projekt:	Pension-Am-Hauptbahnhof
 *
 * Create:	15.06.2009
 * Copyright 2009 by Kirchnerei
 *			http://www.kirchnerei.de
 *			mailto:infos@kirchnerei.de
 *
 * Veröffentlichung:
 * Version:	1.1 (Build: 19)
 * Datum:	30.01.2012
 * Vendor:	Kirchnerei
 *
 * Subversion:
 * Author:	$LastChangedBy: sarah $
 * Date:	$LastChangedDate: 2009-06-24 12:22:25 +0200 (Wed, 24 Jun 2009) $
 * Version:	$LastChangedRevision: 308 $
 */


var BACKGROUND_COLOR = '#444444';
var DIALOG_BACKGROUND = '#F9F3E3';
var WAIT_MESSAGE = '<h1 class="waiting"><img src="assets/busy.gif" alt="Warten"/> <span>Bitte warten</span></h1>';

/**
 * doShowWaitung() blockiert die Anwendung wegen Wartezeit
 */
function doShowWaiting() {
	$.blockUI({
		message: WAIT_MESSAGE,
		css: {
			border: '3px solid #999999',
			backgroundColor: DIALOG_BACKGROUND
		},
		overlayCSS: {
			backgroundColor: BACKGROUND_COLOR,
			opacity: 0.7
		},
		fadeIn: 400,
		fadeOut: 100
	});	// end if blockUI
}

function doBlockElement(id) {
	$(id).block({
		message: WAIT_MESSAGE,
		css: {
			border: '3px solid #999999',
			backgroundColor: DIALOG_BACKGROUND
		},
		overlayCSS: {
			backgroundColor: BACKGROUND_COLOR,
			opacity: 0.7
		},
		fadeIn: 400,
		fadeOut: 100		
	});
}


/**
 * doShowCenterDialog() blockiert die Anwendung mit einem Eingabeformular
 * 
 * @param data ist der Html Code
 */
function doShowCenterDialog(data) {
	$.blockUI({
		message: data,
		css: {
			border: 'none',
			backgroundColor: '',
			width: '100%',
			left: '',
			right: '',
			top: '60px',
			cursor: 'default'
		},
		overlayCSS: {
			backgroundColor: BACKGROUND_COLOR,
			opacity: 0.7
		},
		fadeIn: 400,
		fadeOut: 400
	}); // end of blockUI()
}

 /**
  * doDialogClose() schließt einen modalen Dialog
  */
function doDialogClose() {
	$.unblockUI({fadeOut: 400});
}

function doSendKontakt(link) {
    var n = 0;
    var r = "";
    for( var i = 0; i < link.length; i++)
    {
        n = link.charCodeAt( i );
        if( n >= 8364 )
        {
            n = 128;
        }
        r += String.fromCharCode( n - 1 );
    }
	
    document.location.href = r;
}
