function showprice(productid,optionid,price,shippingcost){
    var selectname="select"+productid+optionid;
    var selectvalue = document.getElementById(selectname).value;    
    
    //var d = document.getElementById("DivemailID");
    //var e = document.getElementById("childDiv1"); 
    
    //d.innerHTML += "<div id='childDiv'></div>";
    //if(e!=null){
    //d.removeChild(e);
    //} 
    //End check mail
    var divname="divtotal"+productid+optionid;
    if (selectvalue!=''){
    
            url = 'ajax_viewcart.php';
            param = "productid="+productid+"&quantity="+selectvalue+"&optionid="+optionid+"&price="+price+"&shipping_res="+shippingcost, true;
            myAjax = new Ajax.Updater(divname,url,{method: 'get', parameters: param});
            
            url = 'ajax_totalpricecart.php';
            param = true;
            myAjax = new Ajax.Updater('divsubtotal',url,{method: 'get', parameters: param});
			
			url = 'ajax_totalpricecart_inc_btw.php';
            param = true;
            myAjax = new Ajax.Updater('divbtw',url,{method: 'get', parameters: param});
			
			url = 'ajax_totalpricecart2.php';
            param = true;
			myAjax = new Ajax.Updater('divtotalprice',url,{method: 'get', parameters: param});
    }
  }
  
  var xmlhttp;
  
  function deleteLine(lineid,id)
  {
	var line =document.getElementById("product_line"+lineid);
	line.innerHTML = '';
	sessionUnset(id);
	
	url = 'ajax_totalpricecart.php';
            param = true;
            myAjax = new Ajax.Updater('divsubtotal',url,{method: 'get', parameters: param});
			
			url = 'ajax_totalpricecart_inc_btw.php';
            param = true;
            myAjax = new Ajax.Updater('divbtw',url,{method: 'get', parameters: param});
			
			url = 'ajax_totalpricecart2.php';
            param = true;
			myAjax = new Ajax.Updater('divtotalprice',url,{method: 'get', parameters: param});
  }
  
  function sessionUnset(id)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="sessionvariableremover.php";
url=url+"?id="+id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
{
alert("Product is verwijderd.");
}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

function checkSelect(nr,lang)
	{
		for(k=0;k<nr;k++){
		if(document.getElementById('op'+k).value==''){
		if(lang==2){ 
		alert('Zorg a.u.b. dat alle keuzes zijn geselecteerd.');
		}
		else{alert('Please make sure that all options are selected.');}
		return false;}}
		return true;
		

	}

 

