var xmlHttp
var einschaltvar = "true";
function show_option(str,strsub)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}        
var url="http://www.bige.de/ajax/options_select/responsexml.php"
url=url+"?q="+str+"&qsub="+strsub
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8")
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   {
   xmlDoc=xmlHttp.responseXML;   
   document.getElementById("einbaurahmen_text").innerHTML=xmlDoc.getElementsByTagName("dyn_description")[0].childNodes[0].nodeValue;   
   var changearraypic = new Array();
  	changearraypic[118]='<a href="/images/product_images/original_images/118_0.jpg"><img src="/images/product_images/special/einbaurahmen_1.jpg" id="einbaurahmen_pic"/></a>';
	changearraypic[119]='<a href="/images/product_images/original_images/119_0.jpg"><img src="/images/product_images/special/einbaurahmen_2.jpg" id="einbaurahmen_pic"/></a>';
	changearraypic[117]='<a href="/images/product_images/original_images/117_0.jpg"><img src="/images/product_images/special/einbaurahmen_3.jpg" id="einbaurahmen_pic"/></a>';
	changearraypic[120]='<a href="/images/product_images/original_images/120_0.jpg"><img src="/images/product_images/special/einbaurahmen_4.jpg" id="einbaurahmen_pic"/></a>';
	changearraypic[121]='<a href="/images/product_images/original_images/121_0.jpg"><img src="/images/product_images/special/einbaurahmen_5.jpg" id="einbaurahmen_pic"/></a>';
	changearraypic[122]='<a href="/images/product_images/original_images/122_0.jpg"><img src="/images/product_images/special/einbaurahmen_6.jpg" id="einbaurahmen_pic"/></a>';
	changearraypic[123]='<a href="/images/product_images/original_images/123_0.jpg"><img src="/images/product_images/special/einbaurahmen_7.jpg" id="einbaurahmen_pic"/></a>';
			
   document.getElementById("einbaurahmen_bild").innerHTML=changearraypic[xmlDoc.getElementsByTagName("idphp")[0].childNodes[0].nodeValue];   


   /*
   document.getElementById("hometown").innerHTML=xmlDoc.getElementsByTagName("hometown")[0].childNodes[0].nodeValue;   
   document.getElementById("product_img").src='img/'+xmlDoc.getElementsByTagName("image")[0].childNodes[0].nodeValue; 
   document.getElementById("idphp").innerHTML='###'+xmlDoc.getElementsByTagName("idphp")[0].childNodes[0].nodeValue+'###';   
   */
   var selection = document.getElementById("select_id_6");
   var selval = xmlDoc.getElementsByTagName("idsel")[0].childNodes[0].nodeValue;
   var i=0;
	for (i=0;i<selection.options.length;i++){
		if(selection[i].value==selval){ 
			selection.options[i].selected=true;
			break;
		}
	}
	showPrice(document.getElementById("cart_quantity"));
   
   //document.getElementById("6").options.selectedIndex = 2;

   }   

} 






function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
  {
  objXMLHttp=new XMLHttpRequest()
  }
else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
return objXMLHttp
}

function change_sel_back(selind)
{
	if (selind == 0)
	{
		show_option('118','17');
	}
	else if (selind == 1)
	{
		show_option('119','18');
	}
	else if (selind == 2)
	{
		show_option('117','19');
	}
	else if (selind == 3)
	{
		show_option('120','20');
	}
	else if (selind == 4)
	{
		show_option('121','21');
	}
	else if (selind == 5)
	{
		show_option('122','22');
	}
	else if (selind == 6)
	{
		show_option('123','23');
	}
}
