
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function convertAmount(feld) {
	
    eingabe = String(document.forms[0].elements[feld].value);
    if(eingabe.indexOf(',') != -1) {
        eingabe = eingabe.replace(',','.');
    } else {
        if(eingabe.indexOf('.') == -1) {
            eingabe = eingabe+'.00';
        }
    }
    
    document.forms[0].elements[feld].value = eingabe;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function addToCart(artikel)
{
	window.location.href = "index.php?action=addToCart&artikel=" + artikel;
}

///////////////////////////////////////////////////////////////////////////////////////////

function deleteArtikel(id,name)
{
	Check = confirm("Soll der Artikel \""+ name +"\" wirklich unwiderruflich gelöscht werden ?");
	if(Check == true) location.href = "artikel.php?action=deleteArtikelDB&id=" + id;
} 

////////////
function deleteAngebot(id,name,url)
{
	Check = confirm("Soll das \"Angebot "+ name +"\" wirklich unwiderruflich gelöscht werden?");
	if(Check == true) location.href = "index.php?action=deleteAngebotDB&id=" + id + "&returnto=" + url;
} 

////////////
function updateCartAngebot(url)
{
	Check = confirm("In Ihrem Einkaufwagen befinden sich bereits Artikel.\n\nMöchten Sie den bisherigen Einkaufswagen löschen? Dann klicken Sie auf OK.\n\nBei Klick auf ABBRECHEN bleibt der Inhalt des Einkaufswagen erhalten.");
	if(Check == true) {
    	location.href = "konfigurator.php?" + url + "&deleteCart=1";
	} else {
    	location.href = "konfigurator.php?" + url;
    }
} 

///////////////////////////////////////////////////////////////////////////////////////////

function showPics(id,nr)
{
	link="/bilder.php?id=" + id + "&nr=" + nr;
	
    var hoehe = 390;
    var breite= 410;
    
	scrollbars="no";
	resizable="no";
	
    hoehe = parseInt(hoehe)+50;						
	var winH = (screen.width - breite) / 2;
	var winV = (screen.height - hoehe) / 2;
	fenster = 'height='+hoehe+',width='+breite+',top='+winV+',left='+winH+',scrollbars='+scroll+',resizable='+resizable;
      			
   	honk = window.open(link, "weiterebilder", fenster);
   	honk.focus();
}

///////////////////////////////////////////////////////////////////////////////////////////

function showContentPopup(url)
{
	if(url.indexOf('?') == -1) {
		url_link=url+"?popup=1";
    } else {
    	url_link=url+"&popup=1";
    }
	
    url_link = url_link;
    
    var hoehe = 450;
    var breite= 600;
    
	scrollbars="yes";
	resizable="yes";
	
    hoehe = parseInt(hoehe)+50;						
	var winH = (screen.width - breite) / 2;
	var winV = (screen.height - hoehe) / 2;
	fenster = 'height='+hoehe+',width='+breite+',top='+winV+',left='+winH+',scrollbars='+scrollbars+',resizable='+resizable;
      			
   	honk = window.open(url_link, "content", fenster);
   	honk.focus();
}

///////////////////////////////////////////////////////////////////////////////////////////

function weitereBilder(id,nr)
{
	link="/bilder.php?id=" + id + "&nr=" + nr;
	
    var hoehe = 390;
    var breite= 410;
    
	scrollbars="no";
	resizable="no";
	
    hoehe = parseInt(hoehe)+50;						
	var winH = (screen.width - breite) / 2;
	var winV = (screen.height - hoehe) / 2;
	fenster = 'height='+hoehe+',width='+breite+',top='+winV+',left='+winH+',scrollbars='+scroll+',resizable='+resizable;
      			
   	honk = window.open(link, "weiterebilder", fenster);
   	honk.focus();
}

///////////////////////////////////////////////////////////////////////////////////////////

function showPic(bild,breite,hoehe)
{
	link="/show_pic.php?bild=" + bild + "&w=" + breite + "&h=" + hoehe;
	
    scrollbars="no";
	resizable="no";
							
	var winH = (screen.width - breite) / 2;
	var winV = (screen.height - hoehe) / 2;
	fenster = 'height='+hoehe+',width='+breite+',top='+winV+',left='+winH+',scrollbars='+scroll+',resizable='+resizable;
      			
   	honk = window.open(link, "detailbild", fenster);
   	honk.focus();
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function showBsp(id,nr)
{
	link="bild.php?artikel=" + id + "&beispiel=" + nr;
	
    var hoehe = 370;
    var breite= 390;
    
	scrollbars="no";
	resizable="no";
	
    hoehe = parseInt(hoehe)+50;						
	var winH = (screen.width - breite) / 2;
	var winV = (screen.height - hoehe) / 2;
	fenster = 'height='+hoehe+',width='+breite+',top='+winV+',left='+winH+',scrollbars='+scroll+',resizable='+resizable;
      			
   	honk = window.open(link, "honk", fenster);
   	honk.focus();
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function showPlanGal(id,nr)
{
	link="bild_planungshilfen.php?artikel=" + id + "&beispiel=" + nr;
	
    var hoehe = 370;
    var breite= 390;
    
	scrollbars="no";
	resizable="no";
	
    hoehe = parseInt(hoehe)+50;						
	var winH = (screen.width - breite) / 2;
	var winV = (screen.height - hoehe) / 2;
	fenster = 'height='+hoehe+',width='+breite+',top='+winV+',left='+winH+',scrollbars='+scroll+',resizable='+resizable;
      			
   	honk = window.open(link, "honk", fenster);
   	honk.focus();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function chooseBelgium()
{
	link="belgium.php";
	
    var breite= 300;
    var hoehe = 150;
    
	scrollbars="no";
	resizable="no";
	
    hoehe = parseInt(hoehe)+50;						
	var winH = (screen.width - breite) / 2;
	var winV = (screen.height - hoehe) / 2;
	fenster = 'height='+hoehe+',width='+breite+',top='+winV+',left='+winH+',scrollbars='+scroll+',resizable='+resizable;
      			
   	honk = window.open(link, "belgium", fenster);
   	honk.focus();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


