function loadPrize(ID,valueID,surfaceID)
	{
	var xmlHttp = null;
	var bla=0;
	// Mozilla, Opera, Safari sowie Internet Explorer 7
	if (typeof XMLHttpRequest != 'undefined'){xmlHttp = new XMLHttpRequest();}
	if (!xmlHttp) 	   {
       // Internet Explorer 6 und älter
       try {xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");}
	    catch(e) {
		 try {xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");}
		  catch(e) {xmlHttp  = null;}}}
if (xmlHttp) {
	var preis = "";
    xmlHttp.open('GET', 'loadprize.php?ID='+ID+'&valueID='+document.form1.size.options[document.form1.size.selectedIndex].value+'&surfaceID='+surfaceID, true);
    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4) {

		   	document.getElementById('divpreis').innerHTML = xmlHttp.responseText+" €*";}};
    xmlHttp.send(null);}
}
	
function getImg(ID,imgID)
	{
	var xmlHttp = null;
	var bla=0;
	// Mozilla, Opera, Safari sowie Internet Explorer 7
	if (typeof XMLHttpRequest != 'undefined'){xmlHttp = new XMLHttpRequest();}
	if (!xmlHttp) 	   {
       // Internet Explorer 6 und älter
       try {xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");}
	    catch(e) {
		 try {xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");}
		  catch(e) {xmlHttp  = null;}}}
if (xmlHttp) {
	var preis = "";
    xmlHttp.open('GET', 'getimage.php?ID='+ID+'&imgID='+imgID, true);
    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4) {
		   	document.getElementById('productpic').src = xmlHttp.responseText;}};
    xmlHttp.send(null);}
}

function getSeries(ID)
	{

	if(document.form1.hersteller.value == "") {
	var oldlength = document.form1.serien.length;
			for(k=0;k<oldlength;k++)
				{
				document.form1.serien.options[0] = null;
				}
	return;
	}
	var xmlHttp = null;
	var bla=0;
	// Mozilla, Opera, Safari sowie Internet Explorer 7
	if (typeof XMLHttpRequest != 'undefined'){xmlHttp = new XMLHttpRequest();}
	if (!xmlHttp) 	   {
       // Internet Explorer 6 und älter
       try {xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");}
	    catch(e) {
		 try {xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");}
		  catch(e) {xmlHttp  = null;}}}
if (xmlHttp) {
	var preis = "";
	var result = "";
    xmlHttp.open('GET', 'getseries.php?ID='+ID, true);
    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4) {
			var oldlength = document.form1.serien.length;
			for(i=0;i<oldlength;i++)
				document.form1.serien.options[0] = null;

		   	result = xmlHttp.responseText;
			series = new Array();
			series = result.split('\n');
			if(series.length > 0)
				{
				count = series.length;
				for(i=0; i<count; i++)
					document.form1.serien.options[i] = new Option(series[i],'i');
				}}};
    xmlHttp.send(null);}
}

function getSurfaces(ID,valueID)
	{
	var xmlHttp = null;
	var bla=0;
	// Mozilla, Opera, Safari sowie Internet Explorer 7
	if (typeof XMLHttpRequest != 'undefined'){xmlHttp = new XMLHttpRequest();}
	if (!xmlHttp) 	   {
       // Internet Explorer 6 und älter
       try {xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");}
	    catch(e) {
		 try {xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");}
		  catch(e) {xmlHttp  = null;}}}
if (xmlHttp) {
	var preis = "";
	var result = "";
    xmlHttp.open('GET', 'getsurfaces.php?ID='+ID+'&valueID='+valueID, true);
    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4) {
			var oldlength = document.form1.surface.length;
			for(i=0;i<oldlength;i++)
				document.form1.surface.options[0] = null;

		   	result = xmlHttp.responseText;
			surfaces = new Array();
			surfaces = result.split(';');
			k=0;
			if(surfaces.length > 0)
				{
				count = surfaces.length;
				for(i=0; i<count; i+=2)
				{
					document.form1.surface.options[k] = new Option(surfaces[i],surfaces[i+1]);
					k++;
				}
				}}};
    xmlHttp.send(null);}
}

function swapImg(img)
	{
	document.getElementById('productpic').src = 'images/'+img+'_big.jpg';
		
	var x = img.split(/\s+/g);
  for(var i = 0; i < x.length; i++)
  	{
    var parts = x[i].match(/(\w)(\w*)/);
    x[i] = parts[1].toUpperCase() + parts[2].toLowerCase();
		}
	document.getElementById('color_name').innerHTML = 'Farbe: '+x.join(' ');
	}
