function replace(string,text,by) { // Replaces text with by in string var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) return string; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) return string; if (i == -1) return string; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) newstr += replace(string.substring(i+txtLength,strLength),text,by); return newstr; } function toggleClassNames() { var n = this.className; this.className = this.altClassName; this.altClassName = n; } function setupDatarows() { var v = document.getElementsByTagName("tr"); for (var i = 0; i < v.length; i++) { if (v[i].className.indexOf("datarow") != -1) { v[i].onmouseover = toggleClassNames; v[i].onmouseout = toggleClassNames; v[i].altClassName = v[i].className + " hover"; } } } if (typeof window.onload == "undefined") { window.onload = setupDatarows; } else { (function() { var oldOnload2 = window.onload; // window.onload = function() { // oldOnload2(); // setupDatarows(); // } })(); } function kH(e) { var pK = e ? e.which : window.event.keyCode; return pK != 13; } document.onkeypress = kH; if (document.layers) document.captureEvents(Event.KEYPRESS); function processstars(a,b,c,d) { for (var x=1;x<=a;x++) { if (x>b) document.write(""); else document.write(""); }//for } function overstar(a,b,d) { for (var x=1;x<=a;x++) { var ddd='star_'+d+"_"+x; var xd=document.getElementById(ddd); xd.setAttribute('src','http://team.apogee.gr/files/rating_over.gif'); } } function outstar(v,f,isfloat,d) { for (var x=1;x<=v;x++) { var ddd='star_'+d+"_"+x; var xd=document.getElementById(ddd); if (x<=f) { xd.setAttribute('src','http://team.apogee.gr/files/rating_on.gif'); } else xd.setAttribute('src','http://team.apogee.gr/files/rating_off.gif'); } } function showResponse(d) { var newid='saved_'+d; var rxd=document.getElementById(newid); rxd.style.visibility="visible"; var mee="var rxd=document.getElementById('"+newid+"');rxd.style.visibility='hidden';"; setTimeout(mee,1000); } //function successajax(d,data, textStatus) function successajax(d) { var toid='loading_'+d; //var toid='loading_'+""; //loading_ var rxd=document.getElementById(toid); rxd.style.visibility="hidden"; jQuery("span#otinane_").html(event); //var sss=$("otinane_2").html("foo"); //alert(sss.size()); //alert(this); // data could be xmlDoc, jsonObj, html, text, etc... this; // the options for this ajax request } function completed(d,a,b) { var rxd=document.getElementById('saved_'+d); rxd.style.visibility="visible"; setTimeout("var rxd=document.getElementById('saved_"+d+"');rxd.style.visibility='hidden';",1000); } function insertfailed(XMLHttpRequest, textStatus, errorThrown) { var rxd=document.getElementById('loading_'); rxd.style.visibility="hidden"; //alert(XMLHttpRequest); //alert(textStatus); if (errorThrown) alert(errorThrown); //alert(errorThrown); // typically only one of textStatus or errorThrown // will have info //this; // the options for this ajax request } //se poio eimai asteri-poso to rating-lala=0,1 float or not... function clickit(rating,isitfloat,d) { var dasd='loading_'+d; var rxd=document.getElementById(dasd); rxd.style.visibility="visible"; // alert(rating); jQuery.ajax({ type: "POST", url: "http://team.apogee.gr/files/rec.php", data:'&ratinga='+rating+'&id='+d+'&c='+isitfloat, //dataType: ($.browser.msie) ? "text" : "xml", /*complete:function(event, XMLHttpRequest, ajaxOptions) { alert(ajaxOptions); // $(this).append("
  • Request Complete.
  • "); },*/ success:function(event, XMLHttpRequest, ajaxOptions) { var toid='loading_'+d; //var toid='loading_'+""; //loading_ var rxd=document.getElementById(toid); rxd.style.visibility="hidden"; //alert(event); //alert(tid); jQuery("#otinane_"+d).html(event); //var sss=$("otinane_2").html("foo"); //alert(sss.size()); //alert(this); // data could be xmlDoc, jsonObj, html, text, etc... this; // the options for this ajax request }, fail:function() { alert('failed'); }, error: function(event, XMLHttpRequest, ajaxOptions, thrownError) { alert("error"); //$(this).text() alert(XMLHttpRequest); alert(jQuery); //data); }, complete:function() { var newid='saved_'+d; var rxd=document.getElementById(newid); rxd.style.visibility="visible"; var mee="var rxd=document.getElementById('"+newid+"');rxd.style.visibility='hidden';"; setTimeout(mee,1000); } } ); // onComplete: showResponse(d), // onSuccess:successajax(d), // onFailure:insertfailed }