function autoJS_booksys_price_input() {
    $$('.autoJS_booksys_price_input').each(function(e) {
        var price = e.value;

        if (price != '') {
            var info = price_priceToString(price);

            var div = new Element('div', {'class': 'overlay link'}).update(info);
            //div.absolutize();
            //div.clonePosition(e);
            div.observe('click',
                function(event){
                    event.element().previous().show();
                    event.element().remove();
                });

            e.hide();
            e.up().appendChild(div);
        }
    });
}

function autoJS_booksys_price() {
    $$('.autoJS_booksys_price').each(function(e) {
        var price = e.innerHTML;

        if (price != '') {
            e.update(price_priceToString(price));
        }
    });
}

function price_priceToString(price) {
    var info = '';
    if (price.search(';') != -1) {
        price = price.split(';');

        if (price[0] == '7offer') {
            info = 'Woche: '+price[2]+'€; 2 Wochen: '+price[3]+'€; Verlängerung: '+price[1]+'€';
        }

        if (price[0] == 'add') {
            info = price[1]+'€ pro Nacht + '+price[2]+'€';
        }

        if (price[0] == 'addSpec') {
            info = price[1]+'€ für '+price[2]+' Nacht; Verlängerung: '+price[3]+'€';
        }
    }
    else {
        info = price+'€';
    }

    return info;
}
