var imgSrc = new Array( "stof_blauw","stof_bordeaux","stof_donkerblauw","stof_grijs","stof_lichtblauw","stof_oranje","stof_rood","stof_zwart","kunstleder_baltic_blauw","kunstleder_chianti_rood","kunstleder_kobalt_blauw","kunstleder_olijf_groen","kunstleder_rood","kunstleder_sisal","kunstleder_terra_cotta","kunstleder_zand"); var text = new Array( new Array("Stof","Blauw","0"),new Array("Stof","Bordeaux","0"),new Array("Stof","Donkerblauw","0"),new Array("Stof","Grijs","0"),new Array("Stof","Lichtblauw","0"),new Array("Stof","Oranje","0"),new Array("Stof","Rood","0"),new Array("Stof","Zwart","0"),new Array("Kunstleder","Baltic blauw","20"),new Array("Kunstleder","Chianti rood","20"),new Array("Kunstleder","Kobalt blauw","20"),new Array("Kunstleder","Olijfgroen","20"),new Array("Kunstleder","Rood","20"),new Array("Kunstleder","Sisal","20"),new Array("Kunstleder","Terra cotta","20"),new Array("Kunstleder","Zand","20"));var color = 0; var hoogte = 0; var kruispoot = 0; var wielen = 0; // initiate an xmlhttp socket function createXMLHTTPsocket() { // INIT XMLHTTP SOCKET var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } return xmlhttp; } // functies function loadPage(page) { http.open('GET','/ajax.php?page='+page); http.onreadystatechange = getPageX; http.send(null); } function getPageX() { if ( http.readyState == 4 ) { var xmlDoc = http.responseXML.documentElement; var data = xmlDoc.getElementsByTagName("data")[0].firstChild.nodeValue; // var data = xmlDoc.getElementsByTagName("data")[0].firstChild.nodeValue; document.getElementById("content").innerHTML = data; } } function sessionColor(colorId) { http.open('GET','/ajax.php?color='+colorId); http.send(null); } function checkColor(colorId) { if(color != colorId) { document.getElementById("color"+color).src = "/images/"+imgSrc[color]+".png"; document.getElementById("color"+colorId).src = "/images/"+imgSrc[colorId]+"_checked.png"; color = colorId; sessionColor(colorId); } } function writeDetails(field,colorId) { document.getElementById("data"+field).innerHTML = "
Bekleding: "+text[colorId][0]+"
Kleur: "+text[colorId][1]+"
"; } function deleteDetails(field) { document.getElementById("data"+field).innerHTML = ""; } function overColor(colorId) { if(color != colorId) { document.getElementById("color"+colorId).src = "/images/"+imgSrc[colorId]+"_checked.png"; if(colorId < 8) { deleteDetails(1); writeDetails(0,colorId); } else { deleteDetails(0); writeDetails(1,colorId); } } } function outColor(colorId) { if(color != colorId) { document.getElementById("color"+colorId).src = "/images/"+imgSrc[colorId]+".png"; if(color < 8) { deleteDetails(1); writeDetails(0,color); } else { deleteDetails(0); writeDetails(1,color); } } } function checkKruispoot(kruispootId) { if(kruispoot != kruispootId) { document.getElementById("check"+kruispoot).src = "/images/unchecked.gif"; document.getElementById("check"+kruispootId).src = "/images/checked.gif"; kruispoot = kruispootId; sessionKruispoot(kruispootId); } } function sessionKruispoot(kruispootId) { http.open('GET','/ajax.php?kruispoot='+kruispootId); http.send(null); } function checkWielen(wielenId) { if(wielen != wielenId) { document.getElementById("check"+wielen).src = "/images/unchecked.gif"; document.getElementById("check"+wielenId).src = "/images/checked.gif"; wielen = wielenId; sessionWielen(wielenId); } } function sessionWielen(wielenId) { http.open('GET','/ajax.php?wielen='+wielenId); http.send(null); } function checkHoogte(hoogteId) { if(hoogte != hoogteId) { document.getElementById("check"+hoogte).src = "/images/unchecked.gif"; document.getElementById("check"+hoogteId).src = "/images/checked.gif"; hoogte = hoogteId; sessionHoogte(hoogteId); } } function sessionHoogte(hoogteId) { http.open('GET','/ajax.php?hoogte='+hoogteId); http.send(null); } var http = createXMLHTTPsocket();