function get_character_data(words,bpw,mux,dp){
	var xmlhttp;
	if (window.XMLHttpRequest){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else if (window.ActiveXObject){
		// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		alert("Your browser does not support XMLHTTP!");
	}
	
	/*
	State	Description
	0	The request is not initialized
	1	The request has been set up
	2	The request has been sent
	3	The request is in process
	4	The request is complete
	*/
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4){
			//alert(xmlhttp.responseText);
			//var resp = eval( "("+xmlhttp.responseText+")" );
			var txt = xmlhttp.responseText;
			var fields = txt.split(",");
			var resp = {
				words:fields[0],
				bpw:fields[1],
				mux:fields[2],
				height:fields[3],
				width:fields[4],
				access:fields[5],
				w_power:fields[6],
				s_power:fields[7]
			};
			
			/*
			alert( "Words = "+resp.words );
			alert( "BPW = "+resp.bpw );
			alert( "MUX = "+resp.mux );
			alert( "Height = "+resp.height );
			alert( "Width = "+resp.width );
			alert( "Access = "+resp.access );
			alert( "Write Power = "+resp.w_power );
			alert( "Standby Power = "+resp.s_power );
			*/
			
			var img_height = resp.height;
			var img_width = resp.width;
			// Scale down the image size if it is too big
			if( img_height > 1000 || img_width > 1000 ){
				img_height *= .25;
				img_width *= .25;
			}else if( img_height > 500 || img_width > 500 ){
				img_height *= .5;
				img_width *= .5;
			}else if( img_height > 300 || img_width > 300 ){
				img_height *= .75;
				img_width *= .75;
			}
			
			var html = "";
			var img = "";
			html += "<p>";
			html += "<h2>Mux "+resp.mux+"</h2><br>";
			
			if( resp.error ){
				html += "<h2>Error: "+resp.error+"</h2><br>";
			}else{
				img = "<img src='images/PIX.GIF' height="+img_height+" width="+img_width+"><br><small>shape not to scale</small><br>";
				html += "Words = "+resp.words+"<br>";
				html += "BPW = "+resp.bpw+"<br>";
				html += "Mux = "+resp.mux+"<br>";
				html += "Width = "+resp.width+"(&micro;m)<br>";
				html += "Height = "+resp.height+"(&micro;m)<br>";
				html += "Access = "+resp.access+"(ns)<br>";
				html += "Write Power = "+resp.w_power+"(mW)<br>";
				html += "Standby Power = "+resp.s_power+"(mW)<br>";
			}
			html += "<\p>";
			
			document.getElementById("divDATAmux"+resp.mux).innerHTML = html;
			document.getElementById("divIMGmux"+resp.mux).innerHTML = img;
			
		}
	}
	
	var link = "scripts/get_char_data.pl";
	link += "?words="+words;
	link += "&bpw="+bpw;
	link += "&mux="+mux;
	link += "&dual_port="+dp;
	
	xmlhttp.open("GET",link,true);
	xmlhttp.send(null);
}


