var xmlHttp

function showHint(str){
	if (str.length < 3)
	{ 
		//document.getElementById("txtHint").innerHTML=""
		
		return
	}

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
//function - jaka nazwa funkcji php ma być wykonana

	var url="funkcje.php?function=szukaj&"
	url=url+"q="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function showHint_member(str){
	if (str.length < 3)
	{ 
		//document.getElementById("txtHint").innerHTML=""
		
		return
	}

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
//function - jaka nazwa funkcji php ma być wykonana

	var url="../funkcje.php?function=szukaj&"
	url=url+"q="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 
//// 
////
function stateChanged() 
	{ 
		//document.getElementById("k").innerHTML= "Szukam..."	+ document.getElementById("txt1").value
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{	 
			document.getElementById("k").innerHTML=xmlHttp.responseText 
	}		 
} 
function stateChanged1() 
	{ 
		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{	 
			document.getElementById("ocena").innerHTML=xmlHttp.responseText 
	}		 
} 
function stateChanged_akceptacja() 
	{ 
		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{	 
			document.getElementById("akceptacja").innerHTML=xmlHttp.responseText 
	}		 
} 

function stateChanged_topzapow() 
	{ 
		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{	 
			document.getElementById("topzapow").innerHTML=xmlHttp.responseText 
	}		 
} 

function stateChanged_topzapow1() 
	{ 
		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{	 
			document.getElementById("topzapow1").innerHTML=xmlHttp.responseText 
	}		 
} 

function ocena_towar(id_towar, ocena,id_grupa,id_kategoria){

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
//function - jaka nazwa funkcji php ma być wykonana

	var url="funkcje.php?function=ocena_towar_cookie"
	url=url+"&id_towar="+ id_towar
	url=url+"&ocena=" + ocena
	url=url+"&id_grupa=" + id_grupa
	url=url+"&id_kategoria=" + id_kategoria
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged1 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 
//funkcje do oceniania towaru
		function fn_js_star_over(id,txt){
					document.getElementById("d_star_info").innerHTML = '<span class=txt><b>Wystaw ocenę:</b></span>';
					for(var a=1;a <= id;a++) document.getElementById("i_star_"+a).src = "images/_stars1.gif";
				};
		function fn_js_star_out(){
					document.getElementById("d_star_info").innerHTML = '<span class=txt><b>Wystaw ocenę:</b></span>';	
					for(var a=1;a <= 5;a++) document.getElementById("i_star_"+a).src = "images/_stars0.gif";
				};
		function fn_js_star_form(ocena,towar,id_grupa,id_kategoria){
					document.forms["f_ocena"]["ocena"].value = ocena;
					document.forms["f_ocena"]["id_towar"].value = towar;
					document.forms["f_ocena"]["id_grupa"].value = id_grupa;
					document.forms["f_ocena"]["id_kategoria"].value = id_kategoria;
					
					ocena_towar(towar,ocena,id_grupa,id_kategoria)
				};
///

//funkcja do akceptacji zamówienia


function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
{
	objXMLHttp=new XMLHttpRequest()
}
	else if (window.ActiveXObject)
{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
} 
///////////




