function shop_ajax(url,pars,target, callback) {
    var myAjax = new Ajax.Updater( target,
    url,
    {
    method: 'get',
    asynchronous: true,
    parameters: pars,
    onComplete: callback,
    evalScripts: false
    });
    
}

        function tauschen(name){
            if (document.getElementById(name).style.display == "none"){
                document.getElementById(name).style.display = "block";
                return;
                }
            if (document.getElementById(name).style.display == "block"){
            	document.getElementById(name).style.display = "none";
                return;
            }
        }
        function verstecken(name){
            document.getElementById(name).style.display = "none";
            return;
         }
        function zeigen(name){
            document.getElementById(name).style.display = "block";
            return;
         }
      


        function produkt_name ( artikel ) {

            var feld = document.getElementById(artikel);

            if ( feld.nodeName == 'INPUT' && feld.name != '' )
                return '- ' + feld.name;
            else if ( feld.nodeName == 'SELECT' )
                return '- ' + feld.options[feld.selectedIndex].text.substring(0,feld.options[feld.selectedIndex].text.lastIndexOf('-') - 1 );
            else return '';

        }


function show_wkhinweis ( meldung ) {
//     document.getElementById ( 'warenkorbmeldung' ).innerHTML = meldung;
//     $( '#warenkorbmeldung' ).slideToggle(0);
//     window.setTimeout ( 'hide_wkhinweis()' , 5000 );
    

}
function hide_wkhinweis (  ) {
//     $( '#warenkorbmeldung' ).slideToggle(0);
}
        

/*
	Oeffnet ein PopUp-Fenster
*/

function popUpPicture ( picUrl, picWidth, picHeight) {
	
	picWidth  = picWidth * 1.1;
	picHeight = picHeight * 1.1;
	
	popUpWindow = window.open ( picUrl, "niessingShopPopUp", "width=" + picWidth + ",height=" + picHeight + ",left=10,top=0,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes");	
	popUpWindow.focus ();
}


/*
	tauscht ein Bild
	action = 0 Dateiname = xxx_off.?
	action = 1 Dateiname = xxx_on.?
*/
function imgChange ( objImg, action) {

	try {
		// Dateinanem des Bildes an . splitten, das letzte Elem. im Array enthaelt die Dateiendung
		arrNameParts = objImg.src.split('.');
		
		// Dateinamen bis auf Endung wieder zusammen bauen
		imgName = '';
		for ( i = 0; i < (arrNameParts.length - 1); i++) {
			
			if ( i != 0) {
				punkt = '.';
			} else {
				punkt = ''
			}
			
			imgName += punkt + arrNameParts[i];
		}
		
		// das letzte Element des Arrays enthaelt die Dateiendung
		imgExt = '.' + arrNameParts[arrNameParts.length - 1];
		
		// _on / _off am Ende des Dateinamens loeschen
		imgName = imgName.replace ( /_off/, '');
		imgName = imgName.replace ( /_on/, '');
		
		// Je nach action _on oder _off an den Dateinamen haengen
		if ( action == 0) {
			imgName += '_off';
		} else {
			imgName += '_on';
		}
		
		// die Dateiendung wieder anhaengen
		imgName += imgExt;
		
		objImg.src = imgName;
	} catch (e) {
		;
	}
}
