function changeFoto(id,thumb,zoom)
{	
	var iframe = document.getElementById('iframe');
	iframe.src = 'poza.php?poza='+thumb
	document.getElementById('link_zoom').href=zoom;
}
var cul2
function changeCuloare(culoare,culori)
{			
	cul2 = culoare
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
	 	return
	}
	var url="get_poze_detaliu.php?cod="+cod_produs+"&culoare="+culoare;
	xmlHttp.onreadystatechange=afiseazaPozeDetaliu 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)			
}
function afiseazaPozeDetaliu() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 				
		//if(continut != xmlHttp.responseText)
		document.getElementById("div_detalii").innerHTML=xmlHttp.responseText 
		var thumb = 'foto/produse/main/mediu/'+cod_produs+'_'+cul2+'.jpg';
		var zoom = 'foto/produse/main/mare/'+cod_produs+'_'+cul2+'.jpg';
		changeFoto('poza',thumb,zoom);
	 } 
}

// begin ajax
var xmlHttp
function showResult(id_culoare,id_marime)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
	 	return
	}
	var url="get_marimi.php?id_produs="+document.getElementById('id_produs').value+"&id_culoare="+id_culoare+"&id_marime="+id_marime
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		 document.getElementById("divform").innerHTML=xmlHttp.responseText 
	 } 
}
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;
}
// end ajax
