function showmag(product_id,artikel_id)
{ 
  if(window.XMLHttpRequest) xmlhttp = new XMLHttpRequest();
  else if(window.ActiveXObject) xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  xmlhttp.onreadystatechange = 
  function() 
  { 
  if (xmlhttp.readyState==4)
    if (xmlhttp.status==200)
          showmag_show(xmlhttp);
  }
  
  xmlhttp.open('GET','require/showmag.php?product_id='+product_id+'&artikel_id='+artikel_id,true);
  xmlhttp.send(null);
}
function showmag_show(req) 
{  
  var xmlDoc = req.responseXML.documentElement;
  var naam = xmlDoc.getElementsByTagName("naam")[0].firstChild.nodeValue;  
  var afbeelding = xmlDoc.getElementsByTagName("afbeelding")[0].firstChild.nodeValue;
  var tekst = xmlDoc.getElementsByTagName("tekst")[0].firstChild.nodeValue;     
  var regels = '';
  
  var artikelen = xmlDoc.getElementsByTagName("artikel");
  for (var i = 0 ; i < artikelen.length ; i++) 
  {
  	var item = artikelen[i];
  	var naam2 = item.getElementsByTagName("naam")[0].firstChild.nodeValue;                    
  	var aantal = item.getElementsByTagName("aantal")[0].firstChild.nodeValue;    
    regels += '<div style="clear:both;">';    
      regels += '<div style="float:left; width:150px;">'+naam2+'</div>';    
      regels += '<div style="float:left;">'+aantal+'</div>'; 
    regels += '</div>';       
  }     
  
  
  document.getElementById('showmag').style.display = 'block';
  document.getElementById('showmag_naam').innerHTML = naam;
  document.getElementById('showmag_afbeelding').innerHTML = '<img src="afbeeldingen/edities/klein-'+afbeelding+'">';  
  document.getElementById('showmag_tekst').innerHTML = tekst; 
  document.getElementById('showmag_regels').innerHTML = regels;  
}


function showmag2(product_id,artikel_id)
{ 
  if(window.XMLHttpRequest) xmlhttp = new XMLHttpRequest();
  else if(window.ActiveXObject) xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  xmlhttp.onreadystatechange = 
  function() 
  { 
  if (xmlhttp.readyState==4)
    if (xmlhttp.status==200)
          showmag2_show(xmlhttp,product_id);
  }
  
  xmlhttp.open('GET','require/showmag2.php?product_id='+product_id+'&artikel_id='+artikel_id,true);
  xmlhttp.send(null);
}
function showmag2_show(req,product_id) 
{  
  var xmlDoc = req.responseXML.documentElement;
  var naam = xmlDoc.getElementsByTagName("naam")[0].firstChild.nodeValue;  
  var afbeelding = xmlDoc.getElementsByTagName("afbeelding")[0].firstChild.nodeValue;
  var tekst = xmlDoc.getElementsByTagName("tekst")[0].firstChild.nodeValue;     
  var aantal = xmlDoc.getElementsByTagName("aantal")[0].firstChild.nodeValue;  
   
  document.getElementById('showmag').style.display = 'block';
  document.getElementById('showmag_naam').innerHTML = naam;
  document.getElementById('showmag_afbeelding').innerHTML = '<img src="afbeeldingen/edities/klein-'+afbeelding+'">';  
  document.getElementById('showmag_tekst').innerHTML = tekst; 
  document.getElementById('showmag_aantal').innerHTML = 'Met uw BladCadeau ontvangt u '+aantal+'x '+naam;  
  document.forms['selecteren'].elements['productid'].value = product_id;   
}


function showquote()
{ 
  if(window.XMLHttpRequest) xmlhttp = new XMLHttpRequest();
  else if(window.ActiveXObject) xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  xmlhttp.onreadystatechange = 
  function() 
  { 
  if (xmlhttp.readyState==4)
    if (xmlhttp.status==200)
          showquote_show(xmlhttp);
  }
  
  xmlhttp.open('GET','require/showquote.php',true);
  xmlhttp.send(null);
}
function showquote_show(req) 
{  
  var xmlDoc = req.responseXML.documentElement;
  var naam = xmlDoc.getElementsByTagName("naam")[0].firstChild.nodeValue;  
  var plaats = xmlDoc.getElementsByTagName("plaats")[0].firstChild.nodeValue;
  var tekst = xmlDoc.getElementsByTagName("tekst")[0].firstChild.nodeValue;     
   
  document.getElementById('quote_naam').innerHTML = '<b>- '+naam+'</b>, '+plaats;
  document.getElementById('quote_tekst').innerHTML = tekst; 
  setTimeout('showquote()',3000);
}

