/*
geminiCMS4_4 - The Tell Projekt: Tell Document Portal
(c)2009 by Frank Reimering Software Systems
*/

/*
onLoad
*/

window.onload = function() {

    initHintBox();
    initjsDOMenu(); // Wichtig !
    loadGoogleMap();
}

function showWarenkorb(a,b)
{
	window.location.href="shop.php?type=cart&cmd=showcart";
}

function startLoading() 
{
}

function stopLoading()
{
}

function showMessage(text)
{
	alert(text);
}

function delBasket() {
    var loc = window.location.href;

    Check = window.confirm('Wollen Sie den Warenkorb wirklich leeren ?');
    if(Check) {
        window.location.href = "shop.php?type=cart&cmd=emptycart";
    }
}
function changeWarenkorbArtikel(wg,aid,said,pos) {

    var line = "said_"+said;
    var anzahl = $F(line);
    var ref = window.location.href;
    
    new Ajax.Request(
        "Core/shop/logic.php",
        {
           parameters: 'asynchronous=false',
           method: 'post',
           postBody: 'type=cart&cmd=edititem&said='+said+'&pos='+pos+'&anzahl='+anzahl,
           onComplete: function(req) {
             //$("debug").innerHTML = req.responseText;
             var flag = req.responseText;
             window.location.href = ref;

           },
           onError: function() {
                alert('Es ein Fehler aufgetreten');
           }
        }
    );
}

function deleteWarenkorbArtikel(wg,aid,said,pos) {
    var ref = window.location.href;

    new Ajax.Request(
        "Core/shop/logic.php",
        {
           parameters: 'asynchronous=false',
           method: 'post',
           postBody: 'type=cart&cmd=edititem&said='+said+'&pos='+pos+'&anzahl=0',
           onComplete: function(req) {
             var flag = req.responseText;
             window.location.href = ref;

           },
           onError: function() {
                alert('Es ein Fehler aufgetreten');
           }
        }
    );
}

