
var req;

function Initialize(){
	try{req=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){
        try{req=new ActiveXObject("Microsoft.XMLHTTP");}
        catch(oc) {req=null;}
    }

	if(!req&&typeof XMLHttpRequest!="undefined") {
    req= new
    XMLHttpRequest();
	}
} 

function oyla(key,urun_id,userId)
{
	Initialize(); 
		var url="rate.asp?urun_id="+ urun_id +"&user_id="+ userId +"&k="+key;

			if(req!=null){
				req.onreadystatechange = Process;
				req.open("GET" ,url, true);
				req.send(null);
			}
		}

function Process()
{
    if (req.readyState == 4){
            if (req.status == 200) {
				document.getElementById("goster").innerHTML = req.responseText;
			document.getElementById("autocomplete").innerHTML = "<font size=\"1\" face=\"Tahoma\"><small><b>Oylama Sonucu Gönderildi<br>Teşekkürler</b></small></font>";
		}else if(req.status == 404){
			document.getElementById("autocomplete").innerHTML = "<font size=\"1\" face=\"Tahoma\"><small><b>Bu Ürün Tarafınızca Daha Önce Oylanmış</b></small></font>";
		}else {
			document.getElementById("autocomplete").innerHTML = "<font size=\"1\" face=\"Tahoma\"><small><b>Bu Ürün Tarafınızca Daha Önce Oylanmış</b></small></font>";
        }
	}
}

