

var xmlHttp
function getColor(Obj)
{ 

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var Value=Obj.value;

var style_logo = checkradio_logo();
var type = document.getElementById("type0").value;
var color_choose = checkradio();

var Path="get_color_by_size.php"+"?styleID="+Value+"&logo="+style_logo+"&typeid="+type+"&color="+color_choose;




//var url="getuser.php"
//url=url+"?q="+str
//alert(Path);
xmlHttp.onreadystatechange=StyleChange_Color 


xmlHttp.open("GET",Path,true)



xmlHttp.send(null)
}
function checkradio(){
 var radios = document.radio_form.color;
    for(var i=0; i<radios.length; i++){
        if(radios[i].checked==true)
		
		return radios[i].value;
		
    }
	
    return "";
	}
	function checkradio_logo(){
 var radios = document.radio_form.logo;
    for(var i=0; i<radios.length; i++){
        if(radios[i].checked==true)
		
		return radios[i].value;
		
    }
	
    return "";
	}
	
function right(current_str,find_str){
    var cL = current_str.length;
    var fL = find_str.length;
    var pos = current_str.lastIndexOf(find_str);
    if(pos+fL>=cL)
        return "";
    else if(pos==-1)
        return current_str;
    else
        return current_str.substring(pos+fL,cL);
} 
function left(current_str,find_str){
	var pos = current_str.lastIndexOf(find_str);
	return current_str.substring(0,pos);
}

function StyleChange_Color() 
{
	

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 
 var color = xmlHttp.responseText;

 //document.getElementById("color").innerHTML=color
  document.getElementById("table").rows[document.getElementById("color").rowIndex].cells[1].innerHTML=color

 
 

 
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

