// JavaScript Document

// JavaScript Document
function setRequestW(value) {
	if(value == 1){
		var size 	=  document.getElementById('sizeForm').options[document.getElementById('sizeForm').selectedIndex].value;
		var anzahl 	=  document.getElementById('anzahlForm').options[document.getElementById('anzahlForm').selectedIndex].value;
		var farbe 	=  document.getElementById('farbeForm').options[document.getElementById('farbeForm').selectedIndex].value;
		var pid		=  document.getElementById('pidForm').value;
		var name		=  document.getElementById('headlineForm').value;
		var preis		=  document.getElementById('preisForm').value;
		var userid		=  document.getElementById('useridForm').value;
		var catid		=  document.getElementById('catidForm').value;
		var scatid		=  document.getElementById('scatidForm').value;
		var produktnr	=  document.getElementById('produktNrForm').value;
		
		jQuery.ajax({
			url: '/includes/incard.php',
			type: 'post',
			dataType: 'json',
			data: {
				getCard: 0,
				userid: userid,
				pid: pid,
				name: name,
				farbe: farbe,
				size: size,
				anzahl: anzahl,
				preis: preis,
				catid: catid,
				scatid: scatid,
				produktnr: produktnr
			},
			success: function(data, textstatus, xmlhttprequest) {
				document.getElementById('warenkorbAusgabe').innerHTML 		= data.arr[0];
			}
		});
	}
	if(value == 3){
		var size 	=  ''/*document.getElementById('sizeForm').options[document.getElementById('sizeForm').selectedIndex].value;*/
		var anzahl 	=  document.getElementById('anzahlForm').options[document.getElementById('anzahlForm').selectedIndex].value;
		var farbe 	=  ''/*document.getElementById('farbeForm').options[document.getElementById('farbeForm').selectedIndex].value;*/
		var pid		=  document.getElementById('pidForm').value;
		var name		=  document.getElementById('headlineForm').value;
		var preis		=  document.getElementById('preisForm').value;
		var userid		=  document.getElementById('useridForm').value;
		var catid		=  document.getElementById('catidForm').value;
		var scatid		=  document.getElementById('scatidForm').value;
		var produktnr	=  document.getElementById('produktNrForm').value;
		
		jQuery.ajax({
			url: '/includes/incard.php',
			type: 'post',
			dataType: 'json',
			data: {
				getCard: 0,
				userid: userid,
				pid: pid,
				name: name,
				farbe: farbe,
				size: size,
				anzahl: anzahl,
				preis: preis,
				catid: catid,
				scatid: scatid,
				produktnr: produktnr
			},
			success: function(data, textstatus, xmlhttprequest) {
				document.getElementById('warenkorbAusgabe').innerHTML 		= data.arr[0];
			}
		});
	}
	if(value == 2){
		
		jQuery.ajax({
			url: '/includes/incard.php',
			type: 'post',
			dataType: 'json',
			data: {
				getCard: 1
			},
			success: function(data, textstatus, xmlhttprequest) {
				
				document.getElementById('warenkorbAusgabe').innerHTML 		= data.arr[0];
			}
		});
	}
	
}


function resetCard(val1, val2) {
	
	jQuery.ajax({
		url: '/includes/incard.php',
		type: 'post',
		dataType: 'json',
		data: {
			getCard: 		3,
			orderpos_id:	val2,
			anzahl: 		val1.value
			
			
		},
		success: function(data, textstatus, xmlhttprequest) {
			document.getElementById('warenkorbAusgabe').innerHTML 		= data.arr[0];
			window.location.reload();
		}
	});
}




